summaryrefslogtreecommitdiffstats
path: root/gl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:19:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:19:27 +0000
commite0023883c6d2e6745a19e4b48e186ed156c1fca8 (patch)
tree1a48b8056ec984385d0d862b683535d04d6ed215 /gl
parentInitial commit. (diff)
downloadman-db-e0023883c6d2e6745a19e4b48e186ed156c1fca8.tar.xz
man-db-e0023883c6d2e6745a19e4b48e186ed156c1fca8.zip
Adding upstream version 2.11.2.upstream/2.11.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gl')
-rw-r--r--gl/lib/Makefile.am3732
-rw-r--r--gl/lib/Makefile.in6617
-rw-r--r--gl/lib/_Noreturn.h45
-rw-r--r--gl/lib/alloca.c167
-rw-r--r--gl/lib/alloca.in.h72
-rw-r--r--gl/lib/arg-nonnull.h26
-rw-r--r--gl/lib/argp-ba.c34
-rw-r--r--gl/lib/argp-eexst.c30
-rw-r--r--gl/lib/argp-fmtstream.c434
-rw-r--r--gl/lib/argp-fmtstream.h300
-rw-r--r--gl/lib/argp-fs-xinl.c46
-rw-r--r--gl/lib/argp-help.c2034
-rw-r--r--gl/lib/argp-namefrob.h170
-rw-r--r--gl/lib/argp-parse.c968
-rw-r--r--gl/lib/argp-pin.c33
-rw-r--r--gl/lib/argp-pv.c33
-rw-r--r--gl/lib/argp-pvh.c30
-rw-r--r--gl/lib/argp-xinl.c46
-rw-r--r--gl/lib/argp.h643
-rw-r--r--gl/lib/asnprintf.c34
-rw-r--r--gl/lib/asprintf.c39
-rw-r--r--gl/lib/assure.h57
-rw-r--r--gl/lib/at-func.c146
-rw-r--r--gl/lib/at-func2.c289
-rw-r--r--gl/lib/attribute.h226
-rw-r--r--gl/lib/basename-lgpl.c71
-rw-r--r--gl/lib/basename-lgpl.h78
-rw-r--r--gl/lib/basename.c64
-rw-r--r--gl/lib/bitrotate.c21
-rw-r--r--gl/lib/bitrotate.h138
-rw-r--r--gl/lib/btowc.c39
-rw-r--r--gl/lib/c++defs.h331
-rw-r--r--gl/lib/calloc.c55
-rw-r--r--gl/lib/canonicalize-lgpl.c472
-rw-r--r--gl/lib/canonicalize.c489
-rw-r--r--gl/lib/canonicalize.h58
-rw-r--r--gl/lib/cdefs.h707
-rw-r--r--gl/lib/chdir-long.c264
-rw-r--r--gl/lib/chdir-long.h30
-rw-r--r--gl/lib/chown.c151
-rw-r--r--gl/lib/cloexec.c83
-rw-r--r--gl/lib/cloexec.h36
-rw-r--r--gl/lib/close.c75
-rw-r--r--gl/lib/closedir.c71
-rw-r--r--gl/lib/ctype.in.h57
-rw-r--r--gl/lib/dirent-private.h44
-rw-r--r--gl/lib/dirent.in.h321
-rw-r--r--gl/lib/dirfd.c98
-rw-r--r--gl/lib/dirname-lgpl.c86
-rw-r--r--gl/lib/dirname.c38
-rw-r--r--gl/lib/dirname.h54
-rw-r--r--gl/lib/dup-safer-flag.c38
-rw-r--r--gl/lib/dup-safer.c34
-rw-r--r--gl/lib/dup.c92
-rw-r--r--gl/lib/dup2.c189
-rw-r--r--gl/lib/dynarray.h284
-rw-r--r--gl/lib/eloop-threshold.h83
-rw-r--r--gl/lib/errno.in.h279
-rw-r--r--gl/lib/error.c411
-rw-r--r--gl/lib/error.h66
-rw-r--r--gl/lib/exitfail.c24
-rw-r--r--gl/lib/exitfail.h18
-rw-r--r--gl/lib/fchdir.c206
-rw-r--r--gl/lib/fchown-stub.c34
-rw-r--r--gl/lib/fcntl.c629
-rw-r--r--gl/lib/fcntl.in.h445
-rw-r--r--gl/lib/fd-hook.c116
-rw-r--r--gl/lib/fd-hook.h119
-rw-r--r--gl/lib/fd-safer-flag.c52
-rw-r--r--gl/lib/fd-safer.c49
-rw-r--r--gl/lib/fdopendir.c249
-rw-r--r--gl/lib/file-set.c74
-rw-r--r--gl/lib/file-set.h33
-rw-r--r--gl/lib/filename.h112
-rw-r--r--gl/lib/filenamecat-lgpl.c90
-rw-r--r--gl/lib/filenamecat.h32
-rw-r--r--gl/lib/flexmember.h60
-rw-r--r--gl/lib/float+.h147
-rw-r--r--gl/lib/float.c33
-rw-r--r--gl/lib/float.in.h194
-rw-r--r--gl/lib/flock.c224
-rw-r--r--gl/lib/fnmatch.c361
-rw-r--r--gl/lib/fnmatch.in.h110
-rw-r--r--gl/lib/fnmatch_loop.c1211
-rw-r--r--gl/lib/free.c53
-rw-r--r--gl/lib/fstat.c94
-rw-r--r--gl/lib/fstatat.c148
-rw-r--r--gl/lib/getcwd-lgpl.c127
-rw-r--r--gl/lib/getcwd.c495
-rw-r--r--gl/lib/getdelim.c147
-rw-r--r--gl/lib/getdtablesize.c124
-rw-r--r--gl/lib/getline.c27
-rw-r--r--gl/lib/getlogin_r.c110
-rw-r--r--gl/lib/getopt-cdefs.in.h66
-rw-r--r--gl/lib/getopt-core.h96
-rw-r--r--gl/lib/getopt-ext.h77
-rw-r--r--gl/lib/getopt-pfx-core.h66
-rw-r--r--gl/lib/getopt-pfx-ext.h70
-rw-r--r--gl/lib/getopt.c811
-rw-r--r--gl/lib/getopt.in.h61
-rw-r--r--gl/lib/getopt1.c159
-rw-r--r--gl/lib/getopt_int.h118
-rw-r--r--gl/lib/getprogname.c302
-rw-r--r--gl/lib/getprogname.h40
-rw-r--r--gl/lib/getrandom.c191
-rw-r--r--gl/lib/gettext.h300
-rw-r--r--gl/lib/gettime.c51
-rw-r--r--gl/lib/gettimeofday.c153
-rw-r--r--gl/lib/gl_anyhash1.h31
-rw-r--r--gl/lib/gl_anyhash2.h82
-rw-r--r--gl/lib/gl_anyhash_primes.h87
-rw-r--r--gl/lib/gl_anylinked_list1.h48
-rw-r--r--gl/lib/gl_anylinked_list2.h1215
-rw-r--r--gl/lib/gl_anyrbtree_list1.h76
-rw-r--r--gl/lib/gl_anyrbtree_list2.h1028
-rw-r--r--gl/lib/gl_anytree_list1.h41
-rw-r--r--gl/lib/gl_anytree_list2.h970
-rw-r--r--gl/lib/gl_array_list.c697
-rw-r--r--gl/lib/gl_array_list.h34
-rw-r--r--gl/lib/gl_hash_map.c333
-rw-r--r--gl/lib/gl_hash_map.h34
-rw-r--r--gl/lib/gl_hash_set.c313
-rw-r--r--gl/lib/gl_hash_set.h34
-rw-r--r--gl/lib/gl_linkedhash_list.c114
-rw-r--r--gl/lib/gl_linkedhash_list.h34
-rw-r--r--gl/lib/gl_list.c21
-rw-r--r--gl/lib/gl_list.h924
-rw-r--r--gl/lib/gl_map.c21
-rw-r--r--gl/lib/gl_map.h375
-rw-r--r--gl/lib/gl_rbtree_list.c106
-rw-r--r--gl/lib/gl_rbtree_list.h34
-rw-r--r--gl/lib/gl_set.c21
-rw-r--r--gl/lib/gl_set.h281
-rw-r--r--gl/lib/gl_xlist.c21
-rw-r--r--gl/lib/gl_xlist.h207
-rw-r--r--gl/lib/gl_xmap.c21
-rw-r--r--gl/lib/gl_xmap.h96
-rw-r--r--gl/lib/gl_xset.c21
-rw-r--r--gl/lib/gl_xset.h81
-rw-r--r--gl/lib/glob-libc.h195
-rw-r--r--gl/lib/glob.c1548
-rw-r--r--gl/lib/glob.in.h177
-rw-r--r--gl/lib/glob_internal.h65
-rw-r--r--gl/lib/glob_pattern_p.c33
-rw-r--r--gl/lib/globfree.c41
-rw-r--r--gl/lib/glthread/lock.c749
-rw-r--r--gl/lib/glthread/lock.h791
-rw-r--r--gl/lib/glthread/threadlib.c108
-rw-r--r--gl/lib/hard-locale.c35
-rw-r--r--gl/lib/hard-locale.h28
-rw-r--r--gl/lib/hash-pjw-bare.c42
-rw-r--r--gl/lib/hash-pjw-bare.h24
-rw-r--r--gl/lib/hash-pjw.c40
-rw-r--r--gl/lib/hash-pjw.h23
-rw-r--r--gl/lib/hash-triple-simple.c59
-rw-r--r--gl/lib/hash-triple.h46
-rw-r--r--gl/lib/hash.c1106
-rw-r--r--gl/lib/hash.h264
-rw-r--r--gl/lib/ialloc.c21
-rw-r--r--gl/lib/ialloc.h100
-rw-r--r--gl/lib/idpriv-drop.c131
-rw-r--r--gl/lib/idpriv-droptemp.c208
-rw-r--r--gl/lib/idpriv.h116
-rw-r--r--gl/lib/idx.h134
-rw-r--r--gl/lib/intprops.h642
-rw-r--r--gl/lib/inttypes.in.h1002
-rw-r--r--gl/lib/ioctl.c92
-rw-r--r--gl/lib/isblank.c33
-rw-r--r--gl/lib/itold.c28
-rw-r--r--gl/lib/langinfo.in.h222
-rw-r--r--gl/lib/lc-charset-dispatch.c82
-rw-r--r--gl/lib/lc-charset-dispatch.h40
-rw-r--r--gl/lib/lchown.c117
-rw-r--r--gl/lib/libc-config.h202
-rw-r--r--gl/lib/limits.in.h131
-rw-r--r--gl/lib/localcharset.c1159
-rw-r--r--gl/lib/localcharset.h137
-rw-r--r--gl/lib/locale.in.h305
-rw-r--r--gl/lib/localeconv.c103
-rw-r--r--gl/lib/lstat.c104
-rw-r--r--gl/lib/malloc.c51
-rw-r--r--gl/lib/malloc/dynarray-skeleton.c528
-rw-r--r--gl/lib/malloc/dynarray.h178
-rw-r--r--gl/lib/malloc/dynarray_at_failure.c40
-rw-r--r--gl/lib/malloc/dynarray_emplace_enlarge.c77
-rw-r--r--gl/lib/malloc/dynarray_finalize.c66
-rw-r--r--gl/lib/malloc/dynarray_resize.c68
-rw-r--r--gl/lib/malloc/dynarray_resize_clear.c39
-rw-r--r--gl/lib/malloc/scratch_buffer.h151
-rw-r--r--gl/lib/malloc/scratch_buffer_dupfree.c41
-rw-r--r--gl/lib/malloc/scratch_buffer_grow.c56
-rw-r--r--gl/lib/malloc/scratch_buffer_grow_preserve.c67
-rw-r--r--gl/lib/malloc/scratch_buffer_set_array_size.c64
-rw-r--r--gl/lib/malloca.c113
-rw-r--r--gl/lib/malloca.h126
-rw-r--r--gl/lib/mbrtowc-impl-utf8.h138
-rw-r--r--gl/lib/mbrtowc-impl.h262
-rw-r--r--gl/lib/mbrtowc.c158
-rw-r--r--gl/lib/mbsinit.c70
-rw-r--r--gl/lib/mbsrtowcs-impl.h122
-rw-r--r--gl/lib/mbsrtowcs-state.c37
-rw-r--r--gl/lib/mbsrtowcs.c36
-rw-r--r--gl/lib/mbtowc-impl.h44
-rw-r--r--gl/lib/mbtowc-lock.c150
-rw-r--r--gl/lib/mbtowc-lock.h125
-rw-r--r--gl/lib/mbtowc.c26
-rw-r--r--gl/lib/memchr.c172
-rw-r--r--gl/lib/memchr.valgrind30
-rw-r--r--gl/lib/memmem.c71
-rw-r--r--gl/lib/mempcpy.c33
-rw-r--r--gl/lib/memrchr.c161
-rw-r--r--gl/lib/minmax.h60
-rw-r--r--gl/lib/mkdir.c93
-rw-r--r--gl/lib/mkdtemp.c39
-rw-r--r--gl/lib/mkstemp.c50
-rw-r--r--gl/lib/msvc-inval.c129
-rw-r--r--gl/lib/msvc-inval.h222
-rw-r--r--gl/lib/msvc-nothrow.c51
-rw-r--r--gl/lib/msvc-nothrow.h43
-rw-r--r--gl/lib/nanosleep.c195
-rw-r--r--gl/lib/nl_langinfo-lock.c150
-rw-r--r--gl/lib/nl_langinfo.c572
-rw-r--r--gl/lib/nonblocking.c163
-rw-r--r--gl/lib/nonblocking.h62
-rw-r--r--gl/lib/open.c209
-rw-r--r--gl/lib/openat-die.c62
-rw-r--r--gl/lib/openat-priv.h64
-rw-r--r--gl/lib/openat-proc.c135
-rw-r--r--gl/lib/openat.c312
-rw-r--r--gl/lib/openat.h125
-rw-r--r--gl/lib/opendir.c179
-rw-r--r--gl/lib/pathmax.h83
-rw-r--r--gl/lib/pipe-safer.c52
-rw-r--r--gl/lib/pipe.c50
-rw-r--r--gl/lib/printf-args.c183
-rw-r--r--gl/lib/printf-args.h150
-rw-r--r--gl/lib/printf-parse.c623
-rw-r--r--gl/lib/printf-parse.h193
-rw-r--r--gl/lib/progname.c92
-rw-r--r--gl/lib/progname.h62
-rw-r--r--gl/lib/pselect.c110
-rw-r--r--gl/lib/pthread_sigmask.c92
-rw-r--r--gl/lib/raise.c83
-rw-r--r--gl/lib/rawmemchr.c125
-rw-r--r--gl/lib/rawmemchr.valgrind28
-rw-r--r--gl/lib/readdir.c102
-rw-r--r--gl/lib/readlink.c104
-rw-r--r--gl/lib/readlinkat.c113
-rw-r--r--gl/lib/realloc.c63
-rw-r--r--gl/lib/reallocarray.c39
-rw-r--r--gl/lib/regcomp.c3788
-rw-r--r--gl/lib/regex.c84
-rw-r--r--gl/lib/regex.h699
-rw-r--r--gl/lib/regex_internal.c1711
-rw-r--r--gl/lib/regex_internal.h835
-rw-r--r--gl/lib/regexec.c4221
-rw-r--r--gl/lib/rename.c477
-rw-r--r--gl/lib/renameat.c25
-rw-r--r--gl/lib/renameatu.c255
-rw-r--r--gl/lib/renameatu.h28
-rw-r--r--gl/lib/rewinddir.c53
-rw-r--r--gl/lib/rmdir.c56
-rw-r--r--gl/lib/same-inode.h47
-rw-r--r--gl/lib/save-cwd.c97
-rw-r--r--gl/lib/save-cwd.h34
-rw-r--r--gl/lib/scratch_buffer.h127
-rw-r--r--gl/lib/select.c598
-rw-r--r--gl/lib/setenv.c390
-rw-r--r--gl/lib/setlocale-lock.c150
-rw-r--r--gl/lib/setlocale_null.c411
-rw-r--r--gl/lib/setlocale_null.h82
-rw-r--r--gl/lib/sig-handler.c21
-rw-r--r--gl/lib/sig-handler.h51
-rw-r--r--gl/lib/sigaction.c204
-rw-r--r--gl/lib/signal.in.h487
-rw-r--r--gl/lib/sigprocmask.c349
-rw-r--r--gl/lib/size_max.h30
-rw-r--r--gl/lib/sleep.c76
-rw-r--r--gl/lib/sockets.c161
-rw-r--r--gl/lib/sockets.h66
-rw-r--r--gl/lib/stat-time.c21
-rw-r--r--gl/lib/stat-time.h252
-rw-r--r--gl/lib/stat-w32.c461
-rw-r--r--gl/lib/stat-w32.h37
-rw-r--r--gl/lib/stat.c440
-rw-r--r--gl/lib/stdalign.in.h127
-rw-r--r--gl/lib/stdarg.in.h35
-rw-r--r--gl/lib/stdbool.in.h132
-rw-r--r--gl/lib/stddef.in.h147
-rw-r--r--gl/lib/stdint.in.h740
-rw-r--r--gl/lib/stdio-read.c168
-rw-r--r--gl/lib/stdio-write.c206
-rw-r--r--gl/lib/stdio.in.h1711
-rw-r--r--gl/lib/stdlib.in.h1559
-rw-r--r--gl/lib/stdopen.c66
-rw-r--r--gl/lib/stdopen.h32
-rw-r--r--gl/lib/stpcpy.c49
-rw-r--r--gl/lib/str-two-way.h452
-rw-r--r--gl/lib/strcasecmp.c62
-rw-r--r--gl/lib/strcasestr.c82
-rw-r--r--gl/lib/strchrnul.c142
-rw-r--r--gl/lib/strchrnul.valgrind28
-rw-r--r--gl/lib/strdup.c54
-rw-r--r--gl/lib/streq.h176
-rw-r--r--gl/lib/strerror-override.c306
-rw-r--r--gl/lib/strerror-override.h57
-rw-r--r--gl/lib/strerror.c71
-rw-r--r--gl/lib/string.in.h1296
-rw-r--r--gl/lib/strings.in.h122
-rw-r--r--gl/lib/stripslash.c45
-rw-r--r--gl/lib/strncasecmp.c62
-rw-r--r--gl/lib/strndup.c36
-rw-r--r--gl/lib/strnlen.c30
-rw-r--r--gl/lib/strnlen1.c35
-rw-r--r--gl/lib/strnlen1.h40
-rw-r--r--gl/lib/strsep.c57
-rw-r--r--gl/lib/sys_file.in.h63
-rw-r--r--gl/lib/sys_ioctl.in.h79
-rw-r--r--gl/lib/sys_random.in.h98
-rw-r--r--gl/lib/sys_select.in.h331
-rw-r--r--gl/lib/sys_socket.c22
-rw-r--r--gl/lib/sys_socket.in.h734
-rw-r--r--gl/lib/sys_stat.in.h954
-rw-r--r--gl/lib/sys_time.in.h224
-rw-r--r--gl/lib/sys_types.in.h106
-rw-r--r--gl/lib/sys_uio.in.h63
-rw-r--r--gl/lib/sysexits.in.h72
-rw-r--r--gl/lib/tempname.c345
-rw-r--r--gl/lib/tempname.h72
-rw-r--r--gl/lib/termios.in.h73
-rw-r--r--gl/lib/time.in.h452
-rw-r--r--gl/lib/timespec.c21
-rw-r--r--gl/lib/timespec.h102
-rw-r--r--gl/lib/unistd--.h32
-rw-r--r--gl/lib/unistd-safer.h31
-rw-r--r--gl/lib/unistd.c22
-rw-r--r--gl/lib/unistd.in.h2327
-rw-r--r--gl/lib/unlink.c98
-rw-r--r--gl/lib/unlinkat.c124
-rw-r--r--gl/lib/utime.c288
-rw-r--r--gl/lib/utime.in.h112
-rw-r--r--gl/lib/utimens.c647
-rw-r--r--gl/lib/utimens.h49
-rw-r--r--gl/lib/vasnprintf.c5741
-rw-r--r--gl/lib/vasnprintf.h72
-rw-r--r--gl/lib/vasprintf.c50
-rw-r--r--gl/lib/verify.h318
-rw-r--r--gl/lib/verror.c80
-rw-r--r--gl/lib/verror.h55
-rw-r--r--gl/lib/vsnprintf.c70
-rw-r--r--gl/lib/w32sock.h140
-rw-r--r--gl/lib/warn-on-use.h149
-rw-r--r--gl/lib/wchar.in.h1338
-rw-r--r--gl/lib/wcrtomb.c80
-rw-r--r--gl/lib/wctype-h.c23
-rw-r--r--gl/lib/wctype.in.h732
-rw-r--r--gl/lib/windows-initguard.h35
-rw-r--r--gl/lib/windows-mutex.c95
-rw-r--r--gl/lib/windows-mutex.h51
-rw-r--r--gl/lib/windows-once.c62
-rw-r--r--gl/lib/windows-once.h47
-rw-r--r--gl/lib/windows-recmutex.c127
-rw-r--r--gl/lib/windows-recmutex.h57
-rw-r--r--gl/lib/windows-rwlock.c377
-rw-r--r--gl/lib/windows-rwlock.h68
-rw-r--r--gl/lib/wmemchr-impl.h27
-rw-r--r--gl/lib/wmemchr.c23
-rw-r--r--gl/lib/wmempcpy.c28
-rw-r--r--gl/lib/xalloc-die.c41
-rw-r--r--gl/lib/xalloc-oversized.h65
-rw-r--r--gl/lib/xalloc.h213
-rw-r--r--gl/lib/xasprintf.c34
-rw-r--r--gl/lib/xgetcwd.c41
-rw-r--r--gl/lib/xgetcwd.h20
-rw-r--r--gl/lib/xmalloc.c339
-rw-r--r--gl/lib/xsize.c21
-rw-r--r--gl/lib/xsize.h108
-rw-r--r--gl/lib/xstdopen.c35
-rw-r--r--gl/lib/xstdopen.h28
-rw-r--r--gl/lib/xstrndup.c36
-rw-r--r--gl/lib/xstrndup.h25
-rw-r--r--gl/lib/xvasprintf.c110
-rw-r--r--gl/lib/xvasprintf.h51
-rw-r--r--gl/m4/00gnulib.m485
-rw-r--r--gl/m4/__inline.m422
-rw-r--r--gl/m4/absolute-header.m4100
-rw-r--r--gl/m4/alloca.m4106
-rw-r--r--gl/m4/argp.m470
-rw-r--r--gl/m4/asm-underscore.m483
-rw-r--r--gl/m4/btowc.m4105
-rw-r--r--gl/m4/builtin-expect.m449
-rw-r--r--gl/m4/calloc.m483
-rw-r--r--gl/m4/canonicalize.m4183
-rw-r--r--gl/m4/chdir-long.m430
-rw-r--r--gl/m4/chown.m4218
-rw-r--r--gl/m4/clock_time.m432
-rw-r--r--gl/m4/close.m435
-rw-r--r--gl/m4/closedir.m431
-rw-r--r--gl/m4/codeset.m424
-rw-r--r--gl/m4/ctype_h.m447
-rw-r--r--gl/m4/d-ino.m460
-rw-r--r--gl/m4/d-type.m432
-rw-r--r--gl/m4/dirent_h.m479
-rw-r--r--gl/m4/dirfd.m486
-rw-r--r--gl/m4/double-slash-root.m438
-rw-r--r--gl/m4/dup.m454
-rw-r--r--gl/m4/dup2.m4105
-rw-r--r--gl/m4/eealloc.m431
-rw-r--r--gl/m4/environ.m446
-rw-r--r--gl/m4/errno_h.m4131
-rw-r--r--gl/m4/error.m431
-rw-r--r--gl/m4/exponentd.m4116
-rw-r--r--gl/m4/extensions.m4227
-rw-r--r--gl/m4/extern-inline.m4130
-rw-r--r--gl/m4/fchdir.m466
-rw-r--r--gl/m4/fcntl-o.m4140
-rw-r--r--gl/m4/fcntl.m4151
-rw-r--r--gl/m4/fcntl_h.m470
-rw-r--r--gl/m4/fdopendir.m467
-rw-r--r--gl/m4/filenamecat.m416
-rw-r--r--gl/m4/flexmember.m444
-rw-r--r--gl/m4/float_h.m4106
-rw-r--r--gl/m4/flock.m424
-rw-r--r--gl/m4/fnmatch.m4153
-rw-r--r--gl/m4/fnmatch_h.m487
-rw-r--r--gl/m4/free.m452
-rw-r--r--gl/m4/fstat.m440
-rw-r--r--gl/m4/fstatat.m465
-rw-r--r--gl/m4/getcwd-abort-bug.m4158
-rw-r--r--gl/m4/getcwd-path-max.m4236
-rw-r--r--gl/m4/getcwd.m4166
-rw-r--r--gl/m4/getdelim.m499
-rw-r--r--gl/m4/getdtablesize.m463
-rw-r--r--gl/m4/getline.m4109
-rw-r--r--gl/m4/getlogin.m432
-rw-r--r--gl/m4/getlogin_r.m492
-rw-r--r--gl/m4/getopt.m4381
-rw-r--r--gl/m4/getpagesize.m449
-rw-r--r--gl/m4/getprogname.m443
-rw-r--r--gl/m4/getrandom.m468
-rw-r--r--gl/m4/gettext.m4401
-rw-r--r--gl/m4/gettime.m421
-rw-r--r--gl/m4/gettimeofday.m469
-rw-r--r--gl/m4/glibc2.m431
-rw-r--r--gl/m4/glob.m4129
-rw-r--r--gl/m4/glob_h.m484
-rw-r--r--gl/m4/gnulib-common.m41075
-rw-r--r--gl/m4/gnulib-comp.m41937
-rw-r--r--gl/m4/host-cpu-c-abi.m4678
-rw-r--r--gl/m4/iconv.m4268
-rw-r--r--gl/m4/idpriv.m414
-rw-r--r--gl/m4/include_next.m4224
-rw-r--r--gl/m4/intdiv0.m487
-rw-r--r--gl/m4/intl.m4272
-rw-r--r--gl/m4/intldir.m419
-rw-r--r--gl/m4/intlmacosx.m456
-rw-r--r--gl/m4/intmax.m436
-rw-r--r--gl/m4/intmax_t.m459
-rw-r--r--gl/m4/inttypes-pri.m442
-rw-r--r--gl/m4/inttypes.m4180
-rw-r--r--gl/m4/inttypes_h.m429
-rw-r--r--gl/m4/ioctl.m444
-rw-r--r--gl/m4/isblank.m417
-rw-r--r--gl/m4/langinfo_h.m4137
-rw-r--r--gl/m4/largefile.m4180
-rw-r--r--gl/m4/lchown.m438
-rw-r--r--gl/m4/lcmessage.m435
-rw-r--r--gl/m4/lib-ignore.m4115
-rw-r--r--gl/m4/lib-ld.m4168
-rw-r--r--gl/m4/lib-link.m4813
-rw-r--r--gl/m4/lib-prefix.m4323
-rw-r--r--gl/m4/libtool.m48427
-rw-r--r--gl/m4/limits-h.m441
-rw-r--r--gl/m4/localcharset.m411
-rw-r--r--gl/m4/locale-fr.m4253
-rw-r--r--gl/m4/locale-ja.m4143
-rw-r--r--gl/m4/locale-zh.m4137
-rw-r--r--gl/m4/locale_h.m4174
-rw-r--r--gl/m4/localeconv.m422
-rw-r--r--gl/m4/lock.m447
-rw-r--r--gl/m4/lstat.m479
-rw-r--r--gl/m4/ltoptions.m4437
-rw-r--r--gl/m4/ltsugar.m4124
-rw-r--r--gl/m4/ltversion.m424
-rw-r--r--gl/m4/lt~obsolete.m499
-rw-r--r--gl/m4/malloc.m4175
-rw-r--r--gl/m4/malloca.m414
-rw-r--r--gl/m4/manywarnings.m4211
-rw-r--r--gl/m4/math_h.m4391
-rw-r--r--gl/m4/mbrtowc.m4790
-rw-r--r--gl/m4/mbsinit.m444
-rw-r--r--gl/m4/mbsrtowcs.m4141
-rw-r--r--gl/m4/mbstate_t.m434
-rw-r--r--gl/m4/mbtowc.m424
-rw-r--r--gl/m4/memchr.m4106
-rw-r--r--gl/m4/memmem.m4155
-rw-r--r--gl/m4/mempcpy.m426
-rw-r--r--gl/m4/memrchr.m423
-rw-r--r--gl/m4/minmax.m444
-rw-r--r--gl/m4/mkdir.m487
-rw-r--r--gl/m4/mkdtemp.m420
-rw-r--r--gl/m4/mkstemp.m487
-rw-r--r--gl/m4/mmap-anon.m455
-rw-r--r--gl/m4/mode_t.m426
-rw-r--r--gl/m4/msvc-inval.m419
-rw-r--r--gl/m4/msvc-nothrow.m410
-rw-r--r--gl/m4/multiarch.m465
-rw-r--r--gl/m4/nanosleep.m4139
-rw-r--r--gl/m4/nl_langinfo.m477
-rw-r--r--gl/m4/nls.m432
-rw-r--r--gl/m4/nocrash.m4131
-rw-r--r--gl/m4/nonblocking.m429
-rw-r--r--gl/m4/off_t.m418
-rw-r--r--gl/m4/open-cloexec.m421
-rw-r--r--gl/m4/open-slash.m460
-rw-r--r--gl/m4/open.m456
-rw-r--r--gl/m4/openat.m438
-rw-r--r--gl/m4/opendir.m432
-rw-r--r--gl/m4/pathmax.m442
-rw-r--r--gl/m4/pipe.m415
-rw-r--r--gl/m4/po.m4453
-rw-r--r--gl/m4/printf-posix.m448
-rw-r--r--gl/m4/printf.m41728
-rw-r--r--gl/m4/progtest.m491
-rw-r--r--gl/m4/pselect.m473
-rw-r--r--gl/m4/pthread_rwlock_rdlock.m4185
-rw-r--r--gl/m4/pthread_sigmask.m4274
-rw-r--r--gl/m4/raise.m436
-rw-r--r--gl/m4/rawmemchr.m420
-rw-r--r--gl/m4/readdir.m415
-rw-r--r--gl/m4/readlink.m4114
-rw-r--r--gl/m4/readlinkat.m439
-rw-r--r--gl/m4/realloc.m463
-rw-r--r--gl/m4/reallocarray.m423
-rw-r--r--gl/m4/regex.m4396
-rw-r--r--gl/m4/rename.m4255
-rw-r--r--gl/m4/renameat.m425
-rw-r--r--gl/m4/rewinddir.m415
-rw-r--r--gl/m4/rmdir.m454
-rw-r--r--gl/m4/save-cwd.m411
-rw-r--r--gl/m4/select.m4117
-rw-r--r--gl/m4/setenv.m4166
-rw-r--r--gl/m4/setlocale_null.m498
-rw-r--r--gl/m4/sigaction.m440
-rw-r--r--gl/m4/signal_h.m4100
-rw-r--r--gl/m4/signalblocking.m423
-rw-r--r--gl/m4/sigpipe.m429
-rw-r--r--gl/m4/size_max.m475
-rw-r--r--gl/m4/sleep.m466
-rw-r--r--gl/m4/socketlib.m496
-rw-r--r--gl/m4/sockets.m417
-rw-r--r--gl/m4/socklen.m476
-rw-r--r--gl/m4/sockpfaf.m484
-rw-r--r--gl/m4/ssize_t.m423
-rw-r--r--gl/m4/stat-time.m483
-rw-r--r--gl/m4/stat.m485
-rw-r--r--gl/m4/stdalign.m456
-rw-r--r--gl/m4/stdarg.m476
-rw-r--r--gl/m4/stdbool.m4117
-rw-r--r--gl/m4/stddef_h.m497
-rw-r--r--gl/m4/stdint.m4531
-rw-r--r--gl/m4/stdint_h.m427
-rw-r--r--gl/m4/stdio_h.m4225
-rw-r--r--gl/m4/stdlib_h.m4200
-rw-r--r--gl/m4/stpcpy.m425
-rw-r--r--gl/m4/strcase.m445
-rw-r--r--gl/m4/strcasestr.m4155
-rw-r--r--gl/m4/strchrnul.m450
-rw-r--r--gl/m4/strdup.m432
-rw-r--r--gl/m4/strerror.m4102
-rw-r--r--gl/m4/string_h.m4145
-rw-r--r--gl/m4/strings_h.m462
-rw-r--r--gl/m4/strndup.m458
-rw-r--r--gl/m4/strnlen.m430
-rw-r--r--gl/m4/strsep.m423
-rw-r--r--gl/m4/sys_file_h.m456
-rw-r--r--gl/m4/sys_ioctl_h.m479
-rw-r--r--gl/m4/sys_random_h.m468
-rw-r--r--gl/m4/sys_select_h.m4110
-rw-r--r--gl/m4/sys_socket_h.m4206
-rw-r--r--gl/m4/sys_stat_h.m4129
-rw-r--r--gl/m4/sys_time_h.m4120
-rw-r--r--gl/m4/sys_types_h.m470
-rw-r--r--gl/m4/sys_uio_h.m446
-rw-r--r--gl/m4/sysexits.m442
-rw-r--r--gl/m4/tempname.m419
-rw-r--r--gl/m4/termios_h.m458
-rw-r--r--gl/m4/threadlib.m4664
-rw-r--r--gl/m4/time_h.m4177
-rw-r--r--gl/m4/timespec.m411
-rw-r--r--gl/m4/uintmax_t.m430
-rw-r--r--gl/m4/unistd-safer.m410
-rw-r--r--gl/m4/unistd_h.m4270
-rw-r--r--gl/m4/unlink.m4135
-rw-r--r--gl/m4/unlinkat.m434
-rw-r--r--gl/m4/utime.m476
-rw-r--r--gl/m4/utime_h.m463
-rw-r--r--gl/m4/utimens.m452
-rw-r--r--gl/m4/utimes.m4161
-rw-r--r--gl/m4/vasnprintf.m4298
-rw-r--r--gl/m4/vasprintf.m446
-rw-r--r--gl/m4/visibility.m482
-rw-r--r--gl/m4/vsnprintf.m462
-rw-r--r--gl/m4/warn-on-use.m449
-rw-r--r--gl/m4/warnings.m4110
-rw-r--r--gl/m4/wchar_h.m4257
-rw-r--r--gl/m4/wchar_t.m424
-rw-r--r--gl/m4/wcrtomb.m4146
-rw-r--r--gl/m4/wctype_h.m4200
-rw-r--r--gl/m4/wint_t.m457
-rw-r--r--gl/m4/wmemchr.m425
-rw-r--r--gl/m4/wmempcpy.m421
-rw-r--r--gl/m4/xalloc.m47
-rw-r--r--gl/m4/xgetcwd.m410
-rw-r--r--gl/m4/xsize.m412
-rw-r--r--gl/m4/xstrndup.m415
-rw-r--r--gl/m4/xvasprintf.m48
-rw-r--r--gl/m4/year2038.m4124
-rw-r--r--gl/m4/zzgnulib.m423
-rw-r--r--gl/po/LINGUAS40
-rw-r--r--gl/po/Makefile.in.in454
-rw-r--r--gl/po/Makevars68
-rw-r--r--gl/po/POTFILES.in405
-rw-r--r--gl/po/Rules-quot47
-rw-r--r--gl/po/af.gmobin0 -> 696 bytes
-rw-r--r--gl/po/af.po542
-rw-r--r--gl/po/be.gmobin0 -> 931 bytes
-rw-r--r--gl/po/be.po485
-rw-r--r--gl/po/bg.gmobin0 -> 6217 bytes
-rw-r--r--gl/po/bg.po963
-rw-r--r--gl/po/boldquot.sed10
-rw-r--r--gl/po/ca.gmobin0 -> 1865 bytes
-rw-r--r--gl/po/ca.po588
-rw-r--r--gl/po/cs.gmobin0 -> 4104 bytes
-rw-r--r--gl/po/cs.po866
-rw-r--r--gl/po/da.gmobin0 -> 3883 bytes
-rw-r--r--gl/po/da.po870
-rw-r--r--gl/po/de.gmobin0 -> 4947 bytes
-rw-r--r--gl/po/de.po1027
-rw-r--r--gl/po/el.gmobin0 -> 671 bytes
-rw-r--r--gl/po/el.po684
-rw-r--r--gl/po/en@boldquot.header25
-rw-r--r--gl/po/en@quot.header22
-rw-r--r--gl/po/eo.gmobin0 -> 4665 bytes
-rw-r--r--gl/po/eo.po962
-rw-r--r--gl/po/es.gmobin0 -> 4851 bytes
-rw-r--r--gl/po/es.po1046
-rw-r--r--gl/po/et.gmobin0 -> 3325 bytes
-rw-r--r--gl/po/et.po713
-rw-r--r--gl/po/eu.gmobin0 -> 663 bytes
-rw-r--r--gl/po/eu.po535
-rw-r--r--gl/po/fi.gmobin0 -> 4836 bytes
-rw-r--r--gl/po/fi.po946
-rw-r--r--gl/po/fr.gmobin0 -> 5001 bytes
-rw-r--r--gl/po/fr.po960
-rw-r--r--gl/po/ga.gmobin0 -> 3682 bytes
-rw-r--r--gl/po/ga.po711
-rw-r--r--gl/po/gl.gmobin0 -> 3228 bytes
-rw-r--r--gl/po/gl.po732
-rw-r--r--gl/po/hu.gmobin0 -> 4135 bytes
-rw-r--r--gl/po/hu.po872
-rw-r--r--gl/po/insert-header.sin23
-rw-r--r--gl/po/it.gmobin0 -> 4886 bytes
-rw-r--r--gl/po/it.po1011
-rw-r--r--gl/po/ja.gmobin0 -> 4411 bytes
-rw-r--r--gl/po/ja.po906
-rw-r--r--gl/po/ka.gmobin0 -> 7259 bytes
-rw-r--r--gl/po/ka.po808
-rw-r--r--gl/po/ko.gmobin0 -> 580 bytes
-rw-r--r--gl/po/ko.po504
-rw-r--r--gl/po/man-db-gnulib.pot242
-rw-r--r--gl/po/ms.gmobin0 -> 736 bytes
-rw-r--r--gl/po/ms.po480
-rw-r--r--gl/po/nb.gmobin0 -> 581 bytes
-rw-r--r--gl/po/nb.po481
-rw-r--r--gl/po/nl.gmobin0 -> 4814 bytes
-rw-r--r--gl/po/nl.po978
-rw-r--r--gl/po/pl.gmobin0 -> 4913 bytes
-rw-r--r--gl/po/pl.po956
-rw-r--r--gl/po/pt.gmobin0 -> 4801 bytes
-rw-r--r--gl/po/pt.po941
-rw-r--r--gl/po/pt_BR.gmobin0 -> 4903 bytes
-rw-r--r--gl/po/pt_BR.po1090
-rw-r--r--gl/po/quot.sed6
-rw-r--r--gl/po/remove-potcdate.sin19
-rw-r--r--gl/po/ro.gmobin0 -> 5091 bytes
-rw-r--r--gl/po/ro.po1063
-rw-r--r--gl/po/ru.gmobin0 -> 6284 bytes
-rw-r--r--gl/po/ru.po969
-rw-r--r--gl/po/rw.gmobin0 -> 590 bytes
-rw-r--r--gl/po/rw.po587
-rw-r--r--gl/po/sk.gmobin0 -> 577 bytes
-rw-r--r--gl/po/sk.po504
-rw-r--r--gl/po/sl.gmobin0 -> 4007 bytes
-rw-r--r--gl/po/sl.po914
-rw-r--r--gl/po/sr.gmobin0 -> 5960 bytes
-rw-r--r--gl/po/sr.po967
-rw-r--r--gl/po/stamp-po1
-rw-r--r--gl/po/sv.gmobin0 -> 4743 bytes
-rw-r--r--gl/po/sv.po954
-rw-r--r--gl/po/tr.gmobin0 -> 793 bytes
-rw-r--r--gl/po/tr.po568
-rw-r--r--gl/po/uk.gmobin0 -> 6096 bytes
-rw-r--r--gl/po/uk.po973
-rw-r--r--gl/po/vi.gmobin0 -> 4440 bytes
-rw-r--r--gl/po/vi.po879
-rw-r--r--gl/po/zh_CN.gmobin0 -> 3641 bytes
-rw-r--r--gl/po/zh_CN.po886
-rw-r--r--gl/po/zh_TW.gmobin0 -> 4472 bytes
-rw-r--r--gl/po/zh_TW.po984
710 files changed, 170677 insertions, 0 deletions
diff --git a/gl/lib/Makefile.am b/gl/lib/Makefile.am
new file mode 100644
index 0000000..a8e268e
--- /dev/null
+++ b/gl/lib/Makefile.am
@@ -0,0 +1,3732 @@
+## DO NOT EDIT! GENERATED AUTOMATICALLY!
+## Process this file with automake to produce Makefile.in.
+# Copyright (C) 2002-2022 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 file. If not, see <https://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License,
+# this file may be distributed as part of a program that
+# contains a configuration script generated by Autoconf, under
+# the same distribution terms as the rest of that program.
+#
+# Generated by gnulib-tool.
+# Reproduce by:
+# gnulib-tool --import --local-dir=gnulib-local \
+# --lib=libgnu \
+# --source-base=gl/lib \
+# --m4-base=gl/m4 \
+# --po-base=gl/ref-po \
+# --doc-base=doc \
+# --tests-base=tests \
+# --aux-dir=build-aux \
+# --no-conditional-dependencies \
+# --libtool \
+# --macro-prefix=gl \
+# --po-domain=man-db \
+# --no-vc-files \
+# argp \
+# array-list \
+# attribute \
+# c99 \
+# canonicalize \
+# closedir \
+# dirent \
+# dirname \
+# error \
+# fcntl-h \
+# flock \
+# fnmatch-gnu \
+# fstat \
+# getline \
+# gettext-h \
+# gitlog-to-changelog \
+# glob \
+# gnupload \
+# hash-map \
+# hash-pjw-bare \
+# hash-set \
+# havelib \
+# idpriv-drop \
+# idpriv-droptemp \
+# lchown \
+# lib-ignore \
+# linkedhash-list \
+# localcharset \
+# manywarnings \
+# memmem \
+# minmax \
+# mkdtemp \
+# mkstemp \
+# nanosleep \
+# nonblocking \
+# openat \
+# opendir \
+# progname \
+# raise \
+# rbtree-list \
+# regex \
+# rename \
+# renameat \
+# setenv \
+# sigaction \
+# signal-h \
+# sigpipe \
+# sigprocmask \
+# stat-time \
+# stdbool \
+# stpcpy \
+# strcase \
+# strcasestr \
+# strerror \
+# strsep \
+# tempname \
+# termios \
+# timespec \
+# unlinkat \
+# utimens \
+# verror \
+# warnings \
+# xalloc \
+# xgetcwd \
+# xlist \
+# xmap \
+# xset \
+# xstdopen \
+# xstrndup \
+# xvasprintf
+
+AUTOMAKE_OPTIONS = 1.14 gnits subdir-objects
+
+SUBDIRS =
+noinst_HEADERS =
+noinst_LIBRARIES =
+noinst_LTLIBRARIES =
+EXTRA_DIST =
+BUILT_SOURCES =
+SUFFIXES =
+MOSTLYCLEANFILES = core *.stackdump
+MOSTLYCLEANDIRS =
+CLEANFILES =
+DISTCLEANFILES =
+MAINTAINERCLEANFILES =
+# No GNU Make output.
+
+AM_CPPFLAGS =
+AM_CFLAGS =
+
+noinst_LTLIBRARIES += libgnu.la
+
+libgnu_la_SOURCES =
+libgnu_la_CFLAGS = $(AM_CFLAGS) $(GL_CFLAG_GNULIB_WARNINGS)
+libgnu_la_LIBADD = $(gl_LTLIBOBJS)
+libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS)
+EXTRA_libgnu_la_SOURCES =
+libgnu_la_LDFLAGS = $(AM_LDFLAGS)
+libgnu_la_LDFLAGS += -no-undefined
+libgnu_la_LDFLAGS += $(LIBSOCKET)
+libgnu_la_LDFLAGS += $(LIBTHREAD)
+libgnu_la_LDFLAGS += $(LIB_CLOCK_GETTIME)
+libgnu_la_LDFLAGS += $(LIB_GETLOGIN)
+libgnu_la_LDFLAGS += $(LIB_GETRANDOM)
+libgnu_la_LDFLAGS += $(LIB_HARD_LOCALE)
+libgnu_la_LDFLAGS += $(LIB_MBRTOWC)
+libgnu_la_LDFLAGS += $(LIB_NANOSLEEP)
+libgnu_la_LDFLAGS += $(LIB_PTHREAD_SIGMASK)
+libgnu_la_LDFLAGS += $(LIB_SELECT)
+libgnu_la_LDFLAGS += $(LIB_SETLOCALE_NULL)
+libgnu_la_LDFLAGS += $(LTLIBINTL)
+
+AM_CPPFLAGS += -DDEFAULT_TEXT_DOMAIN=\"man-db-gnulib\"
+
+## begin gnulib module absolute-header
+
+# Use this preprocessor expression to decide whether #include_next works.
+# Do not rely on a 'configure'-time test for this, since the expression
+# might appear in an installed header, which is used by some other compiler.
+HAVE_INCLUDE_NEXT = (__GNUC__ || __clang__ || 60000000 <= __DECC_VER)
+
+## end gnulib module absolute-header
+
+## begin gnulib module alloca
+
+
+libgnu_la_LIBADD += @LTALLOCA@
+libgnu_la_DEPENDENCIES += @LTALLOCA@
+EXTRA_DIST += alloca.c
+
+EXTRA_libgnu_la_SOURCES += alloca.c
+
+## end gnulib module alloca
+
+## begin gnulib module alloca-opt
+
+BUILT_SOURCES += $(ALLOCA_H)
+
+# We need the following in order to create <alloca.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_ALLOCA_H
+alloca.h: alloca.in.h $(top_builddir)/config.status
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''HAVE_ALLOCA_H''@|$(HAVE_ALLOCA_H)|g' \
+ $(srcdir)/alloca.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+alloca.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += alloca.h alloca.h-t
+
+EXTRA_DIST += alloca.in.h
+
+## end gnulib module alloca-opt
+
+## begin gnulib module argp
+
+libgnu_la_SOURCES += argp.h argp-ba.c argp-eexst.c argp-fmtstream.c argp-fmtstream.h argp-fs-xinl.c argp-help.c argp-namefrob.h argp-parse.c argp-pin.c argp-pv.c argp-pvh.c argp-xinl.c
+
+## end gnulib module argp
+
+## begin gnulib module array-list
+
+libgnu_la_SOURCES += gl_array_list.h gl_array_list.c
+
+## end gnulib module array-list
+
+## begin gnulib module assure
+
+
+EXTRA_DIST += assure.h
+
+## end gnulib module assure
+
+## begin gnulib module at-internal
+
+libgnu_la_SOURCES += openat-priv.h openat-proc.c
+
+## end gnulib module at-internal
+
+## begin gnulib module attribute
+
+
+EXTRA_DIST += attribute.h
+
+## end gnulib module attribute
+
+## begin gnulib module basename-lgpl
+
+libgnu_la_SOURCES += basename-lgpl.c
+
+EXTRA_DIST += basename-lgpl.h
+
+## end gnulib module basename-lgpl
+
+## begin gnulib module bitrotate
+
+libgnu_la_SOURCES += bitrotate.h bitrotate.c
+
+## end gnulib module bitrotate
+
+## begin gnulib module btowc
+
+if GL_COND_OBJ_BTOWC
+libgnu_la_SOURCES += btowc.c
+endif
+
+## end gnulib module btowc
+
+## begin gnulib module calloc-gnu
+
+
+EXTRA_DIST += calloc.c
+
+EXTRA_libgnu_la_SOURCES += calloc.c
+
+## end gnulib module calloc-gnu
+
+## begin gnulib module calloc-posix
+
+
+EXTRA_DIST += calloc.c
+
+EXTRA_libgnu_la_SOURCES += calloc.c
+
+## end gnulib module calloc-posix
+
+## begin gnulib module canonicalize
+
+libgnu_la_SOURCES += canonicalize.c
+
+EXTRA_DIST += canonicalize.h
+
+## end gnulib module canonicalize
+
+## begin gnulib module canonicalize-lgpl
+
+if GL_COND_OBJ_CANONICALIZE_LGPL
+libgnu_la_SOURCES += canonicalize-lgpl.c
+endif
+
+## end gnulib module canonicalize-lgpl
+
+## begin gnulib module chdir-long
+
+if GL_COND_OBJ_CHDIR_LONG
+libgnu_la_SOURCES += chdir-long.c
+endif
+
+EXTRA_DIST += chdir-long.h
+
+## end gnulib module chdir-long
+
+## begin gnulib module chown
+
+if GL_COND_OBJ_CHOWN
+libgnu_la_SOURCES += chown.c
+endif
+if GL_COND_OBJ_FCHOWN_STUB
+libgnu_la_SOURCES += fchown-stub.c
+endif
+
+## end gnulib module chown
+
+## begin gnulib module cloexec
+
+libgnu_la_SOURCES += cloexec.c
+
+EXTRA_DIST += cloexec.h
+
+## end gnulib module cloexec
+
+## begin gnulib module close
+
+if GL_COND_OBJ_CLOSE
+libgnu_la_SOURCES += close.c
+endif
+
+## end gnulib module close
+
+## begin gnulib module closedir
+
+if GL_COND_OBJ_CLOSEDIR
+libgnu_la_SOURCES += closedir.c
+endif
+
+EXTRA_DIST += dirent-private.h
+
+## end gnulib module closedir
+
+## begin gnulib module ctype
+
+BUILT_SOURCES += ctype.h
+
+# We need the following in order to create <ctype.h> when the system
+# doesn't have one that works with the given compiler.
+ctype.h: ctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_CTYPE_H''@|$(NEXT_CTYPE_H)|g' \
+ -e 's/@''GNULIB_ISBLANK''@/$(GL_GNULIB_ISBLANK)/g' \
+ -e 's/@''HAVE_ISBLANK''@/$(HAVE_ISBLANK)/g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/ctype.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += ctype.h ctype.h-t
+
+EXTRA_DIST += ctype.in.h
+
+## end gnulib module ctype
+
+## begin gnulib module dirent
+
+BUILT_SOURCES += dirent.h
+
+# We need the following in order to create <dirent.h> when the system
+# doesn't have one that works with the given compiler.
+dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_DIRENT_H''@|$(HAVE_DIRENT_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \
+ -e 's/@''GNULIB_OPENDIR''@/$(GL_GNULIB_OPENDIR)/g' \
+ -e 's/@''GNULIB_READDIR''@/$(GL_GNULIB_READDIR)/g' \
+ -e 's/@''GNULIB_REWINDDIR''@/$(GL_GNULIB_REWINDDIR)/g' \
+ -e 's/@''GNULIB_CLOSEDIR''@/$(GL_GNULIB_CLOSEDIR)/g' \
+ -e 's/@''GNULIB_DIRFD''@/$(GL_GNULIB_DIRFD)/g' \
+ -e 's/@''GNULIB_FDOPENDIR''@/$(GL_GNULIB_FDOPENDIR)/g' \
+ -e 's/@''GNULIB_SCANDIR''@/$(GL_GNULIB_SCANDIR)/g' \
+ -e 's/@''GNULIB_ALPHASORT''@/$(GL_GNULIB_ALPHASORT)/g' \
+ -e 's/@''HAVE_OPENDIR''@/$(HAVE_OPENDIR)/g' \
+ -e 's/@''HAVE_READDIR''@/$(HAVE_READDIR)/g' \
+ -e 's/@''HAVE_REWINDDIR''@/$(HAVE_REWINDDIR)/g' \
+ -e 's/@''HAVE_CLOSEDIR''@/$(HAVE_CLOSEDIR)/g' \
+ -e 's|@''HAVE_DECL_DIRFD''@|$(HAVE_DECL_DIRFD)|g' \
+ -e 's|@''HAVE_DECL_FDOPENDIR''@|$(HAVE_DECL_FDOPENDIR)|g' \
+ -e 's|@''HAVE_FDOPENDIR''@|$(HAVE_FDOPENDIR)|g' \
+ -e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \
+ -e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \
+ -e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \
+ -e 's|@''REPLACE_CLOSEDIR''@|$(REPLACE_CLOSEDIR)|g' \
+ -e 's|@''REPLACE_DIRFD''@|$(REPLACE_DIRFD)|g' \
+ -e 's|@''REPLACE_FDOPENDIR''@|$(REPLACE_FDOPENDIR)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/dirent.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += dirent.h dirent.h-t
+
+EXTRA_DIST += dirent.in.h
+
+## end gnulib module dirent
+
+## begin gnulib module dirfd
+
+if GL_COND_OBJ_DIRFD
+libgnu_la_SOURCES += dirfd.c
+endif
+
+## end gnulib module dirfd
+
+## begin gnulib module dirname
+
+libgnu_la_SOURCES += dirname.c basename.c
+
+EXTRA_DIST += stripslash.c
+
+EXTRA_libgnu_la_SOURCES += stripslash.c
+
+## end gnulib module dirname
+
+## begin gnulib module dirname-lgpl
+
+libgnu_la_SOURCES += dirname-lgpl.c stripslash.c
+
+EXTRA_DIST += dirname.h
+
+## end gnulib module dirname-lgpl
+
+## begin gnulib module dup
+
+if GL_COND_OBJ_DUP
+libgnu_la_SOURCES += dup.c
+endif
+
+## end gnulib module dup
+
+## begin gnulib module dup2
+
+if GL_COND_OBJ_DUP2
+libgnu_la_SOURCES += dup2.c
+endif
+
+## end gnulib module dup2
+
+## begin gnulib module dynarray
+
+BUILT_SOURCES += malloc/dynarray.gl.h malloc/dynarray-skeleton.gl.h
+
+malloc/dynarray.gl.h: malloc/dynarray.h
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/malloc'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e '/libc_hidden_proto/d' \
+ $(srcdir)/malloc/dynarray.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += malloc/dynarray.gl.h malloc/dynarray.gl.h-t
+
+malloc/dynarray-skeleton.gl.h: malloc/dynarray-skeleton.c
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/malloc'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|<malloc/dynarray\.h>|<malloc/dynarray.gl.h>|g' \
+ -e 's|__attribute_maybe_unused__|_GL_ATTRIBUTE_MAYBE_UNUSED|g' \
+ -e 's|__attribute_nonnull__|_GL_ATTRIBUTE_NONNULL|g' \
+ -e 's|__attribute_warn_unused_result__|_GL_ATTRIBUTE_NODISCARD|g' \
+ -e 's|__glibc_likely|_GL_LIKELY|g' \
+ -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \
+ $(srcdir)/malloc/dynarray-skeleton.c > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += malloc/dynarray-skeleton.gl.h malloc/dynarray-skeleton.gl.h-t
+
+libgnu_la_SOURCES += malloc/dynarray_at_failure.c malloc/dynarray_emplace_enlarge.c malloc/dynarray_finalize.c malloc/dynarray_resize.c malloc/dynarray_resize_clear.c
+
+EXTRA_DIST += dynarray.h malloc/dynarray-skeleton.c malloc/dynarray.h
+
+EXTRA_libgnu_la_SOURCES += malloc/dynarray-skeleton.c
+
+## end gnulib module dynarray
+
+## begin gnulib module eloop-threshold
+
+
+EXTRA_DIST += eloop-threshold.h
+
+## end gnulib module eloop-threshold
+
+## begin gnulib module errno
+
+BUILT_SOURCES += $(ERRNO_H)
+
+# We need the following in order to create <errno.h> when the system
+# doesn't have one that is POSIX compliant.
+if GL_GENERATE_ERRNO_H
+errno.h: errno.in.h $(top_builddir)/config.status
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
+ -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \
+ -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \
+ -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \
+ -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \
+ -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
+ -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
+ $(srcdir)/errno.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+errno.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += errno.h errno.h-t
+
+EXTRA_DIST += errno.in.h
+
+## end gnulib module errno
+
+## begin gnulib module error
+
+if GL_COND_OBJ_ERROR
+libgnu_la_SOURCES += error.c
+endif
+
+EXTRA_DIST += error.h
+
+## end gnulib module error
+
+## begin gnulib module exitfail
+
+libgnu_la_SOURCES += exitfail.c
+
+EXTRA_DIST += exitfail.h
+
+## end gnulib module exitfail
+
+## begin gnulib module fchdir
+
+if GL_COND_OBJ_FCHDIR
+libgnu_la_SOURCES += fchdir.c
+endif
+
+## end gnulib module fchdir
+
+## begin gnulib module fcntl
+
+if GL_COND_OBJ_FCNTL
+libgnu_la_SOURCES += fcntl.c
+endif
+
+## end gnulib module fcntl
+
+## begin gnulib module fcntl-h
+
+BUILT_SOURCES += fcntl.h
+
+# We need the following in order to create <fcntl.h> when the system
+# doesn't have one that works with the given compiler.
+fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
+ -e 's/@''GNULIB_CREAT''@/$(GL_GNULIB_CREAT)/g' \
+ -e 's/@''GNULIB_FCNTL''@/$(GL_GNULIB_FCNTL)/g' \
+ -e 's/@''GNULIB_NONBLOCKING''@/$(GL_GNULIB_NONBLOCKING)/g' \
+ -e 's/@''GNULIB_OPEN''@/$(GL_GNULIB_OPEN)/g' \
+ -e 's/@''GNULIB_OPENAT''@/$(GL_GNULIB_OPENAT)/g' \
+ -e 's/@''GNULIB_MDA_CREAT''@/$(GL_GNULIB_MDA_CREAT)/g' \
+ -e 's/@''GNULIB_MDA_OPEN''@/$(GL_GNULIB_MDA_OPEN)/g' \
+ -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
+ -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
+ -e 's|@''REPLACE_CREAT''@|$(REPLACE_CREAT)|g' \
+ -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
+ -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
+ -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/fcntl.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += fcntl.h fcntl.h-t
+
+EXTRA_DIST += fcntl.in.h
+
+## end gnulib module fcntl-h
+
+## begin gnulib module fd-hook
+
+libgnu_la_SOURCES += fd-hook.c
+
+EXTRA_DIST += fd-hook.h
+
+## end gnulib module fd-hook
+
+## begin gnulib module fd-safer-flag
+
+libgnu_la_SOURCES += fd-safer-flag.c dup-safer-flag.c
+
+## end gnulib module fd-safer-flag
+
+## begin gnulib module fdopendir
+
+if GL_COND_OBJ_FDOPENDIR
+libgnu_la_SOURCES += fdopendir.c
+endif
+
+## end gnulib module fdopendir
+
+## begin gnulib module file-set
+
+libgnu_la_SOURCES += file-set.c
+
+EXTRA_DIST += file-set.h
+
+## end gnulib module file-set
+
+## begin gnulib module filename
+
+
+EXTRA_DIST += filename.h
+
+## end gnulib module filename
+
+## begin gnulib module filenamecat-lgpl
+
+libgnu_la_SOURCES += filenamecat-lgpl.c
+
+EXTRA_DIST += filenamecat.h
+
+## end gnulib module filenamecat-lgpl
+
+## begin gnulib module flexmember
+
+
+EXTRA_DIST += flexmember.h
+
+## end gnulib module flexmember
+
+## begin gnulib module float
+
+BUILT_SOURCES += $(FLOAT_H)
+
+# We need the following in order to create <float.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_FLOAT_H
+float.h: float.in.h $(top_builddir)/config.status
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
+ -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \
+ $(srcdir)/float.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+float.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += float.h float.h-t
+
+if GL_COND_OBJ_FLOAT
+libgnu_la_SOURCES += float.c
+endif
+if GL_COND_OBJ_ITOLD
+libgnu_la_SOURCES += itold.c
+endif
+
+EXTRA_DIST += float.in.h
+
+## end gnulib module float
+
+## begin gnulib module flock
+
+if GL_COND_OBJ_FLOCK
+libgnu_la_SOURCES += flock.c
+endif
+
+## end gnulib module flock
+
+## begin gnulib module fnmatch
+
+
+EXTRA_DIST += fnmatch.c fnmatch_loop.c
+
+EXTRA_libgnu_la_SOURCES += fnmatch.c fnmatch_loop.c
+
+## end gnulib module fnmatch
+
+## begin gnulib module fnmatch-gnu
+
+
+EXTRA_DIST += fnmatch.c
+
+EXTRA_libgnu_la_SOURCES += fnmatch.c
+
+## end gnulib module fnmatch-gnu
+
+## begin gnulib module fnmatch-h
+
+BUILT_SOURCES += $(FNMATCH_H)
+
+# We need the following in order to create <fnmatch.h>.
+if GL_GENERATE_FNMATCH_H
+fnmatch.h: fnmatch.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_FNMATCH_H''@|$(HAVE_FNMATCH_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_FNMATCH_H''@|$(NEXT_FNMATCH_H)|g' \
+ -e 's/@''GNULIB_FNMATCH''@/$(GL_GNULIB_FNMATCH)/g' \
+ -e 's|@''HAVE_FNMATCH''@|$(HAVE_FNMATCH)|g' \
+ -e 's|@''REPLACE_FNMATCH''@|$(REPLACE_FNMATCH)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/fnmatch.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+fnmatch.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t
+
+EXTRA_DIST += fnmatch.in.h
+
+## end gnulib module fnmatch-h
+
+## begin gnulib module free-posix
+
+if GL_COND_OBJ_FREE
+libgnu_la_SOURCES += free.c
+endif
+
+## end gnulib module free-posix
+
+## begin gnulib module fstat
+
+if GL_COND_OBJ_FSTAT
+libgnu_la_SOURCES += fstat.c
+endif
+
+EXTRA_DIST += stat-w32.c stat-w32.h
+
+EXTRA_libgnu_la_SOURCES += stat-w32.c
+
+## end gnulib module fstat
+
+## begin gnulib module fstatat
+
+if GL_COND_OBJ_FSTATAT
+libgnu_la_SOURCES += fstatat.c
+endif
+
+EXTRA_DIST += at-func.c
+
+EXTRA_libgnu_la_SOURCES += at-func.c
+
+## end gnulib module fstatat
+
+## begin gnulib module gen-header
+
+# In 'sed', replace the pattern space with a "DO NOT EDIT" comment.
+SED_HEADER_NOEDIT = s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,
+
+# '$(SED_HEADER_STDOUT) -e "..."' runs 'sed' but first outputs "DO NOT EDIT".
+SED_HEADER_STDOUT = sed -e 1h -e '1$(SED_HEADER_NOEDIT)' -e 1G
+
+# '$(SED_HEADER_TO_AT_t) FILE' copies FILE to $@-t, prepending a leading
+# "DO_NOT_EDIT". Although this could be done more simply via:
+# SED_HEADER_TO_AT_t = $(SED_HEADER_STDOUT) > $@-t
+# the -n and 'w' avoid a fork+exec, at least when GNU Make is used.
+SED_HEADER_TO_AT_t = $(SED_HEADER_STDOUT) -n -e 'w $@-t'
+
+# Use $(gl_V_at) instead of $(AM_V_GEN) or $(AM_V_at) on a line that
+gl_V_at = $(AM_V_GEN)
+
+## end gnulib module gen-header
+
+## begin gnulib module getcwd
+
+if GL_COND_OBJ_GETCWD
+libgnu_la_SOURCES += getcwd.c
+endif
+
+## end gnulib module getcwd
+
+## begin gnulib module getcwd-lgpl
+
+if GL_COND_OBJ_GETCWD_LGPL
+libgnu_la_SOURCES += getcwd-lgpl.c
+endif
+
+## end gnulib module getcwd-lgpl
+
+## begin gnulib module getdelim
+
+if GL_COND_OBJ_GETDELIM
+libgnu_la_SOURCES += getdelim.c
+endif
+
+## end gnulib module getdelim
+
+## begin gnulib module getdtablesize
+
+if GL_COND_OBJ_GETDTABLESIZE
+libgnu_la_SOURCES += getdtablesize.c
+endif
+
+## end gnulib module getdtablesize
+
+## begin gnulib module getline
+
+if GL_COND_OBJ_GETLINE
+libgnu_la_SOURCES += getline.c
+endif
+
+## end gnulib module getline
+
+## begin gnulib module getlogin_r
+
+if GL_COND_OBJ_GETLOGIN_R
+libgnu_la_SOURCES += getlogin_r.c
+endif
+
+## end gnulib module getlogin_r
+
+## begin gnulib module getopt-posix
+
+BUILT_SOURCES += $(GETOPT_H) $(GETOPT_CDEFS_H)
+
+# We need the following in order to create <getopt.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_GETOPT_H
+getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ $(srcdir)/getopt.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+getopt.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+
+if GL_GENERATE_GETOPT_CDEFS_H
+getopt-cdefs.h: getopt-cdefs.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)$(SED_HEADER_STDOUT) \
+ -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \
+ $(srcdir)/getopt-cdefs.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+getopt-cdefs.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+
+MOSTLYCLEANFILES += getopt.h getopt.h-t getopt-cdefs.h getopt-cdefs.h-t
+
+if GL_COND_OBJ_GETOPT
+libgnu_la_SOURCES += getopt.c getopt1.c
+endif
+
+EXTRA_DIST += getopt-cdefs.in.h getopt-core.h getopt-ext.h getopt-pfx-core.h getopt-pfx-ext.h getopt.in.h getopt_int.h
+
+## end gnulib module getopt-posix
+
+## begin gnulib module getprogname
+
+libgnu_la_SOURCES += getprogname.h getprogname.c
+
+## end gnulib module getprogname
+
+## begin gnulib module getrandom
+
+if GL_COND_OBJ_GETRANDOM
+libgnu_la_SOURCES += getrandom.c
+endif
+
+## end gnulib module getrandom
+
+## begin gnulib module gettext-h
+
+libgnu_la_SOURCES += gettext.h
+
+## end gnulib module gettext-h
+
+## begin gnulib module gettime
+
+libgnu_la_SOURCES += gettime.c
+
+## end gnulib module gettime
+
+## begin gnulib module gettimeofday
+
+if GL_COND_OBJ_GETTIMEOFDAY
+libgnu_la_SOURCES += gettimeofday.c
+endif
+
+## end gnulib module gettimeofday
+
+## begin gnulib module gitlog-to-changelog
+
+
+EXTRA_DIST += $(top_srcdir)/build-aux/gitlog-to-changelog
+
+## end gnulib module gitlog-to-changelog
+
+## begin gnulib module glob
+
+if GL_COND_OBJ_GLOB
+libgnu_la_SOURCES += glob.c globfree.c
+endif
+if GL_COND_OBJ_GLOB_PATTERN_P
+libgnu_la_SOURCES += glob_pattern_p.c
+endif
+
+EXTRA_DIST += glob_internal.h
+
+## end gnulib module glob
+
+## begin gnulib module glob-h
+
+BUILT_SOURCES += $(GLOB_H)
+
+# We need the following in order to create <glob.h>.
+if GL_GENERATE_GLOB_H
+glob.h: glob.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_GLOB_H''@|$(HAVE_GLOB_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_GLOB_H''@|$(NEXT_GLOB_H)|g' \
+ -e 's/@''GNULIB_GLOB''@/$(GL_GNULIB_GLOB)/g' \
+ -e 's|@''HAVE_GLOB''@|$(HAVE_GLOB)|g' \
+ -e 's|@''HAVE_GLOB_PATTERN_P''@|$(HAVE_GLOB_PATTERN_P)|g' \
+ -e 's|@''REPLACE_GLOB''@|$(REPLACE_GLOB)|g' \
+ -e 's|@''REPLACE_GLOB_PATTERN_P''@|$(REPLACE_GLOB_PATTERN_P)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/glob.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+glob.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += glob.h glob.h-t
+
+BUILT_SOURCES += glob-libc.gl.h
+
+glob-libc.gl.h: glob-libc.h
+ $(AM_V_GEN)$(SED_HEADER_STDOUT) \
+ -e '/__BEGIN_DECLS/{ s/__BEGIN_DECLS/#ifdef __cplusplus%extern "C" {%#endif/; y/%/\n/; }' \
+ -e '/__END_DECLS/{ s/__END_DECLS/#ifdef __cplusplus%}%#endif/; y/%/\n/; }' \
+ -e 's|__THROWNL||g' \
+ -e 's|__THROW||g' \
+ -e 's|__restrict|restrict|g' \
+ -e 's|defined __USE_MISC|1|' \
+ -e 's|ifdef __USE_GNU|if 1|' \
+ -e 's|ifdef __USE_LARGEFILE64|if 0|' \
+ $(srcdir)/glob-libc.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += glob-libc.gl.h glob-libc.gl.h-t
+
+
+EXTRA_DIST += glob-libc.h glob.in.h
+
+## end gnulib module glob-h
+
+## begin gnulib module gnupload
+
+
+EXTRA_DIST += $(top_srcdir)/build-aux/gnupload
+
+## end gnulib module gnupload
+
+## begin gnulib module hard-locale
+
+libgnu_la_SOURCES += hard-locale.c
+
+EXTRA_DIST += hard-locale.h
+
+## end gnulib module hard-locale
+
+## begin gnulib module hash
+
+libgnu_la_SOURCES += hash.c
+
+EXTRA_DIST += hash.h
+
+## end gnulib module hash
+
+## begin gnulib module hash-map
+
+libgnu_la_SOURCES += gl_hash_map.h gl_hash_map.c gl_anyhash1.h gl_anyhash2.h gl_anyhash_primes.h
+
+## end gnulib module hash-map
+
+## begin gnulib module hash-pjw
+
+libgnu_la_SOURCES += hash-pjw.h hash-pjw.c
+
+## end gnulib module hash-pjw
+
+## begin gnulib module hash-pjw-bare
+
+libgnu_la_SOURCES += hash-pjw-bare.h hash-pjw-bare.c
+
+## end gnulib module hash-pjw-bare
+
+## begin gnulib module hash-set
+
+libgnu_la_SOURCES += gl_hash_set.h gl_hash_set.c gl_anyhash1.h gl_anyhash2.h gl_anyhash_primes.h
+
+## end gnulib module hash-set
+
+## begin gnulib module hash-triple-simple
+
+libgnu_la_SOURCES += hash-triple-simple.c
+
+EXTRA_DIST += hash-triple.h
+
+## end gnulib module hash-triple-simple
+
+## begin gnulib module havelib
+
+
+EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath
+
+## end gnulib module havelib
+
+## begin gnulib module ialloc
+
+libgnu_la_SOURCES += ialloc.c
+
+EXTRA_DIST += ialloc.h
+
+## end gnulib module ialloc
+
+## begin gnulib module idpriv-drop
+
+libgnu_la_SOURCES += idpriv-drop.c
+
+EXTRA_DIST += idpriv.h
+
+## end gnulib module idpriv-drop
+
+## begin gnulib module idpriv-droptemp
+
+libgnu_la_SOURCES += idpriv-droptemp.c
+
+EXTRA_DIST += idpriv.h
+
+## end gnulib module idpriv-droptemp
+
+## begin gnulib module idx
+
+libgnu_la_SOURCES += idx.h
+
+## end gnulib module idx
+
+## begin gnulib module intprops
+
+
+EXTRA_DIST += intprops.h
+
+## end gnulib module intprops
+
+## begin gnulib module inttypes-incomplete
+
+BUILT_SOURCES += inttypes.h
+
+# We need the following in order to create <inttypes.h> when the system
+# doesn't have one that works with the given compiler.
+inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \
+ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
+ -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \
+ -e 's/@''GNULIB_IMAXABS''@/$(GL_GNULIB_IMAXABS)/g' \
+ -e 's/@''GNULIB_IMAXDIV''@/$(GL_GNULIB_IMAXDIV)/g' \
+ -e 's/@''GNULIB_STRTOIMAX''@/$(GL_GNULIB_STRTOIMAX)/g' \
+ -e 's/@''GNULIB_STRTOUMAX''@/$(GL_GNULIB_STRTOUMAX)/g' \
+ -e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \
+ -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \
+ -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \
+ -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \
+ -e 's/@''HAVE_IMAXDIV_T''@/$(HAVE_IMAXDIV_T)/g' \
+ -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \
+ -e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \
+ -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \
+ -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \
+ -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \
+ -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/inttypes.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += inttypes.h inttypes.h-t
+
+EXTRA_DIST += inttypes.in.h
+
+## end gnulib module inttypes-incomplete
+
+## begin gnulib module ioctl
+
+if GL_COND_OBJ_IOCTL
+libgnu_la_SOURCES += ioctl.c
+endif
+
+EXTRA_DIST += w32sock.h
+
+## end gnulib module ioctl
+
+## begin gnulib module isblank
+
+if GL_COND_OBJ_ISBLANK
+libgnu_la_SOURCES += isblank.c
+endif
+
+## end gnulib module isblank
+
+## begin gnulib module langinfo
+
+BUILT_SOURCES += langinfo.h
+
+# We need the following in order to create an empty placeholder for
+# <langinfo.h> when the system doesn't have one.
+langinfo.h: langinfo.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_LANGINFO_H''@|$(NEXT_LANGINFO_H)|g' \
+ -e 's/@''GNULIB_NL_LANGINFO''@/$(GL_GNULIB_NL_LANGINFO)/g' \
+ -e 's|@''HAVE_LANGINFO_CODESET''@|$(HAVE_LANGINFO_CODESET)|g' \
+ -e 's|@''HAVE_LANGINFO_T_FMT_AMPM''@|$(HAVE_LANGINFO_T_FMT_AMPM)|g' \
+ -e 's|@''HAVE_LANGINFO_ALTMON''@|$(HAVE_LANGINFO_ALTMON)|g' \
+ -e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \
+ -e 's|@''HAVE_LANGINFO_YESEXPR''@|$(HAVE_LANGINFO_YESEXPR)|g' \
+ -e 's|@''HAVE_NL_LANGINFO''@|$(HAVE_NL_LANGINFO)|g' \
+ -e 's|@''REPLACE_NL_LANGINFO''@|$(REPLACE_NL_LANGINFO)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/langinfo.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += langinfo.h langinfo.h-t
+
+EXTRA_DIST += langinfo.in.h
+
+## end gnulib module langinfo
+
+## begin gnulib module lchown
+
+if GL_COND_OBJ_LCHOWN
+libgnu_la_SOURCES += lchown.c
+endif
+
+## end gnulib module lchown
+
+## begin gnulib module libc-config
+
+
+EXTRA_DIST += cdefs.h libc-config.h
+
+## end gnulib module libc-config
+
+## begin gnulib module limits-h
+
+BUILT_SOURCES += $(LIMITS_H)
+
+# We need the following in order to create <limits.h> when the system
+# doesn't have one that is compatible with GNU.
+if GL_GENERATE_LIMITS_H
+limits.h: limits.in.h $(top_builddir)/config.status
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \
+ $(srcdir)/limits.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+limits.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += limits.h limits.h-t
+
+EXTRA_DIST += limits.in.h
+
+## end gnulib module limits-h
+
+## begin gnulib module linkedhash-list
+
+libgnu_la_SOURCES += gl_linkedhash_list.h gl_linkedhash_list.c gl_anyhash1.h gl_anyhash2.h gl_anyhash_primes.h gl_anylinked_list1.h gl_anylinked_list2.h
+
+## end gnulib module linkedhash-list
+
+## begin gnulib module list
+
+libgnu_la_SOURCES += gl_list.h gl_list.c
+
+## end gnulib module list
+
+## begin gnulib module localcharset
+
+libgnu_la_SOURCES += localcharset.c
+
+EXTRA_DIST += localcharset.h
+
+## end gnulib module localcharset
+
+## begin gnulib module locale
+
+BUILT_SOURCES += locale.h
+
+# We need the following in order to create <locale.h> when the system
+# doesn't have one that provides all definitions.
+locale.h: locale.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_LOCALE_H''@|$(NEXT_LOCALE_H)|g' \
+ -e 's/@''GNULIB_LOCALECONV''@/$(GL_GNULIB_LOCALECONV)/g' \
+ -e 's/@''GNULIB_SETLOCALE''@/$(GL_GNULIB_SETLOCALE)/g' \
+ -e 's/@''GNULIB_SETLOCALE_NULL''@/$(GL_GNULIB_SETLOCALE_NULL)/g' \
+ -e 's/@''GNULIB_DUPLOCALE''@/$(GL_GNULIB_DUPLOCALE)/g' \
+ -e 's/@''GNULIB_LOCALENAME''@/$(GL_GNULIB_LOCALENAME)/g' \
+ -e 's|@''HAVE_NEWLOCALE''@|$(HAVE_NEWLOCALE)|g' \
+ -e 's|@''HAVE_DUPLOCALE''@|$(HAVE_DUPLOCALE)|g' \
+ -e 's|@''HAVE_FREELOCALE''@|$(HAVE_FREELOCALE)|g' \
+ -e 's|@''HAVE_XLOCALE_H''@|$(HAVE_XLOCALE_H)|g' \
+ -e 's|@''REPLACE_LOCALECONV''@|$(REPLACE_LOCALECONV)|g' \
+ -e 's|@''REPLACE_SETLOCALE''@|$(REPLACE_SETLOCALE)|g' \
+ -e 's|@''REPLACE_NEWLOCALE''@|$(REPLACE_NEWLOCALE)|g' \
+ -e 's|@''REPLACE_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \
+ -e 's|@''REPLACE_FREELOCALE''@|$(REPLACE_FREELOCALE)|g' \
+ -e 's|@''REPLACE_STRUCT_LCONV''@|$(REPLACE_STRUCT_LCONV)|g' \
+ -e 's|@''LOCALENAME_ENHANCE_LOCALE_FUNCS''@|$(LOCALENAME_ENHANCE_LOCALE_FUNCS)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/locale.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += locale.h locale.h-t
+
+EXTRA_DIST += locale.in.h
+
+## end gnulib module locale
+
+## begin gnulib module localeconv
+
+if GL_COND_OBJ_LOCALECONV
+libgnu_la_SOURCES += localeconv.c
+endif
+
+## end gnulib module localeconv
+
+## begin gnulib module lock
+
+libgnu_la_SOURCES += glthread/lock.h glthread/lock.c
+
+## end gnulib module lock
+
+## begin gnulib module lstat
+
+if GL_COND_OBJ_LSTAT
+libgnu_la_SOURCES += lstat.c
+endif
+
+## end gnulib module lstat
+
+## begin gnulib module malloc-gnu
+
+
+EXTRA_DIST += malloc.c
+
+EXTRA_libgnu_la_SOURCES += malloc.c
+
+## end gnulib module malloc-gnu
+
+## begin gnulib module malloc-posix
+
+
+EXTRA_DIST += malloc.c
+
+EXTRA_libgnu_la_SOURCES += malloc.c
+
+## end gnulib module malloc-posix
+
+## begin gnulib module malloca
+
+libgnu_la_SOURCES += malloca.c
+
+EXTRA_DIST += malloca.h
+
+## end gnulib module malloca
+
+## begin gnulib module map
+
+libgnu_la_SOURCES += gl_map.h gl_map.c
+
+## end gnulib module map
+
+## begin gnulib module mbrtowc
+
+if GL_COND_OBJ_MBRTOWC
+libgnu_la_SOURCES += mbrtowc.c
+endif
+
+EXTRA_DIST += lc-charset-dispatch.c lc-charset-dispatch.h mbrtowc-impl-utf8.h mbrtowc-impl.h mbtowc-lock.c mbtowc-lock.h windows-initguard.h
+
+EXTRA_libgnu_la_SOURCES += lc-charset-dispatch.c mbtowc-lock.c
+
+## end gnulib module mbrtowc
+
+## begin gnulib module mbsinit
+
+if GL_COND_OBJ_MBSINIT
+libgnu_la_SOURCES += mbsinit.c
+endif
+
+## end gnulib module mbsinit
+
+## begin gnulib module mbsrtowcs
+
+if GL_COND_OBJ_MBSRTOWCS
+libgnu_la_SOURCES += mbsrtowcs.c
+endif
+
+EXTRA_DIST += mbsrtowcs-impl.h mbsrtowcs-state.c
+
+EXTRA_libgnu_la_SOURCES += mbsrtowcs-state.c
+
+## end gnulib module mbsrtowcs
+
+## begin gnulib module mbtowc
+
+if GL_COND_OBJ_MBTOWC
+libgnu_la_SOURCES += mbtowc.c
+endif
+
+EXTRA_DIST += mbtowc-impl.h
+
+## end gnulib module mbtowc
+
+## begin gnulib module memchr
+
+if GL_COND_OBJ_MEMCHR
+libgnu_la_SOURCES += memchr.c
+endif
+
+EXTRA_DIST += memchr.valgrind
+
+## end gnulib module memchr
+
+## begin gnulib module memmem
+
+
+EXTRA_DIST += memmem.c
+
+EXTRA_libgnu_la_SOURCES += memmem.c
+
+## end gnulib module memmem
+
+## begin gnulib module memmem-simple
+
+
+EXTRA_DIST += memmem.c str-two-way.h
+
+EXTRA_libgnu_la_SOURCES += memmem.c
+
+## end gnulib module memmem-simple
+
+## begin gnulib module mempcpy
+
+if GL_COND_OBJ_MEMPCPY
+libgnu_la_SOURCES += mempcpy.c
+endif
+
+## end gnulib module mempcpy
+
+## begin gnulib module memrchr
+
+if GL_COND_OBJ_MEMRCHR
+libgnu_la_SOURCES += memrchr.c
+endif
+
+## end gnulib module memrchr
+
+## begin gnulib module minmax
+
+libgnu_la_SOURCES += minmax.h
+
+## end gnulib module minmax
+
+## begin gnulib module mkdir
+
+if GL_COND_OBJ_MKDIR
+libgnu_la_SOURCES += mkdir.c
+endif
+
+## end gnulib module mkdir
+
+## begin gnulib module mkdtemp
+
+if GL_COND_OBJ_MKDTEMP
+libgnu_la_SOURCES += mkdtemp.c
+endif
+
+## end gnulib module mkdtemp
+
+## begin gnulib module mkstemp
+
+if GL_COND_OBJ_MKSTEMP
+libgnu_la_SOURCES += mkstemp.c
+endif
+
+## end gnulib module mkstemp
+
+## begin gnulib module msvc-inval
+
+if GL_COND_OBJ_MSVC_INVAL
+libgnu_la_SOURCES += msvc-inval.c
+endif
+
+EXTRA_DIST += msvc-inval.h
+
+## end gnulib module msvc-inval
+
+## begin gnulib module msvc-nothrow
+
+if GL_COND_OBJ_MSVC_NOTHROW
+libgnu_la_SOURCES += msvc-nothrow.c
+endif
+
+EXTRA_DIST += msvc-nothrow.h
+
+## end gnulib module msvc-nothrow
+
+## begin gnulib module nanosleep
+
+if GL_COND_OBJ_NANOSLEEP
+libgnu_la_SOURCES += nanosleep.c
+endif
+
+## end gnulib module nanosleep
+
+## begin gnulib module nl_langinfo
+
+if GL_COND_OBJ_NL_LANGINFO
+libgnu_la_SOURCES += nl_langinfo.c
+endif
+if GL_COND_OBJ_NL_LANGINFO_LOCK
+libgnu_la_SOURCES += nl_langinfo-lock.c
+endif
+
+EXTRA_DIST += windows-initguard.h
+
+## end gnulib module nl_langinfo
+
+## begin gnulib module nonblocking
+
+libgnu_la_SOURCES += nonblocking.c
+
+EXTRA_DIST += nonblocking.h stdio-read.c stdio-write.c
+
+EXTRA_libgnu_la_SOURCES += stdio-read.c stdio-write.c
+
+## end gnulib module nonblocking
+
+## begin gnulib module open
+
+if GL_COND_OBJ_OPEN
+libgnu_la_SOURCES += open.c
+endif
+
+## end gnulib module open
+
+## begin gnulib module openat
+
+if GL_COND_OBJ_OPENAT
+libgnu_la_SOURCES += openat.c
+endif
+
+## end gnulib module openat
+
+## begin gnulib module openat-die
+
+libgnu_la_SOURCES += openat-die.c
+
+## end gnulib module openat-die
+
+## begin gnulib module openat-h
+
+
+EXTRA_DIST += openat.h
+
+## end gnulib module openat-h
+
+## begin gnulib module opendir
+
+if GL_COND_OBJ_OPENDIR
+libgnu_la_SOURCES += opendir.c
+endif
+
+EXTRA_DIST += dirent-private.h
+
+## end gnulib module opendir
+
+## begin gnulib module pathmax
+
+
+EXTRA_DIST += pathmax.h
+
+## end gnulib module pathmax
+
+## begin gnulib module pipe-posix
+
+if GL_COND_OBJ_PIPE
+libgnu_la_SOURCES += pipe.c
+endif
+
+## end gnulib module pipe-posix
+
+## begin gnulib module progname
+
+libgnu_la_SOURCES += progname.h progname.c
+
+## end gnulib module progname
+
+## begin gnulib module pselect
+
+if GL_COND_OBJ_PSELECT
+libgnu_la_SOURCES += pselect.c
+endif
+
+## end gnulib module pselect
+
+## begin gnulib module pthread_sigmask
+
+if GL_COND_OBJ_PTHREAD_SIGMASK
+libgnu_la_SOURCES += pthread_sigmask.c
+endif
+
+## end gnulib module pthread_sigmask
+
+## begin gnulib module raise
+
+if GL_COND_OBJ_RAISE
+libgnu_la_SOURCES += raise.c
+endif
+
+## end gnulib module raise
+
+## begin gnulib module rawmemchr
+
+if GL_COND_OBJ_RAWMEMCHR
+libgnu_la_SOURCES += rawmemchr.c
+endif
+
+EXTRA_DIST += rawmemchr.valgrind
+
+## end gnulib module rawmemchr
+
+## begin gnulib module rbtree-list
+
+libgnu_la_SOURCES += gl_rbtree_list.h gl_rbtree_list.c gl_anyrbtree_list1.h gl_anyrbtree_list2.h gl_anytree_list1.h gl_anytree_list2.h
+
+## end gnulib module rbtree-list
+
+## begin gnulib module readdir
+
+if GL_COND_OBJ_READDIR
+libgnu_la_SOURCES += readdir.c
+endif
+
+EXTRA_DIST += dirent-private.h
+
+## end gnulib module readdir
+
+## begin gnulib module readlink
+
+if GL_COND_OBJ_READLINK
+libgnu_la_SOURCES += readlink.c
+endif
+
+## end gnulib module readlink
+
+## begin gnulib module readlinkat
+
+if GL_COND_OBJ_READLINKAT
+libgnu_la_SOURCES += readlinkat.c
+endif
+
+EXTRA_DIST += at-func.c
+
+EXTRA_libgnu_la_SOURCES += at-func.c
+
+## end gnulib module readlinkat
+
+## begin gnulib module realloc-gnu
+
+
+EXTRA_DIST += realloc.c
+
+EXTRA_libgnu_la_SOURCES += realloc.c
+
+## end gnulib module realloc-gnu
+
+## begin gnulib module realloc-posix
+
+
+EXTRA_DIST += realloc.c
+
+EXTRA_libgnu_la_SOURCES += realloc.c
+
+## end gnulib module realloc-posix
+
+## begin gnulib module reallocarray
+
+if GL_COND_OBJ_REALLOCARRAY
+libgnu_la_SOURCES += reallocarray.c
+endif
+
+## end gnulib module reallocarray
+
+## begin gnulib module regex
+
+if GL_COND_OBJ_REGEX
+libgnu_la_SOURCES += regex.c
+endif
+
+EXTRA_DIST += regcomp.c regex.h regex_internal.c regex_internal.h regexec.c
+
+EXTRA_libgnu_la_SOURCES += regcomp.c regex_internal.c regexec.c
+
+## end gnulib module regex
+
+## begin gnulib module rename
+
+if GL_COND_OBJ_RENAME
+libgnu_la_SOURCES += rename.c
+endif
+
+## end gnulib module rename
+
+## begin gnulib module renameat
+
+if GL_COND_OBJ_RENAMEAT
+libgnu_la_SOURCES += renameat.c
+endif
+
+EXTRA_DIST += at-func2.c
+
+EXTRA_libgnu_la_SOURCES += at-func2.c
+
+## end gnulib module renameat
+
+## begin gnulib module renameatu
+
+libgnu_la_SOURCES += renameatu.c
+
+EXTRA_DIST += at-func2.c renameatu.h
+
+EXTRA_libgnu_la_SOURCES += at-func2.c
+
+## end gnulib module renameatu
+
+## begin gnulib module rewinddir
+
+if GL_COND_OBJ_REWINDDIR
+libgnu_la_SOURCES += rewinddir.c
+endif
+
+EXTRA_DIST += dirent-private.h
+
+## end gnulib module rewinddir
+
+## begin gnulib module rmdir
+
+if GL_COND_OBJ_RMDIR
+libgnu_la_SOURCES += rmdir.c
+endif
+
+## end gnulib module rmdir
+
+## begin gnulib module same-inode
+
+
+EXTRA_DIST += same-inode.h
+
+## end gnulib module same-inode
+
+## begin gnulib module save-cwd
+
+libgnu_la_SOURCES += save-cwd.c
+
+EXTRA_DIST += save-cwd.h
+
+## end gnulib module save-cwd
+
+## begin gnulib module scratch_buffer
+
+BUILT_SOURCES += malloc/scratch_buffer.gl.h
+
+malloc/scratch_buffer.gl.h: malloc/scratch_buffer.h
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/malloc'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|__always_inline|inline _GL_ATTRIBUTE_ALWAYS_INLINE|g' \
+ -e 's|__glibc_likely|_GL_LIKELY|g' \
+ -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \
+ -e '/libc_hidden_proto/d' \
+ $(srcdir)/malloc/scratch_buffer.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += malloc/scratch_buffer.gl.h malloc/scratch_buffer.gl.h-t
+
+libgnu_la_SOURCES += malloc/scratch_buffer_dupfree.c malloc/scratch_buffer_grow.c malloc/scratch_buffer_grow_preserve.c malloc/scratch_buffer_set_array_size.c
+
+EXTRA_DIST += malloc/scratch_buffer.h scratch_buffer.h
+
+## end gnulib module scratch_buffer
+
+## begin gnulib module select
+
+if GL_COND_OBJ_SELECT
+libgnu_la_SOURCES += select.c
+endif
+
+## end gnulib module select
+
+## begin gnulib module set
+
+libgnu_la_SOURCES += gl_set.h gl_set.c
+
+## end gnulib module set
+
+## begin gnulib module setenv
+
+if GL_COND_OBJ_SETENV
+libgnu_la_SOURCES += setenv.c
+endif
+
+## end gnulib module setenv
+
+## begin gnulib module setlocale-null
+
+libgnu_la_SOURCES += setlocale_null.c
+if GL_COND_OBJ_SETLOCALE_LOCK
+libgnu_la_SOURCES += setlocale-lock.c
+endif
+
+EXTRA_DIST += setlocale_null.h windows-initguard.h
+
+## end gnulib module setlocale-null
+
+## begin gnulib module sigaction
+
+if GL_COND_OBJ_SIGACTION
+libgnu_la_SOURCES += sigaction.c
+endif
+libgnu_la_SOURCES += sig-handler.c
+
+EXTRA_DIST += sig-handler.h
+
+## end gnulib module sigaction
+
+## begin gnulib module signal-h
+
+BUILT_SOURCES += signal.h
+
+# We need the following in order to create <signal.h> when the system
+# doesn't have a complete one.
+signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \
+ -e 's/@''GNULIB_PTHREAD_SIGMASK''@/$(GL_GNULIB_PTHREAD_SIGMASK)/g' \
+ -e 's/@''GNULIB_RAISE''@/$(GL_GNULIB_RAISE)/g' \
+ -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GL_GNULIB_SIGNAL_H_SIGPIPE)/g' \
+ -e 's/@''GNULIB_SIGPROCMASK''@/$(GL_GNULIB_SIGPROCMASK)/g' \
+ -e 's/@''GNULIB_SIGACTION''@/$(GL_GNULIB_SIGACTION)/g' \
+ -e 's|@''HAVE_POSIX_SIGNALBLOCKING''@|$(HAVE_POSIX_SIGNALBLOCKING)|g' \
+ -e 's|@''HAVE_PTHREAD_SIGMASK''@|$(HAVE_PTHREAD_SIGMASK)|g' \
+ -e 's|@''HAVE_RAISE''@|$(HAVE_RAISE)|g' \
+ -e 's|@''HAVE_SIGSET_T''@|$(HAVE_SIGSET_T)|g' \
+ -e 's|@''HAVE_SIGINFO_T''@|$(HAVE_SIGINFO_T)|g' \
+ -e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \
+ -e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \
+ -e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \
+ -e 's|@''HAVE_SIGHANDLER_T''@|$(HAVE_SIGHANDLER_T)|g' \
+ -e 's|@''REPLACE_PTHREAD_SIGMASK''@|$(REPLACE_PTHREAD_SIGMASK)|g' \
+ -e 's|@''REPLACE_RAISE''@|$(REPLACE_RAISE)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/signal.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += signal.h signal.h-t
+
+EXTRA_DIST += signal.in.h
+
+## end gnulib module signal-h
+
+## begin gnulib module sigpipe
+
+
+EXTRA_DIST += stdio-write.c
+
+EXTRA_libgnu_la_SOURCES += stdio-write.c
+
+## end gnulib module sigpipe
+
+## begin gnulib module sigprocmask
+
+if GL_COND_OBJ_SIGPROCMASK
+libgnu_la_SOURCES += sigprocmask.c
+endif
+
+## end gnulib module sigprocmask
+
+## begin gnulib module size_max
+
+libgnu_la_SOURCES += size_max.h
+
+## end gnulib module size_max
+
+## begin gnulib module sleep
+
+if GL_COND_OBJ_SLEEP
+libgnu_la_SOURCES += sleep.c
+endif
+
+## end gnulib module sleep
+
+## begin gnulib module snippet/_Noreturn
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+
+_NORETURN_H=$(srcdir)/_Noreturn.h
+
+EXTRA_DIST += _Noreturn.h
+
+## end gnulib module snippet/_Noreturn
+
+## begin gnulib module snippet/arg-nonnull
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+
+ARG_NONNULL_H=$(srcdir)/arg-nonnull.h
+
+EXTRA_DIST += arg-nonnull.h
+
+## end gnulib module snippet/arg-nonnull
+
+## begin gnulib module snippet/c++defs
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+
+CXXDEFS_H=$(srcdir)/c++defs.h
+
+EXTRA_DIST += c++defs.h
+
+## end gnulib module snippet/c++defs
+
+## begin gnulib module snippet/warn-on-use
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+
+WARN_ON_USE_H=$(srcdir)/warn-on-use.h
+
+EXTRA_DIST += warn-on-use.h
+
+## end gnulib module snippet/warn-on-use
+
+## begin gnulib module sockets
+
+libgnu_la_SOURCES += sockets.h sockets.c
+
+EXTRA_DIST += w32sock.h
+
+## end gnulib module sockets
+
+## begin gnulib module stat
+
+if GL_COND_OBJ_STAT
+libgnu_la_SOURCES += stat.c
+endif
+
+EXTRA_DIST += stat-w32.c stat-w32.h
+
+EXTRA_libgnu_la_SOURCES += stat-w32.c
+
+## end gnulib module stat
+
+## begin gnulib module stat-time
+
+libgnu_la_SOURCES += stat-time.c
+
+EXTRA_DIST += stat-time.h
+
+## end gnulib module stat-time
+
+## begin gnulib module stdalign
+
+BUILT_SOURCES += $(STDALIGN_H)
+
+# We need the following in order to create <stdalign.h> when the system
+# doesn't have one that works.
+if GL_GENERATE_STDALIGN_H
+stdalign.h: stdalign.in.h $(top_builddir)/config.status
+ $(gl_V_at)$(SED_HEADER_TO_AT_t) $(srcdir)/stdalign.in.h
+ $(AM_V_at)mv $@-t $@
+else
+stdalign.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += stdalign.h stdalign.h-t
+
+EXTRA_DIST += stdalign.in.h
+
+## end gnulib module stdalign
+
+## begin gnulib module stdarg
+
+BUILT_SOURCES += $(STDARG_H)
+
+# We need the following in order to create <stdarg.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_STDARG_H
+stdarg.h: stdarg.in.h $(top_builddir)/config.status
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDARG_H''@|$(NEXT_STDARG_H)|g' \
+ $(srcdir)/stdarg.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+stdarg.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += stdarg.h stdarg.h-t
+
+EXTRA_DIST += stdarg.in.h
+
+## end gnulib module stdarg
+
+## begin gnulib module stdbool
+
+BUILT_SOURCES += $(STDBOOL_H)
+
+# We need the following in order to create <stdbool.h> when the system
+# doesn't have one that works.
+if GL_GENERATE_STDBOOL_H
+stdbool.h: stdbool.in.h $(top_builddir)/config.status
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' \
+ $(srcdir)/stdbool.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+stdbool.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += stdbool.h stdbool.h-t
+
+EXTRA_DIST += stdbool.in.h
+
+## end gnulib module stdbool
+
+## begin gnulib module stddef
+
+BUILT_SOURCES += $(STDDEF_H)
+
+# We need the following in order to create <stddef.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_STDDEF_H
+stddef.h: stddef.in.h $(top_builddir)/config.status
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
+ -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \
+ -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
+ -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
+ $(srcdir)/stddef.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+stddef.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += stddef.h stddef.h-t
+
+EXTRA_DIST += stddef.in.h
+
+## end gnulib module stddef
+
+## begin gnulib module stdint
+
+BUILT_SOURCES += $(STDINT_H)
+
+# We need the following in order to create <stdint.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_STDINT_H
+stdint.h: stdint.in.h $(top_builddir)/config.status
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
+ -e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \
+ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
+ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
+ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
+ -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
+ -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
+ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
+ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
+ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
+ -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
+ -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
+ -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
+ -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
+ -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
+ -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
+ -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
+ -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
+ -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
+ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
+ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
+ -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \
+ $(srcdir)/stdint.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+stdint.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += stdint.h stdint.h-t
+
+EXTRA_DIST += stdint.in.h
+
+## end gnulib module stdint
+
+## begin gnulib module stdio
+
+BUILT_SOURCES += stdio.h
+
+# We need the following in order to create <stdio.h> when the system
+# doesn't have one that works with the given compiler.
+stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
+ -e 's/@''GNULIB_DPRINTF''@/$(GL_GNULIB_DPRINTF)/g' \
+ -e 's/@''GNULIB_FCLOSE''@/$(GL_GNULIB_FCLOSE)/g' \
+ -e 's/@''GNULIB_FDOPEN''@/$(GL_GNULIB_FDOPEN)/g' \
+ -e 's/@''GNULIB_FFLUSH''@/$(GL_GNULIB_FFLUSH)/g' \
+ -e 's/@''GNULIB_FGETC''@/$(GL_GNULIB_FGETC)/g' \
+ -e 's/@''GNULIB_FGETS''@/$(GL_GNULIB_FGETS)/g' \
+ -e 's/@''GNULIB_FOPEN''@/$(GL_GNULIB_FOPEN)/g' \
+ -e 's/@''GNULIB_FOPEN_GNU''@/$(GL_GNULIB_FOPEN_GNU)/g' \
+ -e 's/@''GNULIB_FPRINTF''@/$(GL_GNULIB_FPRINTF)/g' \
+ -e 's/@''GNULIB_FPRINTF_POSIX''@/$(GL_GNULIB_FPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_FPURGE''@/$(GL_GNULIB_FPURGE)/g' \
+ -e 's/@''GNULIB_FPUTC''@/$(GL_GNULIB_FPUTC)/g' \
+ -e 's/@''GNULIB_FPUTS''@/$(GL_GNULIB_FPUTS)/g' \
+ -e 's/@''GNULIB_FREAD''@/$(GL_GNULIB_FREAD)/g' \
+ -e 's/@''GNULIB_FREOPEN''@/$(GL_GNULIB_FREOPEN)/g' \
+ -e 's/@''GNULIB_FSCANF''@/$(GL_GNULIB_FSCANF)/g' \
+ -e 's/@''GNULIB_FSEEK''@/$(GL_GNULIB_FSEEK)/g' \
+ -e 's/@''GNULIB_FSEEKO''@/$(GL_GNULIB_FSEEKO)/g' \
+ -e 's/@''GNULIB_FTELL''@/$(GL_GNULIB_FTELL)/g' \
+ -e 's/@''GNULIB_FTELLO''@/$(GL_GNULIB_FTELLO)/g' \
+ -e 's/@''GNULIB_FWRITE''@/$(GL_GNULIB_FWRITE)/g' \
+ -e 's/@''GNULIB_GETC''@/$(GL_GNULIB_GETC)/g' \
+ -e 's/@''GNULIB_GETCHAR''@/$(GL_GNULIB_GETCHAR)/g' \
+ -e 's/@''GNULIB_GETDELIM''@/$(GL_GNULIB_GETDELIM)/g' \
+ -e 's/@''GNULIB_GETLINE''@/$(GL_GNULIB_GETLINE)/g' \
+ -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GL_GNULIB_OBSTACK_PRINTF)/g' \
+ -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GL_GNULIB_OBSTACK_PRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_PCLOSE''@/$(GL_GNULIB_PCLOSE)/g' \
+ -e 's/@''GNULIB_PERROR''@/$(GL_GNULIB_PERROR)/g' \
+ -e 's/@''GNULIB_POPEN''@/$(GL_GNULIB_POPEN)/g' \
+ -e 's/@''GNULIB_PRINTF''@/$(GL_GNULIB_PRINTF)/g' \
+ -e 's/@''GNULIB_PRINTF_POSIX''@/$(GL_GNULIB_PRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_PUTC''@/$(GL_GNULIB_PUTC)/g' \
+ -e 's/@''GNULIB_PUTCHAR''@/$(GL_GNULIB_PUTCHAR)/g' \
+ -e 's/@''GNULIB_PUTS''@/$(GL_GNULIB_PUTS)/g' \
+ -e 's/@''GNULIB_REMOVE''@/$(GL_GNULIB_REMOVE)/g' \
+ -e 's/@''GNULIB_RENAME''@/$(GL_GNULIB_RENAME)/g' \
+ -e 's/@''GNULIB_RENAMEAT''@/$(GL_GNULIB_RENAMEAT)/g' \
+ -e 's/@''GNULIB_SCANF''@/$(GL_GNULIB_SCANF)/g' \
+ -e 's/@''GNULIB_SNPRINTF''@/$(GL_GNULIB_SNPRINTF)/g' \
+ -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GL_GNULIB_SPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GL_GNULIB_STDIO_H_NONBLOCKING)/g' \
+ -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GL_GNULIB_STDIO_H_SIGPIPE)/g' \
+ -e 's/@''GNULIB_TMPFILE''@/$(GL_GNULIB_TMPFILE)/g' \
+ -e 's/@''GNULIB_VASPRINTF''@/$(GL_GNULIB_VASPRINTF)/g' \
+ -e 's/@''GNULIB_VDPRINTF''@/$(GL_GNULIB_VDPRINTF)/g' \
+ -e 's/@''GNULIB_VFPRINTF''@/$(GL_GNULIB_VFPRINTF)/g' \
+ -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GL_GNULIB_VFPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_VFSCANF''@/$(GL_GNULIB_VFSCANF)/g' \
+ -e 's/@''GNULIB_VSCANF''@/$(GL_GNULIB_VSCANF)/g' \
+ -e 's/@''GNULIB_VPRINTF''@/$(GL_GNULIB_VPRINTF)/g' \
+ -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GL_GNULIB_VPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_VSNPRINTF''@/$(GL_GNULIB_VSNPRINTF)/g' \
+ -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GL_GNULIB_VSPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_MDA_FCLOSEALL''@/$(GL_GNULIB_MDA_FCLOSEALL)/g' \
+ -e 's/@''GNULIB_MDA_FDOPEN''@/$(GL_GNULIB_MDA_FDOPEN)/g' \
+ -e 's/@''GNULIB_MDA_FILENO''@/$(GL_GNULIB_MDA_FILENO)/g' \
+ -e 's/@''GNULIB_MDA_GETW''@/$(GL_GNULIB_MDA_GETW)/g' \
+ -e 's/@''GNULIB_MDA_PUTW''@/$(GL_GNULIB_MDA_PUTW)/g' \
+ -e 's/@''GNULIB_MDA_TEMPNAM''@/$(GL_GNULIB_MDA_TEMPNAM)/g' \
+ < $(srcdir)/stdio.in.h | \
+ sed -e 's|@''HAVE_DECL_FCLOSEALL''@|$(HAVE_DECL_FCLOSEALL)|g' \
+ -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
+ -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
+ -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
+ -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
+ -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
+ -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
+ -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
+ -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
+ -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
+ -e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \
+ -e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \
+ -e 's|@''HAVE_PCLOSE''@|$(HAVE_PCLOSE)|g' \
+ -e 's|@''HAVE_POPEN''@|$(HAVE_POPEN)|g' \
+ -e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \
+ -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
+ -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
+ -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
+ -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
+ -e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \
+ -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
+ -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
+ -e 's|@''REPLACE_FOPEN_FOR_FOPEN_GNU''@|$(REPLACE_FOPEN_FOR_FOPEN_GNU)|g' \
+ -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
+ -e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \
+ -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \
+ -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
+ -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
+ -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
+ -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
+ -e 's|@''REPLACE_GETDELIM''@|$(REPLACE_GETDELIM)|g' \
+ -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
+ -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
+ -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
+ -e 's|@''REPLACE_POPEN''@|$(REPLACE_POPEN)|g' \
+ -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
+ -e 's|@''REPLACE_REMOVE''@|$(REPLACE_REMOVE)|g' \
+ -e 's|@''REPLACE_RENAME''@|$(REPLACE_RENAME)|g' \
+ -e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \
+ -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
+ -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
+ -e 's|@''REPLACE_STDIO_READ_FUNCS''@|$(REPLACE_STDIO_READ_FUNCS)|g' \
+ -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
+ -e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \
+ -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
+ -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
+ -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
+ -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
+ -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
+ -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
+ -e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += stdio.h stdio.h-t
+
+if GL_COND_OBJ_STDIO_READ
+libgnu_la_SOURCES += stdio-read.c
+endif
+if GL_COND_OBJ_STDIO_WRITE
+libgnu_la_SOURCES += stdio-write.c
+endif
+
+EXTRA_DIST += stdio.in.h
+
+## end gnulib module stdio
+
+## begin gnulib module stdlib
+
+BUILT_SOURCES += stdlib.h
+
+# We need the following in order to create <stdlib.h> when the system
+# doesn't have one that works with the given compiler.
+stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
+ $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
+ -e 's/@''GNULIB__EXIT''@/$(GL_GNULIB__EXIT)/g' \
+ -e 's/@''GNULIB_ALIGNED_ALLOC''@/$(GL_GNULIB_ALIGNED_ALLOC)/g' \
+ -e 's/@''GNULIB_ATOLL''@/$(GL_GNULIB_ATOLL)/g' \
+ -e 's/@''GNULIB_CALLOC_GNU''@/$(GL_GNULIB_CALLOC_GNU)/g' \
+ -e 's/@''GNULIB_CALLOC_POSIX''@/$(GL_GNULIB_CALLOC_POSIX)/g' \
+ -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GL_GNULIB_CANONICALIZE_FILE_NAME)/g' \
+ -e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \
+ -e 's/@''GNULIB_GETLOADAVG''@/$(GL_GNULIB_GETLOADAVG)/g' \
+ -e 's/@''GNULIB_GETSUBOPT''@/$(GL_GNULIB_GETSUBOPT)/g' \
+ -e 's/@''GNULIB_GRANTPT''@/$(GL_GNULIB_GRANTPT)/g' \
+ -e 's/@''GNULIB_MALLOC_GNU''@/$(GL_GNULIB_MALLOC_GNU)/g' \
+ -e 's/@''GNULIB_MALLOC_POSIX''@/$(GL_GNULIB_MALLOC_POSIX)/g' \
+ -e 's/@''GNULIB_MBTOWC''@/$(GL_GNULIB_MBTOWC)/g' \
+ -e 's/@''GNULIB_MKDTEMP''@/$(GL_GNULIB_MKDTEMP)/g' \
+ -e 's/@''GNULIB_MKOSTEMP''@/$(GL_GNULIB_MKOSTEMP)/g' \
+ -e 's/@''GNULIB_MKOSTEMPS''@/$(GL_GNULIB_MKOSTEMPS)/g' \
+ -e 's/@''GNULIB_MKSTEMP''@/$(GL_GNULIB_MKSTEMP)/g' \
+ -e 's/@''GNULIB_MKSTEMPS''@/$(GL_GNULIB_MKSTEMPS)/g' \
+ -e 's/@''GNULIB_POSIX_MEMALIGN''@/$(GL_GNULIB_POSIX_MEMALIGN)/g' \
+ -e 's/@''GNULIB_POSIX_OPENPT''@/$(GL_GNULIB_POSIX_OPENPT)/g' \
+ -e 's/@''GNULIB_PTSNAME''@/$(GL_GNULIB_PTSNAME)/g' \
+ -e 's/@''GNULIB_PTSNAME_R''@/$(GL_GNULIB_PTSNAME_R)/g' \
+ -e 's/@''GNULIB_PUTENV''@/$(GL_GNULIB_PUTENV)/g' \
+ -e 's/@''GNULIB_QSORT_R''@/$(GL_GNULIB_QSORT_R)/g' \
+ -e 's/@''GNULIB_RANDOM''@/$(GL_GNULIB_RANDOM)/g' \
+ -e 's/@''GNULIB_RANDOM_R''@/$(GL_GNULIB_RANDOM_R)/g' \
+ -e 's/@''GNULIB_REALLOC_GNU''@/$(GL_GNULIB_REALLOC_GNU)/g' \
+ -e 's/@''GNULIB_REALLOC_POSIX''@/$(GL_GNULIB_REALLOC_POSIX)/g' \
+ -e 's/@''GNULIB_REALLOCARRAY''@/$(GL_GNULIB_REALLOCARRAY)/g' \
+ -e 's/@''GNULIB_REALPATH''@/$(GL_GNULIB_REALPATH)/g' \
+ -e 's/@''GNULIB_RPMATCH''@/$(GL_GNULIB_RPMATCH)/g' \
+ -e 's/@''GNULIB_SECURE_GETENV''@/$(GL_GNULIB_SECURE_GETENV)/g' \
+ -e 's/@''GNULIB_SETENV''@/$(GL_GNULIB_SETENV)/g' \
+ -e 's/@''GNULIB_STRTOD''@/$(GL_GNULIB_STRTOD)/g' \
+ -e 's/@''GNULIB_STRTOL''@/$(GL_GNULIB_STRTOL)/g' \
+ -e 's/@''GNULIB_STRTOLD''@/$(GL_GNULIB_STRTOLD)/g' \
+ -e 's/@''GNULIB_STRTOLL''@/$(GL_GNULIB_STRTOLL)/g' \
+ -e 's/@''GNULIB_STRTOUL''@/$(GL_GNULIB_STRTOUL)/g' \
+ -e 's/@''GNULIB_STRTOULL''@/$(GL_GNULIB_STRTOULL)/g' \
+ -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GL_GNULIB_SYSTEM_POSIX)/g' \
+ -e 's/@''GNULIB_UNLOCKPT''@/$(GL_GNULIB_UNLOCKPT)/g' \
+ -e 's/@''GNULIB_UNSETENV''@/$(GL_GNULIB_UNSETENV)/g' \
+ -e 's/@''GNULIB_WCTOMB''@/$(GL_GNULIB_WCTOMB)/g' \
+ -e 's/@''GNULIB_MDA_ECVT''@/$(GL_GNULIB_MDA_ECVT)/g' \
+ -e 's/@''GNULIB_MDA_FCVT''@/$(GL_GNULIB_MDA_FCVT)/g' \
+ -e 's/@''GNULIB_MDA_GCVT''@/$(GL_GNULIB_MDA_GCVT)/g' \
+ -e 's/@''GNULIB_MDA_MKTEMP''@/$(GL_GNULIB_MDA_MKTEMP)/g' \
+ -e 's/@''GNULIB_MDA_PUTENV''@/$(GL_GNULIB_MDA_PUTENV)/g' \
+ < $(srcdir)/stdlib.in.h | \
+ sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
+ -e 's|@''HAVE_ALIGNED_ALLOC''@|$(HAVE_ALIGNED_ALLOC)|g' \
+ -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
+ -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
+ -e 's|@''HAVE_DECL_ECVT''@|$(HAVE_DECL_ECVT)|g' \
+ -e 's|@''HAVE_DECL_FCVT''@|$(HAVE_DECL_FCVT)|g' \
+ -e 's|@''HAVE_DECL_GCVT''@|$(HAVE_DECL_GCVT)|g' \
+ -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
+ -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
+ -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \
+ -e 's|@''HAVE_INITSTATE''@|$(HAVE_INITSTATE)|g' \
+ -e 's|@''HAVE_DECL_INITSTATE''@|$(HAVE_DECL_INITSTATE)|g' \
+ -e 's|@''HAVE_MBTOWC''@|$(HAVE_MBTOWC)|g' \
+ -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
+ -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \
+ -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \
+ -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \
+ -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \
+ -e 's|@''HAVE_POSIX_MEMALIGN''@|$(HAVE_POSIX_MEMALIGN)|g' \
+ -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \
+ -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
+ -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \
+ -e 's|@''HAVE_QSORT_R''@|$(HAVE_QSORT_R)|g' \
+ -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \
+ -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
+ -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
+ -e 's|@''HAVE_REALLOCARRAY''@|$(HAVE_REALLOCARRAY)|g' \
+ -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
+ -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
+ -e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \
+ -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \
+ -e 's|@''HAVE_SETSTATE''@|$(HAVE_SETSTATE)|g' \
+ -e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \
+ -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
+ -e 's|@''HAVE_STRTOL''@|$(HAVE_STRTOL)|g' \
+ -e 's|@''HAVE_STRTOLD''@|$(HAVE_STRTOLD)|g' \
+ -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
+ -e 's|@''HAVE_STRTOUL''@|$(HAVE_STRTOUL)|g' \
+ -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \
+ -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \
+ -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
+ -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \
+ -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \
+ -e 's|@''REPLACE_ALIGNED_ALLOC''@|$(REPLACE_ALIGNED_ALLOC)|g' \
+ -e 's|@''REPLACE_CALLOC_FOR_CALLOC_GNU''@|$(REPLACE_CALLOC_FOR_CALLOC_GNU)|g' \
+ -e 's|@''REPLACE_CALLOC_FOR_CALLOC_POSIX''@|$(REPLACE_CALLOC_FOR_CALLOC_POSIX)|g' \
+ -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
+ -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
+ -e 's|@''REPLACE_INITSTATE''@|$(REPLACE_INITSTATE)|g' \
+ -e 's|@''REPLACE_MALLOC_FOR_MALLOC_GNU''@|$(REPLACE_MALLOC_FOR_MALLOC_GNU)|g' \
+ -e 's|@''REPLACE_MALLOC_FOR_MALLOC_POSIX''@|$(REPLACE_MALLOC_FOR_MALLOC_POSIX)|g' \
+ -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
+ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
+ -e 's|@''REPLACE_POSIX_MEMALIGN''@|$(REPLACE_POSIX_MEMALIGN)|g' \
+ -e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \
+ -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
+ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
+ -e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \
+ -e 's|@''REPLACE_RANDOM''@|$(REPLACE_RANDOM)|g' \
+ -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
+ -e 's|@''REPLACE_REALLOC_FOR_REALLOC_GNU''@|$(REPLACE_REALLOC_FOR_REALLOC_GNU)|g' \
+ -e 's|@''REPLACE_REALLOC_FOR_REALLOC_POSIX''@|$(REPLACE_REALLOC_FOR_REALLOC_POSIX)|g' \
+ -e 's|@''REPLACE_REALLOCARRAY''@|$(REPLACE_REALLOCARRAY)|g' \
+ -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
+ -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
+ -e 's|@''REPLACE_SETSTATE''@|$(REPLACE_SETSTATE)|g' \
+ -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
+ -e 's|@''REPLACE_STRTOL''@|$(REPLACE_STRTOL)|g' \
+ -e 's|@''REPLACE_STRTOLD''@|$(REPLACE_STRTOLD)|g' \
+ -e 's|@''REPLACE_STRTOLL''@|$(REPLACE_STRTOLL)|g' \
+ -e 's|@''REPLACE_STRTOUL''@|$(REPLACE_STRTOUL)|g' \
+ -e 's|@''REPLACE_STRTOULL''@|$(REPLACE_STRTOULL)|g' \
+ -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
+ -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _Noreturn/r $(_NORETURN_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += stdlib.h stdlib.h-t
+
+EXTRA_DIST += stdlib.in.h
+
+## end gnulib module stdlib
+
+## begin gnulib module stdopen
+
+libgnu_la_SOURCES += stdopen.c
+
+EXTRA_DIST += stdopen.h
+
+## end gnulib module stdopen
+
+## begin gnulib module stpcpy
+
+if GL_COND_OBJ_STPCPY
+libgnu_la_SOURCES += stpcpy.c
+endif
+
+## end gnulib module stpcpy
+
+## begin gnulib module strcase
+
+if GL_COND_OBJ_STRCASECMP
+libgnu_la_SOURCES += strcasecmp.c
+endif
+if GL_COND_OBJ_STRNCASECMP
+libgnu_la_SOURCES += strncasecmp.c
+endif
+
+## end gnulib module strcase
+
+## begin gnulib module strcasestr
+
+
+EXTRA_DIST += strcasestr.c
+
+EXTRA_libgnu_la_SOURCES += strcasestr.c
+
+## end gnulib module strcasestr
+
+## begin gnulib module strcasestr-simple
+
+
+EXTRA_DIST += str-two-way.h strcasestr.c
+
+EXTRA_libgnu_la_SOURCES += strcasestr.c
+
+## end gnulib module strcasestr-simple
+
+## begin gnulib module strchrnul
+
+if GL_COND_OBJ_STRCHRNUL
+libgnu_la_SOURCES += strchrnul.c
+endif
+
+EXTRA_DIST += strchrnul.valgrind
+
+## end gnulib module strchrnul
+
+## begin gnulib module strdup-posix
+
+if GL_COND_OBJ_STRDUP
+libgnu_la_SOURCES += strdup.c
+endif
+
+## end gnulib module strdup-posix
+
+## begin gnulib module streq
+
+
+EXTRA_DIST += streq.h
+
+## end gnulib module streq
+
+## begin gnulib module strerror
+
+if GL_COND_OBJ_STRERROR
+libgnu_la_SOURCES += strerror.c
+endif
+
+## end gnulib module strerror
+
+## begin gnulib module strerror-override
+
+if GL_COND_OBJ_STRERROR_OVERRIDE
+libgnu_la_SOURCES += strerror-override.c
+endif
+
+EXTRA_DIST += strerror-override.h
+
+## end gnulib module strerror-override
+
+## begin gnulib module string
+
+BUILT_SOURCES += string.h
+
+# We need the following in order to create <string.h> when the system
+# doesn't have one that works with the given compiler.
+string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
+ -e 's/@''GNULIB_EXPLICIT_BZERO''@/$(GL_GNULIB_EXPLICIT_BZERO)/g' \
+ -e 's/@''GNULIB_FFSL''@/$(GL_GNULIB_FFSL)/g' \
+ -e 's/@''GNULIB_FFSLL''@/$(GL_GNULIB_FFSLL)/g' \
+ -e 's/@''GNULIB_MBSLEN''@/$(GL_GNULIB_MBSLEN)/g' \
+ -e 's/@''GNULIB_MBSNLEN''@/$(GL_GNULIB_MBSNLEN)/g' \
+ -e 's/@''GNULIB_MBSCHR''@/$(GL_GNULIB_MBSCHR)/g' \
+ -e 's/@''GNULIB_MBSRCHR''@/$(GL_GNULIB_MBSRCHR)/g' \
+ -e 's/@''GNULIB_MBSSTR''@/$(GL_GNULIB_MBSSTR)/g' \
+ -e 's/@''GNULIB_MBSCASECMP''@/$(GL_GNULIB_MBSCASECMP)/g' \
+ -e 's/@''GNULIB_MBSNCASECMP''@/$(GL_GNULIB_MBSNCASECMP)/g' \
+ -e 's/@''GNULIB_MBSPCASECMP''@/$(GL_GNULIB_MBSPCASECMP)/g' \
+ -e 's/@''GNULIB_MBSCASESTR''@/$(GL_GNULIB_MBSCASESTR)/g' \
+ -e 's/@''GNULIB_MBSCSPN''@/$(GL_GNULIB_MBSCSPN)/g' \
+ -e 's/@''GNULIB_MBSPBRK''@/$(GL_GNULIB_MBSPBRK)/g' \
+ -e 's/@''GNULIB_MBSSPN''@/$(GL_GNULIB_MBSSPN)/g' \
+ -e 's/@''GNULIB_MBSSEP''@/$(GL_GNULIB_MBSSEP)/g' \
+ -e 's/@''GNULIB_MBSTOK_R''@/$(GL_GNULIB_MBSTOK_R)/g' \
+ -e 's/@''GNULIB_MEMCHR''@/$(GL_GNULIB_MEMCHR)/g' \
+ -e 's/@''GNULIB_MEMMEM''@/$(GL_GNULIB_MEMMEM)/g' \
+ -e 's/@''GNULIB_MEMPCPY''@/$(GL_GNULIB_MEMPCPY)/g' \
+ -e 's/@''GNULIB_MEMRCHR''@/$(GL_GNULIB_MEMRCHR)/g' \
+ -e 's/@''GNULIB_RAWMEMCHR''@/$(GL_GNULIB_RAWMEMCHR)/g' \
+ -e 's/@''GNULIB_STPCPY''@/$(GL_GNULIB_STPCPY)/g' \
+ -e 's/@''GNULIB_STPNCPY''@/$(GL_GNULIB_STPNCPY)/g' \
+ -e 's/@''GNULIB_STRCHRNUL''@/$(GL_GNULIB_STRCHRNUL)/g' \
+ -e 's/@''GNULIB_STRDUP''@/$(GL_GNULIB_STRDUP)/g' \
+ -e 's/@''GNULIB_STRNCAT''@/$(GL_GNULIB_STRNCAT)/g' \
+ -e 's/@''GNULIB_STRNDUP''@/$(GL_GNULIB_STRNDUP)/g' \
+ -e 's/@''GNULIB_STRNLEN''@/$(GL_GNULIB_STRNLEN)/g' \
+ -e 's/@''GNULIB_STRPBRK''@/$(GL_GNULIB_STRPBRK)/g' \
+ -e 's/@''GNULIB_STRSEP''@/$(GL_GNULIB_STRSEP)/g' \
+ -e 's/@''GNULIB_STRSTR''@/$(GL_GNULIB_STRSTR)/g' \
+ -e 's/@''GNULIB_STRCASESTR''@/$(GL_GNULIB_STRCASESTR)/g' \
+ -e 's/@''GNULIB_STRTOK_R''@/$(GL_GNULIB_STRTOK_R)/g' \
+ -e 's/@''GNULIB_STRERROR''@/$(GL_GNULIB_STRERROR)/g' \
+ -e 's/@''GNULIB_STRERROR_R''@/$(GL_GNULIB_STRERROR_R)/g' \
+ -e 's/@''GNULIB_STRERRORNAME_NP''@/$(GL_GNULIB_STRERRORNAME_NP)/g' \
+ -e 's/@''GNULIB_SIGABBREV_NP''@/$(GL_GNULIB_SIGABBREV_NP)/g' \
+ -e 's/@''GNULIB_SIGDESCR_NP''@/$(GL_GNULIB_SIGDESCR_NP)/g' \
+ -e 's/@''GNULIB_STRSIGNAL''@/$(GL_GNULIB_STRSIGNAL)/g' \
+ -e 's/@''GNULIB_STRVERSCMP''@/$(GL_GNULIB_STRVERSCMP)/g' \
+ -e 's/@''GNULIB_MDA_MEMCCPY''@/$(GL_GNULIB_MDA_MEMCCPY)/g' \
+ -e 's/@''GNULIB_MDA_STRDUP''@/$(GL_GNULIB_MDA_STRDUP)/g' \
+ -e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \
+ < $(srcdir)/string.in.h | \
+ sed -e 's|@''HAVE_EXPLICIT_BZERO''@|$(HAVE_EXPLICIT_BZERO)|g' \
+ -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
+ -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
+ -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
+ -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
+ -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
+ -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
+ -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \
+ -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
+ -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
+ -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
+ -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
+ -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \
+ -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \
+ -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
+ -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \
+ -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \
+ -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
+ -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \
+ -e 's|@''HAVE_STRERRORNAME_NP''@|$(HAVE_STRERRORNAME_NP)|g' \
+ -e 's|@''HAVE_SIGABBREV_NP''@|$(HAVE_SIGABBREV_NP)|g' \
+ -e 's|@''HAVE_SIGDESCR_NP''@|$(HAVE_SIGDESCR_NP)|g' \
+ -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
+ -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \
+ -e 's|@''REPLACE_FFSLL''@|$(REPLACE_FFSLL)|g' \
+ -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
+ -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
+ -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
+ -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
+ -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \
+ -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
+ -e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \
+ -e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \
+ -e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \
+ -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
+ -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
+ -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
+ -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
+ -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \
+ -e 's|@''REPLACE_STRERRORNAME_NP''@|$(REPLACE_STRERRORNAME_NP)|g' \
+ -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
+ -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += string.h string.h-t
+
+EXTRA_DIST += string.in.h
+
+## end gnulib module string
+
+## begin gnulib module strings
+
+BUILT_SOURCES += strings.h
+
+# We need the following in order to create <strings.h> when the system
+# doesn't have one that works with the given compiler.
+strings.h: strings.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_STRINGS_H''@|$(HAVE_STRINGS_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STRINGS_H''@|$(NEXT_STRINGS_H)|g' \
+ -e 's/@''GNULIB_FFS''@/$(GL_GNULIB_FFS)/g' \
+ -e 's|@''HAVE_FFS''@|$(HAVE_FFS)|g' \
+ -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \
+ -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/strings.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += strings.h strings.h-t
+
+EXTRA_DIST += strings.in.h
+
+## end gnulib module strings
+
+## begin gnulib module strndup
+
+if GL_COND_OBJ_STRNDUP
+libgnu_la_SOURCES += strndup.c
+endif
+
+## end gnulib module strndup
+
+## begin gnulib module strnlen
+
+if GL_COND_OBJ_STRNLEN
+libgnu_la_SOURCES += strnlen.c
+endif
+
+## end gnulib module strnlen
+
+## begin gnulib module strnlen1
+
+libgnu_la_SOURCES += strnlen1.h strnlen1.c
+
+## end gnulib module strnlen1
+
+## begin gnulib module strsep
+
+if GL_COND_OBJ_STRSEP
+libgnu_la_SOURCES += strsep.c
+endif
+
+## end gnulib module strsep
+
+## begin gnulib module sys_file
+
+BUILT_SOURCES += sys/file.h
+
+# We need the following in order to create <sys/file.h> when the system
+# has one that is incomplete.
+sys/file.h: sys_file.in.h $(top_builddir)/config.status $(WARN_ON_USE_H)
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's/@''HAVE_SYS_FILE_H''@/$(HAVE_SYS_FILE_H)/g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_FILE_H''@|$(NEXT_SYS_FILE_H)|g' \
+ -e 's/@''HAVE_FLOCK''@/$(HAVE_FLOCK)/g' \
+ -e 's/@''GNULIB_FLOCK''@/$(GL_GNULIB_FLOCK)/g' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/sys_file.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += sys/file.h sys/file.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_file.in.h
+
+## end gnulib module sys_file
+
+## begin gnulib module sys_ioctl
+
+BUILT_SOURCES += sys/ioctl.h
+
+# We need the following in order to create <sys/ioctl.h> when the system
+# does not have a complete one.
+sys/ioctl.h: sys_ioctl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_SYS_IOCTL_H''@|$(HAVE_SYS_IOCTL_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_IOCTL_H''@|$(NEXT_SYS_IOCTL_H)|g' \
+ -e 's/@''GNULIB_IOCTL''@/$(GL_GNULIB_IOCTL)/g' \
+ -e 's|@''SYS_IOCTL_H_HAVE_WINSOCK2_H''@|$(SYS_IOCTL_H_HAVE_WINSOCK2_H)|g' \
+ -e 's|@''SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
+ -e 's|@''REPLACE_IOCTL''@|$(REPLACE_IOCTL)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/sys_ioctl.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += sys/ioctl.h sys/ioctl.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_ioctl.in.h
+
+## end gnulib module sys_ioctl
+
+## begin gnulib module sys_random
+
+BUILT_SOURCES += sys/random.h
+
+# We need the following in order to create <sys/random.h> when the system
+# doesn't have one.
+sys/random.h: sys_random.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_RANDOM_H''@|$(NEXT_SYS_RANDOM_H)|g' \
+ -e 's|@''HAVE_SYS_RANDOM_H''@|$(HAVE_SYS_RANDOM_H)|g' \
+ -e 's/@''GNULIB_GETRANDOM''@/$(GL_GNULIB_GETRANDOM)/g' \
+ -e 's/@''HAVE_GETRANDOM''@/$(HAVE_GETRANDOM)/g' \
+ -e 's/@''REPLACE_GETRANDOM''@/$(REPLACE_GETRANDOM)/g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/sys_random.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += sys/random.h sys/random.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_random.in.h
+
+## end gnulib module sys_random
+
+## begin gnulib module sys_select
+
+BUILT_SOURCES += sys/select.h
+
+# We need the following in order to create <sys/select.h> when the system
+# doesn't have one that works with the given compiler.
+sys/select.h: sys_select.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_SELECT_H''@|$(NEXT_SYS_SELECT_H)|g' \
+ -e 's|@''HAVE_SYS_SELECT_H''@|$(HAVE_SYS_SELECT_H)|g' \
+ -e 's/@''GNULIB_PSELECT''@/$(GL_GNULIB_PSELECT)/g' \
+ -e 's/@''GNULIB_SELECT''@/$(GL_GNULIB_SELECT)/g' \
+ -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
+ -e 's|@''HAVE_PSELECT''@|$(HAVE_PSELECT)|g' \
+ -e 's|@''REPLACE_PSELECT''@|$(REPLACE_PSELECT)|g' \
+ -e 's|@''REPLACE_SELECT''@|$(REPLACE_SELECT)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/sys_select.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += sys/select.h sys/select.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_select.in.h
+
+## end gnulib module sys_select
+
+## begin gnulib module sys_socket
+
+BUILT_SOURCES += sys/socket.h
+libgnu_la_SOURCES += 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.
+sys/socket.h: sys_socket.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_SOCKET_H''@|$(NEXT_SYS_SOCKET_H)|g' \
+ -e 's|@''HAVE_SYS_SOCKET_H''@|$(HAVE_SYS_SOCKET_H)|g' \
+ -e 's/@''GNULIB_CLOSE''@/$(GL_GNULIB_CLOSE)/g' \
+ -e 's/@''GNULIB_SOCKET''@/$(GL_GNULIB_SOCKET)/g' \
+ -e 's/@''GNULIB_CONNECT''@/$(GL_GNULIB_CONNECT)/g' \
+ -e 's/@''GNULIB_ACCEPT''@/$(GL_GNULIB_ACCEPT)/g' \
+ -e 's/@''GNULIB_BIND''@/$(GL_GNULIB_BIND)/g' \
+ -e 's/@''GNULIB_GETPEERNAME''@/$(GL_GNULIB_GETPEERNAME)/g' \
+ -e 's/@''GNULIB_GETSOCKNAME''@/$(GL_GNULIB_GETSOCKNAME)/g' \
+ -e 's/@''GNULIB_GETSOCKOPT''@/$(GL_GNULIB_GETSOCKOPT)/g' \
+ -e 's/@''GNULIB_LISTEN''@/$(GL_GNULIB_LISTEN)/g' \
+ -e 's/@''GNULIB_RECV''@/$(GL_GNULIB_RECV)/g' \
+ -e 's/@''GNULIB_SEND''@/$(GL_GNULIB_SEND)/g' \
+ -e 's/@''GNULIB_RECVFROM''@/$(GL_GNULIB_RECVFROM)/g' \
+ -e 's/@''GNULIB_SENDTO''@/$(GL_GNULIB_SENDTO)/g' \
+ -e 's/@''GNULIB_SETSOCKOPT''@/$(GL_GNULIB_SETSOCKOPT)/g' \
+ -e 's/@''GNULIB_SHUTDOWN''@/$(GL_GNULIB_SHUTDOWN)/g' \
+ -e 's/@''GNULIB_ACCEPT4''@/$(GL_GNULIB_ACCEPT4)/g' \
+ -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
+ -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
+ -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE''@|$(HAVE_STRUCT_SOCKADDR_STORAGE)|g' \
+ -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY''@|$(HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY)|g' \
+ -e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \
+ -e 's|@''HAVE_ACCEPT4''@|$(HAVE_ACCEPT4)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/sys_socket.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_socket.in.h
+
+## end gnulib module sys_socket
+
+## begin gnulib module sys_stat
+
+BUILT_SOURCES += sys/stat.h
+
+# We need the following in order to create <sys/stat.h> when the system
+# has one that is incomplete.
+sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
+ -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \
+ -e 's|@''WINDOWS_STAT_TIMESPEC''@|$(WINDOWS_STAT_TIMESPEC)|g' \
+ -e 's/@''GNULIB_CHMOD''@/$(GL_GNULIB_CHMOD)/g' \
+ -e 's/@''GNULIB_FCHMODAT''@/$(GL_GNULIB_FCHMODAT)/g' \
+ -e 's/@''GNULIB_FSTAT''@/$(GL_GNULIB_FSTAT)/g' \
+ -e 's/@''GNULIB_FSTATAT''@/$(GL_GNULIB_FSTATAT)/g' \
+ -e 's/@''GNULIB_FUTIMENS''@/$(GL_GNULIB_FUTIMENS)/g' \
+ -e 's/@''GNULIB_GETUMASK''@/$(GL_GNULIB_GETUMASK)/g' \
+ -e 's/@''GNULIB_LCHMOD''@/$(GL_GNULIB_LCHMOD)/g' \
+ -e 's/@''GNULIB_LSTAT''@/$(GL_GNULIB_LSTAT)/g' \
+ -e 's/@''GNULIB_MKDIR''@/$(GL_GNULIB_MKDIR)/g' \
+ -e 's/@''GNULIB_MKDIRAT''@/$(GL_GNULIB_MKDIRAT)/g' \
+ -e 's/@''GNULIB_MKFIFO''@/$(GL_GNULIB_MKFIFO)/g' \
+ -e 's/@''GNULIB_MKFIFOAT''@/$(GL_GNULIB_MKFIFOAT)/g' \
+ -e 's/@''GNULIB_MKNOD''@/$(GL_GNULIB_MKNOD)/g' \
+ -e 's/@''GNULIB_MKNODAT''@/$(GL_GNULIB_MKNODAT)/g' \
+ -e 's/@''GNULIB_STAT''@/$(GL_GNULIB_STAT)/g' \
+ -e 's/@''GNULIB_UTIMENSAT''@/$(GL_GNULIB_UTIMENSAT)/g' \
+ -e 's/@''GNULIB_OVERRIDES_STRUCT_STAT''@/$(GL_GNULIB_OVERRIDES_STRUCT_STAT)/g' \
+ -e 's/@''GNULIB_MDA_CHMOD''@/$(GL_GNULIB_MDA_CHMOD)/g' \
+ -e 's/@''GNULIB_MDA_MKDIR''@/$(GL_GNULIB_MDA_MKDIR)/g' \
+ -e 's/@''GNULIB_MDA_UMASK''@/$(GL_GNULIB_MDA_UMASK)/g' \
+ -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
+ -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
+ -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \
+ -e 's|@''HAVE_GETUMASK''@|$(HAVE_GETUMASK)|g' \
+ -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \
+ -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
+ -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \
+ -e 's|@''HAVE_MKFIFO''@|$(HAVE_MKFIFO)|g' \
+ -e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \
+ -e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \
+ -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \
+ -e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \
+ -e 's|@''REPLACE_CHMOD''@|$(REPLACE_CHMOD)|g' \
+ -e 's|@''REPLACE_FCHMODAT''@|$(REPLACE_FCHMODAT)|g' \
+ -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \
+ -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \
+ -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \
+ -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \
+ -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \
+ -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \
+ -e 's|@''REPLACE_MKFIFOAT''@|$(REPLACE_MKFIFOAT)|g' \
+ -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \
+ -e 's|@''REPLACE_MKNODAT''@|$(REPLACE_MKNODAT)|g' \
+ -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \
+ -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/sys_stat.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_stat.in.h
+
+## end gnulib module sys_stat
+
+## begin gnulib module sys_time
+
+BUILT_SOURCES += sys/time.h
+
+# We need the following in order to create <sys/time.h> when the system
+# doesn't have one that works with the given compiler.
+sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \
+ -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GL_GNULIB_GETTIMEOFDAY)/g' \
+ -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
+ -e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \
+ -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
+ -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
+ -e 's/@''REPLACE_STRUCT_TIMEVAL''@/$(REPLACE_STRUCT_TIMEVAL)/g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/sys_time.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += sys/time.h sys/time.h-t
+
+EXTRA_DIST += sys_time.in.h
+
+## end gnulib module sys_time
+
+## begin gnulib module sys_types
+
+BUILT_SOURCES += sys/types.h
+
+# We need the following in order to create <sys/types.h> when the system
+# doesn't have one that works with the given compiler.
+sys/types.h: sys_types.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \
+ -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
+ -e 's|@''WINDOWS_STAT_INODES''@|$(WINDOWS_STAT_INODES)|g' \
+ $(srcdir)/sys_types.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += sys/types.h sys/types.h-t
+
+EXTRA_DIST += sys_types.in.h
+
+## end gnulib module sys_types
+
+## begin gnulib module sys_uio
+
+BUILT_SOURCES += sys/uio.h
+
+# We need the following in order to create <sys/uio.h> when the system
+# doesn't have one that works with the given compiler.
+sys/uio.h: sys_uio.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_UIO_H''@|$(NEXT_SYS_UIO_H)|g' \
+ -e 's|@''HAVE_SYS_UIO_H''@|$(HAVE_SYS_UIO_H)|g' \
+ $(srcdir)/sys_uio.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += sys/uio.h sys/uio.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_uio.in.h
+
+## end gnulib module sys_uio
+
+## begin gnulib module sysexits
+
+BUILT_SOURCES += $(SYSEXITS_H)
+
+# We need the following in order to create <sysexits.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_SYSEXITS_H
+sysexits.h: sysexits.in.h $(top_builddir)/config.status
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_SYSEXITS_H''@|$(HAVE_SYSEXITS_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYSEXITS_H''@|$(NEXT_SYSEXITS_H)|g' \
+ $(srcdir)/sysexits.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+sysexits.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += sysexits.h sysexits.h-t
+
+EXTRA_DIST += sysexits.in.h
+
+## end gnulib module sysexits
+
+## begin gnulib module tempname
+
+libgnu_la_SOURCES += tempname.c
+
+EXTRA_DIST += tempname.h
+
+## end gnulib module tempname
+
+## begin gnulib module termios
+
+BUILT_SOURCES += termios.h
+
+# We need the following in order to create <termios.h> when the system
+# version does not have all declarations.
+termios.h: termios.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_TERMIOS_H''@|$(NEXT_TERMIOS_H)|g' \
+ -e 's/@''GNULIB_TCGETSID''@/$(GL_GNULIB_TCGETSID)/g' \
+ -e 's|@''HAVE_DECL_TCGETSID''@|$(HAVE_DECL_TCGETSID)|g' \
+ -e 's|@''HAVE_TERMIOS_H''@|$(HAVE_TERMIOS_H)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/termios.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += termios.h termios.h-t
+
+EXTRA_DIST += termios.in.h
+
+## end gnulib module termios
+
+## begin gnulib module threadlib
+
+libgnu_la_SOURCES += glthread/threadlib.c
+
+## end gnulib module threadlib
+
+## begin gnulib module time
+
+BUILT_SOURCES += time.h
+
+# We need the following in order to create <time.h> when the system
+# doesn't have one that works with the given compiler.
+time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
+ -e 's/@''GNULIB_CTIME''@/$(GL_GNULIB_CTIME)/g' \
+ -e 's/@''GNULIB_LOCALTIME''@/$(GL_GNULIB_LOCALTIME)/g' \
+ -e 's/@''GNULIB_MKTIME''@/$(GL_GNULIB_MKTIME)/g' \
+ -e 's/@''GNULIB_NANOSLEEP''@/$(GL_GNULIB_NANOSLEEP)/g' \
+ -e 's/@''GNULIB_STRFTIME''@/$(GL_GNULIB_STRFTIME)/g' \
+ -e 's/@''GNULIB_STRPTIME''@/$(GL_GNULIB_STRPTIME)/g' \
+ -e 's/@''GNULIB_TIMEGM''@/$(GL_GNULIB_TIMEGM)/g' \
+ -e 's/@''GNULIB_TIMESPEC_GET''@/$(GL_GNULIB_TIMESPEC_GET)/g' \
+ -e 's/@''GNULIB_TIMESPEC_GETRES''@/$(GL_GNULIB_TIMESPEC_GETRES)/g' \
+ -e 's/@''GNULIB_TIME_R''@/$(GL_GNULIB_TIME_R)/g' \
+ -e 's/@''GNULIB_TIME_RZ''@/$(GL_GNULIB_TIME_RZ)/g' \
+ -e 's/@''GNULIB_TZSET''@/$(GL_GNULIB_TZSET)/g' \
+ -e 's/@''GNULIB_MDA_TZSET''@/$(GL_GNULIB_MDA_TZSET)/g' \
+ -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
+ -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
+ -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
+ -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
+ -e 's|@''HAVE_TIMESPEC_GET''@|$(HAVE_TIMESPEC_GET)|g' \
+ -e 's|@''HAVE_TIMESPEC_GETRES''@|$(HAVE_TIMESPEC_GETRES)|g' \
+ -e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \
+ -e 's|@''REPLACE_CTIME''@|$(REPLACE_CTIME)|g' \
+ -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \
+ -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \
+ -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
+ -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
+ -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
+ -e 's|@''REPLACE_STRFTIME''@|$(REPLACE_STRFTIME)|g' \
+ -e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
+ -e 's|@''REPLACE_TZSET''@|$(REPLACE_TZSET)|g' \
+ -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \
+ -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
+ -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
+ -e 's|@''UNISTD_H_DEFINES_STRUCT_TIMESPEC''@|$(UNISTD_H_DEFINES_STRUCT_TIMESPEC)|g' \
+ -e 's|@''TIME_H_DEFINES_TIME_UTC''@|$(TIME_H_DEFINES_TIME_UTC)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/time.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += time.h time.h-t
+
+EXTRA_DIST += time.in.h
+
+## end gnulib module time
+
+## begin gnulib module timespec
+
+libgnu_la_SOURCES += timespec.c
+
+EXTRA_DIST += timespec.h
+
+## end gnulib module timespec
+
+## begin gnulib module unistd
+
+BUILT_SOURCES += unistd.h
+libgnu_la_SOURCES += unistd.c
+
+# We need the following in order to create an empty placeholder for
+# <unistd.h> when the system doesn't have one.
+unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
+ -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
+ -e 's/@''GNULIB_ACCESS''@/$(GL_GNULIB_ACCESS)/g' \
+ -e 's/@''GNULIB_CHDIR''@/$(GL_GNULIB_CHDIR)/g' \
+ -e 's/@''GNULIB_CHOWN''@/$(GL_GNULIB_CHOWN)/g' \
+ -e 's/@''GNULIB_CLOSE''@/$(GL_GNULIB_CLOSE)/g' \
+ -e 's/@''GNULIB_COPY_FILE_RANGE''@/$(GL_GNULIB_COPY_FILE_RANGE)/g' \
+ -e 's/@''GNULIB_DUP''@/$(GL_GNULIB_DUP)/g' \
+ -e 's/@''GNULIB_DUP2''@/$(GL_GNULIB_DUP2)/g' \
+ -e 's/@''GNULIB_DUP3''@/$(GL_GNULIB_DUP3)/g' \
+ -e 's/@''GNULIB_ENVIRON''@/$(GL_GNULIB_ENVIRON)/g' \
+ -e 's/@''GNULIB_EUIDACCESS''@/$(GL_GNULIB_EUIDACCESS)/g' \
+ -e 's/@''GNULIB_EXECL''@/$(GL_GNULIB_EXECL)/g' \
+ -e 's/@''GNULIB_EXECLE''@/$(GL_GNULIB_EXECLE)/g' \
+ -e 's/@''GNULIB_EXECLP''@/$(GL_GNULIB_EXECLP)/g' \
+ -e 's/@''GNULIB_EXECV''@/$(GL_GNULIB_EXECV)/g' \
+ -e 's/@''GNULIB_EXECVE''@/$(GL_GNULIB_EXECVE)/g' \
+ -e 's/@''GNULIB_EXECVP''@/$(GL_GNULIB_EXECVP)/g' \
+ -e 's/@''GNULIB_EXECVPE''@/$(GL_GNULIB_EXECVPE)/g' \
+ -e 's/@''GNULIB_FACCESSAT''@/$(GL_GNULIB_FACCESSAT)/g' \
+ -e 's/@''GNULIB_FCHDIR''@/$(GL_GNULIB_FCHDIR)/g' \
+ -e 's/@''GNULIB_FCHOWNAT''@/$(GL_GNULIB_FCHOWNAT)/g' \
+ -e 's/@''GNULIB_FDATASYNC''@/$(GL_GNULIB_FDATASYNC)/g' \
+ -e 's/@''GNULIB_FSYNC''@/$(GL_GNULIB_FSYNC)/g' \
+ -e 's/@''GNULIB_FTRUNCATE''@/$(GL_GNULIB_FTRUNCATE)/g' \
+ -e 's/@''GNULIB_GETCWD''@/$(GL_GNULIB_GETCWD)/g' \
+ -e 's/@''GNULIB_GETDOMAINNAME''@/$(GL_GNULIB_GETDOMAINNAME)/g' \
+ -e 's/@''GNULIB_GETDTABLESIZE''@/$(GL_GNULIB_GETDTABLESIZE)/g' \
+ -e 's/@''GNULIB_GETENTROPY''@/$(GL_GNULIB_GETENTROPY)/g' \
+ -e 's/@''GNULIB_GETGROUPS''@/$(GL_GNULIB_GETGROUPS)/g' \
+ -e 's/@''GNULIB_GETHOSTNAME''@/$(GL_GNULIB_GETHOSTNAME)/g' \
+ -e 's/@''GNULIB_GETLOGIN''@/$(GL_GNULIB_GETLOGIN)/g' \
+ -e 's/@''GNULIB_GETLOGIN_R''@/$(GL_GNULIB_GETLOGIN_R)/g' \
+ -e 's/@''GNULIB_GETOPT_POSIX''@/$(GL_GNULIB_GETOPT_POSIX)/g' \
+ -e 's/@''GNULIB_GETPAGESIZE''@/$(GL_GNULIB_GETPAGESIZE)/g' \
+ -e 's/@''GNULIB_GETPASS''@/$(GL_GNULIB_GETPASS)/g' \
+ -e 's/@''GNULIB_GETPASS_GNU''@/$(GL_GNULIB_GETPASS_GNU)/g' \
+ -e 's/@''GNULIB_GETUSERSHELL''@/$(GL_GNULIB_GETUSERSHELL)/g' \
+ -e 's/@''GNULIB_GROUP_MEMBER''@/$(GL_GNULIB_GROUP_MEMBER)/g' \
+ -e 's/@''GNULIB_ISATTY''@/$(GL_GNULIB_ISATTY)/g' \
+ -e 's/@''GNULIB_LCHOWN''@/$(GL_GNULIB_LCHOWN)/g' \
+ -e 's/@''GNULIB_LINK''@/$(GL_GNULIB_LINK)/g' \
+ -e 's/@''GNULIB_LINKAT''@/$(GL_GNULIB_LINKAT)/g' \
+ -e 's/@''GNULIB_LSEEK''@/$(GL_GNULIB_LSEEK)/g' \
+ -e 's/@''GNULIB_PIPE''@/$(GL_GNULIB_PIPE)/g' \
+ -e 's/@''GNULIB_PIPE2''@/$(GL_GNULIB_PIPE2)/g' \
+ -e 's/@''GNULIB_PREAD''@/$(GL_GNULIB_PREAD)/g' \
+ -e 's/@''GNULIB_PWRITE''@/$(GL_GNULIB_PWRITE)/g' \
+ -e 's/@''GNULIB_READ''@/$(GL_GNULIB_READ)/g' \
+ -e 's/@''GNULIB_READLINK''@/$(GL_GNULIB_READLINK)/g' \
+ -e 's/@''GNULIB_READLINKAT''@/$(GL_GNULIB_READLINKAT)/g' \
+ -e 's/@''GNULIB_RMDIR''@/$(GL_GNULIB_RMDIR)/g' \
+ -e 's/@''GNULIB_SETHOSTNAME''@/$(GL_GNULIB_SETHOSTNAME)/g' \
+ -e 's/@''GNULIB_SLEEP''@/$(GL_GNULIB_SLEEP)/g' \
+ -e 's/@''GNULIB_SYMLINK''@/$(GL_GNULIB_SYMLINK)/g' \
+ -e 's/@''GNULIB_SYMLINKAT''@/$(GL_GNULIB_SYMLINKAT)/g' \
+ -e 's/@''GNULIB_TRUNCATE''@/$(GL_GNULIB_TRUNCATE)/g' \
+ -e 's/@''GNULIB_TTYNAME_R''@/$(GL_GNULIB_TTYNAME_R)/g' \
+ -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GL_GNULIB_UNISTD_H_GETOPT)/g' \
+ -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GL_GNULIB_UNISTD_H_NONBLOCKING)/g' \
+ -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GL_GNULIB_UNISTD_H_SIGPIPE)/g' \
+ -e 's/@''GNULIB_UNLINK''@/$(GL_GNULIB_UNLINK)/g' \
+ -e 's/@''GNULIB_UNLINKAT''@/$(GL_GNULIB_UNLINKAT)/g' \
+ -e 's/@''GNULIB_USLEEP''@/$(GL_GNULIB_USLEEP)/g' \
+ -e 's/@''GNULIB_WRITE''@/$(GL_GNULIB_WRITE)/g' \
+ -e 's/@''GNULIB_MDA_ACCESS''@/$(GL_GNULIB_MDA_ACCESS)/g' \
+ -e 's/@''GNULIB_MDA_CHDIR''@/$(GL_GNULIB_MDA_CHDIR)/g' \
+ -e 's/@''GNULIB_MDA_CLOSE''@/$(GL_GNULIB_MDA_CLOSE)/g' \
+ -e 's/@''GNULIB_MDA_DUP''@/$(GL_GNULIB_MDA_DUP)/g' \
+ -e 's/@''GNULIB_MDA_DUP2''@/$(GL_GNULIB_MDA_DUP2)/g' \
+ -e 's/@''GNULIB_MDA_EXECL''@/$(GL_GNULIB_MDA_EXECL)/g' \
+ -e 's/@''GNULIB_MDA_EXECLE''@/$(GL_GNULIB_MDA_EXECLE)/g' \
+ -e 's/@''GNULIB_MDA_EXECLP''@/$(GL_GNULIB_MDA_EXECLP)/g' \
+ -e 's/@''GNULIB_MDA_EXECV''@/$(GL_GNULIB_MDA_EXECV)/g' \
+ -e 's/@''GNULIB_MDA_EXECVE''@/$(GL_GNULIB_MDA_EXECVE)/g' \
+ -e 's/@''GNULIB_MDA_EXECVP''@/$(GL_GNULIB_MDA_EXECVP)/g' \
+ -e 's/@''GNULIB_MDA_EXECVPE''@/$(GL_GNULIB_MDA_EXECVPE)/g' \
+ -e 's/@''GNULIB_MDA_GETCWD''@/$(GL_GNULIB_MDA_GETCWD)/g' \
+ -e 's/@''GNULIB_MDA_GETPID''@/$(GL_GNULIB_MDA_GETPID)/g' \
+ -e 's/@''GNULIB_MDA_ISATTY''@/$(GL_GNULIB_MDA_ISATTY)/g' \
+ -e 's/@''GNULIB_MDA_LSEEK''@/$(GL_GNULIB_MDA_LSEEK)/g' \
+ -e 's/@''GNULIB_MDA_READ''@/$(GL_GNULIB_MDA_READ)/g' \
+ -e 's/@''GNULIB_MDA_RMDIR''@/$(GL_GNULIB_MDA_RMDIR)/g' \
+ -e 's/@''GNULIB_MDA_SWAB''@/$(GL_GNULIB_MDA_SWAB)/g' \
+ -e 's/@''GNULIB_MDA_UNLINK''@/$(GL_GNULIB_MDA_UNLINK)/g' \
+ -e 's/@''GNULIB_MDA_WRITE''@/$(GL_GNULIB_MDA_WRITE)/g' \
+ < $(srcdir)/unistd.in.h | \
+ sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
+ -e 's|@''HAVE_COPY_FILE_RANGE''@|$(HAVE_COPY_FILE_RANGE)|g' \
+ -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
+ -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
+ -e 's|@''HAVE_EXECVPE''@|$(HAVE_EXECVPE)|g' \
+ -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \
+ -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \
+ -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \
+ -e 's|@''HAVE_FDATASYNC''@|$(HAVE_FDATASYNC)|g' \
+ -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
+ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
+ -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
+ -e 's|@''HAVE_GETENTROPY''@|$(HAVE_GETENTROPY)|g' \
+ -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
+ -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
+ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
+ -e 's|@''HAVE_GETPASS''@|$(HAVE_GETPASS)|g' \
+ -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \
+ -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
+ -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
+ -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \
+ -e 's|@''HAVE_PIPE''@|$(HAVE_PIPE)|g' \
+ -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \
+ -e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \
+ -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \
+ -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
+ -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
+ -e 's|@''HAVE_SETHOSTNAME''@|$(HAVE_SETHOSTNAME)|g' \
+ -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
+ -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \
+ -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \
+ -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
+ -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
+ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
+ -e 's|@''HAVE_DECL_EXECVPE''@|$(HAVE_DECL_EXECVPE)|g' \
+ -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \
+ -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \
+ -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \
+ -e 's|@''HAVE_DECL_GETLOGIN''@|$(HAVE_DECL_GETLOGIN)|g' \
+ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
+ -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
+ -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
+ -e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \
+ -e 's|@''HAVE_DECL_TRUNCATE''@|$(HAVE_DECL_TRUNCATE)|g' \
+ -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \
+ -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
+ -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
+ | \
+ sed -e 's|@''REPLACE_ACCESS''@|$(REPLACE_ACCESS)|g' \
+ -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
+ -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
+ -e 's|@''REPLACE_COPY_FILE_RANGE''@|$(REPLACE_COPY_FILE_RANGE)|g' \
+ -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
+ -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
+ -e 's|@''REPLACE_EXECL''@|$(REPLACE_EXECL)|g' \
+ -e 's|@''REPLACE_EXECLE''@|$(REPLACE_EXECLE)|g' \
+ -e 's|@''REPLACE_EXECLP''@|$(REPLACE_EXECLP)|g' \
+ -e 's|@''REPLACE_EXECV''@|$(REPLACE_EXECV)|g' \
+ -e 's|@''REPLACE_EXECVE''@|$(REPLACE_EXECVE)|g' \
+ -e 's|@''REPLACE_EXECVP''@|$(REPLACE_EXECVP)|g' \
+ -e 's|@''REPLACE_EXECVPE''@|$(REPLACE_EXECVPE)|g' \
+ -e 's|@''REPLACE_FACCESSAT''@|$(REPLACE_FACCESSAT)|g' \
+ -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
+ -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
+ -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
+ -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
+ -e 's|@''REPLACE_GETDTABLESIZE''@|$(REPLACE_GETDTABLESIZE)|g' \
+ -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
+ -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
+ -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
+ -e 's|@''REPLACE_GETPASS''@|$(REPLACE_GETPASS)|g' \
+ -e 's|@''REPLACE_GETPASS_FOR_GETPASS_GNU''@|$(REPLACE_GETPASS_FOR_GETPASS_GNU)|g' \
+ -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \
+ -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
+ -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
+ -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \
+ -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
+ -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \
+ -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
+ -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \
+ -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
+ -e 's|@''REPLACE_READLINKAT''@|$(REPLACE_READLINKAT)|g' \
+ -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
+ -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
+ -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
+ -e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \
+ -e 's|@''REPLACE_TRUNCATE''@|$(REPLACE_TRUNCATE)|g' \
+ -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \
+ -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
+ -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
+ -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \
+ -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \
+ -e 's|@''UNISTD_H_HAVE_SYS_RANDOM_H''@|$(UNISTD_H_HAVE_SYS_RANDOM_H)|g' \
+ -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
+ -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += unistd.h unistd.h-t
+
+EXTRA_DIST += unistd.in.h
+
+## end gnulib module unistd
+
+## begin gnulib module unistd-safer
+
+libgnu_la_SOURCES += dup-safer.c fd-safer.c pipe-safer.c
+
+EXTRA_DIST += unistd--.h unistd-safer.h
+
+## end gnulib module unistd-safer
+
+## begin gnulib module unlink
+
+if GL_COND_OBJ_UNLINK
+libgnu_la_SOURCES += unlink.c
+endif
+
+## end gnulib module unlink
+
+## begin gnulib module unlinkat
+
+if GL_COND_OBJ_UNLINKAT
+libgnu_la_SOURCES += unlinkat.c
+endif
+
+EXTRA_DIST += at-func.c
+
+EXTRA_libgnu_la_SOURCES += at-func.c
+
+## end gnulib module unlinkat
+
+## begin gnulib module utime
+
+if GL_COND_OBJ_UTIME
+libgnu_la_SOURCES += utime.c
+endif
+
+## end gnulib module utime
+
+## begin gnulib module utime-h
+
+BUILT_SOURCES += utime.h
+
+# We need the following in order to create <utime.h> when the system
+# doesn't have one that works with the given compiler.
+utime.h: utime.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's/@''HAVE_UTIME_H''@/$(HAVE_UTIME_H)/g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_UTIME_H''@|$(NEXT_UTIME_H)|g' \
+ -e 's/@''GNULIB_UTIME''@/$(GL_GNULIB_UTIME)/g' \
+ -e 's/@''GNULIB_MDA_UTIME''@/$(GL_GNULIB_MDA_UTIME)/g' \
+ -e 's|@''HAVE_UTIME''@|$(HAVE_UTIME)|g' \
+ -e 's|@''REPLACE_UTIME''@|$(REPLACE_UTIME)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/utime.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += utime.h utime.h-t
+
+EXTRA_DIST += utime.in.h
+
+## end gnulib module utime-h
+
+## begin gnulib module utimens
+
+libgnu_la_SOURCES += utimens.c
+
+EXTRA_DIST += utimens.h
+
+## end gnulib module utimens
+
+## begin gnulib module vasnprintf
+
+
+EXTRA_DIST += asnprintf.c float+.h printf-args.c printf-args.h printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h
+
+EXTRA_libgnu_la_SOURCES += asnprintf.c printf-args.c printf-parse.c vasnprintf.c
+
+## end gnulib module vasnprintf
+
+## begin gnulib module vasprintf
+
+
+EXTRA_DIST += asprintf.c vasprintf.c
+
+EXTRA_libgnu_la_SOURCES += asprintf.c vasprintf.c
+
+## end gnulib module vasprintf
+
+## begin gnulib module verify
+
+
+EXTRA_DIST += verify.h
+
+## end gnulib module verify
+
+## begin gnulib module verror
+
+libgnu_la_SOURCES += verror.h verror.c
+
+## end gnulib module verror
+
+## begin gnulib module vsnprintf
+
+
+EXTRA_DIST += vsnprintf.c
+
+EXTRA_libgnu_la_SOURCES += vsnprintf.c
+
+## end gnulib module vsnprintf
+
+## begin gnulib module wchar
+
+BUILT_SOURCES += wchar.h
+
+# We need the following in order to create <wchar.h> when the system
+# version does not work standalone.
+wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
+ -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
+ -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
+ -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \
+ -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \
+ -e 's/@''GNULIB_BTOWC''@/$(GL_GNULIB_BTOWC)/g' \
+ -e 's/@''GNULIB_WCTOB''@/$(GL_GNULIB_WCTOB)/g' \
+ -e 's/@''GNULIB_MBSINIT''@/$(GL_GNULIB_MBSINIT)/g' \
+ -e 's/@''GNULIB_MBRTOWC''@/$(GL_GNULIB_MBRTOWC)/g' \
+ -e 's/@''GNULIB_MBRLEN''@/$(GL_GNULIB_MBRLEN)/g' \
+ -e 's/@''GNULIB_MBSRTOWCS''@/$(GL_GNULIB_MBSRTOWCS)/g' \
+ -e 's/@''GNULIB_MBSNRTOWCS''@/$(GL_GNULIB_MBSNRTOWCS)/g' \
+ -e 's/@''GNULIB_WCRTOMB''@/$(GL_GNULIB_WCRTOMB)/g' \
+ -e 's/@''GNULIB_WCSRTOMBS''@/$(GL_GNULIB_WCSRTOMBS)/g' \
+ -e 's/@''GNULIB_WCSNRTOMBS''@/$(GL_GNULIB_WCSNRTOMBS)/g' \
+ -e 's/@''GNULIB_WCWIDTH''@/$(GL_GNULIB_WCWIDTH)/g' \
+ -e 's/@''GNULIB_WMEMCHR''@/$(GL_GNULIB_WMEMCHR)/g' \
+ -e 's/@''GNULIB_WMEMCMP''@/$(GL_GNULIB_WMEMCMP)/g' \
+ -e 's/@''GNULIB_WMEMCPY''@/$(GL_GNULIB_WMEMCPY)/g' \
+ -e 's/@''GNULIB_WMEMMOVE''@/$(GL_GNULIB_WMEMMOVE)/g' \
+ -e 's/@''GNULIB_WMEMPCPY''@/$(GL_GNULIB_WMEMPCPY)/g' \
+ -e 's/@''GNULIB_WMEMSET''@/$(GL_GNULIB_WMEMSET)/g' \
+ -e 's/@''GNULIB_WCSLEN''@/$(GL_GNULIB_WCSLEN)/g' \
+ -e 's/@''GNULIB_WCSNLEN''@/$(GL_GNULIB_WCSNLEN)/g' \
+ -e 's/@''GNULIB_WCSCPY''@/$(GL_GNULIB_WCSCPY)/g' \
+ -e 's/@''GNULIB_WCPCPY''@/$(GL_GNULIB_WCPCPY)/g' \
+ -e 's/@''GNULIB_WCSNCPY''@/$(GL_GNULIB_WCSNCPY)/g' \
+ -e 's/@''GNULIB_WCPNCPY''@/$(GL_GNULIB_WCPNCPY)/g' \
+ -e 's/@''GNULIB_WCSCAT''@/$(GL_GNULIB_WCSCAT)/g' \
+ -e 's/@''GNULIB_WCSNCAT''@/$(GL_GNULIB_WCSNCAT)/g' \
+ -e 's/@''GNULIB_WCSCMP''@/$(GL_GNULIB_WCSCMP)/g' \
+ -e 's/@''GNULIB_WCSNCMP''@/$(GL_GNULIB_WCSNCMP)/g' \
+ -e 's/@''GNULIB_WCSCASECMP''@/$(GL_GNULIB_WCSCASECMP)/g' \
+ -e 's/@''GNULIB_WCSNCASECMP''@/$(GL_GNULIB_WCSNCASECMP)/g' \
+ -e 's/@''GNULIB_WCSCOLL''@/$(GL_GNULIB_WCSCOLL)/g' \
+ -e 's/@''GNULIB_WCSXFRM''@/$(GL_GNULIB_WCSXFRM)/g' \
+ -e 's/@''GNULIB_WCSDUP''@/$(GL_GNULIB_WCSDUP)/g' \
+ -e 's/@''GNULIB_WCSCHR''@/$(GL_GNULIB_WCSCHR)/g' \
+ -e 's/@''GNULIB_WCSRCHR''@/$(GL_GNULIB_WCSRCHR)/g' \
+ -e 's/@''GNULIB_WCSCSPN''@/$(GL_GNULIB_WCSCSPN)/g' \
+ -e 's/@''GNULIB_WCSSPN''@/$(GL_GNULIB_WCSSPN)/g' \
+ -e 's/@''GNULIB_WCSPBRK''@/$(GL_GNULIB_WCSPBRK)/g' \
+ -e 's/@''GNULIB_WCSSTR''@/$(GL_GNULIB_WCSSTR)/g' \
+ -e 's/@''GNULIB_WCSTOK''@/$(GL_GNULIB_WCSTOK)/g' \
+ -e 's/@''GNULIB_WCSWIDTH''@/$(GL_GNULIB_WCSWIDTH)/g' \
+ -e 's/@''GNULIB_WCSFTIME''@/$(GL_GNULIB_WCSFTIME)/g' \
+ -e 's/@''GNULIB_MDA_WCSDUP''@/$(GL_GNULIB_MDA_WCSDUP)/g' \
+ -e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \
+ < $(srcdir)/wchar.in.h | \
+ sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
+ -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
+ -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \
+ -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \
+ -e 's|@''HAVE_MBRLEN''@|$(HAVE_MBRLEN)|g' \
+ -e 's|@''HAVE_MBSRTOWCS''@|$(HAVE_MBSRTOWCS)|g' \
+ -e 's|@''HAVE_MBSNRTOWCS''@|$(HAVE_MBSNRTOWCS)|g' \
+ -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \
+ -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \
+ -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \
+ -e 's|@''HAVE_WMEMCHR''@|$(HAVE_WMEMCHR)|g' \
+ -e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \
+ -e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \
+ -e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \
+ -e 's|@''HAVE_WMEMPCPY''@|$(HAVE_WMEMPCPY)|g' \
+ -e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \
+ -e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \
+ -e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \
+ -e 's|@''HAVE_WCSCPY''@|$(HAVE_WCSCPY)|g' \
+ -e 's|@''HAVE_WCPCPY''@|$(HAVE_WCPCPY)|g' \
+ -e 's|@''HAVE_WCSNCPY''@|$(HAVE_WCSNCPY)|g' \
+ -e 's|@''HAVE_WCPNCPY''@|$(HAVE_WCPNCPY)|g' \
+ -e 's|@''HAVE_WCSCAT''@|$(HAVE_WCSCAT)|g' \
+ -e 's|@''HAVE_WCSNCAT''@|$(HAVE_WCSNCAT)|g' \
+ -e 's|@''HAVE_WCSCMP''@|$(HAVE_WCSCMP)|g' \
+ -e 's|@''HAVE_WCSNCMP''@|$(HAVE_WCSNCMP)|g' \
+ -e 's|@''HAVE_WCSCASECMP''@|$(HAVE_WCSCASECMP)|g' \
+ -e 's|@''HAVE_WCSNCASECMP''@|$(HAVE_WCSNCASECMP)|g' \
+ -e 's|@''HAVE_WCSCOLL''@|$(HAVE_WCSCOLL)|g' \
+ -e 's|@''HAVE_WCSXFRM''@|$(HAVE_WCSXFRM)|g' \
+ -e 's|@''HAVE_WCSDUP''@|$(HAVE_WCSDUP)|g' \
+ -e 's|@''HAVE_WCSCHR''@|$(HAVE_WCSCHR)|g' \
+ -e 's|@''HAVE_WCSRCHR''@|$(HAVE_WCSRCHR)|g' \
+ -e 's|@''HAVE_WCSCSPN''@|$(HAVE_WCSCSPN)|g' \
+ -e 's|@''HAVE_WCSSPN''@|$(HAVE_WCSSPN)|g' \
+ -e 's|@''HAVE_WCSPBRK''@|$(HAVE_WCSPBRK)|g' \
+ -e 's|@''HAVE_WCSSTR''@|$(HAVE_WCSSTR)|g' \
+ -e 's|@''HAVE_WCSTOK''@|$(HAVE_WCSTOK)|g' \
+ -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \
+ -e 's|@''HAVE_WCSFTIME''@|$(HAVE_WCSFTIME)|g' \
+ -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
+ -e 's|@''HAVE_DECL_WCSDUP''@|$(HAVE_DECL_WCSDUP)|g' \
+ -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
+ | \
+ sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
+ -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \
+ -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \
+ -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
+ -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \
+ -e 's|@''REPLACE_MBRTOWC''@|$(REPLACE_MBRTOWC)|g' \
+ -e 's|@''REPLACE_MBRLEN''@|$(REPLACE_MBRLEN)|g' \
+ -e 's|@''REPLACE_MBSRTOWCS''@|$(REPLACE_MBSRTOWCS)|g' \
+ -e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \
+ -e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \
+ -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \
+ -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
+ -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
+ -e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \
+ -e 's|@''REPLACE_WCSFTIME''@|$(REPLACE_WCSFTIME)|g' \
+ -e 's|@''REPLACE_WCSTOK''@|$(REPLACE_WCSTOK)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += wchar.h wchar.h-t
+
+EXTRA_DIST += wchar.in.h
+
+## end gnulib module wchar
+
+## begin gnulib module wcrtomb
+
+if GL_COND_OBJ_WCRTOMB
+libgnu_la_SOURCES += wcrtomb.c
+endif
+
+## end gnulib module wcrtomb
+
+## begin gnulib module wctype-h
+
+BUILT_SOURCES += wctype.h
+libgnu_la_SOURCES += 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.
+wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \
+ -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \
+ -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \
+ -e 's/@''GNULIB_ISWBLANK''@/$(GL_GNULIB_ISWBLANK)/g' \
+ -e 's/@''GNULIB_ISWDIGIT''@/$(GL_GNULIB_ISWDIGIT)/g' \
+ -e 's/@''GNULIB_ISWXDIGIT''@/$(GL_GNULIB_ISWXDIGIT)/g' \
+ -e 's/@''GNULIB_WCTYPE''@/$(GL_GNULIB_WCTYPE)/g' \
+ -e 's/@''GNULIB_ISWCTYPE''@/$(GL_GNULIB_ISWCTYPE)/g' \
+ -e 's/@''GNULIB_WCTRANS''@/$(GL_GNULIB_WCTRANS)/g' \
+ -e 's/@''GNULIB_TOWCTRANS''@/$(GL_GNULIB_TOWCTRANS)/g' \
+ -e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \
+ -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \
+ -e 's/@''HAVE_WCTYPE_T''@/$(HAVE_WCTYPE_T)/g' \
+ -e 's/@''HAVE_WCTRANS_T''@/$(HAVE_WCTRANS_T)/g' \
+ -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
+ -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \
+ -e 's/@''REPLACE_ISWDIGIT''@/$(REPLACE_ISWDIGIT)/g' \
+ -e 's/@''REPLACE_ISWXDIGIT''@/$(REPLACE_ISWXDIGIT)/g' \
+ -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \
+ -e 's/@''REPLACE_TOWLOWER''@/$(REPLACE_TOWLOWER)/g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/wctype.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += wctype.h wctype.h-t
+
+EXTRA_DIST += wctype.in.h
+
+## end gnulib module wctype-h
+
+## begin gnulib module windows-mutex
+
+if GL_COND_OBJ_WINDOWS_MUTEX
+libgnu_la_SOURCES += windows-mutex.c
+endif
+
+EXTRA_DIST += windows-initguard.h windows-mutex.h
+
+## end gnulib module windows-mutex
+
+## begin gnulib module windows-once
+
+if GL_COND_OBJ_WINDOWS_ONCE
+libgnu_la_SOURCES += windows-once.c
+endif
+
+EXTRA_DIST += windows-once.h
+
+## end gnulib module windows-once
+
+## begin gnulib module windows-recmutex
+
+if GL_COND_OBJ_WINDOWS_RECMUTEX
+libgnu_la_SOURCES += windows-recmutex.c
+endif
+
+EXTRA_DIST += windows-initguard.h windows-recmutex.h
+
+## end gnulib module windows-recmutex
+
+## begin gnulib module windows-rwlock
+
+if GL_COND_OBJ_WINDOWS_RWLOCK
+libgnu_la_SOURCES += windows-rwlock.c
+endif
+
+EXTRA_DIST += windows-initguard.h windows-rwlock.h
+
+## end gnulib module windows-rwlock
+
+## begin gnulib module wmemchr
+
+if GL_COND_OBJ_WMEMCHR
+libgnu_la_SOURCES += wmemchr.c
+endif
+
+EXTRA_DIST += wmemchr-impl.h
+
+## end gnulib module wmemchr
+
+## begin gnulib module wmempcpy
+
+if GL_COND_OBJ_WMEMPCPY
+libgnu_la_SOURCES += wmempcpy.c
+endif
+
+## end gnulib module wmempcpy
+
+## begin gnulib module xalloc
+
+libgnu_la_SOURCES += xmalloc.c
+
+EXTRA_DIST += xalloc.h
+
+## end gnulib module xalloc
+
+## begin gnulib module xalloc-die
+
+libgnu_la_SOURCES += xalloc-die.c
+
+EXTRA_DIST += xalloc.h
+
+## end gnulib module xalloc-die
+
+## begin gnulib module xalloc-oversized
+
+
+EXTRA_DIST += xalloc-oversized.h
+
+## end gnulib module xalloc-oversized
+
+## begin gnulib module xgetcwd
+
+libgnu_la_SOURCES += xgetcwd.c
+
+EXTRA_DIST += xgetcwd.h
+
+## end gnulib module xgetcwd
+
+## begin gnulib module xlist
+
+libgnu_la_SOURCES += gl_xlist.h gl_xlist.c
+
+## end gnulib module xlist
+
+## begin gnulib module xmap
+
+libgnu_la_SOURCES += gl_xmap.h gl_xmap.c
+
+## end gnulib module xmap
+
+## begin gnulib module xset
+
+libgnu_la_SOURCES += gl_xset.h gl_xset.c
+
+## end gnulib module xset
+
+## begin gnulib module xsize
+
+libgnu_la_SOURCES += xsize.h xsize.c
+
+## end gnulib module xsize
+
+## begin gnulib module xstdopen
+
+libgnu_la_SOURCES += xstdopen.c
+
+EXTRA_DIST += xstdopen.h
+
+## end gnulib module xstdopen
+
+## begin gnulib module xstrndup
+
+libgnu_la_SOURCES += xstrndup.h xstrndup.c
+
+## end gnulib module xstrndup
+
+## begin gnulib module xvasprintf
+
+libgnu_la_SOURCES += xvasprintf.h xvasprintf.c xasprintf.c
+
+EXTRA_DIST += xalloc.h
+
+## end gnulib module xvasprintf
+
+
+mostlyclean-local: mostlyclean-generic
+ @for dir in '' $(MOSTLYCLEANDIRS); do \
+ if test -n "$$dir" && test -d $$dir; then \
+ echo "rmdir $$dir"; rmdir $$dir; \
+ fi; \
+ done; \
+ :
+distclean-local: distclean-gnulib-libobjs
+distclean-gnulib-libobjs:
+ -rm -f @gl_LIBOBJDEPS@
+maintainer-clean-local: distclean-gnulib-libobjs
diff --git a/gl/lib/Makefile.in b/gl/lib/Makefile.in
new file mode 100644
index 0000000..3caa632
--- /dev/null
+++ b/gl/lib/Makefile.in
@@ -0,0 +1,6617 @@
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
+
+# This Makefile.in 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (C) 2002-2022 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 file. If not, see <https://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License,
+# this file may be distributed as part of a program that
+# contains a configuration script generated by Autoconf, under
+# the same distribution terms as the rest of that program.
+#
+# Generated by gnulib-tool.
+# Reproduce by:
+# gnulib-tool --import --local-dir=gnulib-local \
+# --lib=libgnu \
+# --source-base=gl/lib \
+# --m4-base=gl/m4 \
+# --po-base=gl/ref-po \
+# --doc-base=doc \
+# --tests-base=tests \
+# --aux-dir=build-aux \
+# --no-conditional-dependencies \
+# --libtool \
+# --macro-prefix=gl \
+# --po-domain=man-db \
+# --no-vc-files \
+# argp \
+# array-list \
+# attribute \
+# c99 \
+# canonicalize \
+# closedir \
+# dirent \
+# dirname \
+# error \
+# fcntl-h \
+# flock \
+# fnmatch-gnu \
+# fstat \
+# getline \
+# gettext-h \
+# gitlog-to-changelog \
+# glob \
+# gnupload \
+# hash-map \
+# hash-pjw-bare \
+# hash-set \
+# havelib \
+# idpriv-drop \
+# idpriv-droptemp \
+# lchown \
+# lib-ignore \
+# linkedhash-list \
+# localcharset \
+# manywarnings \
+# memmem \
+# minmax \
+# mkdtemp \
+# mkstemp \
+# nanosleep \
+# nonblocking \
+# openat \
+# opendir \
+# progname \
+# raise \
+# rbtree-list \
+# regex \
+# rename \
+# renameat \
+# setenv \
+# sigaction \
+# signal-h \
+# sigpipe \
+# sigprocmask \
+# stat-time \
+# stdbool \
+# stpcpy \
+# strcase \
+# strcasestr \
+# strerror \
+# strsep \
+# tempname \
+# termios \
+# timespec \
+# unlinkat \
+# utimens \
+# verror \
+# warnings \
+# xalloc \
+# xgetcwd \
+# xlist \
+# xmap \
+# xset \
+# xstdopen \
+# xstrndup \
+# xvasprintf
+
+
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@GL_COND_OBJ_BTOWC_TRUE@am__append_1 = btowc.c
+@GL_COND_OBJ_CANONICALIZE_LGPL_TRUE@am__append_2 = canonicalize-lgpl.c
+@GL_COND_OBJ_CHDIR_LONG_TRUE@am__append_3 = chdir-long.c
+@GL_COND_OBJ_CHOWN_TRUE@am__append_4 = chown.c
+@GL_COND_OBJ_FCHOWN_STUB_TRUE@am__append_5 = fchown-stub.c
+@GL_COND_OBJ_CLOSE_TRUE@am__append_6 = close.c
+@GL_COND_OBJ_CLOSEDIR_TRUE@am__append_7 = closedir.c
+@GL_COND_OBJ_DIRFD_TRUE@am__append_8 = dirfd.c
+@GL_COND_OBJ_DUP_TRUE@am__append_9 = dup.c
+@GL_COND_OBJ_DUP2_TRUE@am__append_10 = dup2.c
+@GL_COND_OBJ_ERROR_TRUE@am__append_11 = error.c
+@GL_COND_OBJ_FCHDIR_TRUE@am__append_12 = fchdir.c
+@GL_COND_OBJ_FCNTL_TRUE@am__append_13 = fcntl.c
+@GL_COND_OBJ_FDOPENDIR_TRUE@am__append_14 = fdopendir.c
+@GL_COND_OBJ_FLOAT_TRUE@am__append_15 = float.c
+@GL_COND_OBJ_ITOLD_TRUE@am__append_16 = itold.c
+@GL_COND_OBJ_FLOCK_TRUE@am__append_17 = flock.c
+@GL_COND_OBJ_FREE_TRUE@am__append_18 = free.c
+@GL_COND_OBJ_FSTAT_TRUE@am__append_19 = fstat.c
+@GL_COND_OBJ_FSTATAT_TRUE@am__append_20 = fstatat.c
+@GL_COND_OBJ_GETCWD_TRUE@am__append_21 = getcwd.c
+@GL_COND_OBJ_GETCWD_LGPL_TRUE@am__append_22 = getcwd-lgpl.c
+@GL_COND_OBJ_GETDELIM_TRUE@am__append_23 = getdelim.c
+@GL_COND_OBJ_GETDTABLESIZE_TRUE@am__append_24 = getdtablesize.c
+@GL_COND_OBJ_GETLINE_TRUE@am__append_25 = getline.c
+@GL_COND_OBJ_GETLOGIN_R_TRUE@am__append_26 = getlogin_r.c
+@GL_COND_OBJ_GETOPT_TRUE@am__append_27 = getopt.c getopt1.c
+@GL_COND_OBJ_GETRANDOM_TRUE@am__append_28 = getrandom.c
+@GL_COND_OBJ_GETTIMEOFDAY_TRUE@am__append_29 = gettimeofday.c
+@GL_COND_OBJ_GLOB_TRUE@am__append_30 = glob.c globfree.c
+@GL_COND_OBJ_GLOB_PATTERN_P_TRUE@am__append_31 = glob_pattern_p.c
+@GL_COND_OBJ_IOCTL_TRUE@am__append_32 = ioctl.c
+@GL_COND_OBJ_ISBLANK_TRUE@am__append_33 = isblank.c
+@GL_COND_OBJ_LCHOWN_TRUE@am__append_34 = lchown.c
+@GL_COND_OBJ_LOCALECONV_TRUE@am__append_35 = localeconv.c
+@GL_COND_OBJ_LSTAT_TRUE@am__append_36 = lstat.c
+@GL_COND_OBJ_MBRTOWC_TRUE@am__append_37 = mbrtowc.c
+@GL_COND_OBJ_MBSINIT_TRUE@am__append_38 = mbsinit.c
+@GL_COND_OBJ_MBSRTOWCS_TRUE@am__append_39 = mbsrtowcs.c
+@GL_COND_OBJ_MBTOWC_TRUE@am__append_40 = mbtowc.c
+@GL_COND_OBJ_MEMCHR_TRUE@am__append_41 = memchr.c
+@GL_COND_OBJ_MEMPCPY_TRUE@am__append_42 = mempcpy.c
+@GL_COND_OBJ_MEMRCHR_TRUE@am__append_43 = memrchr.c
+@GL_COND_OBJ_MKDIR_TRUE@am__append_44 = mkdir.c
+@GL_COND_OBJ_MKDTEMP_TRUE@am__append_45 = mkdtemp.c
+@GL_COND_OBJ_MKSTEMP_TRUE@am__append_46 = mkstemp.c
+@GL_COND_OBJ_MSVC_INVAL_TRUE@am__append_47 = msvc-inval.c
+@GL_COND_OBJ_MSVC_NOTHROW_TRUE@am__append_48 = msvc-nothrow.c
+@GL_COND_OBJ_NANOSLEEP_TRUE@am__append_49 = nanosleep.c
+@GL_COND_OBJ_NL_LANGINFO_TRUE@am__append_50 = nl_langinfo.c
+@GL_COND_OBJ_NL_LANGINFO_LOCK_TRUE@am__append_51 = nl_langinfo-lock.c
+@GL_COND_OBJ_OPEN_TRUE@am__append_52 = open.c
+@GL_COND_OBJ_OPENAT_TRUE@am__append_53 = openat.c
+@GL_COND_OBJ_OPENDIR_TRUE@am__append_54 = opendir.c
+@GL_COND_OBJ_PIPE_TRUE@am__append_55 = pipe.c
+@GL_COND_OBJ_PSELECT_TRUE@am__append_56 = pselect.c
+@GL_COND_OBJ_PTHREAD_SIGMASK_TRUE@am__append_57 = pthread_sigmask.c
+@GL_COND_OBJ_RAISE_TRUE@am__append_58 = raise.c
+@GL_COND_OBJ_RAWMEMCHR_TRUE@am__append_59 = rawmemchr.c
+@GL_COND_OBJ_READDIR_TRUE@am__append_60 = readdir.c
+@GL_COND_OBJ_READLINK_TRUE@am__append_61 = readlink.c
+@GL_COND_OBJ_READLINKAT_TRUE@am__append_62 = readlinkat.c
+@GL_COND_OBJ_REALLOCARRAY_TRUE@am__append_63 = reallocarray.c
+@GL_COND_OBJ_REGEX_TRUE@am__append_64 = regex.c
+@GL_COND_OBJ_RENAME_TRUE@am__append_65 = rename.c
+@GL_COND_OBJ_RENAMEAT_TRUE@am__append_66 = renameat.c
+@GL_COND_OBJ_REWINDDIR_TRUE@am__append_67 = rewinddir.c
+@GL_COND_OBJ_RMDIR_TRUE@am__append_68 = rmdir.c
+@GL_COND_OBJ_SELECT_TRUE@am__append_69 = select.c
+@GL_COND_OBJ_SETENV_TRUE@am__append_70 = setenv.c
+@GL_COND_OBJ_SETLOCALE_LOCK_TRUE@am__append_71 = setlocale-lock.c
+@GL_COND_OBJ_SIGACTION_TRUE@am__append_72 = sigaction.c
+@GL_COND_OBJ_SIGPROCMASK_TRUE@am__append_73 = sigprocmask.c
+@GL_COND_OBJ_SLEEP_TRUE@am__append_74 = sleep.c
+@GL_COND_OBJ_STAT_TRUE@am__append_75 = stat.c
+@GL_COND_OBJ_STDIO_READ_TRUE@am__append_76 = stdio-read.c
+@GL_COND_OBJ_STDIO_WRITE_TRUE@am__append_77 = stdio-write.c
+@GL_COND_OBJ_STPCPY_TRUE@am__append_78 = stpcpy.c
+@GL_COND_OBJ_STRCASECMP_TRUE@am__append_79 = strcasecmp.c
+@GL_COND_OBJ_STRNCASECMP_TRUE@am__append_80 = strncasecmp.c
+@GL_COND_OBJ_STRCHRNUL_TRUE@am__append_81 = strchrnul.c
+@GL_COND_OBJ_STRDUP_TRUE@am__append_82 = strdup.c
+@GL_COND_OBJ_STRERROR_TRUE@am__append_83 = strerror.c
+@GL_COND_OBJ_STRERROR_OVERRIDE_TRUE@am__append_84 = strerror-override.c
+@GL_COND_OBJ_STRNDUP_TRUE@am__append_85 = strndup.c
+@GL_COND_OBJ_STRNLEN_TRUE@am__append_86 = strnlen.c
+@GL_COND_OBJ_STRSEP_TRUE@am__append_87 = strsep.c
+@GL_COND_OBJ_UNLINK_TRUE@am__append_88 = unlink.c
+@GL_COND_OBJ_UNLINKAT_TRUE@am__append_89 = unlinkat.c
+@GL_COND_OBJ_UTIME_TRUE@am__append_90 = utime.c
+@GL_COND_OBJ_WCRTOMB_TRUE@am__append_91 = wcrtomb.c
+@GL_COND_OBJ_WINDOWS_MUTEX_TRUE@am__append_92 = windows-mutex.c
+@GL_COND_OBJ_WINDOWS_ONCE_TRUE@am__append_93 = windows-once.c
+@GL_COND_OBJ_WINDOWS_RECMUTEX_TRUE@am__append_94 = windows-recmutex.c
+@GL_COND_OBJ_WINDOWS_RWLOCK_TRUE@am__append_95 = windows-rwlock.c
+@GL_COND_OBJ_WMEMCHR_TRUE@am__append_96 = wmemchr.c
+@GL_COND_OBJ_WMEMPCPY_TRUE@am__append_97 = wmempcpy.c
+subdir = gl/lib
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/man-arg-automatic-create.m4 \
+ $(top_srcdir)/m4/man-arg-automatic-update.m4 \
+ $(top_srcdir)/m4/man-arg-cache-owner.m4 \
+ $(top_srcdir)/m4/man-arg-cats.m4 \
+ $(top_srcdir)/m4/man-arg-config-file.m4 \
+ $(top_srcdir)/m4/man-arg-db.m4 \
+ $(top_srcdir)/m4/man-arg-device.m4 \
+ $(top_srcdir)/m4/man-arg-mandirs.m4 \
+ $(top_srcdir)/m4/man-arg-manual.m4 \
+ $(top_srcdir)/m4/man-arg-override-dir.m4 \
+ $(top_srcdir)/m4/man-arg-sections.m4 \
+ $(top_srcdir)/m4/man-arg-setuid.m4 \
+ $(top_srcdir)/m4/man-arg-snapdir.m4 \
+ $(top_srcdir)/m4/man-arg-systemdsystemunitdir.m4 \
+ $(top_srcdir)/m4/man-arg-systemdtmpfilesdir.m4 \
+ $(top_srcdir)/m4/man-arg-undoc.m4 $(top_srcdir)/m4/man-bdb.m4 \
+ $(top_srcdir)/m4/man-check-progs.m4 \
+ $(top_srcdir)/m4/man-compress-lib.m4 \
+ $(top_srcdir)/m4/man-gnu-nroff.m4 \
+ $(top_srcdir)/m4/man-heirloom-nroff.m4 \
+ $(top_srcdir)/m4/man-libseccomp.m4 \
+ $(top_srcdir)/m4/man-linguas.m4 $(top_srcdir)/m4/man-po4a.m4 \
+ $(top_srcdir)/m4/man-tar-sort-name.m4 \
+ $(top_srcdir)/m4/man-trans-subst.m4 \
+ $(top_srcdir)/gl/m4/00gnulib.m4 \
+ $(top_srcdir)/gl/m4/__inline.m4 \
+ $(top_srcdir)/gl/m4/absolute-header.m4 \
+ $(top_srcdir)/gl/m4/alloca.m4 $(top_srcdir)/gl/m4/argp.m4 \
+ $(top_srcdir)/gl/m4/asm-underscore.m4 \
+ $(top_srcdir)/gl/m4/btowc.m4 \
+ $(top_srcdir)/gl/m4/builtin-expect.m4 \
+ $(top_srcdir)/gl/m4/calloc.m4 \
+ $(top_srcdir)/gl/m4/canonicalize.m4 \
+ $(top_srcdir)/gl/m4/chdir-long.m4 $(top_srcdir)/gl/m4/chown.m4 \
+ $(top_srcdir)/gl/m4/clock_time.m4 $(top_srcdir)/gl/m4/close.m4 \
+ $(top_srcdir)/gl/m4/closedir.m4 $(top_srcdir)/gl/m4/codeset.m4 \
+ $(top_srcdir)/gl/m4/ctype_h.m4 $(top_srcdir)/gl/m4/d-ino.m4 \
+ $(top_srcdir)/gl/m4/d-type.m4 $(top_srcdir)/gl/m4/dirent_h.m4 \
+ $(top_srcdir)/gl/m4/dirfd.m4 \
+ $(top_srcdir)/gl/m4/double-slash-root.m4 \
+ $(top_srcdir)/gl/m4/dup.m4 $(top_srcdir)/gl/m4/dup2.m4 \
+ $(top_srcdir)/gl/m4/eealloc.m4 $(top_srcdir)/gl/m4/environ.m4 \
+ $(top_srcdir)/gl/m4/errno_h.m4 $(top_srcdir)/gl/m4/error.m4 \
+ $(top_srcdir)/gl/m4/exponentd.m4 \
+ $(top_srcdir)/gl/m4/extensions.m4 \
+ $(top_srcdir)/gl/m4/extern-inline.m4 \
+ $(top_srcdir)/gl/m4/fchdir.m4 $(top_srcdir)/gl/m4/fcntl-o.m4 \
+ $(top_srcdir)/gl/m4/fcntl.m4 $(top_srcdir)/gl/m4/fcntl_h.m4 \
+ $(top_srcdir)/gl/m4/fdopendir.m4 \
+ $(top_srcdir)/gl/m4/filenamecat.m4 \
+ $(top_srcdir)/gl/m4/flexmember.m4 \
+ $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/flock.m4 \
+ $(top_srcdir)/gl/m4/fnmatch.m4 \
+ $(top_srcdir)/gl/m4/fnmatch_h.m4 $(top_srcdir)/gl/m4/free.m4 \
+ $(top_srcdir)/gl/m4/fstat.m4 $(top_srcdir)/gl/m4/fstatat.m4 \
+ $(top_srcdir)/gl/m4/getcwd-abort-bug.m4 \
+ $(top_srcdir)/gl/m4/getcwd-path-max.m4 \
+ $(top_srcdir)/gl/m4/getcwd.m4 $(top_srcdir)/gl/m4/getdelim.m4 \
+ $(top_srcdir)/gl/m4/getdtablesize.m4 \
+ $(top_srcdir)/gl/m4/getline.m4 $(top_srcdir)/gl/m4/getlogin.m4 \
+ $(top_srcdir)/gl/m4/getlogin_r.m4 \
+ $(top_srcdir)/gl/m4/getopt.m4 \
+ $(top_srcdir)/gl/m4/getpagesize.m4 \
+ $(top_srcdir)/gl/m4/getprogname.m4 \
+ $(top_srcdir)/gl/m4/getrandom.m4 \
+ $(top_srcdir)/gl/m4/gettext.m4 $(top_srcdir)/gl/m4/gettime.m4 \
+ $(top_srcdir)/gl/m4/gettimeofday.m4 \
+ $(top_srcdir)/gl/m4/glob.m4 $(top_srcdir)/gl/m4/glob_h.m4 \
+ $(top_srcdir)/gl/m4/gnulib-common.m4 \
+ $(top_srcdir)/gl/m4/gnulib-comp.m4 \
+ $(top_srcdir)/gl/m4/host-cpu-c-abi.m4 \
+ $(top_srcdir)/gl/m4/iconv.m4 $(top_srcdir)/gl/m4/idpriv.m4 \
+ $(top_srcdir)/gl/m4/include_next.m4 \
+ $(top_srcdir)/gl/m4/intlmacosx.m4 \
+ $(top_srcdir)/gl/m4/intmax_t.m4 \
+ $(top_srcdir)/gl/m4/inttypes.m4 \
+ $(top_srcdir)/gl/m4/inttypes_h.m4 $(top_srcdir)/gl/m4/ioctl.m4 \
+ $(top_srcdir)/gl/m4/isblank.m4 \
+ $(top_srcdir)/gl/m4/langinfo_h.m4 \
+ $(top_srcdir)/gl/m4/largefile.m4 $(top_srcdir)/gl/m4/lchown.m4 \
+ $(top_srcdir)/gl/m4/lib-ignore.m4 \
+ $(top_srcdir)/gl/m4/lib-ld.m4 $(top_srcdir)/gl/m4/lib-link.m4 \
+ $(top_srcdir)/gl/m4/lib-prefix.m4 \
+ $(top_srcdir)/gl/m4/libtool.m4 $(top_srcdir)/gl/m4/limits-h.m4 \
+ $(top_srcdir)/gl/m4/localcharset.m4 \
+ $(top_srcdir)/gl/m4/locale-fr.m4 \
+ $(top_srcdir)/gl/m4/locale-ja.m4 \
+ $(top_srcdir)/gl/m4/locale-zh.m4 \
+ $(top_srcdir)/gl/m4/locale_h.m4 \
+ $(top_srcdir)/gl/m4/localeconv.m4 $(top_srcdir)/gl/m4/lock.m4 \
+ $(top_srcdir)/gl/m4/lstat.m4 $(top_srcdir)/gl/m4/ltoptions.m4 \
+ $(top_srcdir)/gl/m4/ltsugar.m4 \
+ $(top_srcdir)/gl/m4/ltversion.m4 \
+ $(top_srcdir)/gl/m4/lt~obsolete.m4 \
+ $(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/malloca.m4 \
+ $(top_srcdir)/gl/m4/manywarnings.m4 \
+ $(top_srcdir)/gl/m4/mbrtowc.m4 $(top_srcdir)/gl/m4/mbsinit.m4 \
+ $(top_srcdir)/gl/m4/mbsrtowcs.m4 \
+ $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mbtowc.m4 \
+ $(top_srcdir)/gl/m4/memchr.m4 $(top_srcdir)/gl/m4/memmem.m4 \
+ $(top_srcdir)/gl/m4/mempcpy.m4 $(top_srcdir)/gl/m4/memrchr.m4 \
+ $(top_srcdir)/gl/m4/minmax.m4 $(top_srcdir)/gl/m4/mkdir.m4 \
+ $(top_srcdir)/gl/m4/mkdtemp.m4 $(top_srcdir)/gl/m4/mkstemp.m4 \
+ $(top_srcdir)/gl/m4/mmap-anon.m4 $(top_srcdir)/gl/m4/mode_t.m4 \
+ $(top_srcdir)/gl/m4/msvc-inval.m4 \
+ $(top_srcdir)/gl/m4/msvc-nothrow.m4 \
+ $(top_srcdir)/gl/m4/multiarch.m4 \
+ $(top_srcdir)/gl/m4/nanosleep.m4 \
+ $(top_srcdir)/gl/m4/nl_langinfo.m4 $(top_srcdir)/gl/m4/nls.m4 \
+ $(top_srcdir)/gl/m4/nocrash.m4 \
+ $(top_srcdir)/gl/m4/nonblocking.m4 \
+ $(top_srcdir)/gl/m4/off_t.m4 \
+ $(top_srcdir)/gl/m4/open-cloexec.m4 \
+ $(top_srcdir)/gl/m4/open-slash.m4 $(top_srcdir)/gl/m4/open.m4 \
+ $(top_srcdir)/gl/m4/openat.m4 $(top_srcdir)/gl/m4/opendir.m4 \
+ $(top_srcdir)/gl/m4/pathmax.m4 $(top_srcdir)/gl/m4/pipe.m4 \
+ $(top_srcdir)/gl/m4/po.m4 $(top_srcdir)/gl/m4/printf.m4 \
+ $(top_srcdir)/gl/m4/progtest.m4 $(top_srcdir)/gl/m4/pselect.m4 \
+ $(top_srcdir)/gl/m4/pthread_rwlock_rdlock.m4 \
+ $(top_srcdir)/gl/m4/pthread_sigmask.m4 \
+ $(top_srcdir)/gl/m4/raise.m4 $(top_srcdir)/gl/m4/rawmemchr.m4 \
+ $(top_srcdir)/gl/m4/readdir.m4 $(top_srcdir)/gl/m4/readlink.m4 \
+ $(top_srcdir)/gl/m4/readlinkat.m4 \
+ $(top_srcdir)/gl/m4/realloc.m4 \
+ $(top_srcdir)/gl/m4/reallocarray.m4 \
+ $(top_srcdir)/gl/m4/regex.m4 $(top_srcdir)/gl/m4/rename.m4 \
+ $(top_srcdir)/gl/m4/renameat.m4 \
+ $(top_srcdir)/gl/m4/rewinddir.m4 $(top_srcdir)/gl/m4/rmdir.m4 \
+ $(top_srcdir)/gl/m4/save-cwd.m4 $(top_srcdir)/gl/m4/select.m4 \
+ $(top_srcdir)/gl/m4/setenv.m4 \
+ $(top_srcdir)/gl/m4/setlocale_null.m4 \
+ $(top_srcdir)/gl/m4/sigaction.m4 \
+ $(top_srcdir)/gl/m4/signal_h.m4 \
+ $(top_srcdir)/gl/m4/signalblocking.m4 \
+ $(top_srcdir)/gl/m4/sigpipe.m4 $(top_srcdir)/gl/m4/size_max.m4 \
+ $(top_srcdir)/gl/m4/sleep.m4 $(top_srcdir)/gl/m4/socketlib.m4 \
+ $(top_srcdir)/gl/m4/sockets.m4 $(top_srcdir)/gl/m4/socklen.m4 \
+ $(top_srcdir)/gl/m4/ssize_t.m4 \
+ $(top_srcdir)/gl/m4/stat-time.m4 $(top_srcdir)/gl/m4/stat.m4 \
+ $(top_srcdir)/gl/m4/stdalign.m4 $(top_srcdir)/gl/m4/stdarg.m4 \
+ $(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stddef_h.m4 \
+ $(top_srcdir)/gl/m4/stdint.m4 $(top_srcdir)/gl/m4/stdint_h.m4 \
+ $(top_srcdir)/gl/m4/stdio_h.m4 $(top_srcdir)/gl/m4/stdlib_h.m4 \
+ $(top_srcdir)/gl/m4/stpcpy.m4 $(top_srcdir)/gl/m4/strcase.m4 \
+ $(top_srcdir)/gl/m4/strcasestr.m4 \
+ $(top_srcdir)/gl/m4/strchrnul.m4 $(top_srcdir)/gl/m4/strdup.m4 \
+ $(top_srcdir)/gl/m4/strerror.m4 \
+ $(top_srcdir)/gl/m4/string_h.m4 \
+ $(top_srcdir)/gl/m4/strings_h.m4 \
+ $(top_srcdir)/gl/m4/strndup.m4 $(top_srcdir)/gl/m4/strnlen.m4 \
+ $(top_srcdir)/gl/m4/strsep.m4 \
+ $(top_srcdir)/gl/m4/sys_file_h.m4 \
+ $(top_srcdir)/gl/m4/sys_ioctl_h.m4 \
+ $(top_srcdir)/gl/m4/sys_random_h.m4 \
+ $(top_srcdir)/gl/m4/sys_select_h.m4 \
+ $(top_srcdir)/gl/m4/sys_socket_h.m4 \
+ $(top_srcdir)/gl/m4/sys_stat_h.m4 \
+ $(top_srcdir)/gl/m4/sys_time_h.m4 \
+ $(top_srcdir)/gl/m4/sys_types_h.m4 \
+ $(top_srcdir)/gl/m4/sys_uio_h.m4 \
+ $(top_srcdir)/gl/m4/sysexits.m4 \
+ $(top_srcdir)/gl/m4/tempname.m4 \
+ $(top_srcdir)/gl/m4/termios_h.m4 \
+ $(top_srcdir)/gl/m4/threadlib.m4 $(top_srcdir)/gl/m4/time_h.m4 \
+ $(top_srcdir)/gl/m4/timespec.m4 \
+ $(top_srcdir)/gl/m4/unistd-safer.m4 \
+ $(top_srcdir)/gl/m4/unistd_h.m4 $(top_srcdir)/gl/m4/unlink.m4 \
+ $(top_srcdir)/gl/m4/unlinkat.m4 $(top_srcdir)/gl/m4/utime.m4 \
+ $(top_srcdir)/gl/m4/utime_h.m4 $(top_srcdir)/gl/m4/utimens.m4 \
+ $(top_srcdir)/gl/m4/utimes.m4 \
+ $(top_srcdir)/gl/m4/vasnprintf.m4 \
+ $(top_srcdir)/gl/m4/vasprintf.m4 \
+ $(top_srcdir)/gl/m4/visibility.m4 \
+ $(top_srcdir)/gl/m4/vsnprintf.m4 \
+ $(top_srcdir)/gl/m4/warn-on-use.m4 \
+ $(top_srcdir)/gl/m4/warnings.m4 $(top_srcdir)/gl/m4/wchar_h.m4 \
+ $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wcrtomb.m4 \
+ $(top_srcdir)/gl/m4/wctype_h.m4 $(top_srcdir)/gl/m4/wint_t.m4 \
+ $(top_srcdir)/gl/m4/wmemchr.m4 $(top_srcdir)/gl/m4/wmempcpy.m4 \
+ $(top_srcdir)/gl/m4/xalloc.m4 $(top_srcdir)/gl/m4/xgetcwd.m4 \
+ $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/xstrndup.m4 \
+ $(top_srcdir)/gl/m4/xvasprintf.m4 \
+ $(top_srcdir)/gl/m4/year2038.m4 \
+ $(top_srcdir)/gl/m4/zzgnulib.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
+ $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+am__libgnu_la_SOURCES_DIST = argp.h argp-ba.c argp-eexst.c \
+ argp-fmtstream.c argp-fmtstream.h argp-fs-xinl.c argp-help.c \
+ argp-namefrob.h argp-parse.c argp-pin.c argp-pv.c argp-pvh.c \
+ argp-xinl.c gl_array_list.h gl_array_list.c openat-priv.h \
+ openat-proc.c basename-lgpl.c bitrotate.h bitrotate.c btowc.c \
+ canonicalize.c canonicalize-lgpl.c chdir-long.c chown.c \
+ fchown-stub.c cloexec.c close.c closedir.c dirfd.c dirname.c \
+ basename.c dirname-lgpl.c stripslash.c dup.c dup2.c \
+ malloc/dynarray_at_failure.c malloc/dynarray_emplace_enlarge.c \
+ malloc/dynarray_finalize.c malloc/dynarray_resize.c \
+ malloc/dynarray_resize_clear.c error.c exitfail.c fchdir.c \
+ fcntl.c fd-hook.c fd-safer-flag.c dup-safer-flag.c fdopendir.c \
+ file-set.c filenamecat-lgpl.c float.c itold.c flock.c free.c \
+ fstat.c fstatat.c getcwd.c getcwd-lgpl.c getdelim.c \
+ getdtablesize.c getline.c getlogin_r.c getopt.c getopt1.c \
+ getprogname.h getprogname.c getrandom.c gettext.h gettime.c \
+ gettimeofday.c glob.c globfree.c glob_pattern_p.c \
+ hard-locale.c hash.c gl_hash_map.h gl_hash_map.c gl_anyhash1.h \
+ gl_anyhash2.h gl_anyhash_primes.h hash-pjw.h hash-pjw.c \
+ hash-pjw-bare.h hash-pjw-bare.c gl_hash_set.h gl_hash_set.c \
+ hash-triple-simple.c ialloc.c idpriv-drop.c idpriv-droptemp.c \
+ idx.h ioctl.c isblank.c lchown.c gl_linkedhash_list.h \
+ gl_linkedhash_list.c gl_anylinked_list1.h gl_anylinked_list2.h \
+ gl_list.h gl_list.c localcharset.c localeconv.c \
+ glthread/lock.h glthread/lock.c lstat.c malloca.c gl_map.h \
+ gl_map.c mbrtowc.c mbsinit.c mbsrtowcs.c mbtowc.c memchr.c \
+ mempcpy.c memrchr.c minmax.h mkdir.c mkdtemp.c mkstemp.c \
+ msvc-inval.c msvc-nothrow.c nanosleep.c nl_langinfo.c \
+ nl_langinfo-lock.c nonblocking.c open.c openat.c openat-die.c \
+ opendir.c pipe.c progname.h progname.c pselect.c \
+ pthread_sigmask.c raise.c rawmemchr.c gl_rbtree_list.h \
+ gl_rbtree_list.c gl_anyrbtree_list1.h gl_anyrbtree_list2.h \
+ gl_anytree_list1.h gl_anytree_list2.h readdir.c readlink.c \
+ readlinkat.c reallocarray.c regex.c rename.c renameat.c \
+ renameatu.c rewinddir.c rmdir.c save-cwd.c \
+ malloc/scratch_buffer_dupfree.c malloc/scratch_buffer_grow.c \
+ malloc/scratch_buffer_grow_preserve.c \
+ malloc/scratch_buffer_set_array_size.c select.c gl_set.h \
+ gl_set.c setenv.c setlocale_null.c setlocale-lock.c \
+ sigaction.c sig-handler.c sigprocmask.c size_max.h sleep.c \
+ sockets.h sockets.c stat.c stat-time.c stdio-read.c \
+ stdio-write.c stdopen.c stpcpy.c strcasecmp.c strncasecmp.c \
+ strchrnul.c strdup.c strerror.c strerror-override.c strndup.c \
+ strnlen.c strnlen1.h strnlen1.c strsep.c sys_socket.c \
+ tempname.c glthread/threadlib.c timespec.c unistd.c \
+ dup-safer.c fd-safer.c pipe-safer.c unlink.c unlinkat.c \
+ utime.c utimens.c verror.h verror.c wcrtomb.c wctype-h.c \
+ windows-mutex.c windows-once.c windows-recmutex.c \
+ windows-rwlock.c wmemchr.c wmempcpy.c xmalloc.c xalloc-die.c \
+ xgetcwd.c gl_xlist.h gl_xlist.c gl_xmap.h gl_xmap.c gl_xset.h \
+ gl_xset.c xsize.h xsize.c xstdopen.c xstrndup.h xstrndup.c \
+ xvasprintf.h xvasprintf.c xasprintf.c
+@GL_COND_OBJ_BTOWC_TRUE@am__objects_1 = libgnu_la-btowc.lo
+@GL_COND_OBJ_CANONICALIZE_LGPL_TRUE@am__objects_2 = libgnu_la-canonicalize-lgpl.lo
+@GL_COND_OBJ_CHDIR_LONG_TRUE@am__objects_3 = libgnu_la-chdir-long.lo
+@GL_COND_OBJ_CHOWN_TRUE@am__objects_4 = libgnu_la-chown.lo
+@GL_COND_OBJ_FCHOWN_STUB_TRUE@am__objects_5 = \
+@GL_COND_OBJ_FCHOWN_STUB_TRUE@ libgnu_la-fchown-stub.lo
+@GL_COND_OBJ_CLOSE_TRUE@am__objects_6 = libgnu_la-close.lo
+@GL_COND_OBJ_CLOSEDIR_TRUE@am__objects_7 = libgnu_la-closedir.lo
+@GL_COND_OBJ_DIRFD_TRUE@am__objects_8 = libgnu_la-dirfd.lo
+@GL_COND_OBJ_DUP_TRUE@am__objects_9 = libgnu_la-dup.lo
+@GL_COND_OBJ_DUP2_TRUE@am__objects_10 = libgnu_la-dup2.lo
+am__dirstamp = $(am__leading_dot)dirstamp
+@GL_COND_OBJ_ERROR_TRUE@am__objects_11 = libgnu_la-error.lo
+@GL_COND_OBJ_FCHDIR_TRUE@am__objects_12 = libgnu_la-fchdir.lo
+@GL_COND_OBJ_FCNTL_TRUE@am__objects_13 = libgnu_la-fcntl.lo
+@GL_COND_OBJ_FDOPENDIR_TRUE@am__objects_14 = libgnu_la-fdopendir.lo
+@GL_COND_OBJ_FLOAT_TRUE@am__objects_15 = libgnu_la-float.lo
+@GL_COND_OBJ_ITOLD_TRUE@am__objects_16 = libgnu_la-itold.lo
+@GL_COND_OBJ_FLOCK_TRUE@am__objects_17 = libgnu_la-flock.lo
+@GL_COND_OBJ_FREE_TRUE@am__objects_18 = libgnu_la-free.lo
+@GL_COND_OBJ_FSTAT_TRUE@am__objects_19 = libgnu_la-fstat.lo
+@GL_COND_OBJ_FSTATAT_TRUE@am__objects_20 = libgnu_la-fstatat.lo
+@GL_COND_OBJ_GETCWD_TRUE@am__objects_21 = libgnu_la-getcwd.lo
+@GL_COND_OBJ_GETCWD_LGPL_TRUE@am__objects_22 = \
+@GL_COND_OBJ_GETCWD_LGPL_TRUE@ libgnu_la-getcwd-lgpl.lo
+@GL_COND_OBJ_GETDELIM_TRUE@am__objects_23 = libgnu_la-getdelim.lo
+@GL_COND_OBJ_GETDTABLESIZE_TRUE@am__objects_24 = \
+@GL_COND_OBJ_GETDTABLESIZE_TRUE@ libgnu_la-getdtablesize.lo
+@GL_COND_OBJ_GETLINE_TRUE@am__objects_25 = libgnu_la-getline.lo
+@GL_COND_OBJ_GETLOGIN_R_TRUE@am__objects_26 = libgnu_la-getlogin_r.lo
+@GL_COND_OBJ_GETOPT_TRUE@am__objects_27 = libgnu_la-getopt.lo \
+@GL_COND_OBJ_GETOPT_TRUE@ libgnu_la-getopt1.lo
+@GL_COND_OBJ_GETRANDOM_TRUE@am__objects_28 = libgnu_la-getrandom.lo
+@GL_COND_OBJ_GETTIMEOFDAY_TRUE@am__objects_29 = \
+@GL_COND_OBJ_GETTIMEOFDAY_TRUE@ libgnu_la-gettimeofday.lo
+@GL_COND_OBJ_GLOB_TRUE@am__objects_30 = libgnu_la-glob.lo \
+@GL_COND_OBJ_GLOB_TRUE@ libgnu_la-globfree.lo
+@GL_COND_OBJ_GLOB_PATTERN_P_TRUE@am__objects_31 = \
+@GL_COND_OBJ_GLOB_PATTERN_P_TRUE@ libgnu_la-glob_pattern_p.lo
+@GL_COND_OBJ_IOCTL_TRUE@am__objects_32 = libgnu_la-ioctl.lo
+@GL_COND_OBJ_ISBLANK_TRUE@am__objects_33 = libgnu_la-isblank.lo
+@GL_COND_OBJ_LCHOWN_TRUE@am__objects_34 = libgnu_la-lchown.lo
+@GL_COND_OBJ_LOCALECONV_TRUE@am__objects_35 = libgnu_la-localeconv.lo
+@GL_COND_OBJ_LSTAT_TRUE@am__objects_36 = libgnu_la-lstat.lo
+@GL_COND_OBJ_MBRTOWC_TRUE@am__objects_37 = libgnu_la-mbrtowc.lo
+@GL_COND_OBJ_MBSINIT_TRUE@am__objects_38 = libgnu_la-mbsinit.lo
+@GL_COND_OBJ_MBSRTOWCS_TRUE@am__objects_39 = libgnu_la-mbsrtowcs.lo
+@GL_COND_OBJ_MBTOWC_TRUE@am__objects_40 = libgnu_la-mbtowc.lo
+@GL_COND_OBJ_MEMCHR_TRUE@am__objects_41 = libgnu_la-memchr.lo
+@GL_COND_OBJ_MEMPCPY_TRUE@am__objects_42 = libgnu_la-mempcpy.lo
+@GL_COND_OBJ_MEMRCHR_TRUE@am__objects_43 = libgnu_la-memrchr.lo
+@GL_COND_OBJ_MKDIR_TRUE@am__objects_44 = libgnu_la-mkdir.lo
+@GL_COND_OBJ_MKDTEMP_TRUE@am__objects_45 = libgnu_la-mkdtemp.lo
+@GL_COND_OBJ_MKSTEMP_TRUE@am__objects_46 = libgnu_la-mkstemp.lo
+@GL_COND_OBJ_MSVC_INVAL_TRUE@am__objects_47 = libgnu_la-msvc-inval.lo
+@GL_COND_OBJ_MSVC_NOTHROW_TRUE@am__objects_48 = \
+@GL_COND_OBJ_MSVC_NOTHROW_TRUE@ libgnu_la-msvc-nothrow.lo
+@GL_COND_OBJ_NANOSLEEP_TRUE@am__objects_49 = libgnu_la-nanosleep.lo
+@GL_COND_OBJ_NL_LANGINFO_TRUE@am__objects_50 = \
+@GL_COND_OBJ_NL_LANGINFO_TRUE@ libgnu_la-nl_langinfo.lo
+@GL_COND_OBJ_NL_LANGINFO_LOCK_TRUE@am__objects_51 = libgnu_la-nl_langinfo-lock.lo
+@GL_COND_OBJ_OPEN_TRUE@am__objects_52 = libgnu_la-open.lo
+@GL_COND_OBJ_OPENAT_TRUE@am__objects_53 = libgnu_la-openat.lo
+@GL_COND_OBJ_OPENDIR_TRUE@am__objects_54 = libgnu_la-opendir.lo
+@GL_COND_OBJ_PIPE_TRUE@am__objects_55 = libgnu_la-pipe.lo
+@GL_COND_OBJ_PSELECT_TRUE@am__objects_56 = libgnu_la-pselect.lo
+@GL_COND_OBJ_PTHREAD_SIGMASK_TRUE@am__objects_57 = libgnu_la-pthread_sigmask.lo
+@GL_COND_OBJ_RAISE_TRUE@am__objects_58 = libgnu_la-raise.lo
+@GL_COND_OBJ_RAWMEMCHR_TRUE@am__objects_59 = libgnu_la-rawmemchr.lo
+@GL_COND_OBJ_READDIR_TRUE@am__objects_60 = libgnu_la-readdir.lo
+@GL_COND_OBJ_READLINK_TRUE@am__objects_61 = libgnu_la-readlink.lo
+@GL_COND_OBJ_READLINKAT_TRUE@am__objects_62 = libgnu_la-readlinkat.lo
+@GL_COND_OBJ_REALLOCARRAY_TRUE@am__objects_63 = \
+@GL_COND_OBJ_REALLOCARRAY_TRUE@ libgnu_la-reallocarray.lo
+@GL_COND_OBJ_REGEX_TRUE@am__objects_64 = libgnu_la-regex.lo
+@GL_COND_OBJ_RENAME_TRUE@am__objects_65 = libgnu_la-rename.lo
+@GL_COND_OBJ_RENAMEAT_TRUE@am__objects_66 = libgnu_la-renameat.lo
+@GL_COND_OBJ_REWINDDIR_TRUE@am__objects_67 = libgnu_la-rewinddir.lo
+@GL_COND_OBJ_RMDIR_TRUE@am__objects_68 = libgnu_la-rmdir.lo
+@GL_COND_OBJ_SELECT_TRUE@am__objects_69 = libgnu_la-select.lo
+@GL_COND_OBJ_SETENV_TRUE@am__objects_70 = libgnu_la-setenv.lo
+@GL_COND_OBJ_SETLOCALE_LOCK_TRUE@am__objects_71 = \
+@GL_COND_OBJ_SETLOCALE_LOCK_TRUE@ libgnu_la-setlocale-lock.lo
+@GL_COND_OBJ_SIGACTION_TRUE@am__objects_72 = libgnu_la-sigaction.lo
+@GL_COND_OBJ_SIGPROCMASK_TRUE@am__objects_73 = \
+@GL_COND_OBJ_SIGPROCMASK_TRUE@ libgnu_la-sigprocmask.lo
+@GL_COND_OBJ_SLEEP_TRUE@am__objects_74 = libgnu_la-sleep.lo
+@GL_COND_OBJ_STAT_TRUE@am__objects_75 = libgnu_la-stat.lo
+@GL_COND_OBJ_STDIO_READ_TRUE@am__objects_76 = libgnu_la-stdio-read.lo
+@GL_COND_OBJ_STDIO_WRITE_TRUE@am__objects_77 = \
+@GL_COND_OBJ_STDIO_WRITE_TRUE@ libgnu_la-stdio-write.lo
+@GL_COND_OBJ_STPCPY_TRUE@am__objects_78 = libgnu_la-stpcpy.lo
+@GL_COND_OBJ_STRCASECMP_TRUE@am__objects_79 = libgnu_la-strcasecmp.lo
+@GL_COND_OBJ_STRNCASECMP_TRUE@am__objects_80 = \
+@GL_COND_OBJ_STRNCASECMP_TRUE@ libgnu_la-strncasecmp.lo
+@GL_COND_OBJ_STRCHRNUL_TRUE@am__objects_81 = libgnu_la-strchrnul.lo
+@GL_COND_OBJ_STRDUP_TRUE@am__objects_82 = libgnu_la-strdup.lo
+@GL_COND_OBJ_STRERROR_TRUE@am__objects_83 = libgnu_la-strerror.lo
+@GL_COND_OBJ_STRERROR_OVERRIDE_TRUE@am__objects_84 = libgnu_la-strerror-override.lo
+@GL_COND_OBJ_STRNDUP_TRUE@am__objects_85 = libgnu_la-strndup.lo
+@GL_COND_OBJ_STRNLEN_TRUE@am__objects_86 = libgnu_la-strnlen.lo
+@GL_COND_OBJ_STRSEP_TRUE@am__objects_87 = libgnu_la-strsep.lo
+@GL_COND_OBJ_UNLINK_TRUE@am__objects_88 = libgnu_la-unlink.lo
+@GL_COND_OBJ_UNLINKAT_TRUE@am__objects_89 = libgnu_la-unlinkat.lo
+@GL_COND_OBJ_UTIME_TRUE@am__objects_90 = libgnu_la-utime.lo
+@GL_COND_OBJ_WCRTOMB_TRUE@am__objects_91 = libgnu_la-wcrtomb.lo
+@GL_COND_OBJ_WINDOWS_MUTEX_TRUE@am__objects_92 = \
+@GL_COND_OBJ_WINDOWS_MUTEX_TRUE@ libgnu_la-windows-mutex.lo
+@GL_COND_OBJ_WINDOWS_ONCE_TRUE@am__objects_93 = \
+@GL_COND_OBJ_WINDOWS_ONCE_TRUE@ libgnu_la-windows-once.lo
+@GL_COND_OBJ_WINDOWS_RECMUTEX_TRUE@am__objects_94 = libgnu_la-windows-recmutex.lo
+@GL_COND_OBJ_WINDOWS_RWLOCK_TRUE@am__objects_95 = \
+@GL_COND_OBJ_WINDOWS_RWLOCK_TRUE@ libgnu_la-windows-rwlock.lo
+@GL_COND_OBJ_WMEMCHR_TRUE@am__objects_96 = libgnu_la-wmemchr.lo
+@GL_COND_OBJ_WMEMPCPY_TRUE@am__objects_97 = libgnu_la-wmempcpy.lo
+am_libgnu_la_OBJECTS = libgnu_la-argp-ba.lo libgnu_la-argp-eexst.lo \
+ libgnu_la-argp-fmtstream.lo libgnu_la-argp-fs-xinl.lo \
+ libgnu_la-argp-help.lo libgnu_la-argp-parse.lo \
+ libgnu_la-argp-pin.lo libgnu_la-argp-pv.lo \
+ libgnu_la-argp-pvh.lo libgnu_la-argp-xinl.lo \
+ libgnu_la-gl_array_list.lo libgnu_la-openat-proc.lo \
+ libgnu_la-basename-lgpl.lo libgnu_la-bitrotate.lo \
+ $(am__objects_1) libgnu_la-canonicalize.lo $(am__objects_2) \
+ $(am__objects_3) $(am__objects_4) $(am__objects_5) \
+ libgnu_la-cloexec.lo $(am__objects_6) $(am__objects_7) \
+ $(am__objects_8) libgnu_la-dirname.lo libgnu_la-basename.lo \
+ libgnu_la-dirname-lgpl.lo libgnu_la-stripslash.lo \
+ $(am__objects_9) $(am__objects_10) \
+ malloc/libgnu_la-dynarray_at_failure.lo \
+ malloc/libgnu_la-dynarray_emplace_enlarge.lo \
+ malloc/libgnu_la-dynarray_finalize.lo \
+ malloc/libgnu_la-dynarray_resize.lo \
+ malloc/libgnu_la-dynarray_resize_clear.lo $(am__objects_11) \
+ libgnu_la-exitfail.lo $(am__objects_12) $(am__objects_13) \
+ libgnu_la-fd-hook.lo libgnu_la-fd-safer-flag.lo \
+ libgnu_la-dup-safer-flag.lo $(am__objects_14) \
+ libgnu_la-file-set.lo libgnu_la-filenamecat-lgpl.lo \
+ $(am__objects_15) $(am__objects_16) $(am__objects_17) \
+ $(am__objects_18) $(am__objects_19) $(am__objects_20) \
+ $(am__objects_21) $(am__objects_22) $(am__objects_23) \
+ $(am__objects_24) $(am__objects_25) $(am__objects_26) \
+ $(am__objects_27) libgnu_la-getprogname.lo $(am__objects_28) \
+ libgnu_la-gettime.lo $(am__objects_29) $(am__objects_30) \
+ $(am__objects_31) libgnu_la-hard-locale.lo libgnu_la-hash.lo \
+ libgnu_la-gl_hash_map.lo libgnu_la-hash-pjw.lo \
+ libgnu_la-hash-pjw-bare.lo libgnu_la-gl_hash_set.lo \
+ libgnu_la-hash-triple-simple.lo libgnu_la-ialloc.lo \
+ libgnu_la-idpriv-drop.lo libgnu_la-idpriv-droptemp.lo \
+ $(am__objects_32) $(am__objects_33) $(am__objects_34) \
+ libgnu_la-gl_linkedhash_list.lo libgnu_la-gl_list.lo \
+ libgnu_la-localcharset.lo $(am__objects_35) \
+ glthread/libgnu_la-lock.lo $(am__objects_36) \
+ libgnu_la-malloca.lo libgnu_la-gl_map.lo $(am__objects_37) \
+ $(am__objects_38) $(am__objects_39) $(am__objects_40) \
+ $(am__objects_41) $(am__objects_42) $(am__objects_43) \
+ $(am__objects_44) $(am__objects_45) $(am__objects_46) \
+ $(am__objects_47) $(am__objects_48) $(am__objects_49) \
+ $(am__objects_50) $(am__objects_51) libgnu_la-nonblocking.lo \
+ $(am__objects_52) $(am__objects_53) libgnu_la-openat-die.lo \
+ $(am__objects_54) $(am__objects_55) libgnu_la-progname.lo \
+ $(am__objects_56) $(am__objects_57) $(am__objects_58) \
+ $(am__objects_59) libgnu_la-gl_rbtree_list.lo \
+ $(am__objects_60) $(am__objects_61) $(am__objects_62) \
+ $(am__objects_63) $(am__objects_64) $(am__objects_65) \
+ $(am__objects_66) libgnu_la-renameatu.lo $(am__objects_67) \
+ $(am__objects_68) libgnu_la-save-cwd.lo \
+ malloc/libgnu_la-scratch_buffer_dupfree.lo \
+ malloc/libgnu_la-scratch_buffer_grow.lo \
+ malloc/libgnu_la-scratch_buffer_grow_preserve.lo \
+ malloc/libgnu_la-scratch_buffer_set_array_size.lo \
+ $(am__objects_69) libgnu_la-gl_set.lo $(am__objects_70) \
+ libgnu_la-setlocale_null.lo $(am__objects_71) \
+ $(am__objects_72) libgnu_la-sig-handler.lo $(am__objects_73) \
+ $(am__objects_74) libgnu_la-sockets.lo $(am__objects_75) \
+ libgnu_la-stat-time.lo $(am__objects_76) $(am__objects_77) \
+ libgnu_la-stdopen.lo $(am__objects_78) $(am__objects_79) \
+ $(am__objects_80) $(am__objects_81) $(am__objects_82) \
+ $(am__objects_83) $(am__objects_84) $(am__objects_85) \
+ $(am__objects_86) libgnu_la-strnlen1.lo $(am__objects_87) \
+ libgnu_la-sys_socket.lo libgnu_la-tempname.lo \
+ glthread/libgnu_la-threadlib.lo libgnu_la-timespec.lo \
+ libgnu_la-unistd.lo libgnu_la-dup-safer.lo \
+ libgnu_la-fd-safer.lo libgnu_la-pipe-safer.lo \
+ $(am__objects_88) $(am__objects_89) $(am__objects_90) \
+ libgnu_la-utimens.lo libgnu_la-verror.lo $(am__objects_91) \
+ libgnu_la-wctype-h.lo $(am__objects_92) $(am__objects_93) \
+ $(am__objects_94) $(am__objects_95) $(am__objects_96) \
+ $(am__objects_97) libgnu_la-xmalloc.lo libgnu_la-xalloc-die.lo \
+ libgnu_la-xgetcwd.lo libgnu_la-gl_xlist.lo \
+ libgnu_la-gl_xmap.lo libgnu_la-gl_xset.lo libgnu_la-xsize.lo \
+ libgnu_la-xstdopen.lo libgnu_la-xstrndup.lo \
+ libgnu_la-xvasprintf.lo libgnu_la-xasprintf.lo
+libgnu_la_OBJECTS = $(am_libgnu_la_OBJECTS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+libgnu_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libgnu_la_CFLAGS) \
+ $(CFLAGS) $(libgnu_la_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/alloca.Plo \
+ ./$(DEPDIR)/libgnu_la-alloca.Plo \
+ ./$(DEPDIR)/libgnu_la-argp-ba.Plo \
+ ./$(DEPDIR)/libgnu_la-argp-eexst.Plo \
+ ./$(DEPDIR)/libgnu_la-argp-fmtstream.Plo \
+ ./$(DEPDIR)/libgnu_la-argp-fs-xinl.Plo \
+ ./$(DEPDIR)/libgnu_la-argp-help.Plo \
+ ./$(DEPDIR)/libgnu_la-argp-parse.Plo \
+ ./$(DEPDIR)/libgnu_la-argp-pin.Plo \
+ ./$(DEPDIR)/libgnu_la-argp-pv.Plo \
+ ./$(DEPDIR)/libgnu_la-argp-pvh.Plo \
+ ./$(DEPDIR)/libgnu_la-argp-xinl.Plo \
+ ./$(DEPDIR)/libgnu_la-asnprintf.Plo \
+ ./$(DEPDIR)/libgnu_la-asprintf.Plo \
+ ./$(DEPDIR)/libgnu_la-at-func.Plo \
+ ./$(DEPDIR)/libgnu_la-at-func2.Plo \
+ ./$(DEPDIR)/libgnu_la-basename-lgpl.Plo \
+ ./$(DEPDIR)/libgnu_la-basename.Plo \
+ ./$(DEPDIR)/libgnu_la-bitrotate.Plo \
+ ./$(DEPDIR)/libgnu_la-btowc.Plo \
+ ./$(DEPDIR)/libgnu_la-calloc.Plo \
+ ./$(DEPDIR)/libgnu_la-canonicalize-lgpl.Plo \
+ ./$(DEPDIR)/libgnu_la-canonicalize.Plo \
+ ./$(DEPDIR)/libgnu_la-chdir-long.Plo \
+ ./$(DEPDIR)/libgnu_la-chown.Plo \
+ ./$(DEPDIR)/libgnu_la-cloexec.Plo \
+ ./$(DEPDIR)/libgnu_la-close.Plo \
+ ./$(DEPDIR)/libgnu_la-closedir.Plo \
+ ./$(DEPDIR)/libgnu_la-dirfd.Plo \
+ ./$(DEPDIR)/libgnu_la-dirname-lgpl.Plo \
+ ./$(DEPDIR)/libgnu_la-dirname.Plo \
+ ./$(DEPDIR)/libgnu_la-dup-safer-flag.Plo \
+ ./$(DEPDIR)/libgnu_la-dup-safer.Plo \
+ ./$(DEPDIR)/libgnu_la-dup.Plo ./$(DEPDIR)/libgnu_la-dup2.Plo \
+ ./$(DEPDIR)/libgnu_la-error.Plo \
+ ./$(DEPDIR)/libgnu_la-exitfail.Plo \
+ ./$(DEPDIR)/libgnu_la-fchdir.Plo \
+ ./$(DEPDIR)/libgnu_la-fchown-stub.Plo \
+ ./$(DEPDIR)/libgnu_la-fcntl.Plo \
+ ./$(DEPDIR)/libgnu_la-fd-hook.Plo \
+ ./$(DEPDIR)/libgnu_la-fd-safer-flag.Plo \
+ ./$(DEPDIR)/libgnu_la-fd-safer.Plo \
+ ./$(DEPDIR)/libgnu_la-fdopendir.Plo \
+ ./$(DEPDIR)/libgnu_la-file-set.Plo \
+ ./$(DEPDIR)/libgnu_la-filenamecat-lgpl.Plo \
+ ./$(DEPDIR)/libgnu_la-float.Plo \
+ ./$(DEPDIR)/libgnu_la-flock.Plo \
+ ./$(DEPDIR)/libgnu_la-fnmatch.Plo \
+ ./$(DEPDIR)/libgnu_la-fnmatch_loop.Plo \
+ ./$(DEPDIR)/libgnu_la-free.Plo ./$(DEPDIR)/libgnu_la-fstat.Plo \
+ ./$(DEPDIR)/libgnu_la-fstatat.Plo \
+ ./$(DEPDIR)/libgnu_la-getcwd-lgpl.Plo \
+ ./$(DEPDIR)/libgnu_la-getcwd.Plo \
+ ./$(DEPDIR)/libgnu_la-getdelim.Plo \
+ ./$(DEPDIR)/libgnu_la-getdtablesize.Plo \
+ ./$(DEPDIR)/libgnu_la-getline.Plo \
+ ./$(DEPDIR)/libgnu_la-getlogin_r.Plo \
+ ./$(DEPDIR)/libgnu_la-getopt.Plo \
+ ./$(DEPDIR)/libgnu_la-getopt1.Plo \
+ ./$(DEPDIR)/libgnu_la-getprogname.Plo \
+ ./$(DEPDIR)/libgnu_la-getrandom.Plo \
+ ./$(DEPDIR)/libgnu_la-gettime.Plo \
+ ./$(DEPDIR)/libgnu_la-gettimeofday.Plo \
+ ./$(DEPDIR)/libgnu_la-gl_array_list.Plo \
+ ./$(DEPDIR)/libgnu_la-gl_hash_map.Plo \
+ ./$(DEPDIR)/libgnu_la-gl_hash_set.Plo \
+ ./$(DEPDIR)/libgnu_la-gl_linkedhash_list.Plo \
+ ./$(DEPDIR)/libgnu_la-gl_list.Plo \
+ ./$(DEPDIR)/libgnu_la-gl_map.Plo \
+ ./$(DEPDIR)/libgnu_la-gl_rbtree_list.Plo \
+ ./$(DEPDIR)/libgnu_la-gl_set.Plo \
+ ./$(DEPDIR)/libgnu_la-gl_xlist.Plo \
+ ./$(DEPDIR)/libgnu_la-gl_xmap.Plo \
+ ./$(DEPDIR)/libgnu_la-gl_xset.Plo \
+ ./$(DEPDIR)/libgnu_la-glob.Plo \
+ ./$(DEPDIR)/libgnu_la-glob_pattern_p.Plo \
+ ./$(DEPDIR)/libgnu_la-globfree.Plo \
+ ./$(DEPDIR)/libgnu_la-hard-locale.Plo \
+ ./$(DEPDIR)/libgnu_la-hash-pjw-bare.Plo \
+ ./$(DEPDIR)/libgnu_la-hash-pjw.Plo \
+ ./$(DEPDIR)/libgnu_la-hash-triple-simple.Plo \
+ ./$(DEPDIR)/libgnu_la-hash.Plo \
+ ./$(DEPDIR)/libgnu_la-ialloc.Plo \
+ ./$(DEPDIR)/libgnu_la-idpriv-drop.Plo \
+ ./$(DEPDIR)/libgnu_la-idpriv-droptemp.Plo \
+ ./$(DEPDIR)/libgnu_la-ioctl.Plo \
+ ./$(DEPDIR)/libgnu_la-isblank.Plo \
+ ./$(DEPDIR)/libgnu_la-itold.Plo \
+ ./$(DEPDIR)/libgnu_la-lc-charset-dispatch.Plo \
+ ./$(DEPDIR)/libgnu_la-lchown.Plo \
+ ./$(DEPDIR)/libgnu_la-localcharset.Plo \
+ ./$(DEPDIR)/libgnu_la-localeconv.Plo \
+ ./$(DEPDIR)/libgnu_la-lstat.Plo \
+ ./$(DEPDIR)/libgnu_la-malloc.Plo \
+ ./$(DEPDIR)/libgnu_la-malloca.Plo \
+ ./$(DEPDIR)/libgnu_la-mbrtowc.Plo \
+ ./$(DEPDIR)/libgnu_la-mbsinit.Plo \
+ ./$(DEPDIR)/libgnu_la-mbsrtowcs-state.Plo \
+ ./$(DEPDIR)/libgnu_la-mbsrtowcs.Plo \
+ ./$(DEPDIR)/libgnu_la-mbtowc-lock.Plo \
+ ./$(DEPDIR)/libgnu_la-mbtowc.Plo \
+ ./$(DEPDIR)/libgnu_la-memchr.Plo \
+ ./$(DEPDIR)/libgnu_la-memmem.Plo \
+ ./$(DEPDIR)/libgnu_la-mempcpy.Plo \
+ ./$(DEPDIR)/libgnu_la-memrchr.Plo \
+ ./$(DEPDIR)/libgnu_la-mkdir.Plo \
+ ./$(DEPDIR)/libgnu_la-mkdtemp.Plo \
+ ./$(DEPDIR)/libgnu_la-mkstemp.Plo \
+ ./$(DEPDIR)/libgnu_la-msvc-inval.Plo \
+ ./$(DEPDIR)/libgnu_la-msvc-nothrow.Plo \
+ ./$(DEPDIR)/libgnu_la-nanosleep.Plo \
+ ./$(DEPDIR)/libgnu_la-nl_langinfo-lock.Plo \
+ ./$(DEPDIR)/libgnu_la-nl_langinfo.Plo \
+ ./$(DEPDIR)/libgnu_la-nonblocking.Plo \
+ ./$(DEPDIR)/libgnu_la-open.Plo \
+ ./$(DEPDIR)/libgnu_la-openat-die.Plo \
+ ./$(DEPDIR)/libgnu_la-openat-proc.Plo \
+ ./$(DEPDIR)/libgnu_la-openat.Plo \
+ ./$(DEPDIR)/libgnu_la-opendir.Plo \
+ ./$(DEPDIR)/libgnu_la-pipe-safer.Plo \
+ ./$(DEPDIR)/libgnu_la-pipe.Plo \
+ ./$(DEPDIR)/libgnu_la-printf-args.Plo \
+ ./$(DEPDIR)/libgnu_la-printf-parse.Plo \
+ ./$(DEPDIR)/libgnu_la-progname.Plo \
+ ./$(DEPDIR)/libgnu_la-pselect.Plo \
+ ./$(DEPDIR)/libgnu_la-pthread_sigmask.Plo \
+ ./$(DEPDIR)/libgnu_la-raise.Plo \
+ ./$(DEPDIR)/libgnu_la-rawmemchr.Plo \
+ ./$(DEPDIR)/libgnu_la-readdir.Plo \
+ ./$(DEPDIR)/libgnu_la-readlink.Plo \
+ ./$(DEPDIR)/libgnu_la-readlinkat.Plo \
+ ./$(DEPDIR)/libgnu_la-realloc.Plo \
+ ./$(DEPDIR)/libgnu_la-reallocarray.Plo \
+ ./$(DEPDIR)/libgnu_la-regcomp.Plo \
+ ./$(DEPDIR)/libgnu_la-regex.Plo \
+ ./$(DEPDIR)/libgnu_la-regex_internal.Plo \
+ ./$(DEPDIR)/libgnu_la-regexec.Plo \
+ ./$(DEPDIR)/libgnu_la-rename.Plo \
+ ./$(DEPDIR)/libgnu_la-renameat.Plo \
+ ./$(DEPDIR)/libgnu_la-renameatu.Plo \
+ ./$(DEPDIR)/libgnu_la-rewinddir.Plo \
+ ./$(DEPDIR)/libgnu_la-rmdir.Plo \
+ ./$(DEPDIR)/libgnu_la-save-cwd.Plo \
+ ./$(DEPDIR)/libgnu_la-select.Plo \
+ ./$(DEPDIR)/libgnu_la-setenv.Plo \
+ ./$(DEPDIR)/libgnu_la-setlocale-lock.Plo \
+ ./$(DEPDIR)/libgnu_la-setlocale_null.Plo \
+ ./$(DEPDIR)/libgnu_la-sig-handler.Plo \
+ ./$(DEPDIR)/libgnu_la-sigaction.Plo \
+ ./$(DEPDIR)/libgnu_la-sigprocmask.Plo \
+ ./$(DEPDIR)/libgnu_la-sleep.Plo \
+ ./$(DEPDIR)/libgnu_la-sockets.Plo \
+ ./$(DEPDIR)/libgnu_la-stat-time.Plo \
+ ./$(DEPDIR)/libgnu_la-stat-w32.Plo \
+ ./$(DEPDIR)/libgnu_la-stat.Plo \
+ ./$(DEPDIR)/libgnu_la-stdio-read.Plo \
+ ./$(DEPDIR)/libgnu_la-stdio-write.Plo \
+ ./$(DEPDIR)/libgnu_la-stdopen.Plo \
+ ./$(DEPDIR)/libgnu_la-stpcpy.Plo \
+ ./$(DEPDIR)/libgnu_la-strcasecmp.Plo \
+ ./$(DEPDIR)/libgnu_la-strcasestr.Plo \
+ ./$(DEPDIR)/libgnu_la-strchrnul.Plo \
+ ./$(DEPDIR)/libgnu_la-strdup.Plo \
+ ./$(DEPDIR)/libgnu_la-strerror-override.Plo \
+ ./$(DEPDIR)/libgnu_la-strerror.Plo \
+ ./$(DEPDIR)/libgnu_la-stripslash.Plo \
+ ./$(DEPDIR)/libgnu_la-strncasecmp.Plo \
+ ./$(DEPDIR)/libgnu_la-strndup.Plo \
+ ./$(DEPDIR)/libgnu_la-strnlen.Plo \
+ ./$(DEPDIR)/libgnu_la-strnlen1.Plo \
+ ./$(DEPDIR)/libgnu_la-strsep.Plo \
+ ./$(DEPDIR)/libgnu_la-sys_socket.Plo \
+ ./$(DEPDIR)/libgnu_la-tempname.Plo \
+ ./$(DEPDIR)/libgnu_la-timespec.Plo \
+ ./$(DEPDIR)/libgnu_la-unistd.Plo \
+ ./$(DEPDIR)/libgnu_la-unlink.Plo \
+ ./$(DEPDIR)/libgnu_la-unlinkat.Plo \
+ ./$(DEPDIR)/libgnu_la-utime.Plo \
+ ./$(DEPDIR)/libgnu_la-utimens.Plo \
+ ./$(DEPDIR)/libgnu_la-vasnprintf.Plo \
+ ./$(DEPDIR)/libgnu_la-vasprintf.Plo \
+ ./$(DEPDIR)/libgnu_la-verror.Plo \
+ ./$(DEPDIR)/libgnu_la-vsnprintf.Plo \
+ ./$(DEPDIR)/libgnu_la-wcrtomb.Plo \
+ ./$(DEPDIR)/libgnu_la-wctype-h.Plo \
+ ./$(DEPDIR)/libgnu_la-windows-mutex.Plo \
+ ./$(DEPDIR)/libgnu_la-windows-once.Plo \
+ ./$(DEPDIR)/libgnu_la-windows-recmutex.Plo \
+ ./$(DEPDIR)/libgnu_la-windows-rwlock.Plo \
+ ./$(DEPDIR)/libgnu_la-wmemchr.Plo \
+ ./$(DEPDIR)/libgnu_la-wmempcpy.Plo \
+ ./$(DEPDIR)/libgnu_la-xalloc-die.Plo \
+ ./$(DEPDIR)/libgnu_la-xasprintf.Plo \
+ ./$(DEPDIR)/libgnu_la-xgetcwd.Plo \
+ ./$(DEPDIR)/libgnu_la-xmalloc.Plo \
+ ./$(DEPDIR)/libgnu_la-xsize.Plo \
+ ./$(DEPDIR)/libgnu_la-xstdopen.Plo \
+ ./$(DEPDIR)/libgnu_la-xstrndup.Plo \
+ ./$(DEPDIR)/libgnu_la-xvasprintf.Plo \
+ glthread/$(DEPDIR)/libgnu_la-lock.Plo \
+ glthread/$(DEPDIR)/libgnu_la-threadlib.Plo \
+ malloc/$(DEPDIR)/libgnu_la-dynarray-skeleton.Plo \
+ malloc/$(DEPDIR)/libgnu_la-dynarray_at_failure.Plo \
+ malloc/$(DEPDIR)/libgnu_la-dynarray_emplace_enlarge.Plo \
+ malloc/$(DEPDIR)/libgnu_la-dynarray_finalize.Plo \
+ malloc/$(DEPDIR)/libgnu_la-dynarray_resize.Plo \
+ malloc/$(DEPDIR)/libgnu_la-dynarray_resize_clear.Plo \
+ malloc/$(DEPDIR)/libgnu_la-scratch_buffer_dupfree.Plo \
+ malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow.Plo \
+ malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow_preserve.Plo \
+ malloc/$(DEPDIR)/libgnu_la-scratch_buffer_set_array_size.Plo
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(libgnu_la_SOURCES) $(EXTRA_libgnu_la_SOURCES)
+DIST_SOURCES = $(am__libgnu_la_SOURCES_DIST) \
+ $(EXTRA_libgnu_la_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+HEADERS = $(noinst_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ distdir distdir-am
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in \
+ $(top_srcdir)/build-aux/depcomp alloca.c
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+AR = @AR@
+ARFLAGS = @ARFLAGS@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
+CYGPATH_W = @CYGPATH_W@
+DBLIBS = @DBLIBS@
+DBTYPE = @DBTYPE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@
+EMULTIHOP_VALUE = @EMULTIHOP_VALUE@
+ENOLINK_HIDDEN = @ENOLINK_HIDDEN@
+ENOLINK_VALUE = @ENOLINK_VALUE@
+EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
+EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
+ERRNO_H = @ERRNO_H@
+ETAGS = @ETAGS@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FILECMD = @FILECMD@
+FLOAT_H = @FLOAT_H@
+FNMATCH_H = @FNMATCH_H@
+GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
+GETOPT_H = @GETOPT_H@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GLOB_H = @GLOB_H@
+GL_CFLAG_ALLOW_WARNINGS = @GL_CFLAG_ALLOW_WARNINGS@
+GL_CFLAG_GNULIB_WARNINGS = @GL_CFLAG_GNULIB_WARNINGS@
+GL_GNULIB_ACCEPT = @GL_GNULIB_ACCEPT@
+GL_GNULIB_ACCEPT4 = @GL_GNULIB_ACCEPT4@
+GL_GNULIB_ACCESS = @GL_GNULIB_ACCESS@
+GL_GNULIB_ALIGNED_ALLOC = @GL_GNULIB_ALIGNED_ALLOC@
+GL_GNULIB_ALPHASORT = @GL_GNULIB_ALPHASORT@
+GL_GNULIB_ATOLL = @GL_GNULIB_ATOLL@
+GL_GNULIB_BIND = @GL_GNULIB_BIND@
+GL_GNULIB_BTOWC = @GL_GNULIB_BTOWC@
+GL_GNULIB_CALLOC_GNU = @GL_GNULIB_CALLOC_GNU@
+GL_GNULIB_CALLOC_POSIX = @GL_GNULIB_CALLOC_POSIX@
+GL_GNULIB_CANONICALIZE_FILE_NAME = @GL_GNULIB_CANONICALIZE_FILE_NAME@
+GL_GNULIB_CHDIR = @GL_GNULIB_CHDIR@
+GL_GNULIB_CHMOD = @GL_GNULIB_CHMOD@
+GL_GNULIB_CHOWN = @GL_GNULIB_CHOWN@
+GL_GNULIB_CLOSE = @GL_GNULIB_CLOSE@
+GL_GNULIB_CLOSEDIR = @GL_GNULIB_CLOSEDIR@
+GL_GNULIB_CONNECT = @GL_GNULIB_CONNECT@
+GL_GNULIB_COPY_FILE_RANGE = @GL_GNULIB_COPY_FILE_RANGE@
+GL_GNULIB_CREAT = @GL_GNULIB_CREAT@
+GL_GNULIB_CTIME = @GL_GNULIB_CTIME@
+GL_GNULIB_DIRFD = @GL_GNULIB_DIRFD@
+GL_GNULIB_DPRINTF = @GL_GNULIB_DPRINTF@
+GL_GNULIB_DUP = @GL_GNULIB_DUP@
+GL_GNULIB_DUP2 = @GL_GNULIB_DUP2@
+GL_GNULIB_DUP3 = @GL_GNULIB_DUP3@
+GL_GNULIB_DUPLOCALE = @GL_GNULIB_DUPLOCALE@
+GL_GNULIB_ENVIRON = @GL_GNULIB_ENVIRON@
+GL_GNULIB_EUIDACCESS = @GL_GNULIB_EUIDACCESS@
+GL_GNULIB_EXECL = @GL_GNULIB_EXECL@
+GL_GNULIB_EXECLE = @GL_GNULIB_EXECLE@
+GL_GNULIB_EXECLP = @GL_GNULIB_EXECLP@
+GL_GNULIB_EXECV = @GL_GNULIB_EXECV@
+GL_GNULIB_EXECVE = @GL_GNULIB_EXECVE@
+GL_GNULIB_EXECVP = @GL_GNULIB_EXECVP@
+GL_GNULIB_EXECVPE = @GL_GNULIB_EXECVPE@
+GL_GNULIB_EXPLICIT_BZERO = @GL_GNULIB_EXPLICIT_BZERO@
+GL_GNULIB_FACCESSAT = @GL_GNULIB_FACCESSAT@
+GL_GNULIB_FCHDIR = @GL_GNULIB_FCHDIR@
+GL_GNULIB_FCHMODAT = @GL_GNULIB_FCHMODAT@
+GL_GNULIB_FCHOWNAT = @GL_GNULIB_FCHOWNAT@
+GL_GNULIB_FCLOSE = @GL_GNULIB_FCLOSE@
+GL_GNULIB_FCNTL = @GL_GNULIB_FCNTL@
+GL_GNULIB_FDATASYNC = @GL_GNULIB_FDATASYNC@
+GL_GNULIB_FDOPEN = @GL_GNULIB_FDOPEN@
+GL_GNULIB_FDOPENDIR = @GL_GNULIB_FDOPENDIR@
+GL_GNULIB_FFLUSH = @GL_GNULIB_FFLUSH@
+GL_GNULIB_FFS = @GL_GNULIB_FFS@
+GL_GNULIB_FFSL = @GL_GNULIB_FFSL@
+GL_GNULIB_FFSLL = @GL_GNULIB_FFSLL@
+GL_GNULIB_FGETC = @GL_GNULIB_FGETC@
+GL_GNULIB_FGETS = @GL_GNULIB_FGETS@
+GL_GNULIB_FLOCK = @GL_GNULIB_FLOCK@
+GL_GNULIB_FNMATCH = @GL_GNULIB_FNMATCH@
+GL_GNULIB_FOPEN = @GL_GNULIB_FOPEN@
+GL_GNULIB_FOPEN_GNU = @GL_GNULIB_FOPEN_GNU@
+GL_GNULIB_FPRINTF = @GL_GNULIB_FPRINTF@
+GL_GNULIB_FPRINTF_POSIX = @GL_GNULIB_FPRINTF_POSIX@
+GL_GNULIB_FPURGE = @GL_GNULIB_FPURGE@
+GL_GNULIB_FPUTC = @GL_GNULIB_FPUTC@
+GL_GNULIB_FPUTS = @GL_GNULIB_FPUTS@
+GL_GNULIB_FREAD = @GL_GNULIB_FREAD@
+GL_GNULIB_FREE_POSIX = @GL_GNULIB_FREE_POSIX@
+GL_GNULIB_FREOPEN = @GL_GNULIB_FREOPEN@
+GL_GNULIB_FSCANF = @GL_GNULIB_FSCANF@
+GL_GNULIB_FSEEK = @GL_GNULIB_FSEEK@
+GL_GNULIB_FSEEKO = @GL_GNULIB_FSEEKO@
+GL_GNULIB_FSTAT = @GL_GNULIB_FSTAT@
+GL_GNULIB_FSTATAT = @GL_GNULIB_FSTATAT@
+GL_GNULIB_FSYNC = @GL_GNULIB_FSYNC@
+GL_GNULIB_FTELL = @GL_GNULIB_FTELL@
+GL_GNULIB_FTELLO = @GL_GNULIB_FTELLO@
+GL_GNULIB_FTRUNCATE = @GL_GNULIB_FTRUNCATE@
+GL_GNULIB_FUTIMENS = @GL_GNULIB_FUTIMENS@
+GL_GNULIB_FWRITE = @GL_GNULIB_FWRITE@
+GL_GNULIB_GETC = @GL_GNULIB_GETC@
+GL_GNULIB_GETCHAR = @GL_GNULIB_GETCHAR@
+GL_GNULIB_GETCWD = @GL_GNULIB_GETCWD@
+GL_GNULIB_GETDELIM = @GL_GNULIB_GETDELIM@
+GL_GNULIB_GETDOMAINNAME = @GL_GNULIB_GETDOMAINNAME@
+GL_GNULIB_GETDTABLESIZE = @GL_GNULIB_GETDTABLESIZE@
+GL_GNULIB_GETENTROPY = @GL_GNULIB_GETENTROPY@
+GL_GNULIB_GETGROUPS = @GL_GNULIB_GETGROUPS@
+GL_GNULIB_GETHOSTNAME = @GL_GNULIB_GETHOSTNAME@
+GL_GNULIB_GETLINE = @GL_GNULIB_GETLINE@
+GL_GNULIB_GETLOADAVG = @GL_GNULIB_GETLOADAVG@
+GL_GNULIB_GETLOGIN = @GL_GNULIB_GETLOGIN@
+GL_GNULIB_GETLOGIN_R = @GL_GNULIB_GETLOGIN_R@
+GL_GNULIB_GETOPT_POSIX = @GL_GNULIB_GETOPT_POSIX@
+GL_GNULIB_GETPAGESIZE = @GL_GNULIB_GETPAGESIZE@
+GL_GNULIB_GETPASS = @GL_GNULIB_GETPASS@
+GL_GNULIB_GETPASS_GNU = @GL_GNULIB_GETPASS_GNU@
+GL_GNULIB_GETPEERNAME = @GL_GNULIB_GETPEERNAME@
+GL_GNULIB_GETRANDOM = @GL_GNULIB_GETRANDOM@
+GL_GNULIB_GETSOCKNAME = @GL_GNULIB_GETSOCKNAME@
+GL_GNULIB_GETSOCKOPT = @GL_GNULIB_GETSOCKOPT@
+GL_GNULIB_GETSUBOPT = @GL_GNULIB_GETSUBOPT@
+GL_GNULIB_GETTIMEOFDAY = @GL_GNULIB_GETTIMEOFDAY@
+GL_GNULIB_GETUMASK = @GL_GNULIB_GETUMASK@
+GL_GNULIB_GETUSERSHELL = @GL_GNULIB_GETUSERSHELL@
+GL_GNULIB_GLOB = @GL_GNULIB_GLOB@
+GL_GNULIB_GRANTPT = @GL_GNULIB_GRANTPT@
+GL_GNULIB_GROUP_MEMBER = @GL_GNULIB_GROUP_MEMBER@
+GL_GNULIB_IMAXABS = @GL_GNULIB_IMAXABS@
+GL_GNULIB_IMAXDIV = @GL_GNULIB_IMAXDIV@
+GL_GNULIB_IOCTL = @GL_GNULIB_IOCTL@
+GL_GNULIB_ISATTY = @GL_GNULIB_ISATTY@
+GL_GNULIB_ISBLANK = @GL_GNULIB_ISBLANK@
+GL_GNULIB_ISWBLANK = @GL_GNULIB_ISWBLANK@
+GL_GNULIB_ISWCTYPE = @GL_GNULIB_ISWCTYPE@
+GL_GNULIB_ISWDIGIT = @GL_GNULIB_ISWDIGIT@
+GL_GNULIB_ISWXDIGIT = @GL_GNULIB_ISWXDIGIT@
+GL_GNULIB_LCHMOD = @GL_GNULIB_LCHMOD@
+GL_GNULIB_LCHOWN = @GL_GNULIB_LCHOWN@
+GL_GNULIB_LINK = @GL_GNULIB_LINK@
+GL_GNULIB_LINKAT = @GL_GNULIB_LINKAT@
+GL_GNULIB_LISTEN = @GL_GNULIB_LISTEN@
+GL_GNULIB_LOCALECONV = @GL_GNULIB_LOCALECONV@
+GL_GNULIB_LOCALENAME = @GL_GNULIB_LOCALENAME@
+GL_GNULIB_LOCALTIME = @GL_GNULIB_LOCALTIME@
+GL_GNULIB_LSEEK = @GL_GNULIB_LSEEK@
+GL_GNULIB_LSTAT = @GL_GNULIB_LSTAT@
+GL_GNULIB_MALLOC_GNU = @GL_GNULIB_MALLOC_GNU@
+GL_GNULIB_MALLOC_POSIX = @GL_GNULIB_MALLOC_POSIX@
+GL_GNULIB_MBRLEN = @GL_GNULIB_MBRLEN@
+GL_GNULIB_MBRTOWC = @GL_GNULIB_MBRTOWC@
+GL_GNULIB_MBSCASECMP = @GL_GNULIB_MBSCASECMP@
+GL_GNULIB_MBSCASESTR = @GL_GNULIB_MBSCASESTR@
+GL_GNULIB_MBSCHR = @GL_GNULIB_MBSCHR@
+GL_GNULIB_MBSCSPN = @GL_GNULIB_MBSCSPN@
+GL_GNULIB_MBSINIT = @GL_GNULIB_MBSINIT@
+GL_GNULIB_MBSLEN = @GL_GNULIB_MBSLEN@
+GL_GNULIB_MBSNCASECMP = @GL_GNULIB_MBSNCASECMP@
+GL_GNULIB_MBSNLEN = @GL_GNULIB_MBSNLEN@
+GL_GNULIB_MBSNRTOWCS = @GL_GNULIB_MBSNRTOWCS@
+GL_GNULIB_MBSPBRK = @GL_GNULIB_MBSPBRK@
+GL_GNULIB_MBSPCASECMP = @GL_GNULIB_MBSPCASECMP@
+GL_GNULIB_MBSRCHR = @GL_GNULIB_MBSRCHR@
+GL_GNULIB_MBSRTOWCS = @GL_GNULIB_MBSRTOWCS@
+GL_GNULIB_MBSSEP = @GL_GNULIB_MBSSEP@
+GL_GNULIB_MBSSPN = @GL_GNULIB_MBSSPN@
+GL_GNULIB_MBSSTR = @GL_GNULIB_MBSSTR@
+GL_GNULIB_MBSTOK_R = @GL_GNULIB_MBSTOK_R@
+GL_GNULIB_MBTOWC = @GL_GNULIB_MBTOWC@
+GL_GNULIB_MDA_ACCESS = @GL_GNULIB_MDA_ACCESS@
+GL_GNULIB_MDA_CHDIR = @GL_GNULIB_MDA_CHDIR@
+GL_GNULIB_MDA_CHMOD = @GL_GNULIB_MDA_CHMOD@
+GL_GNULIB_MDA_CLOSE = @GL_GNULIB_MDA_CLOSE@
+GL_GNULIB_MDA_CREAT = @GL_GNULIB_MDA_CREAT@
+GL_GNULIB_MDA_DUP = @GL_GNULIB_MDA_DUP@
+GL_GNULIB_MDA_DUP2 = @GL_GNULIB_MDA_DUP2@
+GL_GNULIB_MDA_ECVT = @GL_GNULIB_MDA_ECVT@
+GL_GNULIB_MDA_EXECL = @GL_GNULIB_MDA_EXECL@
+GL_GNULIB_MDA_EXECLE = @GL_GNULIB_MDA_EXECLE@
+GL_GNULIB_MDA_EXECLP = @GL_GNULIB_MDA_EXECLP@
+GL_GNULIB_MDA_EXECV = @GL_GNULIB_MDA_EXECV@
+GL_GNULIB_MDA_EXECVE = @GL_GNULIB_MDA_EXECVE@
+GL_GNULIB_MDA_EXECVP = @GL_GNULIB_MDA_EXECVP@
+GL_GNULIB_MDA_EXECVPE = @GL_GNULIB_MDA_EXECVPE@
+GL_GNULIB_MDA_FCLOSEALL = @GL_GNULIB_MDA_FCLOSEALL@
+GL_GNULIB_MDA_FCVT = @GL_GNULIB_MDA_FCVT@
+GL_GNULIB_MDA_FDOPEN = @GL_GNULIB_MDA_FDOPEN@
+GL_GNULIB_MDA_FILENO = @GL_GNULIB_MDA_FILENO@
+GL_GNULIB_MDA_GCVT = @GL_GNULIB_MDA_GCVT@
+GL_GNULIB_MDA_GETCWD = @GL_GNULIB_MDA_GETCWD@
+GL_GNULIB_MDA_GETPID = @GL_GNULIB_MDA_GETPID@
+GL_GNULIB_MDA_GETW = @GL_GNULIB_MDA_GETW@
+GL_GNULIB_MDA_ISATTY = @GL_GNULIB_MDA_ISATTY@
+GL_GNULIB_MDA_LSEEK = @GL_GNULIB_MDA_LSEEK@
+GL_GNULIB_MDA_MEMCCPY = @GL_GNULIB_MDA_MEMCCPY@
+GL_GNULIB_MDA_MKDIR = @GL_GNULIB_MDA_MKDIR@
+GL_GNULIB_MDA_MKTEMP = @GL_GNULIB_MDA_MKTEMP@
+GL_GNULIB_MDA_OPEN = @GL_GNULIB_MDA_OPEN@
+GL_GNULIB_MDA_PUTENV = @GL_GNULIB_MDA_PUTENV@
+GL_GNULIB_MDA_PUTW = @GL_GNULIB_MDA_PUTW@
+GL_GNULIB_MDA_READ = @GL_GNULIB_MDA_READ@
+GL_GNULIB_MDA_RMDIR = @GL_GNULIB_MDA_RMDIR@
+GL_GNULIB_MDA_STRDUP = @GL_GNULIB_MDA_STRDUP@
+GL_GNULIB_MDA_SWAB = @GL_GNULIB_MDA_SWAB@
+GL_GNULIB_MDA_TEMPNAM = @GL_GNULIB_MDA_TEMPNAM@
+GL_GNULIB_MDA_TZSET = @GL_GNULIB_MDA_TZSET@
+GL_GNULIB_MDA_UMASK = @GL_GNULIB_MDA_UMASK@
+GL_GNULIB_MDA_UNLINK = @GL_GNULIB_MDA_UNLINK@
+GL_GNULIB_MDA_UTIME = @GL_GNULIB_MDA_UTIME@
+GL_GNULIB_MDA_WCSDUP = @GL_GNULIB_MDA_WCSDUP@
+GL_GNULIB_MDA_WRITE = @GL_GNULIB_MDA_WRITE@
+GL_GNULIB_MEMCHR = @GL_GNULIB_MEMCHR@
+GL_GNULIB_MEMMEM = @GL_GNULIB_MEMMEM@
+GL_GNULIB_MEMPCPY = @GL_GNULIB_MEMPCPY@
+GL_GNULIB_MEMRCHR = @GL_GNULIB_MEMRCHR@
+GL_GNULIB_MKDIR = @GL_GNULIB_MKDIR@
+GL_GNULIB_MKDIRAT = @GL_GNULIB_MKDIRAT@
+GL_GNULIB_MKDTEMP = @GL_GNULIB_MKDTEMP@
+GL_GNULIB_MKFIFO = @GL_GNULIB_MKFIFO@
+GL_GNULIB_MKFIFOAT = @GL_GNULIB_MKFIFOAT@
+GL_GNULIB_MKNOD = @GL_GNULIB_MKNOD@
+GL_GNULIB_MKNODAT = @GL_GNULIB_MKNODAT@
+GL_GNULIB_MKOSTEMP = @GL_GNULIB_MKOSTEMP@
+GL_GNULIB_MKOSTEMPS = @GL_GNULIB_MKOSTEMPS@
+GL_GNULIB_MKSTEMP = @GL_GNULIB_MKSTEMP@
+GL_GNULIB_MKSTEMPS = @GL_GNULIB_MKSTEMPS@
+GL_GNULIB_MKTIME = @GL_GNULIB_MKTIME@
+GL_GNULIB_NANOSLEEP = @GL_GNULIB_NANOSLEEP@
+GL_GNULIB_NL_LANGINFO = @GL_GNULIB_NL_LANGINFO@
+GL_GNULIB_NONBLOCKING = @GL_GNULIB_NONBLOCKING@
+GL_GNULIB_OBSTACK_PRINTF = @GL_GNULIB_OBSTACK_PRINTF@
+GL_GNULIB_OBSTACK_PRINTF_POSIX = @GL_GNULIB_OBSTACK_PRINTF_POSIX@
+GL_GNULIB_OPEN = @GL_GNULIB_OPEN@
+GL_GNULIB_OPENAT = @GL_GNULIB_OPENAT@
+GL_GNULIB_OPENDIR = @GL_GNULIB_OPENDIR@
+GL_GNULIB_OVERRIDES_STRUCT_STAT = @GL_GNULIB_OVERRIDES_STRUCT_STAT@
+GL_GNULIB_PCLOSE = @GL_GNULIB_PCLOSE@
+GL_GNULIB_PERROR = @GL_GNULIB_PERROR@
+GL_GNULIB_PIPE = @GL_GNULIB_PIPE@
+GL_GNULIB_PIPE2 = @GL_GNULIB_PIPE2@
+GL_GNULIB_POPEN = @GL_GNULIB_POPEN@
+GL_GNULIB_POSIX_MEMALIGN = @GL_GNULIB_POSIX_MEMALIGN@
+GL_GNULIB_POSIX_OPENPT = @GL_GNULIB_POSIX_OPENPT@
+GL_GNULIB_PREAD = @GL_GNULIB_PREAD@
+GL_GNULIB_PRINTF = @GL_GNULIB_PRINTF@
+GL_GNULIB_PRINTF_POSIX = @GL_GNULIB_PRINTF_POSIX@
+GL_GNULIB_PSELECT = @GL_GNULIB_PSELECT@
+GL_GNULIB_PTHREAD_SIGMASK = @GL_GNULIB_PTHREAD_SIGMASK@
+GL_GNULIB_PTSNAME = @GL_GNULIB_PTSNAME@
+GL_GNULIB_PTSNAME_R = @GL_GNULIB_PTSNAME_R@
+GL_GNULIB_PUTC = @GL_GNULIB_PUTC@
+GL_GNULIB_PUTCHAR = @GL_GNULIB_PUTCHAR@
+GL_GNULIB_PUTENV = @GL_GNULIB_PUTENV@
+GL_GNULIB_PUTS = @GL_GNULIB_PUTS@
+GL_GNULIB_PWRITE = @GL_GNULIB_PWRITE@
+GL_GNULIB_QSORT_R = @GL_GNULIB_QSORT_R@
+GL_GNULIB_RAISE = @GL_GNULIB_RAISE@
+GL_GNULIB_RANDOM = @GL_GNULIB_RANDOM@
+GL_GNULIB_RANDOM_R = @GL_GNULIB_RANDOM_R@
+GL_GNULIB_RAWMEMCHR = @GL_GNULIB_RAWMEMCHR@
+GL_GNULIB_READ = @GL_GNULIB_READ@
+GL_GNULIB_READDIR = @GL_GNULIB_READDIR@
+GL_GNULIB_READLINK = @GL_GNULIB_READLINK@
+GL_GNULIB_READLINKAT = @GL_GNULIB_READLINKAT@
+GL_GNULIB_REALLOCARRAY = @GL_GNULIB_REALLOCARRAY@
+GL_GNULIB_REALLOC_GNU = @GL_GNULIB_REALLOC_GNU@
+GL_GNULIB_REALLOC_POSIX = @GL_GNULIB_REALLOC_POSIX@
+GL_GNULIB_REALPATH = @GL_GNULIB_REALPATH@
+GL_GNULIB_RECV = @GL_GNULIB_RECV@
+GL_GNULIB_RECVFROM = @GL_GNULIB_RECVFROM@
+GL_GNULIB_REMOVE = @GL_GNULIB_REMOVE@
+GL_GNULIB_RENAME = @GL_GNULIB_RENAME@
+GL_GNULIB_RENAMEAT = @GL_GNULIB_RENAMEAT@
+GL_GNULIB_REWINDDIR = @GL_GNULIB_REWINDDIR@
+GL_GNULIB_RMDIR = @GL_GNULIB_RMDIR@
+GL_GNULIB_RPMATCH = @GL_GNULIB_RPMATCH@
+GL_GNULIB_SCANDIR = @GL_GNULIB_SCANDIR@
+GL_GNULIB_SCANF = @GL_GNULIB_SCANF@
+GL_GNULIB_SECURE_GETENV = @GL_GNULIB_SECURE_GETENV@
+GL_GNULIB_SELECT = @GL_GNULIB_SELECT@
+GL_GNULIB_SEND = @GL_GNULIB_SEND@
+GL_GNULIB_SENDTO = @GL_GNULIB_SENDTO@
+GL_GNULIB_SETENV = @GL_GNULIB_SETENV@
+GL_GNULIB_SETHOSTNAME = @GL_GNULIB_SETHOSTNAME@
+GL_GNULIB_SETLOCALE = @GL_GNULIB_SETLOCALE@
+GL_GNULIB_SETLOCALE_NULL = @GL_GNULIB_SETLOCALE_NULL@
+GL_GNULIB_SETSOCKOPT = @GL_GNULIB_SETSOCKOPT@
+GL_GNULIB_SHUTDOWN = @GL_GNULIB_SHUTDOWN@
+GL_GNULIB_SIGABBREV_NP = @GL_GNULIB_SIGABBREV_NP@
+GL_GNULIB_SIGACTION = @GL_GNULIB_SIGACTION@
+GL_GNULIB_SIGDESCR_NP = @GL_GNULIB_SIGDESCR_NP@
+GL_GNULIB_SIGNAL_H_SIGPIPE = @GL_GNULIB_SIGNAL_H_SIGPIPE@
+GL_GNULIB_SIGPROCMASK = @GL_GNULIB_SIGPROCMASK@
+GL_GNULIB_SLEEP = @GL_GNULIB_SLEEP@
+GL_GNULIB_SNPRINTF = @GL_GNULIB_SNPRINTF@
+GL_GNULIB_SOCKET = @GL_GNULIB_SOCKET@
+GL_GNULIB_SPRINTF_POSIX = @GL_GNULIB_SPRINTF_POSIX@
+GL_GNULIB_STAT = @GL_GNULIB_STAT@
+GL_GNULIB_STDIO_H_NONBLOCKING = @GL_GNULIB_STDIO_H_NONBLOCKING@
+GL_GNULIB_STDIO_H_SIGPIPE = @GL_GNULIB_STDIO_H_SIGPIPE@
+GL_GNULIB_STPCPY = @GL_GNULIB_STPCPY@
+GL_GNULIB_STPNCPY = @GL_GNULIB_STPNCPY@
+GL_GNULIB_STRCASESTR = @GL_GNULIB_STRCASESTR@
+GL_GNULIB_STRCHRNUL = @GL_GNULIB_STRCHRNUL@
+GL_GNULIB_STRDUP = @GL_GNULIB_STRDUP@
+GL_GNULIB_STRERROR = @GL_GNULIB_STRERROR@
+GL_GNULIB_STRERRORNAME_NP = @GL_GNULIB_STRERRORNAME_NP@
+GL_GNULIB_STRERROR_R = @GL_GNULIB_STRERROR_R@
+GL_GNULIB_STRFTIME = @GL_GNULIB_STRFTIME@
+GL_GNULIB_STRNCAT = @GL_GNULIB_STRNCAT@
+GL_GNULIB_STRNDUP = @GL_GNULIB_STRNDUP@
+GL_GNULIB_STRNLEN = @GL_GNULIB_STRNLEN@
+GL_GNULIB_STRPBRK = @GL_GNULIB_STRPBRK@
+GL_GNULIB_STRPTIME = @GL_GNULIB_STRPTIME@
+GL_GNULIB_STRSEP = @GL_GNULIB_STRSEP@
+GL_GNULIB_STRSIGNAL = @GL_GNULIB_STRSIGNAL@
+GL_GNULIB_STRSTR = @GL_GNULIB_STRSTR@
+GL_GNULIB_STRTOD = @GL_GNULIB_STRTOD@
+GL_GNULIB_STRTOIMAX = @GL_GNULIB_STRTOIMAX@
+GL_GNULIB_STRTOK_R = @GL_GNULIB_STRTOK_R@
+GL_GNULIB_STRTOL = @GL_GNULIB_STRTOL@
+GL_GNULIB_STRTOLD = @GL_GNULIB_STRTOLD@
+GL_GNULIB_STRTOLL = @GL_GNULIB_STRTOLL@
+GL_GNULIB_STRTOUL = @GL_GNULIB_STRTOUL@
+GL_GNULIB_STRTOULL = @GL_GNULIB_STRTOULL@
+GL_GNULIB_STRTOUMAX = @GL_GNULIB_STRTOUMAX@
+GL_GNULIB_STRVERSCMP = @GL_GNULIB_STRVERSCMP@
+GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@
+GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@
+GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@
+GL_GNULIB_TCGETSID = @GL_GNULIB_TCGETSID@
+GL_GNULIB_TIMEGM = @GL_GNULIB_TIMEGM@
+GL_GNULIB_TIMESPEC_GET = @GL_GNULIB_TIMESPEC_GET@
+GL_GNULIB_TIMESPEC_GETRES = @GL_GNULIB_TIMESPEC_GETRES@
+GL_GNULIB_TIME_R = @GL_GNULIB_TIME_R@
+GL_GNULIB_TIME_RZ = @GL_GNULIB_TIME_RZ@
+GL_GNULIB_TMPFILE = @GL_GNULIB_TMPFILE@
+GL_GNULIB_TOWCTRANS = @GL_GNULIB_TOWCTRANS@
+GL_GNULIB_TRUNCATE = @GL_GNULIB_TRUNCATE@
+GL_GNULIB_TTYNAME_R = @GL_GNULIB_TTYNAME_R@
+GL_GNULIB_TZSET = @GL_GNULIB_TZSET@
+GL_GNULIB_UNISTD_H_GETOPT = @GL_GNULIB_UNISTD_H_GETOPT@
+GL_GNULIB_UNISTD_H_NONBLOCKING = @GL_GNULIB_UNISTD_H_NONBLOCKING@
+GL_GNULIB_UNISTD_H_SIGPIPE = @GL_GNULIB_UNISTD_H_SIGPIPE@
+GL_GNULIB_UNLINK = @GL_GNULIB_UNLINK@
+GL_GNULIB_UNLINKAT = @GL_GNULIB_UNLINKAT@
+GL_GNULIB_UNLOCKPT = @GL_GNULIB_UNLOCKPT@
+GL_GNULIB_UNSETENV = @GL_GNULIB_UNSETENV@
+GL_GNULIB_USLEEP = @GL_GNULIB_USLEEP@
+GL_GNULIB_UTIME = @GL_GNULIB_UTIME@
+GL_GNULIB_UTIMENSAT = @GL_GNULIB_UTIMENSAT@
+GL_GNULIB_VASPRINTF = @GL_GNULIB_VASPRINTF@
+GL_GNULIB_VDPRINTF = @GL_GNULIB_VDPRINTF@
+GL_GNULIB_VFPRINTF = @GL_GNULIB_VFPRINTF@
+GL_GNULIB_VFPRINTF_POSIX = @GL_GNULIB_VFPRINTF_POSIX@
+GL_GNULIB_VFSCANF = @GL_GNULIB_VFSCANF@
+GL_GNULIB_VPRINTF = @GL_GNULIB_VPRINTF@
+GL_GNULIB_VPRINTF_POSIX = @GL_GNULIB_VPRINTF_POSIX@
+GL_GNULIB_VSCANF = @GL_GNULIB_VSCANF@
+GL_GNULIB_VSNPRINTF = @GL_GNULIB_VSNPRINTF@
+GL_GNULIB_VSPRINTF_POSIX = @GL_GNULIB_VSPRINTF_POSIX@
+GL_GNULIB_WCPCPY = @GL_GNULIB_WCPCPY@
+GL_GNULIB_WCPNCPY = @GL_GNULIB_WCPNCPY@
+GL_GNULIB_WCRTOMB = @GL_GNULIB_WCRTOMB@
+GL_GNULIB_WCSCASECMP = @GL_GNULIB_WCSCASECMP@
+GL_GNULIB_WCSCAT = @GL_GNULIB_WCSCAT@
+GL_GNULIB_WCSCHR = @GL_GNULIB_WCSCHR@
+GL_GNULIB_WCSCMP = @GL_GNULIB_WCSCMP@
+GL_GNULIB_WCSCOLL = @GL_GNULIB_WCSCOLL@
+GL_GNULIB_WCSCPY = @GL_GNULIB_WCSCPY@
+GL_GNULIB_WCSCSPN = @GL_GNULIB_WCSCSPN@
+GL_GNULIB_WCSDUP = @GL_GNULIB_WCSDUP@
+GL_GNULIB_WCSFTIME = @GL_GNULIB_WCSFTIME@
+GL_GNULIB_WCSLEN = @GL_GNULIB_WCSLEN@
+GL_GNULIB_WCSNCASECMP = @GL_GNULIB_WCSNCASECMP@
+GL_GNULIB_WCSNCAT = @GL_GNULIB_WCSNCAT@
+GL_GNULIB_WCSNCMP = @GL_GNULIB_WCSNCMP@
+GL_GNULIB_WCSNCPY = @GL_GNULIB_WCSNCPY@
+GL_GNULIB_WCSNLEN = @GL_GNULIB_WCSNLEN@
+GL_GNULIB_WCSNRTOMBS = @GL_GNULIB_WCSNRTOMBS@
+GL_GNULIB_WCSPBRK = @GL_GNULIB_WCSPBRK@
+GL_GNULIB_WCSRCHR = @GL_GNULIB_WCSRCHR@
+GL_GNULIB_WCSRTOMBS = @GL_GNULIB_WCSRTOMBS@
+GL_GNULIB_WCSSPN = @GL_GNULIB_WCSSPN@
+GL_GNULIB_WCSSTR = @GL_GNULIB_WCSSTR@
+GL_GNULIB_WCSTOK = @GL_GNULIB_WCSTOK@
+GL_GNULIB_WCSWIDTH = @GL_GNULIB_WCSWIDTH@
+GL_GNULIB_WCSXFRM = @GL_GNULIB_WCSXFRM@
+GL_GNULIB_WCTOB = @GL_GNULIB_WCTOB@
+GL_GNULIB_WCTOMB = @GL_GNULIB_WCTOMB@
+GL_GNULIB_WCTRANS = @GL_GNULIB_WCTRANS@
+GL_GNULIB_WCTYPE = @GL_GNULIB_WCTYPE@
+GL_GNULIB_WCWIDTH = @GL_GNULIB_WCWIDTH@
+GL_GNULIB_WMEMCHR = @GL_GNULIB_WMEMCHR@
+GL_GNULIB_WMEMCMP = @GL_GNULIB_WMEMCMP@
+GL_GNULIB_WMEMCPY = @GL_GNULIB_WMEMCPY@
+GL_GNULIB_WMEMMOVE = @GL_GNULIB_WMEMMOVE@
+GL_GNULIB_WMEMPCPY = @GL_GNULIB_WMEMPCPY@
+GL_GNULIB_WMEMSET = @GL_GNULIB_WMEMSET@
+GL_GNULIB_WRITE = @GL_GNULIB_WRITE@
+GL_GNULIB__EXIT = @GL_GNULIB__EXIT@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
+GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
+HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@
+HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
+HAVE_ALPHASORT = @HAVE_ALPHASORT@
+HAVE_ATOLL = @HAVE_ATOLL@
+HAVE_BTOWC = @HAVE_BTOWC@
+HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_CLOSEDIR = @HAVE_CLOSEDIR@
+HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@
+HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@
+HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@
+HAVE_DECL_ECVT = @HAVE_DECL_ECVT@
+HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@
+HAVE_DECL_FCVT = @HAVE_DECL_FCVT@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+HAVE_DECL_GCVT = @HAVE_DECL_GCVT@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
+HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
+HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
+HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@
+HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@
+HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
+HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
+HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
+HAVE_DECL_TCGETSID = @HAVE_DECL_TCGETSID@
+HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@
+HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@
+HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DIRENT_H = @HAVE_DIRENT_H@
+HAVE_DPRINTF = @HAVE_DPRINTF@
+HAVE_DUP3 = @HAVE_DUP3@
+HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
+HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXECVPE = @HAVE_EXECVPE@
+HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
+HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
+HAVE_FDOPENDIR = @HAVE_FDOPENDIR@
+HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFS = @HAVE_FFS@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+HAVE_FLOCK = @HAVE_FLOCK@
+HAVE_FNMATCH = @HAVE_FNMATCH@
+HAVE_FNMATCH_H = @HAVE_FNMATCH_H@
+HAVE_FREELOCALE = @HAVE_FREELOCALE@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
+HAVE_FSYNC = @HAVE_FSYNC@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
+HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETENTROPY = @HAVE_GETENTROPY@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
+HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
+HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
+HAVE_GETRANDOM = @HAVE_GETRANDOM@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GETUMASK = @HAVE_GETUMASK@
+HAVE_GLOB = @HAVE_GLOB@
+HAVE_GLOB_H = @HAVE_GLOB_H@
+HAVE_GLOB_PATTERN_P = @HAVE_GLOB_PATTERN_P@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
+HAVE_INITSTATE = @HAVE_INITSTATE@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISBLANK = @HAVE_ISBLANK@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
+HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
+HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@
+HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@
+HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
+HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@
+HAVE_MBRLEN = @HAVE_MBRLEN@
+HAVE_MBRTOWC = @HAVE_MBRTOWC@
+HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
+HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
+HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MBTOWC = @HAVE_MBTOWC@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
+HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OPENDIR = @HAVE_OPENDIR@
+HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
+HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PSELECT = @HAVE_PSELECT@
+HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
+HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_QSORT_R = @HAVE_QSORT_R@
+HAVE_RAISE = @HAVE_RAISE@
+HAVE_RANDOM = @HAVE_RANDOM@
+HAVE_RANDOM_H = @HAVE_RANDOM_H@
+HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READDIR = @HAVE_READDIR@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_REWINDDIR = @HAVE_REWINDDIR@
+HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
+HAVE_SCANDIR = @HAVE_SCANDIR@
+HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
+HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SETSTATE = @HAVE_SETSTATE@
+HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@
+HAVE_SIGACTION = @HAVE_SIGACTION@
+HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@
+HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@
+HAVE_SIGINFO_T = @HAVE_SIGINFO_T@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SIGSET_T = @HAVE_SIGSET_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@
+HAVE_STRINGS_H = @HAVE_STRINGS_H@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOL = @HAVE_STRTOL@
+HAVE_STRTOLD = @HAVE_STRTOLD@
+HAVE_STRTOLL = @HAVE_STRTOLL@
+HAVE_STRTOUL = @HAVE_STRTOUL@
+HAVE_STRTOULL = @HAVE_STRTOULL@
+HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
+HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
+HAVE_SYSEXITS_H = @HAVE_SYSEXITS_H@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@
+HAVE_SYS_FILE_H = @HAVE_SYS_FILE_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@
+HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
+HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_RANDOM_H = @HAVE_SYS_RANDOM_H@
+HAVE_SYS_SELECT_H = @HAVE_SYS_SELECT_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@
+HAVE_TERMIOS_H = @HAVE_TERMIOS_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@
+HAVE_TIMESPEC_GETRES = @HAVE_TIMESPEC_GETRES@
+HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
+HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIME = @HAVE_UTIME@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
+HAVE_UTIME_H = @HAVE_UTIME_H@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VDPRINTF = @HAVE_VDPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
+HAVE_WCPCPY = @HAVE_WCPCPY@
+HAVE_WCPNCPY = @HAVE_WCPNCPY@
+HAVE_WCRTOMB = @HAVE_WCRTOMB@
+HAVE_WCSCASECMP = @HAVE_WCSCASECMP@
+HAVE_WCSCAT = @HAVE_WCSCAT@
+HAVE_WCSCHR = @HAVE_WCSCHR@
+HAVE_WCSCMP = @HAVE_WCSCMP@
+HAVE_WCSCOLL = @HAVE_WCSCOLL@
+HAVE_WCSCPY = @HAVE_WCSCPY@
+HAVE_WCSCSPN = @HAVE_WCSCSPN@
+HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSFTIME = @HAVE_WCSFTIME@
+HAVE_WCSLEN = @HAVE_WCSLEN@
+HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
+HAVE_WCSNCAT = @HAVE_WCSNCAT@
+HAVE_WCSNCMP = @HAVE_WCSNCMP@
+HAVE_WCSNCPY = @HAVE_WCSNCPY@
+HAVE_WCSNLEN = @HAVE_WCSNLEN@
+HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
+HAVE_WCSPBRK = @HAVE_WCSPBRK@
+HAVE_WCSRCHR = @HAVE_WCSRCHR@
+HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
+HAVE_WCSSPN = @HAVE_WCSSPN@
+HAVE_WCSSTR = @HAVE_WCSSTR@
+HAVE_WCSTOK = @HAVE_WCSTOK@
+HAVE_WCSWIDTH = @HAVE_WCSWIDTH@
+HAVE_WCSXFRM = @HAVE_WCSXFRM@
+HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
+HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
+HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WINT_T = @HAVE_WINT_T@
+HAVE_WMEMCHR = @HAVE_WMEMCHR@
+HAVE_WMEMCMP = @HAVE_WMEMCMP@
+HAVE_WMEMCPY = @HAVE_WMEMCPY@
+HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMPCPY = @HAVE_WMEMPCPY@
+HAVE_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
+HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
+IGNORE_UNUSED_LIBRARIES_CFLAGS = @IGNORE_UNUSED_LIBRARIES_CFLAGS@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@
+INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCOMPRESS = @LIBCOMPRESS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBMAN_EXPORT_LDFLAGS = @LIBMAN_EXPORT_LDFLAGS@
+LIBMULTITHREAD = @LIBMULTITHREAD@
+LIBOBJS = @LIBOBJS@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
+LIBS = @LIBS@
+LIBSOCKET = @LIBSOCKET@
+LIBSTDTHREAD = @LIBSTDTHREAD@
+LIBTHREAD = @LIBTHREAD@
+LIBTOOL = @LIBTOOL@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_GETLOGIN = @LIB_GETLOGIN@
+LIB_GETRANDOM = @LIB_GETRANDOM@
+LIB_HARD_LOCALE = @LIB_HARD_LOCALE@
+LIB_MBRTOWC = @LIB_MBRTOWC@
+LIB_NANOSLEEP = @LIB_NANOSLEEP@
+LIB_NL_LANGINFO = @LIB_NL_LANGINFO@
+LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@
+LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
+LIB_SELECT = @LIB_SELECT@
+LIB_SETLOCALE_NULL = @LIB_SETLOCALE_NULL@
+LIMITS_H = @LIMITS_H@
+LINGUAS = @LINGUAS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALENAME_ENHANCE_LOCALE_FUNCS = @LOCALENAME_ENHANCE_LOCALE_FUNCS@
+LOCALE_FR = @LOCALE_FR@
+LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
+LOCALE_JA = @LOCALE_JA@
+LOCALE_ZH_CN = @LOCALE_ZH_CN@
+LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBTHREAD = @LTLIBTHREAD@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAKEINFO = @MAKEINFO@
+MANDIR_LAYOUT = @MANDIR_LAYOUT@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MAN_SUBDIRS = @MAN_SUBDIRS@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@
+NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H = @NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_GLOB_H = @NEXT_AS_FIRST_DIRECTIVE_GLOB_H@
+NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
+NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
+NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@
+NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYSEXITS_H = @NEXT_AS_FIRST_DIRECTIVE_SYSEXITS_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_FILE_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_FILE_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@
+NEXT_AS_FIRST_DIRECTIVE_TERMIOS_H = @NEXT_AS_FIRST_DIRECTIVE_TERMIOS_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_UTIME_H = @NEXT_AS_FIRST_DIRECTIVE_UTIME_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
+NEXT_CTYPE_H = @NEXT_CTYPE_H@
+NEXT_DIRENT_H = @NEXT_DIRENT_H@
+NEXT_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_FCNTL_H = @NEXT_FCNTL_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_FNMATCH_H = @NEXT_FNMATCH_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_GLOB_H = @NEXT_GLOB_H@
+NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
+NEXT_LIMITS_H = @NEXT_LIMITS_H@
+NEXT_LOCALE_H = @NEXT_LOCALE_H@
+NEXT_SIGNAL_H = @NEXT_SIGNAL_H@
+NEXT_STDARG_H = @NEXT_STDARG_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRINGS_H = @NEXT_STRINGS_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYSEXITS_H = @NEXT_SYSEXITS_H@
+NEXT_SYS_FILE_H = @NEXT_SYS_FILE_H@
+NEXT_SYS_IOCTL_H = @NEXT_SYS_IOCTL_H@
+NEXT_SYS_RANDOM_H = @NEXT_SYS_RANDOM_H@
+NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
+NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@
+NEXT_TERMIOS_H = @NEXT_TERMIOS_H@
+NEXT_TIME_H = @NEXT_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_UTIME_H = @NEXT_UTIME_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PO4A = @PO4A@
+POSUB = @POSUB@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
+PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PRIPTR_PREFIX = @PRIPTR_PREFIX@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RANLIB = @RANLIB@
+REPLACE_ACCESS = @REPLACE_ACCESS@
+REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@
+REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC_FOR_CALLOC_GNU = @REPLACE_CALLOC_FOR_CALLOC_GNU@
+REPLACE_CALLOC_FOR_CALLOC_POSIX = @REPLACE_CALLOC_FOR_CALLOC_POSIX@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CHMOD = @REPLACE_CHMOD@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_CLOSE = @REPLACE_CLOSE@
+REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@
+REPLACE_COPY_FILE_RANGE = @REPLACE_COPY_FILE_RANGE@
+REPLACE_CREAT = @REPLACE_CREAT@
+REPLACE_CTIME = @REPLACE_CTIME@
+REPLACE_DIRFD = @REPLACE_DIRFD@
+REPLACE_DPRINTF = @REPLACE_DPRINTF@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_EXECL = @REPLACE_EXECL@
+REPLACE_EXECLE = @REPLACE_EXECLE@
+REPLACE_EXECLP = @REPLACE_EXECLP@
+REPLACE_EXECV = @REPLACE_EXECV@
+REPLACE_EXECVE = @REPLACE_EXECVE@
+REPLACE_EXECVP = @REPLACE_EXECVP@
+REPLACE_EXECVPE = @REPLACE_EXECVPE@
+REPLACE_FACCESSAT = @REPLACE_FACCESSAT@
+REPLACE_FCHMODAT = @REPLACE_FCHMODAT@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
+REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
+REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FFSLL = @REPLACE_FFSLL@
+REPLACE_FNMATCH = @REPLACE_FNMATCH@
+REPLACE_FOPEN = @REPLACE_FOPEN@
+REPLACE_FOPEN_FOR_FOPEN_GNU = @REPLACE_FOPEN_FOR_FOPEN_GNU@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
+REPLACE_FREE = @REPLACE_FREE@
+REPLACE_FREELOCALE = @REPLACE_FREELOCALE@
+REPLACE_FREOPEN = @REPLACE_FREOPEN@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
+REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
+REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
+REPLACE_GETPASS_FOR_GETPASS_GNU = @REPLACE_GETPASS_FOR_GETPASS_GNU@
+REPLACE_GETRANDOM = @REPLACE_GETRANDOM@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_GLOB = @REPLACE_GLOB@
+REPLACE_GLOB_PATTERN_P = @REPLACE_GLOB_PATTERN_P@
+REPLACE_GMTIME = @REPLACE_GMTIME@
+REPLACE_INITSTATE = @REPLACE_INITSTATE@
+REPLACE_IOCTL = @REPLACE_IOCTL@
+REPLACE_ISATTY = @REPLACE_ISATTY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
+REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ISWDIGIT = @REPLACE_ISWDIGIT@
+REPLACE_ISWXDIGIT = @REPLACE_ISWXDIGIT@
+REPLACE_ITOLD = @REPLACE_ITOLD@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALECONV = @REPLACE_LOCALECONV@
+REPLACE_LOCALTIME = @REPLACE_LOCALTIME@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC_FOR_MALLOC_GNU = @REPLACE_MALLOC_FOR_MALLOC_GNU@
+REPLACE_MALLOC_FOR_MALLOC_POSIX = @REPLACE_MALLOC_FOR_MALLOC_POSIX@
+REPLACE_MBRLEN = @REPLACE_MBRLEN@
+REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
+REPLACE_MBSINIT = @REPLACE_MBSINIT@
+REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
+REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
+REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MBTOWC = @REPLACE_MBTOWC@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
+REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@
+REPLACE_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKNODAT = @REPLACE_MKNODAT@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
+REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
+REPLACE_OPEN = @REPLACE_OPEN@
+REPLACE_OPENAT = @REPLACE_OPENAT@
+REPLACE_OPENDIR = @REPLACE_OPENDIR@
+REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@
+REPLACE_PREAD = @REPLACE_PREAD@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PSELECT = @REPLACE_PSELECT@
+REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@
+REPLACE_PTSNAME = @REPLACE_PTSNAME@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
+REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_QSORT_R = @REPLACE_QSORT_R@
+REPLACE_RAISE = @REPLACE_RAISE@
+REPLACE_RANDOM = @REPLACE_RANDOM@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_READLINKAT = @REPLACE_READLINKAT@
+REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@
+REPLACE_REALLOC_FOR_REALLOC_GNU = @REPLACE_REALLOC_FOR_REALLOC_GNU@
+REPLACE_REALLOC_FOR_REALLOC_POSIX = @REPLACE_REALLOC_FOR_REALLOC_POSIX@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SELECT = @REPLACE_SELECT@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
+REPLACE_SETSTATE = @REPLACE_SETSTATE@
+REPLACE_SLEEP = @REPLACE_SLEEP@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
+REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@
+REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRFTIME = @REPLACE_STRFTIME@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRTOL = @REPLACE_STRTOL@
+REPLACE_STRTOLD = @REPLACE_STRTOLD@
+REPLACE_STRTOLL = @REPLACE_STRTOLL@
+REPLACE_STRTOUL = @REPLACE_STRTOUL@
+REPLACE_STRTOULL = @REPLACE_STRTOULL@
+REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@
+REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
+REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
+REPLACE_TRUNCATE = @REPLACE_TRUNCATE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_TZSET = @REPLACE_TZSET@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIME = @REPLACE_UTIME@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSFTIME = @REPLACE_WCSFTIME@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
+REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSTOK = @REPLACE_WCSTOK@
+REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
+REPLACE_WCTOB = @REPLACE_WCTOB@
+REPLACE_WCTOMB = @REPLACE_WCTOMB@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
+REPLACE_WRITE = @REPLACE_WRITE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
+STDALIGN_H = @STDALIGN_H@
+STDARG_H = @STDARG_H@
+STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+SYSEXITS_H = @SYSEXITS_H@
+SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@
+SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
+TBL_X_FORMAT = @TBL_X_FORMAT@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@
+TRANS_APROPOS = @TRANS_APROPOS@
+TRANS_APROPOS_UPPER = @TRANS_APROPOS_UPPER@
+TRANS_CATMAN = @TRANS_CATMAN@
+TRANS_CATMAN_UPPER = @TRANS_CATMAN_UPPER@
+TRANS_LEXGROG = @TRANS_LEXGROG@
+TRANS_LEXGROG_UPPER = @TRANS_LEXGROG_UPPER@
+TRANS_MAN = @TRANS_MAN@
+TRANS_MANCONV = @TRANS_MANCONV@
+TRANS_MANCONV_UPPER = @TRANS_MANCONV_UPPER@
+TRANS_MANDB = @TRANS_MANDB@
+TRANS_MANDB_UPPER = @TRANS_MANDB_UPPER@
+TRANS_MANPATH = @TRANS_MANPATH@
+TRANS_MANPATH_UPPER = @TRANS_MANPATH_UPPER@
+TRANS_MAN_RECODE = @TRANS_MAN_RECODE@
+TRANS_MAN_RECODE_UPPER = @TRANS_MAN_RECODE_UPPER@
+TRANS_MAN_UPPER = @TRANS_MAN_UPPER@
+TRANS_WHATIS = @TRANS_WHATIS@
+TRANS_WHATIS_UPPER = @TRANS_WHATIS_UPPER@
+TRANS_ZSOELIM = @TRANS_ZSOELIM@
+TRANS_ZSOELIM_UPPER = @TRANS_ZSOELIM_UPPER@
+TROFF = @TROFF@
+UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@
+UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
+UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
+UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@
+UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+WARN_CFLAGS = @WARN_CFLAGS@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@
+WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+browser = @browser@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+bzip2 = @bzip2@
+cache_top_owner = @cache_top_owner@
+cat = @cat@
+col = @col@
+compress = @compress@
+compressor = @compressor@
+config_file = @config_file@
+config_file_basename = @config_file_basename@
+config_file_dirname = @config_file_dirname@
+datadir = @datadir@
+datarootdir = @datarootdir@
+date = @date@
+docdir = @docdir@
+dvidir = @dvidir@
+eqn = @eqn@
+exec_prefix = @exec_prefix@
+gl_LIBOBJDEPS = @gl_LIBOBJDEPS@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+gltests_LIBOBJDEPS = @gltests_LIBOBJDEPS@
+gltests_LIBOBJS = @gltests_LIBOBJS@
+gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
+grap = @grap@
+grep = @grep@
+gzip = @gzip@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+libpipeline_CFLAGS = @libpipeline_CFLAGS@
+libpipeline_LIBS = @libpipeline_LIBS@
+libseccomp_CFLAGS = @libseccomp_CFLAGS@
+libseccomp_LIBS = @libseccomp_LIBS@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lzip = @lzip@
+lzma = @lzma@
+man_mode = @man_mode@
+man_owner = @man_owner@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+neqn = @neqn@
+nroff = @nroff@
+oldincludedir = @oldincludedir@
+override_dir = @override_dir@
+pager = @pager@
+pdfdir = @pdfdir@
+pic = @pic@
+preconv = @preconv@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+refer = @refer@
+roff_version = @roff_version@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sections = @sections@
+sharedstatedir = @sharedstatedir@
+snapdir = @snapdir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
+systemdtmpfilesdir = @systemdtmpfilesdir@
+target_alias = @target_alias@
+tbl = @tbl@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+tr = @tr@
+troff = @troff@
+troff_as_troff_input = @troff_as_troff_input@
+troff_is_groff = @troff_is_groff@
+vgrind = @vgrind@
+xz = @xz@
+zstd = @zstd@
+AUTOMAKE_OPTIONS = 1.14 gnits subdir-objects
+SUBDIRS =
+noinst_HEADERS =
+noinst_LIBRARIES =
+noinst_LTLIBRARIES = libgnu.la
+EXTRA_DIST = alloca.c alloca.in.h assure.h attribute.h basename-lgpl.h \
+ calloc.c calloc.c canonicalize.h chdir-long.h cloexec.h \
+ dirent-private.h ctype.in.h dirent.in.h stripslash.c dirname.h \
+ dynarray.h malloc/dynarray-skeleton.c malloc/dynarray.h \
+ eloop-threshold.h errno.in.h error.h exitfail.h fcntl.in.h \
+ fd-hook.h file-set.h filename.h filenamecat.h flexmember.h \
+ float.in.h fnmatch.c fnmatch_loop.c fnmatch.c fnmatch.in.h \
+ stat-w32.c stat-w32.h at-func.c getopt-cdefs.in.h \
+ getopt-core.h getopt-ext.h getopt-pfx-core.h getopt-pfx-ext.h \
+ getopt.in.h getopt_int.h \
+ $(top_srcdir)/build-aux/gitlog-to-changelog glob_internal.h \
+ glob-libc.h glob.in.h $(top_srcdir)/build-aux/gnupload \
+ hard-locale.h hash.h hash-triple.h \
+ $(top_srcdir)/build-aux/config.rpath ialloc.h idpriv.h \
+ idpriv.h intprops.h inttypes.in.h w32sock.h langinfo.in.h \
+ cdefs.h libc-config.h limits.in.h localcharset.h locale.in.h \
+ malloc.c malloc.c malloca.h lc-charset-dispatch.c \
+ lc-charset-dispatch.h mbrtowc-impl-utf8.h mbrtowc-impl.h \
+ mbtowc-lock.c mbtowc-lock.h windows-initguard.h \
+ mbsrtowcs-impl.h mbsrtowcs-state.c mbtowc-impl.h \
+ memchr.valgrind memmem.c memmem.c str-two-way.h msvc-inval.h \
+ msvc-nothrow.h windows-initguard.h nonblocking.h stdio-read.c \
+ stdio-write.c openat.h dirent-private.h pathmax.h \
+ rawmemchr.valgrind dirent-private.h at-func.c realloc.c \
+ realloc.c regcomp.c regex.h regex_internal.c regex_internal.h \
+ regexec.c at-func2.c at-func2.c renameatu.h dirent-private.h \
+ same-inode.h save-cwd.h malloc/scratch_buffer.h \
+ scratch_buffer.h setlocale_null.h windows-initguard.h \
+ sig-handler.h signal.in.h stdio-write.c _Noreturn.h \
+ arg-nonnull.h c++defs.h warn-on-use.h w32sock.h stat-w32.c \
+ stat-w32.h stat-time.h stdalign.in.h stdarg.in.h stdbool.in.h \
+ stddef.in.h stdint.in.h stdio.in.h stdlib.in.h stdopen.h \
+ strcasestr.c str-two-way.h strcasestr.c strchrnul.valgrind \
+ streq.h strerror-override.h string.in.h strings.in.h \
+ sys_file.in.h sys_ioctl.in.h sys_random.in.h sys_select.in.h \
+ sys_socket.in.h sys_stat.in.h sys_time.in.h sys_types.in.h \
+ sys_uio.in.h sysexits.in.h tempname.h termios.in.h time.in.h \
+ timespec.h unistd.in.h unistd--.h unistd-safer.h at-func.c \
+ utime.in.h utimens.h asnprintf.c float+.h printf-args.c \
+ printf-args.h printf-parse.c printf-parse.h vasnprintf.c \
+ vasnprintf.h asprintf.c vasprintf.c verify.h vsnprintf.c \
+ wchar.in.h wctype.in.h windows-initguard.h windows-mutex.h \
+ windows-once.h windows-initguard.h windows-recmutex.h \
+ windows-initguard.h windows-rwlock.h wmemchr-impl.h xalloc.h \
+ xalloc.h xalloc-oversized.h xgetcwd.h xstdopen.h xalloc.h
+BUILT_SOURCES = $(ALLOCA_H) ctype.h dirent.h malloc/dynarray.gl.h \
+ malloc/dynarray-skeleton.gl.h $(ERRNO_H) fcntl.h $(FLOAT_H) \
+ $(FNMATCH_H) $(GETOPT_H) $(GETOPT_CDEFS_H) $(GLOB_H) \
+ glob-libc.gl.h inttypes.h langinfo.h $(LIMITS_H) locale.h \
+ malloc/scratch_buffer.gl.h signal.h $(STDALIGN_H) $(STDARG_H) \
+ $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) stdio.h stdlib.h string.h \
+ strings.h sys/file.h sys/ioctl.h sys/random.h sys/select.h \
+ sys/socket.h sys/stat.h sys/time.h sys/types.h sys/uio.h \
+ $(SYSEXITS_H) termios.h time.h unistd.h utime.h wchar.h \
+ wctype.h
+SUFFIXES =
+MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t ctype.h \
+ ctype.h-t dirent.h dirent.h-t malloc/dynarray.gl.h \
+ malloc/dynarray.gl.h-t malloc/dynarray-skeleton.gl.h \
+ malloc/dynarray-skeleton.gl.h-t errno.h errno.h-t fcntl.h \
+ fcntl.h-t float.h float.h-t fnmatch.h fnmatch.h-t getopt.h \
+ getopt.h-t getopt-cdefs.h getopt-cdefs.h-t glob.h glob.h-t \
+ glob-libc.gl.h glob-libc.gl.h-t inttypes.h inttypes.h-t \
+ langinfo.h langinfo.h-t limits.h limits.h-t locale.h \
+ locale.h-t malloc/scratch_buffer.gl.h \
+ malloc/scratch_buffer.gl.h-t signal.h signal.h-t stdalign.h \
+ stdalign.h-t stdarg.h stdarg.h-t stdbool.h stdbool.h-t \
+ stddef.h stddef.h-t stdint.h stdint.h-t stdio.h stdio.h-t \
+ stdlib.h stdlib.h-t string.h string.h-t strings.h strings.h-t \
+ sys/file.h sys/file.h-t sys/ioctl.h sys/ioctl.h-t sys/random.h \
+ sys/random.h-t sys/select.h sys/select.h-t sys/socket.h \
+ sys/socket.h-t sys/stat.h sys/stat.h-t sys/time.h sys/time.h-t \
+ sys/types.h sys/types.h-t sys/uio.h sys/uio.h-t sysexits.h \
+ sysexits.h-t termios.h termios.h-t time.h time.h-t unistd.h \
+ unistd.h-t utime.h utime.h-t wchar.h wchar.h-t wctype.h \
+ wctype.h-t
+MOSTLYCLEANDIRS = sys sys sys sys sys sys sys
+CLEANFILES =
+DISTCLEANFILES =
+MAINTAINERCLEANFILES =
+# No GNU Make output.
+AM_CPPFLAGS = -DDEFAULT_TEXT_DOMAIN=\"man-db-gnulib\"
+AM_CFLAGS =
+libgnu_la_SOURCES = argp.h argp-ba.c argp-eexst.c argp-fmtstream.c \
+ argp-fmtstream.h argp-fs-xinl.c argp-help.c argp-namefrob.h \
+ argp-parse.c argp-pin.c argp-pv.c argp-pvh.c argp-xinl.c \
+ gl_array_list.h gl_array_list.c openat-priv.h openat-proc.c \
+ basename-lgpl.c bitrotate.h bitrotate.c $(am__append_1) \
+ canonicalize.c $(am__append_2) $(am__append_3) $(am__append_4) \
+ $(am__append_5) cloexec.c $(am__append_6) $(am__append_7) \
+ $(am__append_8) dirname.c basename.c dirname-lgpl.c \
+ stripslash.c $(am__append_9) $(am__append_10) \
+ malloc/dynarray_at_failure.c malloc/dynarray_emplace_enlarge.c \
+ malloc/dynarray_finalize.c malloc/dynarray_resize.c \
+ malloc/dynarray_resize_clear.c $(am__append_11) exitfail.c \
+ $(am__append_12) $(am__append_13) fd-hook.c fd-safer-flag.c \
+ dup-safer-flag.c $(am__append_14) file-set.c \
+ filenamecat-lgpl.c $(am__append_15) $(am__append_16) \
+ $(am__append_17) $(am__append_18) $(am__append_19) \
+ $(am__append_20) $(am__append_21) $(am__append_22) \
+ $(am__append_23) $(am__append_24) $(am__append_25) \
+ $(am__append_26) $(am__append_27) getprogname.h getprogname.c \
+ $(am__append_28) gettext.h gettime.c $(am__append_29) \
+ $(am__append_30) $(am__append_31) hard-locale.c hash.c \
+ gl_hash_map.h gl_hash_map.c gl_anyhash1.h gl_anyhash2.h \
+ gl_anyhash_primes.h hash-pjw.h hash-pjw.c hash-pjw-bare.h \
+ hash-pjw-bare.c gl_hash_set.h gl_hash_set.c gl_anyhash1.h \
+ gl_anyhash2.h gl_anyhash_primes.h hash-triple-simple.c \
+ ialloc.c idpriv-drop.c idpriv-droptemp.c idx.h \
+ $(am__append_32) $(am__append_33) $(am__append_34) \
+ gl_linkedhash_list.h gl_linkedhash_list.c gl_anyhash1.h \
+ gl_anyhash2.h gl_anyhash_primes.h gl_anylinked_list1.h \
+ gl_anylinked_list2.h gl_list.h gl_list.c localcharset.c \
+ $(am__append_35) glthread/lock.h glthread/lock.c \
+ $(am__append_36) malloca.c gl_map.h gl_map.c $(am__append_37) \
+ $(am__append_38) $(am__append_39) $(am__append_40) \
+ $(am__append_41) $(am__append_42) $(am__append_43) minmax.h \
+ $(am__append_44) $(am__append_45) $(am__append_46) \
+ $(am__append_47) $(am__append_48) $(am__append_49) \
+ $(am__append_50) $(am__append_51) nonblocking.c \
+ $(am__append_52) $(am__append_53) openat-die.c \
+ $(am__append_54) $(am__append_55) progname.h progname.c \
+ $(am__append_56) $(am__append_57) $(am__append_58) \
+ $(am__append_59) gl_rbtree_list.h gl_rbtree_list.c \
+ gl_anyrbtree_list1.h gl_anyrbtree_list2.h gl_anytree_list1.h \
+ gl_anytree_list2.h $(am__append_60) $(am__append_61) \
+ $(am__append_62) $(am__append_63) $(am__append_64) \
+ $(am__append_65) $(am__append_66) renameatu.c $(am__append_67) \
+ $(am__append_68) save-cwd.c malloc/scratch_buffer_dupfree.c \
+ malloc/scratch_buffer_grow.c \
+ malloc/scratch_buffer_grow_preserve.c \
+ malloc/scratch_buffer_set_array_size.c $(am__append_69) \
+ gl_set.h gl_set.c $(am__append_70) setlocale_null.c \
+ $(am__append_71) $(am__append_72) sig-handler.c \
+ $(am__append_73) size_max.h $(am__append_74) sockets.h \
+ sockets.c $(am__append_75) stat-time.c $(am__append_76) \
+ $(am__append_77) stdopen.c $(am__append_78) $(am__append_79) \
+ $(am__append_80) $(am__append_81) $(am__append_82) \
+ $(am__append_83) $(am__append_84) $(am__append_85) \
+ $(am__append_86) strnlen1.h strnlen1.c $(am__append_87) \
+ sys_socket.c tempname.c glthread/threadlib.c timespec.c \
+ unistd.c dup-safer.c fd-safer.c pipe-safer.c $(am__append_88) \
+ $(am__append_89) $(am__append_90) utimens.c verror.h verror.c \
+ $(am__append_91) wctype-h.c $(am__append_92) $(am__append_93) \
+ $(am__append_94) $(am__append_95) $(am__append_96) \
+ $(am__append_97) xmalloc.c xalloc-die.c xgetcwd.c gl_xlist.h \
+ gl_xlist.c gl_xmap.h gl_xmap.c gl_xset.h gl_xset.c xsize.h \
+ xsize.c xstdopen.c xstrndup.h xstrndup.c xvasprintf.h \
+ xvasprintf.c xasprintf.c
+libgnu_la_CFLAGS = $(AM_CFLAGS) $(GL_CFLAG_GNULIB_WARNINGS)
+libgnu_la_LIBADD = $(gl_LTLIBOBJS) @LTALLOCA@
+libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS) @LTALLOCA@
+EXTRA_libgnu_la_SOURCES = alloca.c calloc.c calloc.c stripslash.c \
+ malloc/dynarray-skeleton.c fnmatch.c fnmatch_loop.c fnmatch.c \
+ stat-w32.c at-func.c malloc.c malloc.c lc-charset-dispatch.c \
+ mbtowc-lock.c mbsrtowcs-state.c memmem.c memmem.c stdio-read.c \
+ stdio-write.c at-func.c realloc.c realloc.c regcomp.c \
+ regex_internal.c regexec.c at-func2.c at-func2.c stdio-write.c \
+ stat-w32.c strcasestr.c strcasestr.c at-func.c asnprintf.c \
+ printf-args.c printf-parse.c vasnprintf.c asprintf.c \
+ vasprintf.c vsnprintf.c
+libgnu_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(LIBSOCKET) \
+ $(LIBTHREAD) $(LIB_CLOCK_GETTIME) $(LIB_GETLOGIN) \
+ $(LIB_GETRANDOM) $(LIB_HARD_LOCALE) $(LIB_MBRTOWC) \
+ $(LIB_NANOSLEEP) $(LIB_PTHREAD_SIGMASK) $(LIB_SELECT) \
+ $(LIB_SETLOCALE_NULL) $(LTLIBINTL)
+
+# Use this preprocessor expression to decide whether #include_next works.
+# Do not rely on a 'configure'-time test for this, since the expression
+# might appear in an installed header, which is used by some other compiler.
+HAVE_INCLUDE_NEXT = (__GNUC__ || __clang__ || 60000000 <= __DECC_VER)
+
+# In 'sed', replace the pattern space with a "DO NOT EDIT" comment.
+SED_HEADER_NOEDIT = s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,
+
+# '$(SED_HEADER_STDOUT) -e "..."' runs 'sed' but first outputs "DO NOT EDIT".
+SED_HEADER_STDOUT = sed -e 1h -e '1$(SED_HEADER_NOEDIT)' -e 1G
+
+# '$(SED_HEADER_TO_AT_t) FILE' copies FILE to $@-t, prepending a leading
+# "DO_NOT_EDIT". Although this could be done more simply via:
+# SED_HEADER_TO_AT_t = $(SED_HEADER_STDOUT) > $@-t
+# the -n and 'w' avoid a fork+exec, at least when GNU Make is used.
+SED_HEADER_TO_AT_t = $(SED_HEADER_STDOUT) -n -e 'w $@-t'
+
+# Use $(gl_V_at) instead of $(AM_V_GEN) or $(AM_V_at) on a line that
+gl_V_at = $(AM_V_GEN)
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+_NORETURN_H = $(srcdir)/_Noreturn.h
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+ARG_NONNULL_H = $(srcdir)/arg-nonnull.h
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+CXXDEFS_H = $(srcdir)/c++defs.h
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+WARN_ON_USE_H = $(srcdir)/warn-on-use.h
+all: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits gl/lib/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnits gl/lib/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+malloc/$(am__dirstamp):
+ @$(MKDIR_P) malloc
+ @: > malloc/$(am__dirstamp)
+malloc/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) malloc/$(DEPDIR)
+ @: > malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/libgnu_la-dynarray_at_failure.lo: malloc/$(am__dirstamp) \
+ malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/libgnu_la-dynarray_emplace_enlarge.lo: malloc/$(am__dirstamp) \
+ malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/libgnu_la-dynarray_finalize.lo: malloc/$(am__dirstamp) \
+ malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/libgnu_la-dynarray_resize.lo: malloc/$(am__dirstamp) \
+ malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/libgnu_la-dynarray_resize_clear.lo: malloc/$(am__dirstamp) \
+ malloc/$(DEPDIR)/$(am__dirstamp)
+glthread/$(am__dirstamp):
+ @$(MKDIR_P) glthread
+ @: > glthread/$(am__dirstamp)
+glthread/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) glthread/$(DEPDIR)
+ @: > glthread/$(DEPDIR)/$(am__dirstamp)
+glthread/libgnu_la-lock.lo: glthread/$(am__dirstamp) \
+ glthread/$(DEPDIR)/$(am__dirstamp)
+malloc/libgnu_la-scratch_buffer_dupfree.lo: malloc/$(am__dirstamp) \
+ malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/libgnu_la-scratch_buffer_grow.lo: malloc/$(am__dirstamp) \
+ malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/libgnu_la-scratch_buffer_grow_preserve.lo: \
+ malloc/$(am__dirstamp) malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/libgnu_la-scratch_buffer_set_array_size.lo: \
+ malloc/$(am__dirstamp) malloc/$(DEPDIR)/$(am__dirstamp)
+glthread/libgnu_la-threadlib.lo: glthread/$(am__dirstamp) \
+ glthread/$(DEPDIR)/$(am__dirstamp)
+malloc/libgnu_la-dynarray-skeleton.lo: malloc/$(am__dirstamp) \
+ malloc/$(DEPDIR)/$(am__dirstamp)
+
+libgnu.la: $(libgnu_la_OBJECTS) $(libgnu_la_DEPENDENCIES) $(EXTRA_libgnu_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(libgnu_la_LINK) $(libgnu_la_OBJECTS) $(libgnu_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f glthread/*.$(OBJEXT)
+ -rm -f glthread/*.lo
+ -rm -f malloc/*.$(OBJEXT)
+ -rm -f malloc/*.lo
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloca.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-alloca.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-argp-ba.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-argp-eexst.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-argp-fmtstream.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-argp-fs-xinl.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-argp-help.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-argp-parse.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-argp-pin.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-argp-pv.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-argp-pvh.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-argp-xinl.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-asnprintf.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-asprintf.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-at-func.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-at-func2.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-basename-lgpl.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-basename.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-bitrotate.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-btowc.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-calloc.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-canonicalize-lgpl.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-canonicalize.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-chdir-long.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-chown.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-cloexec.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-close.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-closedir.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-dirfd.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-dirname-lgpl.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-dirname.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-dup-safer-flag.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-dup-safer.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-dup.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-dup2.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-error.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-exitfail.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-fchdir.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-fchown-stub.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-fcntl.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-fd-hook.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-fd-safer-flag.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-fd-safer.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-fdopendir.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-file-set.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-filenamecat-lgpl.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-float.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-flock.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-fnmatch.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-fnmatch_loop.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-free.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-fstat.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-fstatat.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-getcwd-lgpl.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-getcwd.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-getdelim.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-getdtablesize.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-getline.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-getlogin_r.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-getopt.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-getopt1.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-getprogname.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-getrandom.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-gettime.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-gettimeofday.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-gl_array_list.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-gl_hash_map.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-gl_hash_set.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-gl_linkedhash_list.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-gl_list.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-gl_map.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-gl_rbtree_list.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-gl_set.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-gl_xlist.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-gl_xmap.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-gl_xset.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-glob.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-glob_pattern_p.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-globfree.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-hard-locale.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-hash-pjw-bare.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-hash-pjw.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-hash-triple-simple.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-hash.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-ialloc.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-idpriv-drop.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-idpriv-droptemp.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-ioctl.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-isblank.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-itold.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-lc-charset-dispatch.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-lchown.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-localcharset.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-localeconv.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-lstat.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-malloc.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-malloca.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-mbrtowc.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-mbsinit.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-mbsrtowcs-state.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-mbsrtowcs.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-mbtowc-lock.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-mbtowc.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-memchr.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-memmem.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-mempcpy.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-memrchr.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-mkdir.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-mkdtemp.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-mkstemp.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-msvc-inval.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-msvc-nothrow.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-nanosleep.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-nl_langinfo-lock.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-nl_langinfo.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-nonblocking.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-open.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-openat-die.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-openat-proc.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-openat.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-opendir.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-pipe-safer.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-pipe.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-printf-args.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-printf-parse.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-progname.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-pselect.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-pthread_sigmask.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-raise.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-rawmemchr.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-readdir.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-readlink.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-readlinkat.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-realloc.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-reallocarray.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-regcomp.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-regex.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-regex_internal.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-regexec.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-rename.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-renameat.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-renameatu.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-rewinddir.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-rmdir.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-save-cwd.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-select.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-setenv.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-setlocale-lock.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-setlocale_null.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-sig-handler.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-sigaction.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-sigprocmask.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-sleep.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-sockets.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-stat-time.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-stat-w32.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-stat.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-stdio-read.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-stdio-write.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-stdopen.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-stpcpy.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-strcasecmp.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-strcasestr.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-strchrnul.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-strdup.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-strerror-override.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-strerror.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-stripslash.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-strncasecmp.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-strndup.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-strnlen.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-strnlen1.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-strsep.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-sys_socket.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-tempname.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-timespec.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-unistd.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-unlink.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-unlinkat.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-utime.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-utimens.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-vasnprintf.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-vasprintf.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-verror.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-vsnprintf.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-wcrtomb.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-wctype-h.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-windows-mutex.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-windows-once.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-windows-recmutex.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-windows-rwlock.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-wmemchr.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-wmempcpy.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-xalloc-die.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-xasprintf.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-xgetcwd.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-xmalloc.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-xsize.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-xstdopen.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-xstrndup.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-xvasprintf.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@glthread/$(DEPDIR)/libgnu_la-lock.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@glthread/$(DEPDIR)/libgnu_la-threadlib.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_la-dynarray-skeleton.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_la-dynarray_at_failure.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_la-dynarray_emplace_enlarge.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_la-dynarray_finalize.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_la-dynarray_resize.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_la-dynarray_resize_clear.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_la-scratch_buffer_dupfree.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow_preserve.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_la-scratch_buffer_set_array_size.Plo@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+libgnu_la-argp-ba.lo: argp-ba.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-argp-ba.lo -MD -MP -MF $(DEPDIR)/libgnu_la-argp-ba.Tpo -c -o libgnu_la-argp-ba.lo `test -f 'argp-ba.c' || echo '$(srcdir)/'`argp-ba.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-argp-ba.Tpo $(DEPDIR)/libgnu_la-argp-ba.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='argp-ba.c' object='libgnu_la-argp-ba.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-argp-ba.lo `test -f 'argp-ba.c' || echo '$(srcdir)/'`argp-ba.c
+
+libgnu_la-argp-eexst.lo: argp-eexst.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-argp-eexst.lo -MD -MP -MF $(DEPDIR)/libgnu_la-argp-eexst.Tpo -c -o libgnu_la-argp-eexst.lo `test -f 'argp-eexst.c' || echo '$(srcdir)/'`argp-eexst.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-argp-eexst.Tpo $(DEPDIR)/libgnu_la-argp-eexst.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='argp-eexst.c' object='libgnu_la-argp-eexst.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-argp-eexst.lo `test -f 'argp-eexst.c' || echo '$(srcdir)/'`argp-eexst.c
+
+libgnu_la-argp-fmtstream.lo: argp-fmtstream.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-argp-fmtstream.lo -MD -MP -MF $(DEPDIR)/libgnu_la-argp-fmtstream.Tpo -c -o libgnu_la-argp-fmtstream.lo `test -f 'argp-fmtstream.c' || echo '$(srcdir)/'`argp-fmtstream.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-argp-fmtstream.Tpo $(DEPDIR)/libgnu_la-argp-fmtstream.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='argp-fmtstream.c' object='libgnu_la-argp-fmtstream.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-argp-fmtstream.lo `test -f 'argp-fmtstream.c' || echo '$(srcdir)/'`argp-fmtstream.c
+
+libgnu_la-argp-fs-xinl.lo: argp-fs-xinl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-argp-fs-xinl.lo -MD -MP -MF $(DEPDIR)/libgnu_la-argp-fs-xinl.Tpo -c -o libgnu_la-argp-fs-xinl.lo `test -f 'argp-fs-xinl.c' || echo '$(srcdir)/'`argp-fs-xinl.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-argp-fs-xinl.Tpo $(DEPDIR)/libgnu_la-argp-fs-xinl.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='argp-fs-xinl.c' object='libgnu_la-argp-fs-xinl.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-argp-fs-xinl.lo `test -f 'argp-fs-xinl.c' || echo '$(srcdir)/'`argp-fs-xinl.c
+
+libgnu_la-argp-help.lo: argp-help.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-argp-help.lo -MD -MP -MF $(DEPDIR)/libgnu_la-argp-help.Tpo -c -o libgnu_la-argp-help.lo `test -f 'argp-help.c' || echo '$(srcdir)/'`argp-help.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-argp-help.Tpo $(DEPDIR)/libgnu_la-argp-help.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='argp-help.c' object='libgnu_la-argp-help.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-argp-help.lo `test -f 'argp-help.c' || echo '$(srcdir)/'`argp-help.c
+
+libgnu_la-argp-parse.lo: argp-parse.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-argp-parse.lo -MD -MP -MF $(DEPDIR)/libgnu_la-argp-parse.Tpo -c -o libgnu_la-argp-parse.lo `test -f 'argp-parse.c' || echo '$(srcdir)/'`argp-parse.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-argp-parse.Tpo $(DEPDIR)/libgnu_la-argp-parse.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='argp-parse.c' object='libgnu_la-argp-parse.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-argp-parse.lo `test -f 'argp-parse.c' || echo '$(srcdir)/'`argp-parse.c
+
+libgnu_la-argp-pin.lo: argp-pin.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-argp-pin.lo -MD -MP -MF $(DEPDIR)/libgnu_la-argp-pin.Tpo -c -o libgnu_la-argp-pin.lo `test -f 'argp-pin.c' || echo '$(srcdir)/'`argp-pin.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-argp-pin.Tpo $(DEPDIR)/libgnu_la-argp-pin.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='argp-pin.c' object='libgnu_la-argp-pin.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-argp-pin.lo `test -f 'argp-pin.c' || echo '$(srcdir)/'`argp-pin.c
+
+libgnu_la-argp-pv.lo: argp-pv.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-argp-pv.lo -MD -MP -MF $(DEPDIR)/libgnu_la-argp-pv.Tpo -c -o libgnu_la-argp-pv.lo `test -f 'argp-pv.c' || echo '$(srcdir)/'`argp-pv.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-argp-pv.Tpo $(DEPDIR)/libgnu_la-argp-pv.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='argp-pv.c' object='libgnu_la-argp-pv.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-argp-pv.lo `test -f 'argp-pv.c' || echo '$(srcdir)/'`argp-pv.c
+
+libgnu_la-argp-pvh.lo: argp-pvh.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-argp-pvh.lo -MD -MP -MF $(DEPDIR)/libgnu_la-argp-pvh.Tpo -c -o libgnu_la-argp-pvh.lo `test -f 'argp-pvh.c' || echo '$(srcdir)/'`argp-pvh.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-argp-pvh.Tpo $(DEPDIR)/libgnu_la-argp-pvh.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='argp-pvh.c' object='libgnu_la-argp-pvh.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-argp-pvh.lo `test -f 'argp-pvh.c' || echo '$(srcdir)/'`argp-pvh.c
+
+libgnu_la-argp-xinl.lo: argp-xinl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-argp-xinl.lo -MD -MP -MF $(DEPDIR)/libgnu_la-argp-xinl.Tpo -c -o libgnu_la-argp-xinl.lo `test -f 'argp-xinl.c' || echo '$(srcdir)/'`argp-xinl.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-argp-xinl.Tpo $(DEPDIR)/libgnu_la-argp-xinl.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='argp-xinl.c' object='libgnu_la-argp-xinl.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-argp-xinl.lo `test -f 'argp-xinl.c' || echo '$(srcdir)/'`argp-xinl.c
+
+libgnu_la-gl_array_list.lo: gl_array_list.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-gl_array_list.lo -MD -MP -MF $(DEPDIR)/libgnu_la-gl_array_list.Tpo -c -o libgnu_la-gl_array_list.lo `test -f 'gl_array_list.c' || echo '$(srcdir)/'`gl_array_list.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-gl_array_list.Tpo $(DEPDIR)/libgnu_la-gl_array_list.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gl_array_list.c' object='libgnu_la-gl_array_list.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-gl_array_list.lo `test -f 'gl_array_list.c' || echo '$(srcdir)/'`gl_array_list.c
+
+libgnu_la-openat-proc.lo: openat-proc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-openat-proc.lo -MD -MP -MF $(DEPDIR)/libgnu_la-openat-proc.Tpo -c -o libgnu_la-openat-proc.lo `test -f 'openat-proc.c' || echo '$(srcdir)/'`openat-proc.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-openat-proc.Tpo $(DEPDIR)/libgnu_la-openat-proc.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openat-proc.c' object='libgnu_la-openat-proc.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-openat-proc.lo `test -f 'openat-proc.c' || echo '$(srcdir)/'`openat-proc.c
+
+libgnu_la-basename-lgpl.lo: basename-lgpl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-basename-lgpl.lo -MD -MP -MF $(DEPDIR)/libgnu_la-basename-lgpl.Tpo -c -o libgnu_la-basename-lgpl.lo `test -f 'basename-lgpl.c' || echo '$(srcdir)/'`basename-lgpl.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-basename-lgpl.Tpo $(DEPDIR)/libgnu_la-basename-lgpl.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='basename-lgpl.c' object='libgnu_la-basename-lgpl.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-basename-lgpl.lo `test -f 'basename-lgpl.c' || echo '$(srcdir)/'`basename-lgpl.c
+
+libgnu_la-bitrotate.lo: bitrotate.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-bitrotate.lo -MD -MP -MF $(DEPDIR)/libgnu_la-bitrotate.Tpo -c -o libgnu_la-bitrotate.lo `test -f 'bitrotate.c' || echo '$(srcdir)/'`bitrotate.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-bitrotate.Tpo $(DEPDIR)/libgnu_la-bitrotate.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bitrotate.c' object='libgnu_la-bitrotate.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-bitrotate.lo `test -f 'bitrotate.c' || echo '$(srcdir)/'`bitrotate.c
+
+libgnu_la-btowc.lo: btowc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-btowc.lo -MD -MP -MF $(DEPDIR)/libgnu_la-btowc.Tpo -c -o libgnu_la-btowc.lo `test -f 'btowc.c' || echo '$(srcdir)/'`btowc.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-btowc.Tpo $(DEPDIR)/libgnu_la-btowc.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='btowc.c' object='libgnu_la-btowc.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-btowc.lo `test -f 'btowc.c' || echo '$(srcdir)/'`btowc.c
+
+libgnu_la-canonicalize.lo: canonicalize.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-canonicalize.lo -MD -MP -MF $(DEPDIR)/libgnu_la-canonicalize.Tpo -c -o libgnu_la-canonicalize.lo `test -f 'canonicalize.c' || echo '$(srcdir)/'`canonicalize.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-canonicalize.Tpo $(DEPDIR)/libgnu_la-canonicalize.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='canonicalize.c' object='libgnu_la-canonicalize.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-canonicalize.lo `test -f 'canonicalize.c' || echo '$(srcdir)/'`canonicalize.c
+
+libgnu_la-canonicalize-lgpl.lo: canonicalize-lgpl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-canonicalize-lgpl.lo -MD -MP -MF $(DEPDIR)/libgnu_la-canonicalize-lgpl.Tpo -c -o libgnu_la-canonicalize-lgpl.lo `test -f 'canonicalize-lgpl.c' || echo '$(srcdir)/'`canonicalize-lgpl.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-canonicalize-lgpl.Tpo $(DEPDIR)/libgnu_la-canonicalize-lgpl.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='canonicalize-lgpl.c' object='libgnu_la-canonicalize-lgpl.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-canonicalize-lgpl.lo `test -f 'canonicalize-lgpl.c' || echo '$(srcdir)/'`canonicalize-lgpl.c
+
+libgnu_la-chdir-long.lo: chdir-long.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-chdir-long.lo -MD -MP -MF $(DEPDIR)/libgnu_la-chdir-long.Tpo -c -o libgnu_la-chdir-long.lo `test -f 'chdir-long.c' || echo '$(srcdir)/'`chdir-long.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-chdir-long.Tpo $(DEPDIR)/libgnu_la-chdir-long.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='chdir-long.c' object='libgnu_la-chdir-long.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-chdir-long.lo `test -f 'chdir-long.c' || echo '$(srcdir)/'`chdir-long.c
+
+libgnu_la-chown.lo: chown.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-chown.lo -MD -MP -MF $(DEPDIR)/libgnu_la-chown.Tpo -c -o libgnu_la-chown.lo `test -f 'chown.c' || echo '$(srcdir)/'`chown.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-chown.Tpo $(DEPDIR)/libgnu_la-chown.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='chown.c' object='libgnu_la-chown.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-chown.lo `test -f 'chown.c' || echo '$(srcdir)/'`chown.c
+
+libgnu_la-fchown-stub.lo: fchown-stub.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-fchown-stub.lo -MD -MP -MF $(DEPDIR)/libgnu_la-fchown-stub.Tpo -c -o libgnu_la-fchown-stub.lo `test -f 'fchown-stub.c' || echo '$(srcdir)/'`fchown-stub.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-fchown-stub.Tpo $(DEPDIR)/libgnu_la-fchown-stub.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fchown-stub.c' object='libgnu_la-fchown-stub.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-fchown-stub.lo `test -f 'fchown-stub.c' || echo '$(srcdir)/'`fchown-stub.c
+
+libgnu_la-cloexec.lo: cloexec.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-cloexec.lo -MD -MP -MF $(DEPDIR)/libgnu_la-cloexec.Tpo -c -o libgnu_la-cloexec.lo `test -f 'cloexec.c' || echo '$(srcdir)/'`cloexec.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-cloexec.Tpo $(DEPDIR)/libgnu_la-cloexec.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cloexec.c' object='libgnu_la-cloexec.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-cloexec.lo `test -f 'cloexec.c' || echo '$(srcdir)/'`cloexec.c
+
+libgnu_la-close.lo: close.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-close.lo -MD -MP -MF $(DEPDIR)/libgnu_la-close.Tpo -c -o libgnu_la-close.lo `test -f 'close.c' || echo '$(srcdir)/'`close.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-close.Tpo $(DEPDIR)/libgnu_la-close.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='close.c' object='libgnu_la-close.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-close.lo `test -f 'close.c' || echo '$(srcdir)/'`close.c
+
+libgnu_la-closedir.lo: closedir.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-closedir.lo -MD -MP -MF $(DEPDIR)/libgnu_la-closedir.Tpo -c -o libgnu_la-closedir.lo `test -f 'closedir.c' || echo '$(srcdir)/'`closedir.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-closedir.Tpo $(DEPDIR)/libgnu_la-closedir.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='closedir.c' object='libgnu_la-closedir.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-closedir.lo `test -f 'closedir.c' || echo '$(srcdir)/'`closedir.c
+
+libgnu_la-dirfd.lo: dirfd.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-dirfd.lo -MD -MP -MF $(DEPDIR)/libgnu_la-dirfd.Tpo -c -o libgnu_la-dirfd.lo `test -f 'dirfd.c' || echo '$(srcdir)/'`dirfd.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-dirfd.Tpo $(DEPDIR)/libgnu_la-dirfd.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dirfd.c' object='libgnu_la-dirfd.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-dirfd.lo `test -f 'dirfd.c' || echo '$(srcdir)/'`dirfd.c
+
+libgnu_la-dirname.lo: dirname.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-dirname.lo -MD -MP -MF $(DEPDIR)/libgnu_la-dirname.Tpo -c -o libgnu_la-dirname.lo `test -f 'dirname.c' || echo '$(srcdir)/'`dirname.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-dirname.Tpo $(DEPDIR)/libgnu_la-dirname.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dirname.c' object='libgnu_la-dirname.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-dirname.lo `test -f 'dirname.c' || echo '$(srcdir)/'`dirname.c
+
+libgnu_la-basename.lo: basename.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-basename.lo -MD -MP -MF $(DEPDIR)/libgnu_la-basename.Tpo -c -o libgnu_la-basename.lo `test -f 'basename.c' || echo '$(srcdir)/'`basename.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-basename.Tpo $(DEPDIR)/libgnu_la-basename.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='basename.c' object='libgnu_la-basename.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-basename.lo `test -f 'basename.c' || echo '$(srcdir)/'`basename.c
+
+libgnu_la-dirname-lgpl.lo: dirname-lgpl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-dirname-lgpl.lo -MD -MP -MF $(DEPDIR)/libgnu_la-dirname-lgpl.Tpo -c -o libgnu_la-dirname-lgpl.lo `test -f 'dirname-lgpl.c' || echo '$(srcdir)/'`dirname-lgpl.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-dirname-lgpl.Tpo $(DEPDIR)/libgnu_la-dirname-lgpl.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dirname-lgpl.c' object='libgnu_la-dirname-lgpl.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-dirname-lgpl.lo `test -f 'dirname-lgpl.c' || echo '$(srcdir)/'`dirname-lgpl.c
+
+libgnu_la-stripslash.lo: stripslash.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-stripslash.lo -MD -MP -MF $(DEPDIR)/libgnu_la-stripslash.Tpo -c -o libgnu_la-stripslash.lo `test -f 'stripslash.c' || echo '$(srcdir)/'`stripslash.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-stripslash.Tpo $(DEPDIR)/libgnu_la-stripslash.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stripslash.c' object='libgnu_la-stripslash.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-stripslash.lo `test -f 'stripslash.c' || echo '$(srcdir)/'`stripslash.c
+
+libgnu_la-dup.lo: dup.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-dup.lo -MD -MP -MF $(DEPDIR)/libgnu_la-dup.Tpo -c -o libgnu_la-dup.lo `test -f 'dup.c' || echo '$(srcdir)/'`dup.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-dup.Tpo $(DEPDIR)/libgnu_la-dup.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dup.c' object='libgnu_la-dup.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-dup.lo `test -f 'dup.c' || echo '$(srcdir)/'`dup.c
+
+libgnu_la-dup2.lo: dup2.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-dup2.lo -MD -MP -MF $(DEPDIR)/libgnu_la-dup2.Tpo -c -o libgnu_la-dup2.lo `test -f 'dup2.c' || echo '$(srcdir)/'`dup2.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-dup2.Tpo $(DEPDIR)/libgnu_la-dup2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dup2.c' object='libgnu_la-dup2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-dup2.lo `test -f 'dup2.c' || echo '$(srcdir)/'`dup2.c
+
+malloc/libgnu_la-dynarray_at_failure.lo: malloc/dynarray_at_failure.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-dynarray_at_failure.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-dynarray_at_failure.Tpo -c -o malloc/libgnu_la-dynarray_at_failure.lo `test -f 'malloc/dynarray_at_failure.c' || echo '$(srcdir)/'`malloc/dynarray_at_failure.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-dynarray_at_failure.Tpo malloc/$(DEPDIR)/libgnu_la-dynarray_at_failure.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_at_failure.c' object='malloc/libgnu_la-dynarray_at_failure.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-dynarray_at_failure.lo `test -f 'malloc/dynarray_at_failure.c' || echo '$(srcdir)/'`malloc/dynarray_at_failure.c
+
+malloc/libgnu_la-dynarray_emplace_enlarge.lo: malloc/dynarray_emplace_enlarge.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-dynarray_emplace_enlarge.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-dynarray_emplace_enlarge.Tpo -c -o malloc/libgnu_la-dynarray_emplace_enlarge.lo `test -f 'malloc/dynarray_emplace_enlarge.c' || echo '$(srcdir)/'`malloc/dynarray_emplace_enlarge.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-dynarray_emplace_enlarge.Tpo malloc/$(DEPDIR)/libgnu_la-dynarray_emplace_enlarge.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_emplace_enlarge.c' object='malloc/libgnu_la-dynarray_emplace_enlarge.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-dynarray_emplace_enlarge.lo `test -f 'malloc/dynarray_emplace_enlarge.c' || echo '$(srcdir)/'`malloc/dynarray_emplace_enlarge.c
+
+malloc/libgnu_la-dynarray_finalize.lo: malloc/dynarray_finalize.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-dynarray_finalize.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-dynarray_finalize.Tpo -c -o malloc/libgnu_la-dynarray_finalize.lo `test -f 'malloc/dynarray_finalize.c' || echo '$(srcdir)/'`malloc/dynarray_finalize.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-dynarray_finalize.Tpo malloc/$(DEPDIR)/libgnu_la-dynarray_finalize.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_finalize.c' object='malloc/libgnu_la-dynarray_finalize.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-dynarray_finalize.lo `test -f 'malloc/dynarray_finalize.c' || echo '$(srcdir)/'`malloc/dynarray_finalize.c
+
+malloc/libgnu_la-dynarray_resize.lo: malloc/dynarray_resize.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-dynarray_resize.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-dynarray_resize.Tpo -c -o malloc/libgnu_la-dynarray_resize.lo `test -f 'malloc/dynarray_resize.c' || echo '$(srcdir)/'`malloc/dynarray_resize.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-dynarray_resize.Tpo malloc/$(DEPDIR)/libgnu_la-dynarray_resize.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_resize.c' object='malloc/libgnu_la-dynarray_resize.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-dynarray_resize.lo `test -f 'malloc/dynarray_resize.c' || echo '$(srcdir)/'`malloc/dynarray_resize.c
+
+malloc/libgnu_la-dynarray_resize_clear.lo: malloc/dynarray_resize_clear.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-dynarray_resize_clear.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-dynarray_resize_clear.Tpo -c -o malloc/libgnu_la-dynarray_resize_clear.lo `test -f 'malloc/dynarray_resize_clear.c' || echo '$(srcdir)/'`malloc/dynarray_resize_clear.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-dynarray_resize_clear.Tpo malloc/$(DEPDIR)/libgnu_la-dynarray_resize_clear.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_resize_clear.c' object='malloc/libgnu_la-dynarray_resize_clear.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-dynarray_resize_clear.lo `test -f 'malloc/dynarray_resize_clear.c' || echo '$(srcdir)/'`malloc/dynarray_resize_clear.c
+
+libgnu_la-error.lo: error.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-error.lo -MD -MP -MF $(DEPDIR)/libgnu_la-error.Tpo -c -o libgnu_la-error.lo `test -f 'error.c' || echo '$(srcdir)/'`error.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-error.Tpo $(DEPDIR)/libgnu_la-error.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='error.c' object='libgnu_la-error.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-error.lo `test -f 'error.c' || echo '$(srcdir)/'`error.c
+
+libgnu_la-exitfail.lo: exitfail.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-exitfail.lo -MD -MP -MF $(DEPDIR)/libgnu_la-exitfail.Tpo -c -o libgnu_la-exitfail.lo `test -f 'exitfail.c' || echo '$(srcdir)/'`exitfail.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-exitfail.Tpo $(DEPDIR)/libgnu_la-exitfail.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='exitfail.c' object='libgnu_la-exitfail.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-exitfail.lo `test -f 'exitfail.c' || echo '$(srcdir)/'`exitfail.c
+
+libgnu_la-fchdir.lo: fchdir.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-fchdir.lo -MD -MP -MF $(DEPDIR)/libgnu_la-fchdir.Tpo -c -o libgnu_la-fchdir.lo `test -f 'fchdir.c' || echo '$(srcdir)/'`fchdir.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-fchdir.Tpo $(DEPDIR)/libgnu_la-fchdir.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fchdir.c' object='libgnu_la-fchdir.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-fchdir.lo `test -f 'fchdir.c' || echo '$(srcdir)/'`fchdir.c
+
+libgnu_la-fcntl.lo: fcntl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-fcntl.lo -MD -MP -MF $(DEPDIR)/libgnu_la-fcntl.Tpo -c -o libgnu_la-fcntl.lo `test -f 'fcntl.c' || echo '$(srcdir)/'`fcntl.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-fcntl.Tpo $(DEPDIR)/libgnu_la-fcntl.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fcntl.c' object='libgnu_la-fcntl.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-fcntl.lo `test -f 'fcntl.c' || echo '$(srcdir)/'`fcntl.c
+
+libgnu_la-fd-hook.lo: fd-hook.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-fd-hook.lo -MD -MP -MF $(DEPDIR)/libgnu_la-fd-hook.Tpo -c -o libgnu_la-fd-hook.lo `test -f 'fd-hook.c' || echo '$(srcdir)/'`fd-hook.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-fd-hook.Tpo $(DEPDIR)/libgnu_la-fd-hook.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fd-hook.c' object='libgnu_la-fd-hook.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-fd-hook.lo `test -f 'fd-hook.c' || echo '$(srcdir)/'`fd-hook.c
+
+libgnu_la-fd-safer-flag.lo: fd-safer-flag.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-fd-safer-flag.lo -MD -MP -MF $(DEPDIR)/libgnu_la-fd-safer-flag.Tpo -c -o libgnu_la-fd-safer-flag.lo `test -f 'fd-safer-flag.c' || echo '$(srcdir)/'`fd-safer-flag.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-fd-safer-flag.Tpo $(DEPDIR)/libgnu_la-fd-safer-flag.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fd-safer-flag.c' object='libgnu_la-fd-safer-flag.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-fd-safer-flag.lo `test -f 'fd-safer-flag.c' || echo '$(srcdir)/'`fd-safer-flag.c
+
+libgnu_la-dup-safer-flag.lo: dup-safer-flag.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-dup-safer-flag.lo -MD -MP -MF $(DEPDIR)/libgnu_la-dup-safer-flag.Tpo -c -o libgnu_la-dup-safer-flag.lo `test -f 'dup-safer-flag.c' || echo '$(srcdir)/'`dup-safer-flag.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-dup-safer-flag.Tpo $(DEPDIR)/libgnu_la-dup-safer-flag.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dup-safer-flag.c' object='libgnu_la-dup-safer-flag.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-dup-safer-flag.lo `test -f 'dup-safer-flag.c' || echo '$(srcdir)/'`dup-safer-flag.c
+
+libgnu_la-fdopendir.lo: fdopendir.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-fdopendir.lo -MD -MP -MF $(DEPDIR)/libgnu_la-fdopendir.Tpo -c -o libgnu_la-fdopendir.lo `test -f 'fdopendir.c' || echo '$(srcdir)/'`fdopendir.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-fdopendir.Tpo $(DEPDIR)/libgnu_la-fdopendir.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fdopendir.c' object='libgnu_la-fdopendir.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-fdopendir.lo `test -f 'fdopendir.c' || echo '$(srcdir)/'`fdopendir.c
+
+libgnu_la-file-set.lo: file-set.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-file-set.lo -MD -MP -MF $(DEPDIR)/libgnu_la-file-set.Tpo -c -o libgnu_la-file-set.lo `test -f 'file-set.c' || echo '$(srcdir)/'`file-set.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-file-set.Tpo $(DEPDIR)/libgnu_la-file-set.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file-set.c' object='libgnu_la-file-set.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-file-set.lo `test -f 'file-set.c' || echo '$(srcdir)/'`file-set.c
+
+libgnu_la-filenamecat-lgpl.lo: filenamecat-lgpl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-filenamecat-lgpl.lo -MD -MP -MF $(DEPDIR)/libgnu_la-filenamecat-lgpl.Tpo -c -o libgnu_la-filenamecat-lgpl.lo `test -f 'filenamecat-lgpl.c' || echo '$(srcdir)/'`filenamecat-lgpl.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-filenamecat-lgpl.Tpo $(DEPDIR)/libgnu_la-filenamecat-lgpl.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='filenamecat-lgpl.c' object='libgnu_la-filenamecat-lgpl.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-filenamecat-lgpl.lo `test -f 'filenamecat-lgpl.c' || echo '$(srcdir)/'`filenamecat-lgpl.c
+
+libgnu_la-float.lo: float.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-float.lo -MD -MP -MF $(DEPDIR)/libgnu_la-float.Tpo -c -o libgnu_la-float.lo `test -f 'float.c' || echo '$(srcdir)/'`float.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-float.Tpo $(DEPDIR)/libgnu_la-float.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='float.c' object='libgnu_la-float.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-float.lo `test -f 'float.c' || echo '$(srcdir)/'`float.c
+
+libgnu_la-itold.lo: itold.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-itold.lo -MD -MP -MF $(DEPDIR)/libgnu_la-itold.Tpo -c -o libgnu_la-itold.lo `test -f 'itold.c' || echo '$(srcdir)/'`itold.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-itold.Tpo $(DEPDIR)/libgnu_la-itold.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='itold.c' object='libgnu_la-itold.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-itold.lo `test -f 'itold.c' || echo '$(srcdir)/'`itold.c
+
+libgnu_la-flock.lo: flock.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-flock.lo -MD -MP -MF $(DEPDIR)/libgnu_la-flock.Tpo -c -o libgnu_la-flock.lo `test -f 'flock.c' || echo '$(srcdir)/'`flock.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-flock.Tpo $(DEPDIR)/libgnu_la-flock.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='flock.c' object='libgnu_la-flock.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-flock.lo `test -f 'flock.c' || echo '$(srcdir)/'`flock.c
+
+libgnu_la-free.lo: free.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-free.lo -MD -MP -MF $(DEPDIR)/libgnu_la-free.Tpo -c -o libgnu_la-free.lo `test -f 'free.c' || echo '$(srcdir)/'`free.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-free.Tpo $(DEPDIR)/libgnu_la-free.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='free.c' object='libgnu_la-free.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-free.lo `test -f 'free.c' || echo '$(srcdir)/'`free.c
+
+libgnu_la-fstat.lo: fstat.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-fstat.lo -MD -MP -MF $(DEPDIR)/libgnu_la-fstat.Tpo -c -o libgnu_la-fstat.lo `test -f 'fstat.c' || echo '$(srcdir)/'`fstat.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-fstat.Tpo $(DEPDIR)/libgnu_la-fstat.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fstat.c' object='libgnu_la-fstat.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-fstat.lo `test -f 'fstat.c' || echo '$(srcdir)/'`fstat.c
+
+libgnu_la-fstatat.lo: fstatat.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-fstatat.lo -MD -MP -MF $(DEPDIR)/libgnu_la-fstatat.Tpo -c -o libgnu_la-fstatat.lo `test -f 'fstatat.c' || echo '$(srcdir)/'`fstatat.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-fstatat.Tpo $(DEPDIR)/libgnu_la-fstatat.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fstatat.c' object='libgnu_la-fstatat.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-fstatat.lo `test -f 'fstatat.c' || echo '$(srcdir)/'`fstatat.c
+
+libgnu_la-getcwd.lo: getcwd.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-getcwd.lo -MD -MP -MF $(DEPDIR)/libgnu_la-getcwd.Tpo -c -o libgnu_la-getcwd.lo `test -f 'getcwd.c' || echo '$(srcdir)/'`getcwd.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-getcwd.Tpo $(DEPDIR)/libgnu_la-getcwd.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getcwd.c' object='libgnu_la-getcwd.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-getcwd.lo `test -f 'getcwd.c' || echo '$(srcdir)/'`getcwd.c
+
+libgnu_la-getcwd-lgpl.lo: getcwd-lgpl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-getcwd-lgpl.lo -MD -MP -MF $(DEPDIR)/libgnu_la-getcwd-lgpl.Tpo -c -o libgnu_la-getcwd-lgpl.lo `test -f 'getcwd-lgpl.c' || echo '$(srcdir)/'`getcwd-lgpl.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-getcwd-lgpl.Tpo $(DEPDIR)/libgnu_la-getcwd-lgpl.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getcwd-lgpl.c' object='libgnu_la-getcwd-lgpl.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-getcwd-lgpl.lo `test -f 'getcwd-lgpl.c' || echo '$(srcdir)/'`getcwd-lgpl.c
+
+libgnu_la-getdelim.lo: getdelim.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-getdelim.lo -MD -MP -MF $(DEPDIR)/libgnu_la-getdelim.Tpo -c -o libgnu_la-getdelim.lo `test -f 'getdelim.c' || echo '$(srcdir)/'`getdelim.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-getdelim.Tpo $(DEPDIR)/libgnu_la-getdelim.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getdelim.c' object='libgnu_la-getdelim.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-getdelim.lo `test -f 'getdelim.c' || echo '$(srcdir)/'`getdelim.c
+
+libgnu_la-getdtablesize.lo: getdtablesize.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-getdtablesize.lo -MD -MP -MF $(DEPDIR)/libgnu_la-getdtablesize.Tpo -c -o libgnu_la-getdtablesize.lo `test -f 'getdtablesize.c' || echo '$(srcdir)/'`getdtablesize.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-getdtablesize.Tpo $(DEPDIR)/libgnu_la-getdtablesize.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getdtablesize.c' object='libgnu_la-getdtablesize.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-getdtablesize.lo `test -f 'getdtablesize.c' || echo '$(srcdir)/'`getdtablesize.c
+
+libgnu_la-getline.lo: getline.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-getline.lo -MD -MP -MF $(DEPDIR)/libgnu_la-getline.Tpo -c -o libgnu_la-getline.lo `test -f 'getline.c' || echo '$(srcdir)/'`getline.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-getline.Tpo $(DEPDIR)/libgnu_la-getline.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getline.c' object='libgnu_la-getline.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-getline.lo `test -f 'getline.c' || echo '$(srcdir)/'`getline.c
+
+libgnu_la-getlogin_r.lo: getlogin_r.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-getlogin_r.lo -MD -MP -MF $(DEPDIR)/libgnu_la-getlogin_r.Tpo -c -o libgnu_la-getlogin_r.lo `test -f 'getlogin_r.c' || echo '$(srcdir)/'`getlogin_r.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-getlogin_r.Tpo $(DEPDIR)/libgnu_la-getlogin_r.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getlogin_r.c' object='libgnu_la-getlogin_r.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-getlogin_r.lo `test -f 'getlogin_r.c' || echo '$(srcdir)/'`getlogin_r.c
+
+libgnu_la-getopt.lo: getopt.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-getopt.lo -MD -MP -MF $(DEPDIR)/libgnu_la-getopt.Tpo -c -o libgnu_la-getopt.lo `test -f 'getopt.c' || echo '$(srcdir)/'`getopt.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-getopt.Tpo $(DEPDIR)/libgnu_la-getopt.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getopt.c' object='libgnu_la-getopt.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-getopt.lo `test -f 'getopt.c' || echo '$(srcdir)/'`getopt.c
+
+libgnu_la-getopt1.lo: getopt1.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-getopt1.lo -MD -MP -MF $(DEPDIR)/libgnu_la-getopt1.Tpo -c -o libgnu_la-getopt1.lo `test -f 'getopt1.c' || echo '$(srcdir)/'`getopt1.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-getopt1.Tpo $(DEPDIR)/libgnu_la-getopt1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getopt1.c' object='libgnu_la-getopt1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-getopt1.lo `test -f 'getopt1.c' || echo '$(srcdir)/'`getopt1.c
+
+libgnu_la-getprogname.lo: getprogname.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-getprogname.lo -MD -MP -MF $(DEPDIR)/libgnu_la-getprogname.Tpo -c -o libgnu_la-getprogname.lo `test -f 'getprogname.c' || echo '$(srcdir)/'`getprogname.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-getprogname.Tpo $(DEPDIR)/libgnu_la-getprogname.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getprogname.c' object='libgnu_la-getprogname.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-getprogname.lo `test -f 'getprogname.c' || echo '$(srcdir)/'`getprogname.c
+
+libgnu_la-getrandom.lo: getrandom.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-getrandom.lo -MD -MP -MF $(DEPDIR)/libgnu_la-getrandom.Tpo -c -o libgnu_la-getrandom.lo `test -f 'getrandom.c' || echo '$(srcdir)/'`getrandom.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-getrandom.Tpo $(DEPDIR)/libgnu_la-getrandom.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getrandom.c' object='libgnu_la-getrandom.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-getrandom.lo `test -f 'getrandom.c' || echo '$(srcdir)/'`getrandom.c
+
+libgnu_la-gettime.lo: gettime.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-gettime.lo -MD -MP -MF $(DEPDIR)/libgnu_la-gettime.Tpo -c -o libgnu_la-gettime.lo `test -f 'gettime.c' || echo '$(srcdir)/'`gettime.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-gettime.Tpo $(DEPDIR)/libgnu_la-gettime.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gettime.c' object='libgnu_la-gettime.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-gettime.lo `test -f 'gettime.c' || echo '$(srcdir)/'`gettime.c
+
+libgnu_la-gettimeofday.lo: gettimeofday.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-gettimeofday.lo -MD -MP -MF $(DEPDIR)/libgnu_la-gettimeofday.Tpo -c -o libgnu_la-gettimeofday.lo `test -f 'gettimeofday.c' || echo '$(srcdir)/'`gettimeofday.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-gettimeofday.Tpo $(DEPDIR)/libgnu_la-gettimeofday.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gettimeofday.c' object='libgnu_la-gettimeofday.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-gettimeofday.lo `test -f 'gettimeofday.c' || echo '$(srcdir)/'`gettimeofday.c
+
+libgnu_la-glob.lo: glob.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-glob.lo -MD -MP -MF $(DEPDIR)/libgnu_la-glob.Tpo -c -o libgnu_la-glob.lo `test -f 'glob.c' || echo '$(srcdir)/'`glob.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-glob.Tpo $(DEPDIR)/libgnu_la-glob.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='glob.c' object='libgnu_la-glob.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-glob.lo `test -f 'glob.c' || echo '$(srcdir)/'`glob.c
+
+libgnu_la-globfree.lo: globfree.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-globfree.lo -MD -MP -MF $(DEPDIR)/libgnu_la-globfree.Tpo -c -o libgnu_la-globfree.lo `test -f 'globfree.c' || echo '$(srcdir)/'`globfree.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-globfree.Tpo $(DEPDIR)/libgnu_la-globfree.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='globfree.c' object='libgnu_la-globfree.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-globfree.lo `test -f 'globfree.c' || echo '$(srcdir)/'`globfree.c
+
+libgnu_la-glob_pattern_p.lo: glob_pattern_p.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-glob_pattern_p.lo -MD -MP -MF $(DEPDIR)/libgnu_la-glob_pattern_p.Tpo -c -o libgnu_la-glob_pattern_p.lo `test -f 'glob_pattern_p.c' || echo '$(srcdir)/'`glob_pattern_p.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-glob_pattern_p.Tpo $(DEPDIR)/libgnu_la-glob_pattern_p.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='glob_pattern_p.c' object='libgnu_la-glob_pattern_p.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-glob_pattern_p.lo `test -f 'glob_pattern_p.c' || echo '$(srcdir)/'`glob_pattern_p.c
+
+libgnu_la-hard-locale.lo: hard-locale.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-hard-locale.lo -MD -MP -MF $(DEPDIR)/libgnu_la-hard-locale.Tpo -c -o libgnu_la-hard-locale.lo `test -f 'hard-locale.c' || echo '$(srcdir)/'`hard-locale.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-hard-locale.Tpo $(DEPDIR)/libgnu_la-hard-locale.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hard-locale.c' object='libgnu_la-hard-locale.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-hard-locale.lo `test -f 'hard-locale.c' || echo '$(srcdir)/'`hard-locale.c
+
+libgnu_la-hash.lo: hash.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-hash.lo -MD -MP -MF $(DEPDIR)/libgnu_la-hash.Tpo -c -o libgnu_la-hash.lo `test -f 'hash.c' || echo '$(srcdir)/'`hash.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-hash.Tpo $(DEPDIR)/libgnu_la-hash.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hash.c' object='libgnu_la-hash.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-hash.lo `test -f 'hash.c' || echo '$(srcdir)/'`hash.c
+
+libgnu_la-gl_hash_map.lo: gl_hash_map.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-gl_hash_map.lo -MD -MP -MF $(DEPDIR)/libgnu_la-gl_hash_map.Tpo -c -o libgnu_la-gl_hash_map.lo `test -f 'gl_hash_map.c' || echo '$(srcdir)/'`gl_hash_map.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-gl_hash_map.Tpo $(DEPDIR)/libgnu_la-gl_hash_map.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gl_hash_map.c' object='libgnu_la-gl_hash_map.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-gl_hash_map.lo `test -f 'gl_hash_map.c' || echo '$(srcdir)/'`gl_hash_map.c
+
+libgnu_la-hash-pjw.lo: hash-pjw.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-hash-pjw.lo -MD -MP -MF $(DEPDIR)/libgnu_la-hash-pjw.Tpo -c -o libgnu_la-hash-pjw.lo `test -f 'hash-pjw.c' || echo '$(srcdir)/'`hash-pjw.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-hash-pjw.Tpo $(DEPDIR)/libgnu_la-hash-pjw.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hash-pjw.c' object='libgnu_la-hash-pjw.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-hash-pjw.lo `test -f 'hash-pjw.c' || echo '$(srcdir)/'`hash-pjw.c
+
+libgnu_la-hash-pjw-bare.lo: hash-pjw-bare.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-hash-pjw-bare.lo -MD -MP -MF $(DEPDIR)/libgnu_la-hash-pjw-bare.Tpo -c -o libgnu_la-hash-pjw-bare.lo `test -f 'hash-pjw-bare.c' || echo '$(srcdir)/'`hash-pjw-bare.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-hash-pjw-bare.Tpo $(DEPDIR)/libgnu_la-hash-pjw-bare.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hash-pjw-bare.c' object='libgnu_la-hash-pjw-bare.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-hash-pjw-bare.lo `test -f 'hash-pjw-bare.c' || echo '$(srcdir)/'`hash-pjw-bare.c
+
+libgnu_la-gl_hash_set.lo: gl_hash_set.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-gl_hash_set.lo -MD -MP -MF $(DEPDIR)/libgnu_la-gl_hash_set.Tpo -c -o libgnu_la-gl_hash_set.lo `test -f 'gl_hash_set.c' || echo '$(srcdir)/'`gl_hash_set.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-gl_hash_set.Tpo $(DEPDIR)/libgnu_la-gl_hash_set.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gl_hash_set.c' object='libgnu_la-gl_hash_set.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-gl_hash_set.lo `test -f 'gl_hash_set.c' || echo '$(srcdir)/'`gl_hash_set.c
+
+libgnu_la-hash-triple-simple.lo: hash-triple-simple.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-hash-triple-simple.lo -MD -MP -MF $(DEPDIR)/libgnu_la-hash-triple-simple.Tpo -c -o libgnu_la-hash-triple-simple.lo `test -f 'hash-triple-simple.c' || echo '$(srcdir)/'`hash-triple-simple.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-hash-triple-simple.Tpo $(DEPDIR)/libgnu_la-hash-triple-simple.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hash-triple-simple.c' object='libgnu_la-hash-triple-simple.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-hash-triple-simple.lo `test -f 'hash-triple-simple.c' || echo '$(srcdir)/'`hash-triple-simple.c
+
+libgnu_la-ialloc.lo: ialloc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-ialloc.lo -MD -MP -MF $(DEPDIR)/libgnu_la-ialloc.Tpo -c -o libgnu_la-ialloc.lo `test -f 'ialloc.c' || echo '$(srcdir)/'`ialloc.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-ialloc.Tpo $(DEPDIR)/libgnu_la-ialloc.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ialloc.c' object='libgnu_la-ialloc.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-ialloc.lo `test -f 'ialloc.c' || echo '$(srcdir)/'`ialloc.c
+
+libgnu_la-idpriv-drop.lo: idpriv-drop.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-idpriv-drop.lo -MD -MP -MF $(DEPDIR)/libgnu_la-idpriv-drop.Tpo -c -o libgnu_la-idpriv-drop.lo `test -f 'idpriv-drop.c' || echo '$(srcdir)/'`idpriv-drop.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-idpriv-drop.Tpo $(DEPDIR)/libgnu_la-idpriv-drop.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='idpriv-drop.c' object='libgnu_la-idpriv-drop.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-idpriv-drop.lo `test -f 'idpriv-drop.c' || echo '$(srcdir)/'`idpriv-drop.c
+
+libgnu_la-idpriv-droptemp.lo: idpriv-droptemp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-idpriv-droptemp.lo -MD -MP -MF $(DEPDIR)/libgnu_la-idpriv-droptemp.Tpo -c -o libgnu_la-idpriv-droptemp.lo `test -f 'idpriv-droptemp.c' || echo '$(srcdir)/'`idpriv-droptemp.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-idpriv-droptemp.Tpo $(DEPDIR)/libgnu_la-idpriv-droptemp.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='idpriv-droptemp.c' object='libgnu_la-idpriv-droptemp.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-idpriv-droptemp.lo `test -f 'idpriv-droptemp.c' || echo '$(srcdir)/'`idpriv-droptemp.c
+
+libgnu_la-ioctl.lo: ioctl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-ioctl.lo -MD -MP -MF $(DEPDIR)/libgnu_la-ioctl.Tpo -c -o libgnu_la-ioctl.lo `test -f 'ioctl.c' || echo '$(srcdir)/'`ioctl.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-ioctl.Tpo $(DEPDIR)/libgnu_la-ioctl.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ioctl.c' object='libgnu_la-ioctl.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-ioctl.lo `test -f 'ioctl.c' || echo '$(srcdir)/'`ioctl.c
+
+libgnu_la-isblank.lo: isblank.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-isblank.lo -MD -MP -MF $(DEPDIR)/libgnu_la-isblank.Tpo -c -o libgnu_la-isblank.lo `test -f 'isblank.c' || echo '$(srcdir)/'`isblank.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-isblank.Tpo $(DEPDIR)/libgnu_la-isblank.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='isblank.c' object='libgnu_la-isblank.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-isblank.lo `test -f 'isblank.c' || echo '$(srcdir)/'`isblank.c
+
+libgnu_la-lchown.lo: lchown.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-lchown.lo -MD -MP -MF $(DEPDIR)/libgnu_la-lchown.Tpo -c -o libgnu_la-lchown.lo `test -f 'lchown.c' || echo '$(srcdir)/'`lchown.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-lchown.Tpo $(DEPDIR)/libgnu_la-lchown.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lchown.c' object='libgnu_la-lchown.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-lchown.lo `test -f 'lchown.c' || echo '$(srcdir)/'`lchown.c
+
+libgnu_la-gl_linkedhash_list.lo: gl_linkedhash_list.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-gl_linkedhash_list.lo -MD -MP -MF $(DEPDIR)/libgnu_la-gl_linkedhash_list.Tpo -c -o libgnu_la-gl_linkedhash_list.lo `test -f 'gl_linkedhash_list.c' || echo '$(srcdir)/'`gl_linkedhash_list.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-gl_linkedhash_list.Tpo $(DEPDIR)/libgnu_la-gl_linkedhash_list.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gl_linkedhash_list.c' object='libgnu_la-gl_linkedhash_list.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-gl_linkedhash_list.lo `test -f 'gl_linkedhash_list.c' || echo '$(srcdir)/'`gl_linkedhash_list.c
+
+libgnu_la-gl_list.lo: gl_list.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-gl_list.lo -MD -MP -MF $(DEPDIR)/libgnu_la-gl_list.Tpo -c -o libgnu_la-gl_list.lo `test -f 'gl_list.c' || echo '$(srcdir)/'`gl_list.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-gl_list.Tpo $(DEPDIR)/libgnu_la-gl_list.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gl_list.c' object='libgnu_la-gl_list.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-gl_list.lo `test -f 'gl_list.c' || echo '$(srcdir)/'`gl_list.c
+
+libgnu_la-localcharset.lo: localcharset.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-localcharset.lo -MD -MP -MF $(DEPDIR)/libgnu_la-localcharset.Tpo -c -o libgnu_la-localcharset.lo `test -f 'localcharset.c' || echo '$(srcdir)/'`localcharset.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-localcharset.Tpo $(DEPDIR)/libgnu_la-localcharset.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='localcharset.c' object='libgnu_la-localcharset.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-localcharset.lo `test -f 'localcharset.c' || echo '$(srcdir)/'`localcharset.c
+
+libgnu_la-localeconv.lo: localeconv.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-localeconv.lo -MD -MP -MF $(DEPDIR)/libgnu_la-localeconv.Tpo -c -o libgnu_la-localeconv.lo `test -f 'localeconv.c' || echo '$(srcdir)/'`localeconv.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-localeconv.Tpo $(DEPDIR)/libgnu_la-localeconv.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='localeconv.c' object='libgnu_la-localeconv.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-localeconv.lo `test -f 'localeconv.c' || echo '$(srcdir)/'`localeconv.c
+
+glthread/libgnu_la-lock.lo: glthread/lock.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT glthread/libgnu_la-lock.lo -MD -MP -MF glthread/$(DEPDIR)/libgnu_la-lock.Tpo -c -o glthread/libgnu_la-lock.lo `test -f 'glthread/lock.c' || echo '$(srcdir)/'`glthread/lock.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) glthread/$(DEPDIR)/libgnu_la-lock.Tpo glthread/$(DEPDIR)/libgnu_la-lock.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='glthread/lock.c' object='glthread/libgnu_la-lock.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o glthread/libgnu_la-lock.lo `test -f 'glthread/lock.c' || echo '$(srcdir)/'`glthread/lock.c
+
+libgnu_la-lstat.lo: lstat.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-lstat.lo -MD -MP -MF $(DEPDIR)/libgnu_la-lstat.Tpo -c -o libgnu_la-lstat.lo `test -f 'lstat.c' || echo '$(srcdir)/'`lstat.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-lstat.Tpo $(DEPDIR)/libgnu_la-lstat.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lstat.c' object='libgnu_la-lstat.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-lstat.lo `test -f 'lstat.c' || echo '$(srcdir)/'`lstat.c
+
+libgnu_la-malloca.lo: malloca.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-malloca.lo -MD -MP -MF $(DEPDIR)/libgnu_la-malloca.Tpo -c -o libgnu_la-malloca.lo `test -f 'malloca.c' || echo '$(srcdir)/'`malloca.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-malloca.Tpo $(DEPDIR)/libgnu_la-malloca.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloca.c' object='libgnu_la-malloca.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-malloca.lo `test -f 'malloca.c' || echo '$(srcdir)/'`malloca.c
+
+libgnu_la-gl_map.lo: gl_map.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-gl_map.lo -MD -MP -MF $(DEPDIR)/libgnu_la-gl_map.Tpo -c -o libgnu_la-gl_map.lo `test -f 'gl_map.c' || echo '$(srcdir)/'`gl_map.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-gl_map.Tpo $(DEPDIR)/libgnu_la-gl_map.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gl_map.c' object='libgnu_la-gl_map.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-gl_map.lo `test -f 'gl_map.c' || echo '$(srcdir)/'`gl_map.c
+
+libgnu_la-mbrtowc.lo: mbrtowc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-mbrtowc.lo -MD -MP -MF $(DEPDIR)/libgnu_la-mbrtowc.Tpo -c -o libgnu_la-mbrtowc.lo `test -f 'mbrtowc.c' || echo '$(srcdir)/'`mbrtowc.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-mbrtowc.Tpo $(DEPDIR)/libgnu_la-mbrtowc.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mbrtowc.c' object='libgnu_la-mbrtowc.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-mbrtowc.lo `test -f 'mbrtowc.c' || echo '$(srcdir)/'`mbrtowc.c
+
+libgnu_la-mbsinit.lo: mbsinit.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-mbsinit.lo -MD -MP -MF $(DEPDIR)/libgnu_la-mbsinit.Tpo -c -o libgnu_la-mbsinit.lo `test -f 'mbsinit.c' || echo '$(srcdir)/'`mbsinit.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-mbsinit.Tpo $(DEPDIR)/libgnu_la-mbsinit.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mbsinit.c' object='libgnu_la-mbsinit.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-mbsinit.lo `test -f 'mbsinit.c' || echo '$(srcdir)/'`mbsinit.c
+
+libgnu_la-mbsrtowcs.lo: mbsrtowcs.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-mbsrtowcs.lo -MD -MP -MF $(DEPDIR)/libgnu_la-mbsrtowcs.Tpo -c -o libgnu_la-mbsrtowcs.lo `test -f 'mbsrtowcs.c' || echo '$(srcdir)/'`mbsrtowcs.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-mbsrtowcs.Tpo $(DEPDIR)/libgnu_la-mbsrtowcs.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mbsrtowcs.c' object='libgnu_la-mbsrtowcs.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-mbsrtowcs.lo `test -f 'mbsrtowcs.c' || echo '$(srcdir)/'`mbsrtowcs.c
+
+libgnu_la-mbtowc.lo: mbtowc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-mbtowc.lo -MD -MP -MF $(DEPDIR)/libgnu_la-mbtowc.Tpo -c -o libgnu_la-mbtowc.lo `test -f 'mbtowc.c' || echo '$(srcdir)/'`mbtowc.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-mbtowc.Tpo $(DEPDIR)/libgnu_la-mbtowc.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mbtowc.c' object='libgnu_la-mbtowc.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-mbtowc.lo `test -f 'mbtowc.c' || echo '$(srcdir)/'`mbtowc.c
+
+libgnu_la-memchr.lo: memchr.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-memchr.lo -MD -MP -MF $(DEPDIR)/libgnu_la-memchr.Tpo -c -o libgnu_la-memchr.lo `test -f 'memchr.c' || echo '$(srcdir)/'`memchr.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-memchr.Tpo $(DEPDIR)/libgnu_la-memchr.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='memchr.c' object='libgnu_la-memchr.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-memchr.lo `test -f 'memchr.c' || echo '$(srcdir)/'`memchr.c
+
+libgnu_la-mempcpy.lo: mempcpy.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-mempcpy.lo -MD -MP -MF $(DEPDIR)/libgnu_la-mempcpy.Tpo -c -o libgnu_la-mempcpy.lo `test -f 'mempcpy.c' || echo '$(srcdir)/'`mempcpy.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-mempcpy.Tpo $(DEPDIR)/libgnu_la-mempcpy.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mempcpy.c' object='libgnu_la-mempcpy.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-mempcpy.lo `test -f 'mempcpy.c' || echo '$(srcdir)/'`mempcpy.c
+
+libgnu_la-memrchr.lo: memrchr.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-memrchr.lo -MD -MP -MF $(DEPDIR)/libgnu_la-memrchr.Tpo -c -o libgnu_la-memrchr.lo `test -f 'memrchr.c' || echo '$(srcdir)/'`memrchr.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-memrchr.Tpo $(DEPDIR)/libgnu_la-memrchr.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='memrchr.c' object='libgnu_la-memrchr.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-memrchr.lo `test -f 'memrchr.c' || echo '$(srcdir)/'`memrchr.c
+
+libgnu_la-mkdir.lo: mkdir.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-mkdir.lo -MD -MP -MF $(DEPDIR)/libgnu_la-mkdir.Tpo -c -o libgnu_la-mkdir.lo `test -f 'mkdir.c' || echo '$(srcdir)/'`mkdir.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-mkdir.Tpo $(DEPDIR)/libgnu_la-mkdir.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mkdir.c' object='libgnu_la-mkdir.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-mkdir.lo `test -f 'mkdir.c' || echo '$(srcdir)/'`mkdir.c
+
+libgnu_la-mkdtemp.lo: mkdtemp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-mkdtemp.lo -MD -MP -MF $(DEPDIR)/libgnu_la-mkdtemp.Tpo -c -o libgnu_la-mkdtemp.lo `test -f 'mkdtemp.c' || echo '$(srcdir)/'`mkdtemp.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-mkdtemp.Tpo $(DEPDIR)/libgnu_la-mkdtemp.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mkdtemp.c' object='libgnu_la-mkdtemp.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-mkdtemp.lo `test -f 'mkdtemp.c' || echo '$(srcdir)/'`mkdtemp.c
+
+libgnu_la-mkstemp.lo: mkstemp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-mkstemp.lo -MD -MP -MF $(DEPDIR)/libgnu_la-mkstemp.Tpo -c -o libgnu_la-mkstemp.lo `test -f 'mkstemp.c' || echo '$(srcdir)/'`mkstemp.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-mkstemp.Tpo $(DEPDIR)/libgnu_la-mkstemp.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mkstemp.c' object='libgnu_la-mkstemp.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-mkstemp.lo `test -f 'mkstemp.c' || echo '$(srcdir)/'`mkstemp.c
+
+libgnu_la-msvc-inval.lo: msvc-inval.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-msvc-inval.lo -MD -MP -MF $(DEPDIR)/libgnu_la-msvc-inval.Tpo -c -o libgnu_la-msvc-inval.lo `test -f 'msvc-inval.c' || echo '$(srcdir)/'`msvc-inval.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-msvc-inval.Tpo $(DEPDIR)/libgnu_la-msvc-inval.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='msvc-inval.c' object='libgnu_la-msvc-inval.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-msvc-inval.lo `test -f 'msvc-inval.c' || echo '$(srcdir)/'`msvc-inval.c
+
+libgnu_la-msvc-nothrow.lo: msvc-nothrow.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-msvc-nothrow.lo -MD -MP -MF $(DEPDIR)/libgnu_la-msvc-nothrow.Tpo -c -o libgnu_la-msvc-nothrow.lo `test -f 'msvc-nothrow.c' || echo '$(srcdir)/'`msvc-nothrow.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-msvc-nothrow.Tpo $(DEPDIR)/libgnu_la-msvc-nothrow.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='msvc-nothrow.c' object='libgnu_la-msvc-nothrow.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-msvc-nothrow.lo `test -f 'msvc-nothrow.c' || echo '$(srcdir)/'`msvc-nothrow.c
+
+libgnu_la-nanosleep.lo: nanosleep.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-nanosleep.lo -MD -MP -MF $(DEPDIR)/libgnu_la-nanosleep.Tpo -c -o libgnu_la-nanosleep.lo `test -f 'nanosleep.c' || echo '$(srcdir)/'`nanosleep.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-nanosleep.Tpo $(DEPDIR)/libgnu_la-nanosleep.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nanosleep.c' object='libgnu_la-nanosleep.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-nanosleep.lo `test -f 'nanosleep.c' || echo '$(srcdir)/'`nanosleep.c
+
+libgnu_la-nl_langinfo.lo: nl_langinfo.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-nl_langinfo.lo -MD -MP -MF $(DEPDIR)/libgnu_la-nl_langinfo.Tpo -c -o libgnu_la-nl_langinfo.lo `test -f 'nl_langinfo.c' || echo '$(srcdir)/'`nl_langinfo.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-nl_langinfo.Tpo $(DEPDIR)/libgnu_la-nl_langinfo.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nl_langinfo.c' object='libgnu_la-nl_langinfo.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-nl_langinfo.lo `test -f 'nl_langinfo.c' || echo '$(srcdir)/'`nl_langinfo.c
+
+libgnu_la-nl_langinfo-lock.lo: nl_langinfo-lock.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-nl_langinfo-lock.lo -MD -MP -MF $(DEPDIR)/libgnu_la-nl_langinfo-lock.Tpo -c -o libgnu_la-nl_langinfo-lock.lo `test -f 'nl_langinfo-lock.c' || echo '$(srcdir)/'`nl_langinfo-lock.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-nl_langinfo-lock.Tpo $(DEPDIR)/libgnu_la-nl_langinfo-lock.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nl_langinfo-lock.c' object='libgnu_la-nl_langinfo-lock.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-nl_langinfo-lock.lo `test -f 'nl_langinfo-lock.c' || echo '$(srcdir)/'`nl_langinfo-lock.c
+
+libgnu_la-nonblocking.lo: nonblocking.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-nonblocking.lo -MD -MP -MF $(DEPDIR)/libgnu_la-nonblocking.Tpo -c -o libgnu_la-nonblocking.lo `test -f 'nonblocking.c' || echo '$(srcdir)/'`nonblocking.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-nonblocking.Tpo $(DEPDIR)/libgnu_la-nonblocking.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nonblocking.c' object='libgnu_la-nonblocking.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-nonblocking.lo `test -f 'nonblocking.c' || echo '$(srcdir)/'`nonblocking.c
+
+libgnu_la-open.lo: open.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-open.lo -MD -MP -MF $(DEPDIR)/libgnu_la-open.Tpo -c -o libgnu_la-open.lo `test -f 'open.c' || echo '$(srcdir)/'`open.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-open.Tpo $(DEPDIR)/libgnu_la-open.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='open.c' object='libgnu_la-open.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-open.lo `test -f 'open.c' || echo '$(srcdir)/'`open.c
+
+libgnu_la-openat.lo: openat.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-openat.lo -MD -MP -MF $(DEPDIR)/libgnu_la-openat.Tpo -c -o libgnu_la-openat.lo `test -f 'openat.c' || echo '$(srcdir)/'`openat.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-openat.Tpo $(DEPDIR)/libgnu_la-openat.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openat.c' object='libgnu_la-openat.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-openat.lo `test -f 'openat.c' || echo '$(srcdir)/'`openat.c
+
+libgnu_la-openat-die.lo: openat-die.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-openat-die.lo -MD -MP -MF $(DEPDIR)/libgnu_la-openat-die.Tpo -c -o libgnu_la-openat-die.lo `test -f 'openat-die.c' || echo '$(srcdir)/'`openat-die.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-openat-die.Tpo $(DEPDIR)/libgnu_la-openat-die.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openat-die.c' object='libgnu_la-openat-die.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-openat-die.lo `test -f 'openat-die.c' || echo '$(srcdir)/'`openat-die.c
+
+libgnu_la-opendir.lo: opendir.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-opendir.lo -MD -MP -MF $(DEPDIR)/libgnu_la-opendir.Tpo -c -o libgnu_la-opendir.lo `test -f 'opendir.c' || echo '$(srcdir)/'`opendir.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-opendir.Tpo $(DEPDIR)/libgnu_la-opendir.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='opendir.c' object='libgnu_la-opendir.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-opendir.lo `test -f 'opendir.c' || echo '$(srcdir)/'`opendir.c
+
+libgnu_la-pipe.lo: pipe.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-pipe.lo -MD -MP -MF $(DEPDIR)/libgnu_la-pipe.Tpo -c -o libgnu_la-pipe.lo `test -f 'pipe.c' || echo '$(srcdir)/'`pipe.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-pipe.Tpo $(DEPDIR)/libgnu_la-pipe.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pipe.c' object='libgnu_la-pipe.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-pipe.lo `test -f 'pipe.c' || echo '$(srcdir)/'`pipe.c
+
+libgnu_la-progname.lo: progname.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-progname.lo -MD -MP -MF $(DEPDIR)/libgnu_la-progname.Tpo -c -o libgnu_la-progname.lo `test -f 'progname.c' || echo '$(srcdir)/'`progname.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-progname.Tpo $(DEPDIR)/libgnu_la-progname.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='progname.c' object='libgnu_la-progname.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-progname.lo `test -f 'progname.c' || echo '$(srcdir)/'`progname.c
+
+libgnu_la-pselect.lo: pselect.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-pselect.lo -MD -MP -MF $(DEPDIR)/libgnu_la-pselect.Tpo -c -o libgnu_la-pselect.lo `test -f 'pselect.c' || echo '$(srcdir)/'`pselect.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-pselect.Tpo $(DEPDIR)/libgnu_la-pselect.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pselect.c' object='libgnu_la-pselect.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-pselect.lo `test -f 'pselect.c' || echo '$(srcdir)/'`pselect.c
+
+libgnu_la-pthread_sigmask.lo: pthread_sigmask.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-pthread_sigmask.lo -MD -MP -MF $(DEPDIR)/libgnu_la-pthread_sigmask.Tpo -c -o libgnu_la-pthread_sigmask.lo `test -f 'pthread_sigmask.c' || echo '$(srcdir)/'`pthread_sigmask.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-pthread_sigmask.Tpo $(DEPDIR)/libgnu_la-pthread_sigmask.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pthread_sigmask.c' object='libgnu_la-pthread_sigmask.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-pthread_sigmask.lo `test -f 'pthread_sigmask.c' || echo '$(srcdir)/'`pthread_sigmask.c
+
+libgnu_la-raise.lo: raise.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-raise.lo -MD -MP -MF $(DEPDIR)/libgnu_la-raise.Tpo -c -o libgnu_la-raise.lo `test -f 'raise.c' || echo '$(srcdir)/'`raise.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-raise.Tpo $(DEPDIR)/libgnu_la-raise.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='raise.c' object='libgnu_la-raise.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-raise.lo `test -f 'raise.c' || echo '$(srcdir)/'`raise.c
+
+libgnu_la-rawmemchr.lo: rawmemchr.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-rawmemchr.lo -MD -MP -MF $(DEPDIR)/libgnu_la-rawmemchr.Tpo -c -o libgnu_la-rawmemchr.lo `test -f 'rawmemchr.c' || echo '$(srcdir)/'`rawmemchr.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-rawmemchr.Tpo $(DEPDIR)/libgnu_la-rawmemchr.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rawmemchr.c' object='libgnu_la-rawmemchr.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-rawmemchr.lo `test -f 'rawmemchr.c' || echo '$(srcdir)/'`rawmemchr.c
+
+libgnu_la-gl_rbtree_list.lo: gl_rbtree_list.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-gl_rbtree_list.lo -MD -MP -MF $(DEPDIR)/libgnu_la-gl_rbtree_list.Tpo -c -o libgnu_la-gl_rbtree_list.lo `test -f 'gl_rbtree_list.c' || echo '$(srcdir)/'`gl_rbtree_list.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-gl_rbtree_list.Tpo $(DEPDIR)/libgnu_la-gl_rbtree_list.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gl_rbtree_list.c' object='libgnu_la-gl_rbtree_list.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-gl_rbtree_list.lo `test -f 'gl_rbtree_list.c' || echo '$(srcdir)/'`gl_rbtree_list.c
+
+libgnu_la-readdir.lo: readdir.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-readdir.lo -MD -MP -MF $(DEPDIR)/libgnu_la-readdir.Tpo -c -o libgnu_la-readdir.lo `test -f 'readdir.c' || echo '$(srcdir)/'`readdir.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-readdir.Tpo $(DEPDIR)/libgnu_la-readdir.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='readdir.c' object='libgnu_la-readdir.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-readdir.lo `test -f 'readdir.c' || echo '$(srcdir)/'`readdir.c
+
+libgnu_la-readlink.lo: readlink.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-readlink.lo -MD -MP -MF $(DEPDIR)/libgnu_la-readlink.Tpo -c -o libgnu_la-readlink.lo `test -f 'readlink.c' || echo '$(srcdir)/'`readlink.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-readlink.Tpo $(DEPDIR)/libgnu_la-readlink.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='readlink.c' object='libgnu_la-readlink.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-readlink.lo `test -f 'readlink.c' || echo '$(srcdir)/'`readlink.c
+
+libgnu_la-readlinkat.lo: readlinkat.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-readlinkat.lo -MD -MP -MF $(DEPDIR)/libgnu_la-readlinkat.Tpo -c -o libgnu_la-readlinkat.lo `test -f 'readlinkat.c' || echo '$(srcdir)/'`readlinkat.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-readlinkat.Tpo $(DEPDIR)/libgnu_la-readlinkat.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='readlinkat.c' object='libgnu_la-readlinkat.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-readlinkat.lo `test -f 'readlinkat.c' || echo '$(srcdir)/'`readlinkat.c
+
+libgnu_la-reallocarray.lo: reallocarray.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-reallocarray.lo -MD -MP -MF $(DEPDIR)/libgnu_la-reallocarray.Tpo -c -o libgnu_la-reallocarray.lo `test -f 'reallocarray.c' || echo '$(srcdir)/'`reallocarray.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-reallocarray.Tpo $(DEPDIR)/libgnu_la-reallocarray.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='reallocarray.c' object='libgnu_la-reallocarray.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-reallocarray.lo `test -f 'reallocarray.c' || echo '$(srcdir)/'`reallocarray.c
+
+libgnu_la-regex.lo: regex.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-regex.lo -MD -MP -MF $(DEPDIR)/libgnu_la-regex.Tpo -c -o libgnu_la-regex.lo `test -f 'regex.c' || echo '$(srcdir)/'`regex.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-regex.Tpo $(DEPDIR)/libgnu_la-regex.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='regex.c' object='libgnu_la-regex.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-regex.lo `test -f 'regex.c' || echo '$(srcdir)/'`regex.c
+
+libgnu_la-rename.lo: rename.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-rename.lo -MD -MP -MF $(DEPDIR)/libgnu_la-rename.Tpo -c -o libgnu_la-rename.lo `test -f 'rename.c' || echo '$(srcdir)/'`rename.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-rename.Tpo $(DEPDIR)/libgnu_la-rename.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rename.c' object='libgnu_la-rename.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-rename.lo `test -f 'rename.c' || echo '$(srcdir)/'`rename.c
+
+libgnu_la-renameat.lo: renameat.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-renameat.lo -MD -MP -MF $(DEPDIR)/libgnu_la-renameat.Tpo -c -o libgnu_la-renameat.lo `test -f 'renameat.c' || echo '$(srcdir)/'`renameat.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-renameat.Tpo $(DEPDIR)/libgnu_la-renameat.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='renameat.c' object='libgnu_la-renameat.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-renameat.lo `test -f 'renameat.c' || echo '$(srcdir)/'`renameat.c
+
+libgnu_la-renameatu.lo: renameatu.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-renameatu.lo -MD -MP -MF $(DEPDIR)/libgnu_la-renameatu.Tpo -c -o libgnu_la-renameatu.lo `test -f 'renameatu.c' || echo '$(srcdir)/'`renameatu.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-renameatu.Tpo $(DEPDIR)/libgnu_la-renameatu.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='renameatu.c' object='libgnu_la-renameatu.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-renameatu.lo `test -f 'renameatu.c' || echo '$(srcdir)/'`renameatu.c
+
+libgnu_la-rewinddir.lo: rewinddir.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-rewinddir.lo -MD -MP -MF $(DEPDIR)/libgnu_la-rewinddir.Tpo -c -o libgnu_la-rewinddir.lo `test -f 'rewinddir.c' || echo '$(srcdir)/'`rewinddir.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-rewinddir.Tpo $(DEPDIR)/libgnu_la-rewinddir.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rewinddir.c' object='libgnu_la-rewinddir.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-rewinddir.lo `test -f 'rewinddir.c' || echo '$(srcdir)/'`rewinddir.c
+
+libgnu_la-rmdir.lo: rmdir.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-rmdir.lo -MD -MP -MF $(DEPDIR)/libgnu_la-rmdir.Tpo -c -o libgnu_la-rmdir.lo `test -f 'rmdir.c' || echo '$(srcdir)/'`rmdir.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-rmdir.Tpo $(DEPDIR)/libgnu_la-rmdir.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rmdir.c' object='libgnu_la-rmdir.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-rmdir.lo `test -f 'rmdir.c' || echo '$(srcdir)/'`rmdir.c
+
+libgnu_la-save-cwd.lo: save-cwd.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-save-cwd.lo -MD -MP -MF $(DEPDIR)/libgnu_la-save-cwd.Tpo -c -o libgnu_la-save-cwd.lo `test -f 'save-cwd.c' || echo '$(srcdir)/'`save-cwd.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-save-cwd.Tpo $(DEPDIR)/libgnu_la-save-cwd.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='save-cwd.c' object='libgnu_la-save-cwd.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-save-cwd.lo `test -f 'save-cwd.c' || echo '$(srcdir)/'`save-cwd.c
+
+malloc/libgnu_la-scratch_buffer_dupfree.lo: malloc/scratch_buffer_dupfree.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-scratch_buffer_dupfree.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-scratch_buffer_dupfree.Tpo -c -o malloc/libgnu_la-scratch_buffer_dupfree.lo `test -f 'malloc/scratch_buffer_dupfree.c' || echo '$(srcdir)/'`malloc/scratch_buffer_dupfree.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-scratch_buffer_dupfree.Tpo malloc/$(DEPDIR)/libgnu_la-scratch_buffer_dupfree.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/scratch_buffer_dupfree.c' object='malloc/libgnu_la-scratch_buffer_dupfree.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-scratch_buffer_dupfree.lo `test -f 'malloc/scratch_buffer_dupfree.c' || echo '$(srcdir)/'`malloc/scratch_buffer_dupfree.c
+
+malloc/libgnu_la-scratch_buffer_grow.lo: malloc/scratch_buffer_grow.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-scratch_buffer_grow.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow.Tpo -c -o malloc/libgnu_la-scratch_buffer_grow.lo `test -f 'malloc/scratch_buffer_grow.c' || echo '$(srcdir)/'`malloc/scratch_buffer_grow.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow.Tpo malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/scratch_buffer_grow.c' object='malloc/libgnu_la-scratch_buffer_grow.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-scratch_buffer_grow.lo `test -f 'malloc/scratch_buffer_grow.c' || echo '$(srcdir)/'`malloc/scratch_buffer_grow.c
+
+malloc/libgnu_la-scratch_buffer_grow_preserve.lo: malloc/scratch_buffer_grow_preserve.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-scratch_buffer_grow_preserve.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow_preserve.Tpo -c -o malloc/libgnu_la-scratch_buffer_grow_preserve.lo `test -f 'malloc/scratch_buffer_grow_preserve.c' || echo '$(srcdir)/'`malloc/scratch_buffer_grow_preserve.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow_preserve.Tpo malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow_preserve.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/scratch_buffer_grow_preserve.c' object='malloc/libgnu_la-scratch_buffer_grow_preserve.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-scratch_buffer_grow_preserve.lo `test -f 'malloc/scratch_buffer_grow_preserve.c' || echo '$(srcdir)/'`malloc/scratch_buffer_grow_preserve.c
+
+malloc/libgnu_la-scratch_buffer_set_array_size.lo: malloc/scratch_buffer_set_array_size.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-scratch_buffer_set_array_size.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-scratch_buffer_set_array_size.Tpo -c -o malloc/libgnu_la-scratch_buffer_set_array_size.lo `test -f 'malloc/scratch_buffer_set_array_size.c' || echo '$(srcdir)/'`malloc/scratch_buffer_set_array_size.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-scratch_buffer_set_array_size.Tpo malloc/$(DEPDIR)/libgnu_la-scratch_buffer_set_array_size.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/scratch_buffer_set_array_size.c' object='malloc/libgnu_la-scratch_buffer_set_array_size.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-scratch_buffer_set_array_size.lo `test -f 'malloc/scratch_buffer_set_array_size.c' || echo '$(srcdir)/'`malloc/scratch_buffer_set_array_size.c
+
+libgnu_la-select.lo: select.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-select.lo -MD -MP -MF $(DEPDIR)/libgnu_la-select.Tpo -c -o libgnu_la-select.lo `test -f 'select.c' || echo '$(srcdir)/'`select.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-select.Tpo $(DEPDIR)/libgnu_la-select.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='select.c' object='libgnu_la-select.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-select.lo `test -f 'select.c' || echo '$(srcdir)/'`select.c
+
+libgnu_la-gl_set.lo: gl_set.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-gl_set.lo -MD -MP -MF $(DEPDIR)/libgnu_la-gl_set.Tpo -c -o libgnu_la-gl_set.lo `test -f 'gl_set.c' || echo '$(srcdir)/'`gl_set.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-gl_set.Tpo $(DEPDIR)/libgnu_la-gl_set.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gl_set.c' object='libgnu_la-gl_set.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-gl_set.lo `test -f 'gl_set.c' || echo '$(srcdir)/'`gl_set.c
+
+libgnu_la-setenv.lo: setenv.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-setenv.lo -MD -MP -MF $(DEPDIR)/libgnu_la-setenv.Tpo -c -o libgnu_la-setenv.lo `test -f 'setenv.c' || echo '$(srcdir)/'`setenv.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-setenv.Tpo $(DEPDIR)/libgnu_la-setenv.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='setenv.c' object='libgnu_la-setenv.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-setenv.lo `test -f 'setenv.c' || echo '$(srcdir)/'`setenv.c
+
+libgnu_la-setlocale_null.lo: setlocale_null.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-setlocale_null.lo -MD -MP -MF $(DEPDIR)/libgnu_la-setlocale_null.Tpo -c -o libgnu_la-setlocale_null.lo `test -f 'setlocale_null.c' || echo '$(srcdir)/'`setlocale_null.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-setlocale_null.Tpo $(DEPDIR)/libgnu_la-setlocale_null.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='setlocale_null.c' object='libgnu_la-setlocale_null.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-setlocale_null.lo `test -f 'setlocale_null.c' || echo '$(srcdir)/'`setlocale_null.c
+
+libgnu_la-setlocale-lock.lo: setlocale-lock.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-setlocale-lock.lo -MD -MP -MF $(DEPDIR)/libgnu_la-setlocale-lock.Tpo -c -o libgnu_la-setlocale-lock.lo `test -f 'setlocale-lock.c' || echo '$(srcdir)/'`setlocale-lock.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-setlocale-lock.Tpo $(DEPDIR)/libgnu_la-setlocale-lock.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='setlocale-lock.c' object='libgnu_la-setlocale-lock.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-setlocale-lock.lo `test -f 'setlocale-lock.c' || echo '$(srcdir)/'`setlocale-lock.c
+
+libgnu_la-sigaction.lo: sigaction.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-sigaction.lo -MD -MP -MF $(DEPDIR)/libgnu_la-sigaction.Tpo -c -o libgnu_la-sigaction.lo `test -f 'sigaction.c' || echo '$(srcdir)/'`sigaction.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-sigaction.Tpo $(DEPDIR)/libgnu_la-sigaction.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sigaction.c' object='libgnu_la-sigaction.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-sigaction.lo `test -f 'sigaction.c' || echo '$(srcdir)/'`sigaction.c
+
+libgnu_la-sig-handler.lo: sig-handler.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-sig-handler.lo -MD -MP -MF $(DEPDIR)/libgnu_la-sig-handler.Tpo -c -o libgnu_la-sig-handler.lo `test -f 'sig-handler.c' || echo '$(srcdir)/'`sig-handler.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-sig-handler.Tpo $(DEPDIR)/libgnu_la-sig-handler.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sig-handler.c' object='libgnu_la-sig-handler.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-sig-handler.lo `test -f 'sig-handler.c' || echo '$(srcdir)/'`sig-handler.c
+
+libgnu_la-sigprocmask.lo: sigprocmask.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-sigprocmask.lo -MD -MP -MF $(DEPDIR)/libgnu_la-sigprocmask.Tpo -c -o libgnu_la-sigprocmask.lo `test -f 'sigprocmask.c' || echo '$(srcdir)/'`sigprocmask.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-sigprocmask.Tpo $(DEPDIR)/libgnu_la-sigprocmask.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sigprocmask.c' object='libgnu_la-sigprocmask.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-sigprocmask.lo `test -f 'sigprocmask.c' || echo '$(srcdir)/'`sigprocmask.c
+
+libgnu_la-sleep.lo: sleep.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-sleep.lo -MD -MP -MF $(DEPDIR)/libgnu_la-sleep.Tpo -c -o libgnu_la-sleep.lo `test -f 'sleep.c' || echo '$(srcdir)/'`sleep.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-sleep.Tpo $(DEPDIR)/libgnu_la-sleep.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sleep.c' object='libgnu_la-sleep.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-sleep.lo `test -f 'sleep.c' || echo '$(srcdir)/'`sleep.c
+
+libgnu_la-sockets.lo: sockets.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-sockets.lo -MD -MP -MF $(DEPDIR)/libgnu_la-sockets.Tpo -c -o libgnu_la-sockets.lo `test -f 'sockets.c' || echo '$(srcdir)/'`sockets.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-sockets.Tpo $(DEPDIR)/libgnu_la-sockets.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sockets.c' object='libgnu_la-sockets.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-sockets.lo `test -f 'sockets.c' || echo '$(srcdir)/'`sockets.c
+
+libgnu_la-stat.lo: stat.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-stat.lo -MD -MP -MF $(DEPDIR)/libgnu_la-stat.Tpo -c -o libgnu_la-stat.lo `test -f 'stat.c' || echo '$(srcdir)/'`stat.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-stat.Tpo $(DEPDIR)/libgnu_la-stat.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stat.c' object='libgnu_la-stat.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-stat.lo `test -f 'stat.c' || echo '$(srcdir)/'`stat.c
+
+libgnu_la-stat-time.lo: stat-time.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-stat-time.lo -MD -MP -MF $(DEPDIR)/libgnu_la-stat-time.Tpo -c -o libgnu_la-stat-time.lo `test -f 'stat-time.c' || echo '$(srcdir)/'`stat-time.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-stat-time.Tpo $(DEPDIR)/libgnu_la-stat-time.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stat-time.c' object='libgnu_la-stat-time.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-stat-time.lo `test -f 'stat-time.c' || echo '$(srcdir)/'`stat-time.c
+
+libgnu_la-stdio-read.lo: stdio-read.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-stdio-read.lo -MD -MP -MF $(DEPDIR)/libgnu_la-stdio-read.Tpo -c -o libgnu_la-stdio-read.lo `test -f 'stdio-read.c' || echo '$(srcdir)/'`stdio-read.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-stdio-read.Tpo $(DEPDIR)/libgnu_la-stdio-read.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stdio-read.c' object='libgnu_la-stdio-read.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-stdio-read.lo `test -f 'stdio-read.c' || echo '$(srcdir)/'`stdio-read.c
+
+libgnu_la-stdio-write.lo: stdio-write.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-stdio-write.lo -MD -MP -MF $(DEPDIR)/libgnu_la-stdio-write.Tpo -c -o libgnu_la-stdio-write.lo `test -f 'stdio-write.c' || echo '$(srcdir)/'`stdio-write.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-stdio-write.Tpo $(DEPDIR)/libgnu_la-stdio-write.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stdio-write.c' object='libgnu_la-stdio-write.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-stdio-write.lo `test -f 'stdio-write.c' || echo '$(srcdir)/'`stdio-write.c
+
+libgnu_la-stdopen.lo: stdopen.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-stdopen.lo -MD -MP -MF $(DEPDIR)/libgnu_la-stdopen.Tpo -c -o libgnu_la-stdopen.lo `test -f 'stdopen.c' || echo '$(srcdir)/'`stdopen.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-stdopen.Tpo $(DEPDIR)/libgnu_la-stdopen.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stdopen.c' object='libgnu_la-stdopen.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-stdopen.lo `test -f 'stdopen.c' || echo '$(srcdir)/'`stdopen.c
+
+libgnu_la-stpcpy.lo: stpcpy.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-stpcpy.lo -MD -MP -MF $(DEPDIR)/libgnu_la-stpcpy.Tpo -c -o libgnu_la-stpcpy.lo `test -f 'stpcpy.c' || echo '$(srcdir)/'`stpcpy.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-stpcpy.Tpo $(DEPDIR)/libgnu_la-stpcpy.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stpcpy.c' object='libgnu_la-stpcpy.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-stpcpy.lo `test -f 'stpcpy.c' || echo '$(srcdir)/'`stpcpy.c
+
+libgnu_la-strcasecmp.lo: strcasecmp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-strcasecmp.lo -MD -MP -MF $(DEPDIR)/libgnu_la-strcasecmp.Tpo -c -o libgnu_la-strcasecmp.lo `test -f 'strcasecmp.c' || echo '$(srcdir)/'`strcasecmp.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-strcasecmp.Tpo $(DEPDIR)/libgnu_la-strcasecmp.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strcasecmp.c' object='libgnu_la-strcasecmp.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-strcasecmp.lo `test -f 'strcasecmp.c' || echo '$(srcdir)/'`strcasecmp.c
+
+libgnu_la-strncasecmp.lo: strncasecmp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-strncasecmp.lo -MD -MP -MF $(DEPDIR)/libgnu_la-strncasecmp.Tpo -c -o libgnu_la-strncasecmp.lo `test -f 'strncasecmp.c' || echo '$(srcdir)/'`strncasecmp.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-strncasecmp.Tpo $(DEPDIR)/libgnu_la-strncasecmp.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strncasecmp.c' object='libgnu_la-strncasecmp.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-strncasecmp.lo `test -f 'strncasecmp.c' || echo '$(srcdir)/'`strncasecmp.c
+
+libgnu_la-strchrnul.lo: strchrnul.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-strchrnul.lo -MD -MP -MF $(DEPDIR)/libgnu_la-strchrnul.Tpo -c -o libgnu_la-strchrnul.lo `test -f 'strchrnul.c' || echo '$(srcdir)/'`strchrnul.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-strchrnul.Tpo $(DEPDIR)/libgnu_la-strchrnul.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strchrnul.c' object='libgnu_la-strchrnul.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-strchrnul.lo `test -f 'strchrnul.c' || echo '$(srcdir)/'`strchrnul.c
+
+libgnu_la-strdup.lo: strdup.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-strdup.lo -MD -MP -MF $(DEPDIR)/libgnu_la-strdup.Tpo -c -o libgnu_la-strdup.lo `test -f 'strdup.c' || echo '$(srcdir)/'`strdup.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-strdup.Tpo $(DEPDIR)/libgnu_la-strdup.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strdup.c' object='libgnu_la-strdup.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-strdup.lo `test -f 'strdup.c' || echo '$(srcdir)/'`strdup.c
+
+libgnu_la-strerror.lo: strerror.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-strerror.lo -MD -MP -MF $(DEPDIR)/libgnu_la-strerror.Tpo -c -o libgnu_la-strerror.lo `test -f 'strerror.c' || echo '$(srcdir)/'`strerror.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-strerror.Tpo $(DEPDIR)/libgnu_la-strerror.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strerror.c' object='libgnu_la-strerror.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-strerror.lo `test -f 'strerror.c' || echo '$(srcdir)/'`strerror.c
+
+libgnu_la-strerror-override.lo: strerror-override.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-strerror-override.lo -MD -MP -MF $(DEPDIR)/libgnu_la-strerror-override.Tpo -c -o libgnu_la-strerror-override.lo `test -f 'strerror-override.c' || echo '$(srcdir)/'`strerror-override.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-strerror-override.Tpo $(DEPDIR)/libgnu_la-strerror-override.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strerror-override.c' object='libgnu_la-strerror-override.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-strerror-override.lo `test -f 'strerror-override.c' || echo '$(srcdir)/'`strerror-override.c
+
+libgnu_la-strndup.lo: strndup.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-strndup.lo -MD -MP -MF $(DEPDIR)/libgnu_la-strndup.Tpo -c -o libgnu_la-strndup.lo `test -f 'strndup.c' || echo '$(srcdir)/'`strndup.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-strndup.Tpo $(DEPDIR)/libgnu_la-strndup.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strndup.c' object='libgnu_la-strndup.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-strndup.lo `test -f 'strndup.c' || echo '$(srcdir)/'`strndup.c
+
+libgnu_la-strnlen.lo: strnlen.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-strnlen.lo -MD -MP -MF $(DEPDIR)/libgnu_la-strnlen.Tpo -c -o libgnu_la-strnlen.lo `test -f 'strnlen.c' || echo '$(srcdir)/'`strnlen.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-strnlen.Tpo $(DEPDIR)/libgnu_la-strnlen.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strnlen.c' object='libgnu_la-strnlen.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-strnlen.lo `test -f 'strnlen.c' || echo '$(srcdir)/'`strnlen.c
+
+libgnu_la-strnlen1.lo: strnlen1.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-strnlen1.lo -MD -MP -MF $(DEPDIR)/libgnu_la-strnlen1.Tpo -c -o libgnu_la-strnlen1.lo `test -f 'strnlen1.c' || echo '$(srcdir)/'`strnlen1.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-strnlen1.Tpo $(DEPDIR)/libgnu_la-strnlen1.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strnlen1.c' object='libgnu_la-strnlen1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-strnlen1.lo `test -f 'strnlen1.c' || echo '$(srcdir)/'`strnlen1.c
+
+libgnu_la-strsep.lo: strsep.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-strsep.lo -MD -MP -MF $(DEPDIR)/libgnu_la-strsep.Tpo -c -o libgnu_la-strsep.lo `test -f 'strsep.c' || echo '$(srcdir)/'`strsep.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-strsep.Tpo $(DEPDIR)/libgnu_la-strsep.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strsep.c' object='libgnu_la-strsep.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-strsep.lo `test -f 'strsep.c' || echo '$(srcdir)/'`strsep.c
+
+libgnu_la-sys_socket.lo: sys_socket.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-sys_socket.lo -MD -MP -MF $(DEPDIR)/libgnu_la-sys_socket.Tpo -c -o libgnu_la-sys_socket.lo `test -f 'sys_socket.c' || echo '$(srcdir)/'`sys_socket.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-sys_socket.Tpo $(DEPDIR)/libgnu_la-sys_socket.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sys_socket.c' object='libgnu_la-sys_socket.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-sys_socket.lo `test -f 'sys_socket.c' || echo '$(srcdir)/'`sys_socket.c
+
+libgnu_la-tempname.lo: tempname.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-tempname.lo -MD -MP -MF $(DEPDIR)/libgnu_la-tempname.Tpo -c -o libgnu_la-tempname.lo `test -f 'tempname.c' || echo '$(srcdir)/'`tempname.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-tempname.Tpo $(DEPDIR)/libgnu_la-tempname.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tempname.c' object='libgnu_la-tempname.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-tempname.lo `test -f 'tempname.c' || echo '$(srcdir)/'`tempname.c
+
+glthread/libgnu_la-threadlib.lo: glthread/threadlib.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT glthread/libgnu_la-threadlib.lo -MD -MP -MF glthread/$(DEPDIR)/libgnu_la-threadlib.Tpo -c -o glthread/libgnu_la-threadlib.lo `test -f 'glthread/threadlib.c' || echo '$(srcdir)/'`glthread/threadlib.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) glthread/$(DEPDIR)/libgnu_la-threadlib.Tpo glthread/$(DEPDIR)/libgnu_la-threadlib.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='glthread/threadlib.c' object='glthread/libgnu_la-threadlib.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o glthread/libgnu_la-threadlib.lo `test -f 'glthread/threadlib.c' || echo '$(srcdir)/'`glthread/threadlib.c
+
+libgnu_la-timespec.lo: timespec.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-timespec.lo -MD -MP -MF $(DEPDIR)/libgnu_la-timespec.Tpo -c -o libgnu_la-timespec.lo `test -f 'timespec.c' || echo '$(srcdir)/'`timespec.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-timespec.Tpo $(DEPDIR)/libgnu_la-timespec.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='timespec.c' object='libgnu_la-timespec.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-timespec.lo `test -f 'timespec.c' || echo '$(srcdir)/'`timespec.c
+
+libgnu_la-unistd.lo: unistd.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-unistd.lo -MD -MP -MF $(DEPDIR)/libgnu_la-unistd.Tpo -c -o libgnu_la-unistd.lo `test -f 'unistd.c' || echo '$(srcdir)/'`unistd.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-unistd.Tpo $(DEPDIR)/libgnu_la-unistd.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unistd.c' object='libgnu_la-unistd.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-unistd.lo `test -f 'unistd.c' || echo '$(srcdir)/'`unistd.c
+
+libgnu_la-dup-safer.lo: dup-safer.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-dup-safer.lo -MD -MP -MF $(DEPDIR)/libgnu_la-dup-safer.Tpo -c -o libgnu_la-dup-safer.lo `test -f 'dup-safer.c' || echo '$(srcdir)/'`dup-safer.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-dup-safer.Tpo $(DEPDIR)/libgnu_la-dup-safer.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dup-safer.c' object='libgnu_la-dup-safer.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-dup-safer.lo `test -f 'dup-safer.c' || echo '$(srcdir)/'`dup-safer.c
+
+libgnu_la-fd-safer.lo: fd-safer.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-fd-safer.lo -MD -MP -MF $(DEPDIR)/libgnu_la-fd-safer.Tpo -c -o libgnu_la-fd-safer.lo `test -f 'fd-safer.c' || echo '$(srcdir)/'`fd-safer.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-fd-safer.Tpo $(DEPDIR)/libgnu_la-fd-safer.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fd-safer.c' object='libgnu_la-fd-safer.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-fd-safer.lo `test -f 'fd-safer.c' || echo '$(srcdir)/'`fd-safer.c
+
+libgnu_la-pipe-safer.lo: pipe-safer.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-pipe-safer.lo -MD -MP -MF $(DEPDIR)/libgnu_la-pipe-safer.Tpo -c -o libgnu_la-pipe-safer.lo `test -f 'pipe-safer.c' || echo '$(srcdir)/'`pipe-safer.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-pipe-safer.Tpo $(DEPDIR)/libgnu_la-pipe-safer.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pipe-safer.c' object='libgnu_la-pipe-safer.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-pipe-safer.lo `test -f 'pipe-safer.c' || echo '$(srcdir)/'`pipe-safer.c
+
+libgnu_la-unlink.lo: unlink.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-unlink.lo -MD -MP -MF $(DEPDIR)/libgnu_la-unlink.Tpo -c -o libgnu_la-unlink.lo `test -f 'unlink.c' || echo '$(srcdir)/'`unlink.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-unlink.Tpo $(DEPDIR)/libgnu_la-unlink.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unlink.c' object='libgnu_la-unlink.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-unlink.lo `test -f 'unlink.c' || echo '$(srcdir)/'`unlink.c
+
+libgnu_la-unlinkat.lo: unlinkat.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-unlinkat.lo -MD -MP -MF $(DEPDIR)/libgnu_la-unlinkat.Tpo -c -o libgnu_la-unlinkat.lo `test -f 'unlinkat.c' || echo '$(srcdir)/'`unlinkat.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-unlinkat.Tpo $(DEPDIR)/libgnu_la-unlinkat.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unlinkat.c' object='libgnu_la-unlinkat.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-unlinkat.lo `test -f 'unlinkat.c' || echo '$(srcdir)/'`unlinkat.c
+
+libgnu_la-utime.lo: utime.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-utime.lo -MD -MP -MF $(DEPDIR)/libgnu_la-utime.Tpo -c -o libgnu_la-utime.lo `test -f 'utime.c' || echo '$(srcdir)/'`utime.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-utime.Tpo $(DEPDIR)/libgnu_la-utime.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utime.c' object='libgnu_la-utime.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-utime.lo `test -f 'utime.c' || echo '$(srcdir)/'`utime.c
+
+libgnu_la-utimens.lo: utimens.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-utimens.lo -MD -MP -MF $(DEPDIR)/libgnu_la-utimens.Tpo -c -o libgnu_la-utimens.lo `test -f 'utimens.c' || echo '$(srcdir)/'`utimens.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-utimens.Tpo $(DEPDIR)/libgnu_la-utimens.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utimens.c' object='libgnu_la-utimens.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-utimens.lo `test -f 'utimens.c' || echo '$(srcdir)/'`utimens.c
+
+libgnu_la-verror.lo: verror.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-verror.lo -MD -MP -MF $(DEPDIR)/libgnu_la-verror.Tpo -c -o libgnu_la-verror.lo `test -f 'verror.c' || echo '$(srcdir)/'`verror.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-verror.Tpo $(DEPDIR)/libgnu_la-verror.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='verror.c' object='libgnu_la-verror.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-verror.lo `test -f 'verror.c' || echo '$(srcdir)/'`verror.c
+
+libgnu_la-wcrtomb.lo: wcrtomb.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-wcrtomb.lo -MD -MP -MF $(DEPDIR)/libgnu_la-wcrtomb.Tpo -c -o libgnu_la-wcrtomb.lo `test -f 'wcrtomb.c' || echo '$(srcdir)/'`wcrtomb.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-wcrtomb.Tpo $(DEPDIR)/libgnu_la-wcrtomb.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wcrtomb.c' object='libgnu_la-wcrtomb.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-wcrtomb.lo `test -f 'wcrtomb.c' || echo '$(srcdir)/'`wcrtomb.c
+
+libgnu_la-wctype-h.lo: wctype-h.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-wctype-h.lo -MD -MP -MF $(DEPDIR)/libgnu_la-wctype-h.Tpo -c -o libgnu_la-wctype-h.lo `test -f 'wctype-h.c' || echo '$(srcdir)/'`wctype-h.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-wctype-h.Tpo $(DEPDIR)/libgnu_la-wctype-h.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wctype-h.c' object='libgnu_la-wctype-h.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-wctype-h.lo `test -f 'wctype-h.c' || echo '$(srcdir)/'`wctype-h.c
+
+libgnu_la-windows-mutex.lo: windows-mutex.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-windows-mutex.lo -MD -MP -MF $(DEPDIR)/libgnu_la-windows-mutex.Tpo -c -o libgnu_la-windows-mutex.lo `test -f 'windows-mutex.c' || echo '$(srcdir)/'`windows-mutex.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-windows-mutex.Tpo $(DEPDIR)/libgnu_la-windows-mutex.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='windows-mutex.c' object='libgnu_la-windows-mutex.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-windows-mutex.lo `test -f 'windows-mutex.c' || echo '$(srcdir)/'`windows-mutex.c
+
+libgnu_la-windows-once.lo: windows-once.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-windows-once.lo -MD -MP -MF $(DEPDIR)/libgnu_la-windows-once.Tpo -c -o libgnu_la-windows-once.lo `test -f 'windows-once.c' || echo '$(srcdir)/'`windows-once.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-windows-once.Tpo $(DEPDIR)/libgnu_la-windows-once.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='windows-once.c' object='libgnu_la-windows-once.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-windows-once.lo `test -f 'windows-once.c' || echo '$(srcdir)/'`windows-once.c
+
+libgnu_la-windows-recmutex.lo: windows-recmutex.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-windows-recmutex.lo -MD -MP -MF $(DEPDIR)/libgnu_la-windows-recmutex.Tpo -c -o libgnu_la-windows-recmutex.lo `test -f 'windows-recmutex.c' || echo '$(srcdir)/'`windows-recmutex.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-windows-recmutex.Tpo $(DEPDIR)/libgnu_la-windows-recmutex.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='windows-recmutex.c' object='libgnu_la-windows-recmutex.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-windows-recmutex.lo `test -f 'windows-recmutex.c' || echo '$(srcdir)/'`windows-recmutex.c
+
+libgnu_la-windows-rwlock.lo: windows-rwlock.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-windows-rwlock.lo -MD -MP -MF $(DEPDIR)/libgnu_la-windows-rwlock.Tpo -c -o libgnu_la-windows-rwlock.lo `test -f 'windows-rwlock.c' || echo '$(srcdir)/'`windows-rwlock.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-windows-rwlock.Tpo $(DEPDIR)/libgnu_la-windows-rwlock.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='windows-rwlock.c' object='libgnu_la-windows-rwlock.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-windows-rwlock.lo `test -f 'windows-rwlock.c' || echo '$(srcdir)/'`windows-rwlock.c
+
+libgnu_la-wmemchr.lo: wmemchr.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-wmemchr.lo -MD -MP -MF $(DEPDIR)/libgnu_la-wmemchr.Tpo -c -o libgnu_la-wmemchr.lo `test -f 'wmemchr.c' || echo '$(srcdir)/'`wmemchr.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-wmemchr.Tpo $(DEPDIR)/libgnu_la-wmemchr.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wmemchr.c' object='libgnu_la-wmemchr.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-wmemchr.lo `test -f 'wmemchr.c' || echo '$(srcdir)/'`wmemchr.c
+
+libgnu_la-wmempcpy.lo: wmempcpy.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-wmempcpy.lo -MD -MP -MF $(DEPDIR)/libgnu_la-wmempcpy.Tpo -c -o libgnu_la-wmempcpy.lo `test -f 'wmempcpy.c' || echo '$(srcdir)/'`wmempcpy.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-wmempcpy.Tpo $(DEPDIR)/libgnu_la-wmempcpy.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wmempcpy.c' object='libgnu_la-wmempcpy.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-wmempcpy.lo `test -f 'wmempcpy.c' || echo '$(srcdir)/'`wmempcpy.c
+
+libgnu_la-xmalloc.lo: xmalloc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-xmalloc.lo -MD -MP -MF $(DEPDIR)/libgnu_la-xmalloc.Tpo -c -o libgnu_la-xmalloc.lo `test -f 'xmalloc.c' || echo '$(srcdir)/'`xmalloc.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-xmalloc.Tpo $(DEPDIR)/libgnu_la-xmalloc.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xmalloc.c' object='libgnu_la-xmalloc.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-xmalloc.lo `test -f 'xmalloc.c' || echo '$(srcdir)/'`xmalloc.c
+
+libgnu_la-xalloc-die.lo: xalloc-die.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-xalloc-die.lo -MD -MP -MF $(DEPDIR)/libgnu_la-xalloc-die.Tpo -c -o libgnu_la-xalloc-die.lo `test -f 'xalloc-die.c' || echo '$(srcdir)/'`xalloc-die.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-xalloc-die.Tpo $(DEPDIR)/libgnu_la-xalloc-die.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xalloc-die.c' object='libgnu_la-xalloc-die.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-xalloc-die.lo `test -f 'xalloc-die.c' || echo '$(srcdir)/'`xalloc-die.c
+
+libgnu_la-xgetcwd.lo: xgetcwd.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-xgetcwd.lo -MD -MP -MF $(DEPDIR)/libgnu_la-xgetcwd.Tpo -c -o libgnu_la-xgetcwd.lo `test -f 'xgetcwd.c' || echo '$(srcdir)/'`xgetcwd.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-xgetcwd.Tpo $(DEPDIR)/libgnu_la-xgetcwd.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xgetcwd.c' object='libgnu_la-xgetcwd.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-xgetcwd.lo `test -f 'xgetcwd.c' || echo '$(srcdir)/'`xgetcwd.c
+
+libgnu_la-gl_xlist.lo: gl_xlist.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-gl_xlist.lo -MD -MP -MF $(DEPDIR)/libgnu_la-gl_xlist.Tpo -c -o libgnu_la-gl_xlist.lo `test -f 'gl_xlist.c' || echo '$(srcdir)/'`gl_xlist.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-gl_xlist.Tpo $(DEPDIR)/libgnu_la-gl_xlist.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gl_xlist.c' object='libgnu_la-gl_xlist.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-gl_xlist.lo `test -f 'gl_xlist.c' || echo '$(srcdir)/'`gl_xlist.c
+
+libgnu_la-gl_xmap.lo: gl_xmap.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-gl_xmap.lo -MD -MP -MF $(DEPDIR)/libgnu_la-gl_xmap.Tpo -c -o libgnu_la-gl_xmap.lo `test -f 'gl_xmap.c' || echo '$(srcdir)/'`gl_xmap.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-gl_xmap.Tpo $(DEPDIR)/libgnu_la-gl_xmap.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gl_xmap.c' object='libgnu_la-gl_xmap.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-gl_xmap.lo `test -f 'gl_xmap.c' || echo '$(srcdir)/'`gl_xmap.c
+
+libgnu_la-gl_xset.lo: gl_xset.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-gl_xset.lo -MD -MP -MF $(DEPDIR)/libgnu_la-gl_xset.Tpo -c -o libgnu_la-gl_xset.lo `test -f 'gl_xset.c' || echo '$(srcdir)/'`gl_xset.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-gl_xset.Tpo $(DEPDIR)/libgnu_la-gl_xset.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gl_xset.c' object='libgnu_la-gl_xset.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-gl_xset.lo `test -f 'gl_xset.c' || echo '$(srcdir)/'`gl_xset.c
+
+libgnu_la-xsize.lo: xsize.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-xsize.lo -MD -MP -MF $(DEPDIR)/libgnu_la-xsize.Tpo -c -o libgnu_la-xsize.lo `test -f 'xsize.c' || echo '$(srcdir)/'`xsize.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-xsize.Tpo $(DEPDIR)/libgnu_la-xsize.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xsize.c' object='libgnu_la-xsize.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-xsize.lo `test -f 'xsize.c' || echo '$(srcdir)/'`xsize.c
+
+libgnu_la-xstdopen.lo: xstdopen.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-xstdopen.lo -MD -MP -MF $(DEPDIR)/libgnu_la-xstdopen.Tpo -c -o libgnu_la-xstdopen.lo `test -f 'xstdopen.c' || echo '$(srcdir)/'`xstdopen.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-xstdopen.Tpo $(DEPDIR)/libgnu_la-xstdopen.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xstdopen.c' object='libgnu_la-xstdopen.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-xstdopen.lo `test -f 'xstdopen.c' || echo '$(srcdir)/'`xstdopen.c
+
+libgnu_la-xstrndup.lo: xstrndup.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-xstrndup.lo -MD -MP -MF $(DEPDIR)/libgnu_la-xstrndup.Tpo -c -o libgnu_la-xstrndup.lo `test -f 'xstrndup.c' || echo '$(srcdir)/'`xstrndup.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-xstrndup.Tpo $(DEPDIR)/libgnu_la-xstrndup.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xstrndup.c' object='libgnu_la-xstrndup.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-xstrndup.lo `test -f 'xstrndup.c' || echo '$(srcdir)/'`xstrndup.c
+
+libgnu_la-xvasprintf.lo: xvasprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-xvasprintf.lo -MD -MP -MF $(DEPDIR)/libgnu_la-xvasprintf.Tpo -c -o libgnu_la-xvasprintf.lo `test -f 'xvasprintf.c' || echo '$(srcdir)/'`xvasprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-xvasprintf.Tpo $(DEPDIR)/libgnu_la-xvasprintf.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xvasprintf.c' object='libgnu_la-xvasprintf.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-xvasprintf.lo `test -f 'xvasprintf.c' || echo '$(srcdir)/'`xvasprintf.c
+
+libgnu_la-xasprintf.lo: xasprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-xasprintf.lo -MD -MP -MF $(DEPDIR)/libgnu_la-xasprintf.Tpo -c -o libgnu_la-xasprintf.lo `test -f 'xasprintf.c' || echo '$(srcdir)/'`xasprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-xasprintf.Tpo $(DEPDIR)/libgnu_la-xasprintf.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xasprintf.c' object='libgnu_la-xasprintf.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-xasprintf.lo `test -f 'xasprintf.c' || echo '$(srcdir)/'`xasprintf.c
+
+libgnu_la-alloca.lo: alloca.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-alloca.lo -MD -MP -MF $(DEPDIR)/libgnu_la-alloca.Tpo -c -o libgnu_la-alloca.lo `test -f 'alloca.c' || echo '$(srcdir)/'`alloca.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-alloca.Tpo $(DEPDIR)/libgnu_la-alloca.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='alloca.c' object='libgnu_la-alloca.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-alloca.lo `test -f 'alloca.c' || echo '$(srcdir)/'`alloca.c
+
+libgnu_la-calloc.lo: calloc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-calloc.lo -MD -MP -MF $(DEPDIR)/libgnu_la-calloc.Tpo -c -o libgnu_la-calloc.lo `test -f 'calloc.c' || echo '$(srcdir)/'`calloc.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-calloc.Tpo $(DEPDIR)/libgnu_la-calloc.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='calloc.c' object='libgnu_la-calloc.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-calloc.lo `test -f 'calloc.c' || echo '$(srcdir)/'`calloc.c
+
+malloc/libgnu_la-dynarray-skeleton.lo: malloc/dynarray-skeleton.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT malloc/libgnu_la-dynarray-skeleton.lo -MD -MP -MF malloc/$(DEPDIR)/libgnu_la-dynarray-skeleton.Tpo -c -o malloc/libgnu_la-dynarray-skeleton.lo `test -f 'malloc/dynarray-skeleton.c' || echo '$(srcdir)/'`malloc/dynarray-skeleton.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_la-dynarray-skeleton.Tpo malloc/$(DEPDIR)/libgnu_la-dynarray-skeleton.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray-skeleton.c' object='malloc/libgnu_la-dynarray-skeleton.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_la-dynarray-skeleton.lo `test -f 'malloc/dynarray-skeleton.c' || echo '$(srcdir)/'`malloc/dynarray-skeleton.c
+
+libgnu_la-fnmatch.lo: fnmatch.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-fnmatch.lo -MD -MP -MF $(DEPDIR)/libgnu_la-fnmatch.Tpo -c -o libgnu_la-fnmatch.lo `test -f 'fnmatch.c' || echo '$(srcdir)/'`fnmatch.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-fnmatch.Tpo $(DEPDIR)/libgnu_la-fnmatch.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fnmatch.c' object='libgnu_la-fnmatch.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-fnmatch.lo `test -f 'fnmatch.c' || echo '$(srcdir)/'`fnmatch.c
+
+libgnu_la-fnmatch_loop.lo: fnmatch_loop.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-fnmatch_loop.lo -MD -MP -MF $(DEPDIR)/libgnu_la-fnmatch_loop.Tpo -c -o libgnu_la-fnmatch_loop.lo `test -f 'fnmatch_loop.c' || echo '$(srcdir)/'`fnmatch_loop.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-fnmatch_loop.Tpo $(DEPDIR)/libgnu_la-fnmatch_loop.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fnmatch_loop.c' object='libgnu_la-fnmatch_loop.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-fnmatch_loop.lo `test -f 'fnmatch_loop.c' || echo '$(srcdir)/'`fnmatch_loop.c
+
+libgnu_la-stat-w32.lo: stat-w32.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-stat-w32.lo -MD -MP -MF $(DEPDIR)/libgnu_la-stat-w32.Tpo -c -o libgnu_la-stat-w32.lo `test -f 'stat-w32.c' || echo '$(srcdir)/'`stat-w32.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-stat-w32.Tpo $(DEPDIR)/libgnu_la-stat-w32.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stat-w32.c' object='libgnu_la-stat-w32.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-stat-w32.lo `test -f 'stat-w32.c' || echo '$(srcdir)/'`stat-w32.c
+
+libgnu_la-at-func.lo: at-func.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-at-func.lo -MD -MP -MF $(DEPDIR)/libgnu_la-at-func.Tpo -c -o libgnu_la-at-func.lo `test -f 'at-func.c' || echo '$(srcdir)/'`at-func.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-at-func.Tpo $(DEPDIR)/libgnu_la-at-func.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='at-func.c' object='libgnu_la-at-func.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-at-func.lo `test -f 'at-func.c' || echo '$(srcdir)/'`at-func.c
+
+libgnu_la-malloc.lo: malloc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-malloc.lo -MD -MP -MF $(DEPDIR)/libgnu_la-malloc.Tpo -c -o libgnu_la-malloc.lo `test -f 'malloc.c' || echo '$(srcdir)/'`malloc.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-malloc.Tpo $(DEPDIR)/libgnu_la-malloc.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc.c' object='libgnu_la-malloc.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-malloc.lo `test -f 'malloc.c' || echo '$(srcdir)/'`malloc.c
+
+libgnu_la-lc-charset-dispatch.lo: lc-charset-dispatch.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-lc-charset-dispatch.lo -MD -MP -MF $(DEPDIR)/libgnu_la-lc-charset-dispatch.Tpo -c -o libgnu_la-lc-charset-dispatch.lo `test -f 'lc-charset-dispatch.c' || echo '$(srcdir)/'`lc-charset-dispatch.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-lc-charset-dispatch.Tpo $(DEPDIR)/libgnu_la-lc-charset-dispatch.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lc-charset-dispatch.c' object='libgnu_la-lc-charset-dispatch.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-lc-charset-dispatch.lo `test -f 'lc-charset-dispatch.c' || echo '$(srcdir)/'`lc-charset-dispatch.c
+
+libgnu_la-mbtowc-lock.lo: mbtowc-lock.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-mbtowc-lock.lo -MD -MP -MF $(DEPDIR)/libgnu_la-mbtowc-lock.Tpo -c -o libgnu_la-mbtowc-lock.lo `test -f 'mbtowc-lock.c' || echo '$(srcdir)/'`mbtowc-lock.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-mbtowc-lock.Tpo $(DEPDIR)/libgnu_la-mbtowc-lock.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mbtowc-lock.c' object='libgnu_la-mbtowc-lock.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-mbtowc-lock.lo `test -f 'mbtowc-lock.c' || echo '$(srcdir)/'`mbtowc-lock.c
+
+libgnu_la-mbsrtowcs-state.lo: mbsrtowcs-state.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-mbsrtowcs-state.lo -MD -MP -MF $(DEPDIR)/libgnu_la-mbsrtowcs-state.Tpo -c -o libgnu_la-mbsrtowcs-state.lo `test -f 'mbsrtowcs-state.c' || echo '$(srcdir)/'`mbsrtowcs-state.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-mbsrtowcs-state.Tpo $(DEPDIR)/libgnu_la-mbsrtowcs-state.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mbsrtowcs-state.c' object='libgnu_la-mbsrtowcs-state.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-mbsrtowcs-state.lo `test -f 'mbsrtowcs-state.c' || echo '$(srcdir)/'`mbsrtowcs-state.c
+
+libgnu_la-memmem.lo: memmem.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-memmem.lo -MD -MP -MF $(DEPDIR)/libgnu_la-memmem.Tpo -c -o libgnu_la-memmem.lo `test -f 'memmem.c' || echo '$(srcdir)/'`memmem.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-memmem.Tpo $(DEPDIR)/libgnu_la-memmem.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='memmem.c' object='libgnu_la-memmem.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-memmem.lo `test -f 'memmem.c' || echo '$(srcdir)/'`memmem.c
+
+libgnu_la-realloc.lo: realloc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-realloc.lo -MD -MP -MF $(DEPDIR)/libgnu_la-realloc.Tpo -c -o libgnu_la-realloc.lo `test -f 'realloc.c' || echo '$(srcdir)/'`realloc.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-realloc.Tpo $(DEPDIR)/libgnu_la-realloc.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='realloc.c' object='libgnu_la-realloc.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-realloc.lo `test -f 'realloc.c' || echo '$(srcdir)/'`realloc.c
+
+libgnu_la-regcomp.lo: regcomp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-regcomp.lo -MD -MP -MF $(DEPDIR)/libgnu_la-regcomp.Tpo -c -o libgnu_la-regcomp.lo `test -f 'regcomp.c' || echo '$(srcdir)/'`regcomp.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-regcomp.Tpo $(DEPDIR)/libgnu_la-regcomp.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='regcomp.c' object='libgnu_la-regcomp.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-regcomp.lo `test -f 'regcomp.c' || echo '$(srcdir)/'`regcomp.c
+
+libgnu_la-regex_internal.lo: regex_internal.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-regex_internal.lo -MD -MP -MF $(DEPDIR)/libgnu_la-regex_internal.Tpo -c -o libgnu_la-regex_internal.lo `test -f 'regex_internal.c' || echo '$(srcdir)/'`regex_internal.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-regex_internal.Tpo $(DEPDIR)/libgnu_la-regex_internal.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='regex_internal.c' object='libgnu_la-regex_internal.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-regex_internal.lo `test -f 'regex_internal.c' || echo '$(srcdir)/'`regex_internal.c
+
+libgnu_la-regexec.lo: regexec.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-regexec.lo -MD -MP -MF $(DEPDIR)/libgnu_la-regexec.Tpo -c -o libgnu_la-regexec.lo `test -f 'regexec.c' || echo '$(srcdir)/'`regexec.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-regexec.Tpo $(DEPDIR)/libgnu_la-regexec.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='regexec.c' object='libgnu_la-regexec.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-regexec.lo `test -f 'regexec.c' || echo '$(srcdir)/'`regexec.c
+
+libgnu_la-at-func2.lo: at-func2.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-at-func2.lo -MD -MP -MF $(DEPDIR)/libgnu_la-at-func2.Tpo -c -o libgnu_la-at-func2.lo `test -f 'at-func2.c' || echo '$(srcdir)/'`at-func2.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-at-func2.Tpo $(DEPDIR)/libgnu_la-at-func2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='at-func2.c' object='libgnu_la-at-func2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-at-func2.lo `test -f 'at-func2.c' || echo '$(srcdir)/'`at-func2.c
+
+libgnu_la-strcasestr.lo: strcasestr.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-strcasestr.lo -MD -MP -MF $(DEPDIR)/libgnu_la-strcasestr.Tpo -c -o libgnu_la-strcasestr.lo `test -f 'strcasestr.c' || echo '$(srcdir)/'`strcasestr.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-strcasestr.Tpo $(DEPDIR)/libgnu_la-strcasestr.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strcasestr.c' object='libgnu_la-strcasestr.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-strcasestr.lo `test -f 'strcasestr.c' || echo '$(srcdir)/'`strcasestr.c
+
+libgnu_la-asnprintf.lo: asnprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-asnprintf.lo -MD -MP -MF $(DEPDIR)/libgnu_la-asnprintf.Tpo -c -o libgnu_la-asnprintf.lo `test -f 'asnprintf.c' || echo '$(srcdir)/'`asnprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-asnprintf.Tpo $(DEPDIR)/libgnu_la-asnprintf.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='asnprintf.c' object='libgnu_la-asnprintf.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-asnprintf.lo `test -f 'asnprintf.c' || echo '$(srcdir)/'`asnprintf.c
+
+libgnu_la-printf-args.lo: printf-args.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-printf-args.lo -MD -MP -MF $(DEPDIR)/libgnu_la-printf-args.Tpo -c -o libgnu_la-printf-args.lo `test -f 'printf-args.c' || echo '$(srcdir)/'`printf-args.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-printf-args.Tpo $(DEPDIR)/libgnu_la-printf-args.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printf-args.c' object='libgnu_la-printf-args.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-printf-args.lo `test -f 'printf-args.c' || echo '$(srcdir)/'`printf-args.c
+
+libgnu_la-printf-parse.lo: printf-parse.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-printf-parse.lo -MD -MP -MF $(DEPDIR)/libgnu_la-printf-parse.Tpo -c -o libgnu_la-printf-parse.lo `test -f 'printf-parse.c' || echo '$(srcdir)/'`printf-parse.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-printf-parse.Tpo $(DEPDIR)/libgnu_la-printf-parse.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printf-parse.c' object='libgnu_la-printf-parse.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-printf-parse.lo `test -f 'printf-parse.c' || echo '$(srcdir)/'`printf-parse.c
+
+libgnu_la-vasnprintf.lo: vasnprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-vasnprintf.lo -MD -MP -MF $(DEPDIR)/libgnu_la-vasnprintf.Tpo -c -o libgnu_la-vasnprintf.lo `test -f 'vasnprintf.c' || echo '$(srcdir)/'`vasnprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-vasnprintf.Tpo $(DEPDIR)/libgnu_la-vasnprintf.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vasnprintf.c' object='libgnu_la-vasnprintf.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-vasnprintf.lo `test -f 'vasnprintf.c' || echo '$(srcdir)/'`vasnprintf.c
+
+libgnu_la-asprintf.lo: asprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-asprintf.lo -MD -MP -MF $(DEPDIR)/libgnu_la-asprintf.Tpo -c -o libgnu_la-asprintf.lo `test -f 'asprintf.c' || echo '$(srcdir)/'`asprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-asprintf.Tpo $(DEPDIR)/libgnu_la-asprintf.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='asprintf.c' object='libgnu_la-asprintf.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-asprintf.lo `test -f 'asprintf.c' || echo '$(srcdir)/'`asprintf.c
+
+libgnu_la-vasprintf.lo: vasprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-vasprintf.lo -MD -MP -MF $(DEPDIR)/libgnu_la-vasprintf.Tpo -c -o libgnu_la-vasprintf.lo `test -f 'vasprintf.c' || echo '$(srcdir)/'`vasprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-vasprintf.Tpo $(DEPDIR)/libgnu_la-vasprintf.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vasprintf.c' object='libgnu_la-vasprintf.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-vasprintf.lo `test -f 'vasprintf.c' || echo '$(srcdir)/'`vasprintf.c
+
+libgnu_la-vsnprintf.lo: vsnprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-vsnprintf.lo -MD -MP -MF $(DEPDIR)/libgnu_la-vsnprintf.Tpo -c -o libgnu_la-vsnprintf.lo `test -f 'vsnprintf.c' || echo '$(srcdir)/'`vsnprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-vsnprintf.Tpo $(DEPDIR)/libgnu_la-vsnprintf.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vsnprintf.c' object='libgnu_la-vsnprintf.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-vsnprintf.lo `test -f 'vsnprintf.c' || echo '$(srcdir)/'`vsnprintf.c
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+ -rm -rf glthread/.libs glthread/_libs
+ -rm -rf malloc/.libs malloc/_libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-recursive
+all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(HEADERS)
+installdirs: installdirs-recursive
+installdirs-am:
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-recursive
+install-exec: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -rm -f glthread/$(DEPDIR)/$(am__dirstamp)
+ -rm -f glthread/$(am__dirstamp)
+ -rm -f malloc/$(DEPDIR)/$(am__dirstamp)
+ -rm -f malloc/$(am__dirstamp)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+ clean-noinstLTLIBRARIES mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f ./$(DEPDIR)/alloca.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-alloca.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-argp-ba.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-argp-eexst.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-argp-fmtstream.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-argp-fs-xinl.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-argp-help.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-argp-parse.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-argp-pin.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-argp-pv.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-argp-pvh.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-argp-xinl.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-asnprintf.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-asprintf.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-at-func.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-at-func2.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-basename-lgpl.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-basename.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-bitrotate.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-btowc.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-calloc.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-canonicalize-lgpl.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-canonicalize.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-chdir-long.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-chown.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-cloexec.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-close.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-closedir.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-dirfd.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-dirname-lgpl.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-dirname.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-dup-safer-flag.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-dup-safer.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-dup.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-dup2.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-error.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-exitfail.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fchdir.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fchown-stub.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fcntl.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fd-hook.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fd-safer-flag.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fd-safer.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fdopendir.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-file-set.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-filenamecat-lgpl.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-float.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-flock.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fnmatch.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fnmatch_loop.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-free.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fstat.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fstatat.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-getcwd-lgpl.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-getcwd.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-getdelim.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-getdtablesize.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-getline.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-getlogin_r.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-getopt.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-getopt1.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-getprogname.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-getrandom.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gettime.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gettimeofday.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_array_list.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_hash_map.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_hash_set.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_linkedhash_list.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_list.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_map.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_rbtree_list.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_set.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_xlist.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_xmap.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_xset.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-glob.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-glob_pattern_p.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-globfree.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-hard-locale.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-hash-pjw-bare.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-hash-pjw.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-hash-triple-simple.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-hash.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-ialloc.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-idpriv-drop.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-idpriv-droptemp.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-ioctl.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-isblank.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-itold.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-lc-charset-dispatch.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-lchown.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-localcharset.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-localeconv.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-lstat.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-malloc.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-malloca.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-mbrtowc.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-mbsinit.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-mbsrtowcs-state.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-mbsrtowcs.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-mbtowc-lock.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-mbtowc.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-memchr.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-memmem.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-mempcpy.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-memrchr.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-mkdir.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-mkdtemp.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-mkstemp.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-msvc-inval.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-msvc-nothrow.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-nanosleep.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-nl_langinfo-lock.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-nl_langinfo.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-nonblocking.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-open.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-openat-die.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-openat-proc.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-openat.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-opendir.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-pipe-safer.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-pipe.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-printf-args.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-printf-parse.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-progname.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-pselect.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-pthread_sigmask.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-raise.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-rawmemchr.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-readdir.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-readlink.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-readlinkat.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-realloc.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-reallocarray.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-regcomp.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-regex.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-regex_internal.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-regexec.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-rename.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-renameat.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-renameatu.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-rewinddir.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-rmdir.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-save-cwd.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-select.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-setenv.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-setlocale-lock.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-setlocale_null.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-sig-handler.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-sigaction.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-sigprocmask.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-sleep.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-sockets.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-stat-time.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-stat-w32.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-stat.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-stdio-read.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-stdio-write.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-stdopen.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-stpcpy.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strcasecmp.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strcasestr.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strchrnul.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strdup.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strerror-override.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strerror.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-stripslash.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strncasecmp.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strndup.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strnlen.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strnlen1.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strsep.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-sys_socket.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-tempname.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-timespec.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-unistd.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-unlink.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-unlinkat.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-utime.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-utimens.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-vasnprintf.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-vasprintf.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-verror.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-vsnprintf.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-wcrtomb.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-wctype-h.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-windows-mutex.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-windows-once.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-windows-recmutex.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-windows-rwlock.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-wmemchr.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-wmempcpy.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-xalloc-die.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-xasprintf.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-xgetcwd.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-xmalloc.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-xsize.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-xstdopen.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-xstrndup.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-xvasprintf.Plo
+ -rm -f glthread/$(DEPDIR)/libgnu_la-lock.Plo
+ -rm -f glthread/$(DEPDIR)/libgnu_la-threadlib.Plo
+ -rm -f malloc/$(DEPDIR)/libgnu_la-dynarray-skeleton.Plo
+ -rm -f malloc/$(DEPDIR)/libgnu_la-dynarray_at_failure.Plo
+ -rm -f malloc/$(DEPDIR)/libgnu_la-dynarray_emplace_enlarge.Plo
+ -rm -f malloc/$(DEPDIR)/libgnu_la-dynarray_finalize.Plo
+ -rm -f malloc/$(DEPDIR)/libgnu_la-dynarray_resize.Plo
+ -rm -f malloc/$(DEPDIR)/libgnu_la-dynarray_resize_clear.Plo
+ -rm -f malloc/$(DEPDIR)/libgnu_la-scratch_buffer_dupfree.Plo
+ -rm -f malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow.Plo
+ -rm -f malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow_preserve.Plo
+ -rm -f malloc/$(DEPDIR)/libgnu_la-scratch_buffer_set_array_size.Plo
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-local distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f ./$(DEPDIR)/alloca.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-alloca.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-argp-ba.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-argp-eexst.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-argp-fmtstream.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-argp-fs-xinl.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-argp-help.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-argp-parse.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-argp-pin.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-argp-pv.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-argp-pvh.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-argp-xinl.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-asnprintf.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-asprintf.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-at-func.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-at-func2.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-basename-lgpl.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-basename.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-bitrotate.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-btowc.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-calloc.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-canonicalize-lgpl.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-canonicalize.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-chdir-long.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-chown.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-cloexec.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-close.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-closedir.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-dirfd.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-dirname-lgpl.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-dirname.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-dup-safer-flag.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-dup-safer.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-dup.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-dup2.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-error.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-exitfail.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fchdir.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fchown-stub.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fcntl.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fd-hook.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fd-safer-flag.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fd-safer.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fdopendir.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-file-set.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-filenamecat-lgpl.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-float.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-flock.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fnmatch.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fnmatch_loop.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-free.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fstat.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-fstatat.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-getcwd-lgpl.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-getcwd.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-getdelim.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-getdtablesize.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-getline.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-getlogin_r.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-getopt.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-getopt1.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-getprogname.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-getrandom.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gettime.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gettimeofday.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_array_list.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_hash_map.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_hash_set.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_linkedhash_list.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_list.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_map.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_rbtree_list.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_set.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_xlist.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_xmap.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-gl_xset.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-glob.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-glob_pattern_p.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-globfree.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-hard-locale.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-hash-pjw-bare.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-hash-pjw.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-hash-triple-simple.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-hash.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-ialloc.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-idpriv-drop.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-idpriv-droptemp.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-ioctl.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-isblank.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-itold.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-lc-charset-dispatch.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-lchown.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-localcharset.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-localeconv.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-lstat.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-malloc.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-malloca.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-mbrtowc.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-mbsinit.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-mbsrtowcs-state.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-mbsrtowcs.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-mbtowc-lock.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-mbtowc.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-memchr.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-memmem.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-mempcpy.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-memrchr.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-mkdir.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-mkdtemp.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-mkstemp.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-msvc-inval.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-msvc-nothrow.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-nanosleep.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-nl_langinfo-lock.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-nl_langinfo.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-nonblocking.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-open.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-openat-die.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-openat-proc.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-openat.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-opendir.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-pipe-safer.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-pipe.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-printf-args.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-printf-parse.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-progname.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-pselect.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-pthread_sigmask.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-raise.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-rawmemchr.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-readdir.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-readlink.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-readlinkat.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-realloc.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-reallocarray.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-regcomp.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-regex.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-regex_internal.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-regexec.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-rename.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-renameat.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-renameatu.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-rewinddir.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-rmdir.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-save-cwd.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-select.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-setenv.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-setlocale-lock.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-setlocale_null.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-sig-handler.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-sigaction.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-sigprocmask.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-sleep.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-sockets.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-stat-time.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-stat-w32.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-stat.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-stdio-read.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-stdio-write.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-stdopen.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-stpcpy.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strcasecmp.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strcasestr.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strchrnul.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strdup.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strerror-override.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strerror.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-stripslash.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strncasecmp.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strndup.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strnlen.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strnlen1.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-strsep.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-sys_socket.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-tempname.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-timespec.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-unistd.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-unlink.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-unlinkat.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-utime.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-utimens.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-vasnprintf.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-vasprintf.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-verror.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-vsnprintf.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-wcrtomb.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-wctype-h.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-windows-mutex.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-windows-once.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-windows-recmutex.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-windows-rwlock.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-wmemchr.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-wmempcpy.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-xalloc-die.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-xasprintf.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-xgetcwd.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-xmalloc.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-xsize.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-xstdopen.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-xstrndup.Plo
+ -rm -f ./$(DEPDIR)/libgnu_la-xvasprintf.Plo
+ -rm -f glthread/$(DEPDIR)/libgnu_la-lock.Plo
+ -rm -f glthread/$(DEPDIR)/libgnu_la-threadlib.Plo
+ -rm -f malloc/$(DEPDIR)/libgnu_la-dynarray-skeleton.Plo
+ -rm -f malloc/$(DEPDIR)/libgnu_la-dynarray_at_failure.Plo
+ -rm -f malloc/$(DEPDIR)/libgnu_la-dynarray_emplace_enlarge.Plo
+ -rm -f malloc/$(DEPDIR)/libgnu_la-dynarray_finalize.Plo
+ -rm -f malloc/$(DEPDIR)/libgnu_la-dynarray_resize.Plo
+ -rm -f malloc/$(DEPDIR)/libgnu_la-dynarray_resize_clear.Plo
+ -rm -f malloc/$(DEPDIR)/libgnu_la-scratch_buffer_dupfree.Plo
+ -rm -f malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow.Plo
+ -rm -f malloc/$(DEPDIR)/libgnu_la-scratch_buffer_grow_preserve.Plo
+ -rm -f malloc/$(DEPDIR)/libgnu_la-scratch_buffer_set_array_size.Plo
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic \
+ maintainer-clean-local
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool mostlyclean-local
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) all check install install-am \
+ install-exec install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+ am--depfiles check check-am clean clean-generic clean-libtool \
+ clean-noinstLIBRARIES clean-noinstLTLIBRARIES cscopelist-am \
+ ctags ctags-am distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-local distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs installdirs-am \
+ maintainer-clean maintainer-clean-generic \
+ maintainer-clean-local mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \
+ pdf-am ps ps-am tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# We need the following in order to create <alloca.h> when the system
+# doesn't have one that works with the given compiler.
+@GL_GENERATE_ALLOCA_H_TRUE@alloca.h: alloca.in.h $(top_builddir)/config.status
+@GL_GENERATE_ALLOCA_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_ALLOCA_H_TRUE@ -e 's|@''HAVE_ALLOCA_H''@|$(HAVE_ALLOCA_H)|g' \
+@GL_GENERATE_ALLOCA_H_TRUE@ $(srcdir)/alloca.in.h > $@-t
+@GL_GENERATE_ALLOCA_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_ALLOCA_H_FALSE@alloca.h: $(top_builddir)/config.status
+@GL_GENERATE_ALLOCA_H_FALSE@ rm -f $@
+
+# We need the following in order to create <ctype.h> when the system
+# doesn't have one that works with the given compiler.
+ctype.h: ctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_CTYPE_H''@|$(NEXT_CTYPE_H)|g' \
+ -e 's/@''GNULIB_ISBLANK''@/$(GL_GNULIB_ISBLANK)/g' \
+ -e 's/@''HAVE_ISBLANK''@/$(HAVE_ISBLANK)/g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/ctype.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <dirent.h> when the system
+# doesn't have one that works with the given compiler.
+dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_DIRENT_H''@|$(HAVE_DIRENT_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \
+ -e 's/@''GNULIB_OPENDIR''@/$(GL_GNULIB_OPENDIR)/g' \
+ -e 's/@''GNULIB_READDIR''@/$(GL_GNULIB_READDIR)/g' \
+ -e 's/@''GNULIB_REWINDDIR''@/$(GL_GNULIB_REWINDDIR)/g' \
+ -e 's/@''GNULIB_CLOSEDIR''@/$(GL_GNULIB_CLOSEDIR)/g' \
+ -e 's/@''GNULIB_DIRFD''@/$(GL_GNULIB_DIRFD)/g' \
+ -e 's/@''GNULIB_FDOPENDIR''@/$(GL_GNULIB_FDOPENDIR)/g' \
+ -e 's/@''GNULIB_SCANDIR''@/$(GL_GNULIB_SCANDIR)/g' \
+ -e 's/@''GNULIB_ALPHASORT''@/$(GL_GNULIB_ALPHASORT)/g' \
+ -e 's/@''HAVE_OPENDIR''@/$(HAVE_OPENDIR)/g' \
+ -e 's/@''HAVE_READDIR''@/$(HAVE_READDIR)/g' \
+ -e 's/@''HAVE_REWINDDIR''@/$(HAVE_REWINDDIR)/g' \
+ -e 's/@''HAVE_CLOSEDIR''@/$(HAVE_CLOSEDIR)/g' \
+ -e 's|@''HAVE_DECL_DIRFD''@|$(HAVE_DECL_DIRFD)|g' \
+ -e 's|@''HAVE_DECL_FDOPENDIR''@|$(HAVE_DECL_FDOPENDIR)|g' \
+ -e 's|@''HAVE_FDOPENDIR''@|$(HAVE_FDOPENDIR)|g' \
+ -e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \
+ -e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \
+ -e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \
+ -e 's|@''REPLACE_CLOSEDIR''@|$(REPLACE_CLOSEDIR)|g' \
+ -e 's|@''REPLACE_DIRFD''@|$(REPLACE_DIRFD)|g' \
+ -e 's|@''REPLACE_FDOPENDIR''@|$(REPLACE_FDOPENDIR)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/dirent.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+malloc/dynarray.gl.h: malloc/dynarray.h
+ $(AM_V_GEN)$(MKDIR_P) 'malloc'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e '/libc_hidden_proto/d' \
+ $(srcdir)/malloc/dynarray.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+malloc/dynarray-skeleton.gl.h: malloc/dynarray-skeleton.c
+ $(AM_V_GEN)$(MKDIR_P) 'malloc'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|<malloc/dynarray\.h>|<malloc/dynarray.gl.h>|g' \
+ -e 's|__attribute_maybe_unused__|_GL_ATTRIBUTE_MAYBE_UNUSED|g' \
+ -e 's|__attribute_nonnull__|_GL_ATTRIBUTE_NONNULL|g' \
+ -e 's|__attribute_warn_unused_result__|_GL_ATTRIBUTE_NODISCARD|g' \
+ -e 's|__glibc_likely|_GL_LIKELY|g' \
+ -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \
+ $(srcdir)/malloc/dynarray-skeleton.c > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <errno.h> when the system
+# doesn't have one that is POSIX compliant.
+@GL_GENERATE_ERRNO_H_TRUE@errno.h: errno.in.h $(top_builddir)/config.status
+@GL_GENERATE_ERRNO_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ $(srcdir)/errno.in.h > $@-t
+@GL_GENERATE_ERRNO_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_ERRNO_H_FALSE@errno.h: $(top_builddir)/config.status
+@GL_GENERATE_ERRNO_H_FALSE@ rm -f $@
+
+# We need the following in order to create <fcntl.h> when the system
+# doesn't have one that works with the given compiler.
+fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
+ -e 's/@''GNULIB_CREAT''@/$(GL_GNULIB_CREAT)/g' \
+ -e 's/@''GNULIB_FCNTL''@/$(GL_GNULIB_FCNTL)/g' \
+ -e 's/@''GNULIB_NONBLOCKING''@/$(GL_GNULIB_NONBLOCKING)/g' \
+ -e 's/@''GNULIB_OPEN''@/$(GL_GNULIB_OPEN)/g' \
+ -e 's/@''GNULIB_OPENAT''@/$(GL_GNULIB_OPENAT)/g' \
+ -e 's/@''GNULIB_MDA_CREAT''@/$(GL_GNULIB_MDA_CREAT)/g' \
+ -e 's/@''GNULIB_MDA_OPEN''@/$(GL_GNULIB_MDA_OPEN)/g' \
+ -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
+ -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
+ -e 's|@''REPLACE_CREAT''@|$(REPLACE_CREAT)|g' \
+ -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
+ -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
+ -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/fcntl.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <float.h> when the system
+# doesn't have one that works with the given compiler.
+@GL_GENERATE_FLOAT_H_TRUE@float.h: float.in.h $(top_builddir)/config.status
+@GL_GENERATE_FLOAT_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
+@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \
+@GL_GENERATE_FLOAT_H_TRUE@ $(srcdir)/float.in.h > $@-t
+@GL_GENERATE_FLOAT_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_FLOAT_H_FALSE@float.h: $(top_builddir)/config.status
+@GL_GENERATE_FLOAT_H_FALSE@ rm -f $@
+
+# We need the following in order to create <fnmatch.h>.
+@GL_GENERATE_FNMATCH_H_TRUE@fnmatch.h: fnmatch.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+@GL_GENERATE_FNMATCH_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_FNMATCH_H_TRUE@ -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_FNMATCH_H_TRUE@ -e 's|@''HAVE_FNMATCH_H''@|$(HAVE_FNMATCH_H)|g' \
+@GL_GENERATE_FNMATCH_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_FNMATCH_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_FNMATCH_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_FNMATCH_H_TRUE@ -e 's|@''NEXT_FNMATCH_H''@|$(NEXT_FNMATCH_H)|g' \
+@GL_GENERATE_FNMATCH_H_TRUE@ -e 's/@''GNULIB_FNMATCH''@/$(GL_GNULIB_FNMATCH)/g' \
+@GL_GENERATE_FNMATCH_H_TRUE@ -e 's|@''HAVE_FNMATCH''@|$(HAVE_FNMATCH)|g' \
+@GL_GENERATE_FNMATCH_H_TRUE@ -e 's|@''REPLACE_FNMATCH''@|$(REPLACE_FNMATCH)|g' \
+@GL_GENERATE_FNMATCH_H_TRUE@ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+@GL_GENERATE_FNMATCH_H_TRUE@ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+@GL_GENERATE_FNMATCH_H_TRUE@ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+@GL_GENERATE_FNMATCH_H_TRUE@ $(srcdir)/fnmatch.in.h > $@-t
+@GL_GENERATE_FNMATCH_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_FNMATCH_H_FALSE@fnmatch.h: $(top_builddir)/config.status
+@GL_GENERATE_FNMATCH_H_FALSE@ rm -f $@
+
+# We need the following in order to create <getopt.h> when the system
+# doesn't have one that works with the given compiler.
+@GL_GENERATE_GETOPT_H_TRUE@getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
+@GL_GENERATE_GETOPT_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_GETOPT_H_TRUE@ -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_GETOPT_H_TRUE@ -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
+@GL_GENERATE_GETOPT_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_GETOPT_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_GETOPT_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_GETOPT_H_TRUE@ -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
+@GL_GENERATE_GETOPT_H_TRUE@ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+@GL_GENERATE_GETOPT_H_TRUE@ $(srcdir)/getopt.in.h > $@-t
+@GL_GENERATE_GETOPT_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_GETOPT_H_FALSE@getopt.h: $(top_builddir)/config.status
+@GL_GENERATE_GETOPT_H_FALSE@ rm -f $@
+
+@GL_GENERATE_GETOPT_CDEFS_H_TRUE@getopt-cdefs.h: getopt-cdefs.in.h $(top_builddir)/config.status
+@GL_GENERATE_GETOPT_CDEFS_H_TRUE@ $(AM_V_GEN)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_GETOPT_CDEFS_H_TRUE@ -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \
+@GL_GENERATE_GETOPT_CDEFS_H_TRUE@ $(srcdir)/getopt-cdefs.in.h > $@-t
+@GL_GENERATE_GETOPT_CDEFS_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_GETOPT_CDEFS_H_FALSE@getopt-cdefs.h: $(top_builddir)/config.status
+@GL_GENERATE_GETOPT_CDEFS_H_FALSE@ rm -f $@
+
+# We need the following in order to create <glob.h>.
+@GL_GENERATE_GLOB_H_TRUE@glob.h: glob.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+@GL_GENERATE_GLOB_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_GLOB_H_TRUE@ -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_GLOB_H_TRUE@ -e 's|@''HAVE_GLOB_H''@|$(HAVE_GLOB_H)|g' \
+@GL_GENERATE_GLOB_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_GLOB_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_GLOB_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_GLOB_H_TRUE@ -e 's|@''NEXT_GLOB_H''@|$(NEXT_GLOB_H)|g' \
+@GL_GENERATE_GLOB_H_TRUE@ -e 's/@''GNULIB_GLOB''@/$(GL_GNULIB_GLOB)/g' \
+@GL_GENERATE_GLOB_H_TRUE@ -e 's|@''HAVE_GLOB''@|$(HAVE_GLOB)|g' \
+@GL_GENERATE_GLOB_H_TRUE@ -e 's|@''HAVE_GLOB_PATTERN_P''@|$(HAVE_GLOB_PATTERN_P)|g' \
+@GL_GENERATE_GLOB_H_TRUE@ -e 's|@''REPLACE_GLOB''@|$(REPLACE_GLOB)|g' \
+@GL_GENERATE_GLOB_H_TRUE@ -e 's|@''REPLACE_GLOB_PATTERN_P''@|$(REPLACE_GLOB_PATTERN_P)|g' \
+@GL_GENERATE_GLOB_H_TRUE@ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+@GL_GENERATE_GLOB_H_TRUE@ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+@GL_GENERATE_GLOB_H_TRUE@ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+@GL_GENERATE_GLOB_H_TRUE@ $(srcdir)/glob.in.h > $@-t
+@GL_GENERATE_GLOB_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_GLOB_H_FALSE@glob.h: $(top_builddir)/config.status
+@GL_GENERATE_GLOB_H_FALSE@ rm -f $@
+
+glob-libc.gl.h: glob-libc.h
+ $(AM_V_GEN)$(SED_HEADER_STDOUT) \
+ -e '/__BEGIN_DECLS/{ s/__BEGIN_DECLS/#ifdef __cplusplus%extern "C" {%#endif/; y/%/\n/; }' \
+ -e '/__END_DECLS/{ s/__END_DECLS/#ifdef __cplusplus%}%#endif/; y/%/\n/; }' \
+ -e 's|__THROWNL||g' \
+ -e 's|__THROW||g' \
+ -e 's|__restrict|restrict|g' \
+ -e 's|defined __USE_MISC|1|' \
+ -e 's|ifdef __USE_GNU|if 1|' \
+ -e 's|ifdef __USE_LARGEFILE64|if 0|' \
+ $(srcdir)/glob-libc.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <inttypes.h> when the system
+# doesn't have one that works with the given compiler.
+inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \
+ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
+ -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \
+ -e 's/@''GNULIB_IMAXABS''@/$(GL_GNULIB_IMAXABS)/g' \
+ -e 's/@''GNULIB_IMAXDIV''@/$(GL_GNULIB_IMAXDIV)/g' \
+ -e 's/@''GNULIB_STRTOIMAX''@/$(GL_GNULIB_STRTOIMAX)/g' \
+ -e 's/@''GNULIB_STRTOUMAX''@/$(GL_GNULIB_STRTOUMAX)/g' \
+ -e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \
+ -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \
+ -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \
+ -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \
+ -e 's/@''HAVE_IMAXDIV_T''@/$(HAVE_IMAXDIV_T)/g' \
+ -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \
+ -e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \
+ -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \
+ -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \
+ -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \
+ -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/inttypes.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create an empty placeholder for
+# <langinfo.h> when the system doesn't have one.
+langinfo.h: langinfo.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_LANGINFO_H''@|$(NEXT_LANGINFO_H)|g' \
+ -e 's/@''GNULIB_NL_LANGINFO''@/$(GL_GNULIB_NL_LANGINFO)/g' \
+ -e 's|@''HAVE_LANGINFO_CODESET''@|$(HAVE_LANGINFO_CODESET)|g' \
+ -e 's|@''HAVE_LANGINFO_T_FMT_AMPM''@|$(HAVE_LANGINFO_T_FMT_AMPM)|g' \
+ -e 's|@''HAVE_LANGINFO_ALTMON''@|$(HAVE_LANGINFO_ALTMON)|g' \
+ -e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \
+ -e 's|@''HAVE_LANGINFO_YESEXPR''@|$(HAVE_LANGINFO_YESEXPR)|g' \
+ -e 's|@''HAVE_NL_LANGINFO''@|$(HAVE_NL_LANGINFO)|g' \
+ -e 's|@''REPLACE_NL_LANGINFO''@|$(REPLACE_NL_LANGINFO)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/langinfo.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <limits.h> when the system
+# doesn't have one that is compatible with GNU.
+@GL_GENERATE_LIMITS_H_TRUE@limits.h: limits.in.h $(top_builddir)/config.status
+@GL_GENERATE_LIMITS_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \
+@GL_GENERATE_LIMITS_H_TRUE@ $(srcdir)/limits.in.h > $@-t
+@GL_GENERATE_LIMITS_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_LIMITS_H_FALSE@limits.h: $(top_builddir)/config.status
+@GL_GENERATE_LIMITS_H_FALSE@ rm -f $@
+
+# We need the following in order to create <locale.h> when the system
+# doesn't have one that provides all definitions.
+locale.h: locale.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_LOCALE_H''@|$(NEXT_LOCALE_H)|g' \
+ -e 's/@''GNULIB_LOCALECONV''@/$(GL_GNULIB_LOCALECONV)/g' \
+ -e 's/@''GNULIB_SETLOCALE''@/$(GL_GNULIB_SETLOCALE)/g' \
+ -e 's/@''GNULIB_SETLOCALE_NULL''@/$(GL_GNULIB_SETLOCALE_NULL)/g' \
+ -e 's/@''GNULIB_DUPLOCALE''@/$(GL_GNULIB_DUPLOCALE)/g' \
+ -e 's/@''GNULIB_LOCALENAME''@/$(GL_GNULIB_LOCALENAME)/g' \
+ -e 's|@''HAVE_NEWLOCALE''@|$(HAVE_NEWLOCALE)|g' \
+ -e 's|@''HAVE_DUPLOCALE''@|$(HAVE_DUPLOCALE)|g' \
+ -e 's|@''HAVE_FREELOCALE''@|$(HAVE_FREELOCALE)|g' \
+ -e 's|@''HAVE_XLOCALE_H''@|$(HAVE_XLOCALE_H)|g' \
+ -e 's|@''REPLACE_LOCALECONV''@|$(REPLACE_LOCALECONV)|g' \
+ -e 's|@''REPLACE_SETLOCALE''@|$(REPLACE_SETLOCALE)|g' \
+ -e 's|@''REPLACE_NEWLOCALE''@|$(REPLACE_NEWLOCALE)|g' \
+ -e 's|@''REPLACE_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \
+ -e 's|@''REPLACE_FREELOCALE''@|$(REPLACE_FREELOCALE)|g' \
+ -e 's|@''REPLACE_STRUCT_LCONV''@|$(REPLACE_STRUCT_LCONV)|g' \
+ -e 's|@''LOCALENAME_ENHANCE_LOCALE_FUNCS''@|$(LOCALENAME_ENHANCE_LOCALE_FUNCS)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/locale.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+malloc/scratch_buffer.gl.h: malloc/scratch_buffer.h
+ $(AM_V_GEN)$(MKDIR_P) 'malloc'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|__always_inline|inline _GL_ATTRIBUTE_ALWAYS_INLINE|g' \
+ -e 's|__glibc_likely|_GL_LIKELY|g' \
+ -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \
+ -e '/libc_hidden_proto/d' \
+ $(srcdir)/malloc/scratch_buffer.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <signal.h> when the system
+# doesn't have a complete one.
+signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \
+ -e 's/@''GNULIB_PTHREAD_SIGMASK''@/$(GL_GNULIB_PTHREAD_SIGMASK)/g' \
+ -e 's/@''GNULIB_RAISE''@/$(GL_GNULIB_RAISE)/g' \
+ -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GL_GNULIB_SIGNAL_H_SIGPIPE)/g' \
+ -e 's/@''GNULIB_SIGPROCMASK''@/$(GL_GNULIB_SIGPROCMASK)/g' \
+ -e 's/@''GNULIB_SIGACTION''@/$(GL_GNULIB_SIGACTION)/g' \
+ -e 's|@''HAVE_POSIX_SIGNALBLOCKING''@|$(HAVE_POSIX_SIGNALBLOCKING)|g' \
+ -e 's|@''HAVE_PTHREAD_SIGMASK''@|$(HAVE_PTHREAD_SIGMASK)|g' \
+ -e 's|@''HAVE_RAISE''@|$(HAVE_RAISE)|g' \
+ -e 's|@''HAVE_SIGSET_T''@|$(HAVE_SIGSET_T)|g' \
+ -e 's|@''HAVE_SIGINFO_T''@|$(HAVE_SIGINFO_T)|g' \
+ -e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \
+ -e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \
+ -e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \
+ -e 's|@''HAVE_SIGHANDLER_T''@|$(HAVE_SIGHANDLER_T)|g' \
+ -e 's|@''REPLACE_PTHREAD_SIGMASK''@|$(REPLACE_PTHREAD_SIGMASK)|g' \
+ -e 's|@''REPLACE_RAISE''@|$(REPLACE_RAISE)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/signal.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <stdalign.h> when the system
+# doesn't have one that works.
+@GL_GENERATE_STDALIGN_H_TRUE@stdalign.h: stdalign.in.h $(top_builddir)/config.status
+@GL_GENERATE_STDALIGN_H_TRUE@ $(gl_V_at)$(SED_HEADER_TO_AT_t) $(srcdir)/stdalign.in.h
+@GL_GENERATE_STDALIGN_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_STDALIGN_H_FALSE@stdalign.h: $(top_builddir)/config.status
+@GL_GENERATE_STDALIGN_H_FALSE@ rm -f $@
+
+# We need the following in order to create <stdarg.h> when the system
+# doesn't have one that works with the given compiler.
+@GL_GENERATE_STDARG_H_TRUE@stdarg.h: stdarg.in.h $(top_builddir)/config.status
+@GL_GENERATE_STDARG_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_STDARG_H_TRUE@ -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_STDARG_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_STDARG_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_STDARG_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_STDARG_H_TRUE@ -e 's|@''NEXT_STDARG_H''@|$(NEXT_STDARG_H)|g' \
+@GL_GENERATE_STDARG_H_TRUE@ $(srcdir)/stdarg.in.h > $@-t
+@GL_GENERATE_STDARG_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_STDARG_H_FALSE@stdarg.h: $(top_builddir)/config.status
+@GL_GENERATE_STDARG_H_FALSE@ rm -f $@
+
+# We need the following in order to create <stdbool.h> when the system
+# doesn't have one that works.
+@GL_GENERATE_STDBOOL_H_TRUE@stdbool.h: stdbool.in.h $(top_builddir)/config.status
+@GL_GENERATE_STDBOOL_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_STDBOOL_H_TRUE@ -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' \
+@GL_GENERATE_STDBOOL_H_TRUE@ $(srcdir)/stdbool.in.h > $@-t
+@GL_GENERATE_STDBOOL_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_STDBOOL_H_FALSE@stdbool.h: $(top_builddir)/config.status
+@GL_GENERATE_STDBOOL_H_FALSE@ rm -f $@
+
+# We need the following in order to create <stddef.h> when the system
+# doesn't have one that works with the given compiler.
+@GL_GENERATE_STDDEF_H_TRUE@stddef.h: stddef.in.h $(top_builddir)/config.status
+@GL_GENERATE_STDDEF_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
+@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \
+@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
+@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
+@GL_GENERATE_STDDEF_H_TRUE@ $(srcdir)/stddef.in.h > $@-t
+@GL_GENERATE_STDDEF_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_STDDEF_H_FALSE@stddef.h: $(top_builddir)/config.status
+@GL_GENERATE_STDDEF_H_FALSE@ rm -f $@
+
+# We need the following in order to create <stdint.h> when the system
+# doesn't have one that works with the given compiler.
+@GL_GENERATE_STDINT_H_TRUE@stdint.h: stdint.in.h $(top_builddir)/config.status
+@GL_GENERATE_STDINT_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ $(srcdir)/stdint.in.h > $@-t
+@GL_GENERATE_STDINT_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_STDINT_H_FALSE@stdint.h: $(top_builddir)/config.status
+@GL_GENERATE_STDINT_H_FALSE@ rm -f $@
+
+# We need the following in order to create <stdio.h> when the system
+# doesn't have one that works with the given compiler.
+stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
+ -e 's/@''GNULIB_DPRINTF''@/$(GL_GNULIB_DPRINTF)/g' \
+ -e 's/@''GNULIB_FCLOSE''@/$(GL_GNULIB_FCLOSE)/g' \
+ -e 's/@''GNULIB_FDOPEN''@/$(GL_GNULIB_FDOPEN)/g' \
+ -e 's/@''GNULIB_FFLUSH''@/$(GL_GNULIB_FFLUSH)/g' \
+ -e 's/@''GNULIB_FGETC''@/$(GL_GNULIB_FGETC)/g' \
+ -e 's/@''GNULIB_FGETS''@/$(GL_GNULIB_FGETS)/g' \
+ -e 's/@''GNULIB_FOPEN''@/$(GL_GNULIB_FOPEN)/g' \
+ -e 's/@''GNULIB_FOPEN_GNU''@/$(GL_GNULIB_FOPEN_GNU)/g' \
+ -e 's/@''GNULIB_FPRINTF''@/$(GL_GNULIB_FPRINTF)/g' \
+ -e 's/@''GNULIB_FPRINTF_POSIX''@/$(GL_GNULIB_FPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_FPURGE''@/$(GL_GNULIB_FPURGE)/g' \
+ -e 's/@''GNULIB_FPUTC''@/$(GL_GNULIB_FPUTC)/g' \
+ -e 's/@''GNULIB_FPUTS''@/$(GL_GNULIB_FPUTS)/g' \
+ -e 's/@''GNULIB_FREAD''@/$(GL_GNULIB_FREAD)/g' \
+ -e 's/@''GNULIB_FREOPEN''@/$(GL_GNULIB_FREOPEN)/g' \
+ -e 's/@''GNULIB_FSCANF''@/$(GL_GNULIB_FSCANF)/g' \
+ -e 's/@''GNULIB_FSEEK''@/$(GL_GNULIB_FSEEK)/g' \
+ -e 's/@''GNULIB_FSEEKO''@/$(GL_GNULIB_FSEEKO)/g' \
+ -e 's/@''GNULIB_FTELL''@/$(GL_GNULIB_FTELL)/g' \
+ -e 's/@''GNULIB_FTELLO''@/$(GL_GNULIB_FTELLO)/g' \
+ -e 's/@''GNULIB_FWRITE''@/$(GL_GNULIB_FWRITE)/g' \
+ -e 's/@''GNULIB_GETC''@/$(GL_GNULIB_GETC)/g' \
+ -e 's/@''GNULIB_GETCHAR''@/$(GL_GNULIB_GETCHAR)/g' \
+ -e 's/@''GNULIB_GETDELIM''@/$(GL_GNULIB_GETDELIM)/g' \
+ -e 's/@''GNULIB_GETLINE''@/$(GL_GNULIB_GETLINE)/g' \
+ -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GL_GNULIB_OBSTACK_PRINTF)/g' \
+ -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GL_GNULIB_OBSTACK_PRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_PCLOSE''@/$(GL_GNULIB_PCLOSE)/g' \
+ -e 's/@''GNULIB_PERROR''@/$(GL_GNULIB_PERROR)/g' \
+ -e 's/@''GNULIB_POPEN''@/$(GL_GNULIB_POPEN)/g' \
+ -e 's/@''GNULIB_PRINTF''@/$(GL_GNULIB_PRINTF)/g' \
+ -e 's/@''GNULIB_PRINTF_POSIX''@/$(GL_GNULIB_PRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_PUTC''@/$(GL_GNULIB_PUTC)/g' \
+ -e 's/@''GNULIB_PUTCHAR''@/$(GL_GNULIB_PUTCHAR)/g' \
+ -e 's/@''GNULIB_PUTS''@/$(GL_GNULIB_PUTS)/g' \
+ -e 's/@''GNULIB_REMOVE''@/$(GL_GNULIB_REMOVE)/g' \
+ -e 's/@''GNULIB_RENAME''@/$(GL_GNULIB_RENAME)/g' \
+ -e 's/@''GNULIB_RENAMEAT''@/$(GL_GNULIB_RENAMEAT)/g' \
+ -e 's/@''GNULIB_SCANF''@/$(GL_GNULIB_SCANF)/g' \
+ -e 's/@''GNULIB_SNPRINTF''@/$(GL_GNULIB_SNPRINTF)/g' \
+ -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GL_GNULIB_SPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GL_GNULIB_STDIO_H_NONBLOCKING)/g' \
+ -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GL_GNULIB_STDIO_H_SIGPIPE)/g' \
+ -e 's/@''GNULIB_TMPFILE''@/$(GL_GNULIB_TMPFILE)/g' \
+ -e 's/@''GNULIB_VASPRINTF''@/$(GL_GNULIB_VASPRINTF)/g' \
+ -e 's/@''GNULIB_VDPRINTF''@/$(GL_GNULIB_VDPRINTF)/g' \
+ -e 's/@''GNULIB_VFPRINTF''@/$(GL_GNULIB_VFPRINTF)/g' \
+ -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GL_GNULIB_VFPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_VFSCANF''@/$(GL_GNULIB_VFSCANF)/g' \
+ -e 's/@''GNULIB_VSCANF''@/$(GL_GNULIB_VSCANF)/g' \
+ -e 's/@''GNULIB_VPRINTF''@/$(GL_GNULIB_VPRINTF)/g' \
+ -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GL_GNULIB_VPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_VSNPRINTF''@/$(GL_GNULIB_VSNPRINTF)/g' \
+ -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GL_GNULIB_VSPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_MDA_FCLOSEALL''@/$(GL_GNULIB_MDA_FCLOSEALL)/g' \
+ -e 's/@''GNULIB_MDA_FDOPEN''@/$(GL_GNULIB_MDA_FDOPEN)/g' \
+ -e 's/@''GNULIB_MDA_FILENO''@/$(GL_GNULIB_MDA_FILENO)/g' \
+ -e 's/@''GNULIB_MDA_GETW''@/$(GL_GNULIB_MDA_GETW)/g' \
+ -e 's/@''GNULIB_MDA_PUTW''@/$(GL_GNULIB_MDA_PUTW)/g' \
+ -e 's/@''GNULIB_MDA_TEMPNAM''@/$(GL_GNULIB_MDA_TEMPNAM)/g' \
+ < $(srcdir)/stdio.in.h | \
+ sed -e 's|@''HAVE_DECL_FCLOSEALL''@|$(HAVE_DECL_FCLOSEALL)|g' \
+ -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
+ -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
+ -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
+ -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
+ -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
+ -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
+ -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
+ -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
+ -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
+ -e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \
+ -e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \
+ -e 's|@''HAVE_PCLOSE''@|$(HAVE_PCLOSE)|g' \
+ -e 's|@''HAVE_POPEN''@|$(HAVE_POPEN)|g' \
+ -e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \
+ -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
+ -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
+ -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
+ -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
+ -e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \
+ -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
+ -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
+ -e 's|@''REPLACE_FOPEN_FOR_FOPEN_GNU''@|$(REPLACE_FOPEN_FOR_FOPEN_GNU)|g' \
+ -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
+ -e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \
+ -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \
+ -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
+ -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
+ -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
+ -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
+ -e 's|@''REPLACE_GETDELIM''@|$(REPLACE_GETDELIM)|g' \
+ -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
+ -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
+ -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
+ -e 's|@''REPLACE_POPEN''@|$(REPLACE_POPEN)|g' \
+ -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
+ -e 's|@''REPLACE_REMOVE''@|$(REPLACE_REMOVE)|g' \
+ -e 's|@''REPLACE_RENAME''@|$(REPLACE_RENAME)|g' \
+ -e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \
+ -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
+ -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
+ -e 's|@''REPLACE_STDIO_READ_FUNCS''@|$(REPLACE_STDIO_READ_FUNCS)|g' \
+ -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
+ -e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \
+ -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
+ -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
+ -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
+ -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
+ -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
+ -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
+ -e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <stdlib.h> when the system
+# doesn't have one that works with the given compiler.
+stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
+ $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
+ -e 's/@''GNULIB__EXIT''@/$(GL_GNULIB__EXIT)/g' \
+ -e 's/@''GNULIB_ALIGNED_ALLOC''@/$(GL_GNULIB_ALIGNED_ALLOC)/g' \
+ -e 's/@''GNULIB_ATOLL''@/$(GL_GNULIB_ATOLL)/g' \
+ -e 's/@''GNULIB_CALLOC_GNU''@/$(GL_GNULIB_CALLOC_GNU)/g' \
+ -e 's/@''GNULIB_CALLOC_POSIX''@/$(GL_GNULIB_CALLOC_POSIX)/g' \
+ -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GL_GNULIB_CANONICALIZE_FILE_NAME)/g' \
+ -e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \
+ -e 's/@''GNULIB_GETLOADAVG''@/$(GL_GNULIB_GETLOADAVG)/g' \
+ -e 's/@''GNULIB_GETSUBOPT''@/$(GL_GNULIB_GETSUBOPT)/g' \
+ -e 's/@''GNULIB_GRANTPT''@/$(GL_GNULIB_GRANTPT)/g' \
+ -e 's/@''GNULIB_MALLOC_GNU''@/$(GL_GNULIB_MALLOC_GNU)/g' \
+ -e 's/@''GNULIB_MALLOC_POSIX''@/$(GL_GNULIB_MALLOC_POSIX)/g' \
+ -e 's/@''GNULIB_MBTOWC''@/$(GL_GNULIB_MBTOWC)/g' \
+ -e 's/@''GNULIB_MKDTEMP''@/$(GL_GNULIB_MKDTEMP)/g' \
+ -e 's/@''GNULIB_MKOSTEMP''@/$(GL_GNULIB_MKOSTEMP)/g' \
+ -e 's/@''GNULIB_MKOSTEMPS''@/$(GL_GNULIB_MKOSTEMPS)/g' \
+ -e 's/@''GNULIB_MKSTEMP''@/$(GL_GNULIB_MKSTEMP)/g' \
+ -e 's/@''GNULIB_MKSTEMPS''@/$(GL_GNULIB_MKSTEMPS)/g' \
+ -e 's/@''GNULIB_POSIX_MEMALIGN''@/$(GL_GNULIB_POSIX_MEMALIGN)/g' \
+ -e 's/@''GNULIB_POSIX_OPENPT''@/$(GL_GNULIB_POSIX_OPENPT)/g' \
+ -e 's/@''GNULIB_PTSNAME''@/$(GL_GNULIB_PTSNAME)/g' \
+ -e 's/@''GNULIB_PTSNAME_R''@/$(GL_GNULIB_PTSNAME_R)/g' \
+ -e 's/@''GNULIB_PUTENV''@/$(GL_GNULIB_PUTENV)/g' \
+ -e 's/@''GNULIB_QSORT_R''@/$(GL_GNULIB_QSORT_R)/g' \
+ -e 's/@''GNULIB_RANDOM''@/$(GL_GNULIB_RANDOM)/g' \
+ -e 's/@''GNULIB_RANDOM_R''@/$(GL_GNULIB_RANDOM_R)/g' \
+ -e 's/@''GNULIB_REALLOC_GNU''@/$(GL_GNULIB_REALLOC_GNU)/g' \
+ -e 's/@''GNULIB_REALLOC_POSIX''@/$(GL_GNULIB_REALLOC_POSIX)/g' \
+ -e 's/@''GNULIB_REALLOCARRAY''@/$(GL_GNULIB_REALLOCARRAY)/g' \
+ -e 's/@''GNULIB_REALPATH''@/$(GL_GNULIB_REALPATH)/g' \
+ -e 's/@''GNULIB_RPMATCH''@/$(GL_GNULIB_RPMATCH)/g' \
+ -e 's/@''GNULIB_SECURE_GETENV''@/$(GL_GNULIB_SECURE_GETENV)/g' \
+ -e 's/@''GNULIB_SETENV''@/$(GL_GNULIB_SETENV)/g' \
+ -e 's/@''GNULIB_STRTOD''@/$(GL_GNULIB_STRTOD)/g' \
+ -e 's/@''GNULIB_STRTOL''@/$(GL_GNULIB_STRTOL)/g' \
+ -e 's/@''GNULIB_STRTOLD''@/$(GL_GNULIB_STRTOLD)/g' \
+ -e 's/@''GNULIB_STRTOLL''@/$(GL_GNULIB_STRTOLL)/g' \
+ -e 's/@''GNULIB_STRTOUL''@/$(GL_GNULIB_STRTOUL)/g' \
+ -e 's/@''GNULIB_STRTOULL''@/$(GL_GNULIB_STRTOULL)/g' \
+ -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GL_GNULIB_SYSTEM_POSIX)/g' \
+ -e 's/@''GNULIB_UNLOCKPT''@/$(GL_GNULIB_UNLOCKPT)/g' \
+ -e 's/@''GNULIB_UNSETENV''@/$(GL_GNULIB_UNSETENV)/g' \
+ -e 's/@''GNULIB_WCTOMB''@/$(GL_GNULIB_WCTOMB)/g' \
+ -e 's/@''GNULIB_MDA_ECVT''@/$(GL_GNULIB_MDA_ECVT)/g' \
+ -e 's/@''GNULIB_MDA_FCVT''@/$(GL_GNULIB_MDA_FCVT)/g' \
+ -e 's/@''GNULIB_MDA_GCVT''@/$(GL_GNULIB_MDA_GCVT)/g' \
+ -e 's/@''GNULIB_MDA_MKTEMP''@/$(GL_GNULIB_MDA_MKTEMP)/g' \
+ -e 's/@''GNULIB_MDA_PUTENV''@/$(GL_GNULIB_MDA_PUTENV)/g' \
+ < $(srcdir)/stdlib.in.h | \
+ sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
+ -e 's|@''HAVE_ALIGNED_ALLOC''@|$(HAVE_ALIGNED_ALLOC)|g' \
+ -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
+ -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
+ -e 's|@''HAVE_DECL_ECVT''@|$(HAVE_DECL_ECVT)|g' \
+ -e 's|@''HAVE_DECL_FCVT''@|$(HAVE_DECL_FCVT)|g' \
+ -e 's|@''HAVE_DECL_GCVT''@|$(HAVE_DECL_GCVT)|g' \
+ -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
+ -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
+ -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \
+ -e 's|@''HAVE_INITSTATE''@|$(HAVE_INITSTATE)|g' \
+ -e 's|@''HAVE_DECL_INITSTATE''@|$(HAVE_DECL_INITSTATE)|g' \
+ -e 's|@''HAVE_MBTOWC''@|$(HAVE_MBTOWC)|g' \
+ -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
+ -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \
+ -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \
+ -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \
+ -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \
+ -e 's|@''HAVE_POSIX_MEMALIGN''@|$(HAVE_POSIX_MEMALIGN)|g' \
+ -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \
+ -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
+ -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \
+ -e 's|@''HAVE_QSORT_R''@|$(HAVE_QSORT_R)|g' \
+ -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \
+ -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
+ -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
+ -e 's|@''HAVE_REALLOCARRAY''@|$(HAVE_REALLOCARRAY)|g' \
+ -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
+ -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
+ -e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \
+ -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \
+ -e 's|@''HAVE_SETSTATE''@|$(HAVE_SETSTATE)|g' \
+ -e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \
+ -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
+ -e 's|@''HAVE_STRTOL''@|$(HAVE_STRTOL)|g' \
+ -e 's|@''HAVE_STRTOLD''@|$(HAVE_STRTOLD)|g' \
+ -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
+ -e 's|@''HAVE_STRTOUL''@|$(HAVE_STRTOUL)|g' \
+ -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \
+ -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \
+ -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
+ -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \
+ -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \
+ -e 's|@''REPLACE_ALIGNED_ALLOC''@|$(REPLACE_ALIGNED_ALLOC)|g' \
+ -e 's|@''REPLACE_CALLOC_FOR_CALLOC_GNU''@|$(REPLACE_CALLOC_FOR_CALLOC_GNU)|g' \
+ -e 's|@''REPLACE_CALLOC_FOR_CALLOC_POSIX''@|$(REPLACE_CALLOC_FOR_CALLOC_POSIX)|g' \
+ -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
+ -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
+ -e 's|@''REPLACE_INITSTATE''@|$(REPLACE_INITSTATE)|g' \
+ -e 's|@''REPLACE_MALLOC_FOR_MALLOC_GNU''@|$(REPLACE_MALLOC_FOR_MALLOC_GNU)|g' \
+ -e 's|@''REPLACE_MALLOC_FOR_MALLOC_POSIX''@|$(REPLACE_MALLOC_FOR_MALLOC_POSIX)|g' \
+ -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
+ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
+ -e 's|@''REPLACE_POSIX_MEMALIGN''@|$(REPLACE_POSIX_MEMALIGN)|g' \
+ -e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \
+ -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
+ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
+ -e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \
+ -e 's|@''REPLACE_RANDOM''@|$(REPLACE_RANDOM)|g' \
+ -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
+ -e 's|@''REPLACE_REALLOC_FOR_REALLOC_GNU''@|$(REPLACE_REALLOC_FOR_REALLOC_GNU)|g' \
+ -e 's|@''REPLACE_REALLOC_FOR_REALLOC_POSIX''@|$(REPLACE_REALLOC_FOR_REALLOC_POSIX)|g' \
+ -e 's|@''REPLACE_REALLOCARRAY''@|$(REPLACE_REALLOCARRAY)|g' \
+ -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
+ -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
+ -e 's|@''REPLACE_SETSTATE''@|$(REPLACE_SETSTATE)|g' \
+ -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
+ -e 's|@''REPLACE_STRTOL''@|$(REPLACE_STRTOL)|g' \
+ -e 's|@''REPLACE_STRTOLD''@|$(REPLACE_STRTOLD)|g' \
+ -e 's|@''REPLACE_STRTOLL''@|$(REPLACE_STRTOLL)|g' \
+ -e 's|@''REPLACE_STRTOUL''@|$(REPLACE_STRTOUL)|g' \
+ -e 's|@''REPLACE_STRTOULL''@|$(REPLACE_STRTOULL)|g' \
+ -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
+ -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _Noreturn/r $(_NORETURN_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <string.h> when the system
+# doesn't have one that works with the given compiler.
+string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
+ -e 's/@''GNULIB_EXPLICIT_BZERO''@/$(GL_GNULIB_EXPLICIT_BZERO)/g' \
+ -e 's/@''GNULIB_FFSL''@/$(GL_GNULIB_FFSL)/g' \
+ -e 's/@''GNULIB_FFSLL''@/$(GL_GNULIB_FFSLL)/g' \
+ -e 's/@''GNULIB_MBSLEN''@/$(GL_GNULIB_MBSLEN)/g' \
+ -e 's/@''GNULIB_MBSNLEN''@/$(GL_GNULIB_MBSNLEN)/g' \
+ -e 's/@''GNULIB_MBSCHR''@/$(GL_GNULIB_MBSCHR)/g' \
+ -e 's/@''GNULIB_MBSRCHR''@/$(GL_GNULIB_MBSRCHR)/g' \
+ -e 's/@''GNULIB_MBSSTR''@/$(GL_GNULIB_MBSSTR)/g' \
+ -e 's/@''GNULIB_MBSCASECMP''@/$(GL_GNULIB_MBSCASECMP)/g' \
+ -e 's/@''GNULIB_MBSNCASECMP''@/$(GL_GNULIB_MBSNCASECMP)/g' \
+ -e 's/@''GNULIB_MBSPCASECMP''@/$(GL_GNULIB_MBSPCASECMP)/g' \
+ -e 's/@''GNULIB_MBSCASESTR''@/$(GL_GNULIB_MBSCASESTR)/g' \
+ -e 's/@''GNULIB_MBSCSPN''@/$(GL_GNULIB_MBSCSPN)/g' \
+ -e 's/@''GNULIB_MBSPBRK''@/$(GL_GNULIB_MBSPBRK)/g' \
+ -e 's/@''GNULIB_MBSSPN''@/$(GL_GNULIB_MBSSPN)/g' \
+ -e 's/@''GNULIB_MBSSEP''@/$(GL_GNULIB_MBSSEP)/g' \
+ -e 's/@''GNULIB_MBSTOK_R''@/$(GL_GNULIB_MBSTOK_R)/g' \
+ -e 's/@''GNULIB_MEMCHR''@/$(GL_GNULIB_MEMCHR)/g' \
+ -e 's/@''GNULIB_MEMMEM''@/$(GL_GNULIB_MEMMEM)/g' \
+ -e 's/@''GNULIB_MEMPCPY''@/$(GL_GNULIB_MEMPCPY)/g' \
+ -e 's/@''GNULIB_MEMRCHR''@/$(GL_GNULIB_MEMRCHR)/g' \
+ -e 's/@''GNULIB_RAWMEMCHR''@/$(GL_GNULIB_RAWMEMCHR)/g' \
+ -e 's/@''GNULIB_STPCPY''@/$(GL_GNULIB_STPCPY)/g' \
+ -e 's/@''GNULIB_STPNCPY''@/$(GL_GNULIB_STPNCPY)/g' \
+ -e 's/@''GNULIB_STRCHRNUL''@/$(GL_GNULIB_STRCHRNUL)/g' \
+ -e 's/@''GNULIB_STRDUP''@/$(GL_GNULIB_STRDUP)/g' \
+ -e 's/@''GNULIB_STRNCAT''@/$(GL_GNULIB_STRNCAT)/g' \
+ -e 's/@''GNULIB_STRNDUP''@/$(GL_GNULIB_STRNDUP)/g' \
+ -e 's/@''GNULIB_STRNLEN''@/$(GL_GNULIB_STRNLEN)/g' \
+ -e 's/@''GNULIB_STRPBRK''@/$(GL_GNULIB_STRPBRK)/g' \
+ -e 's/@''GNULIB_STRSEP''@/$(GL_GNULIB_STRSEP)/g' \
+ -e 's/@''GNULIB_STRSTR''@/$(GL_GNULIB_STRSTR)/g' \
+ -e 's/@''GNULIB_STRCASESTR''@/$(GL_GNULIB_STRCASESTR)/g' \
+ -e 's/@''GNULIB_STRTOK_R''@/$(GL_GNULIB_STRTOK_R)/g' \
+ -e 's/@''GNULIB_STRERROR''@/$(GL_GNULIB_STRERROR)/g' \
+ -e 's/@''GNULIB_STRERROR_R''@/$(GL_GNULIB_STRERROR_R)/g' \
+ -e 's/@''GNULIB_STRERRORNAME_NP''@/$(GL_GNULIB_STRERRORNAME_NP)/g' \
+ -e 's/@''GNULIB_SIGABBREV_NP''@/$(GL_GNULIB_SIGABBREV_NP)/g' \
+ -e 's/@''GNULIB_SIGDESCR_NP''@/$(GL_GNULIB_SIGDESCR_NP)/g' \
+ -e 's/@''GNULIB_STRSIGNAL''@/$(GL_GNULIB_STRSIGNAL)/g' \
+ -e 's/@''GNULIB_STRVERSCMP''@/$(GL_GNULIB_STRVERSCMP)/g' \
+ -e 's/@''GNULIB_MDA_MEMCCPY''@/$(GL_GNULIB_MDA_MEMCCPY)/g' \
+ -e 's/@''GNULIB_MDA_STRDUP''@/$(GL_GNULIB_MDA_STRDUP)/g' \
+ -e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \
+ < $(srcdir)/string.in.h | \
+ sed -e 's|@''HAVE_EXPLICIT_BZERO''@|$(HAVE_EXPLICIT_BZERO)|g' \
+ -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
+ -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
+ -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
+ -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
+ -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
+ -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
+ -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \
+ -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
+ -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
+ -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
+ -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
+ -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \
+ -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \
+ -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
+ -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \
+ -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \
+ -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
+ -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \
+ -e 's|@''HAVE_STRERRORNAME_NP''@|$(HAVE_STRERRORNAME_NP)|g' \
+ -e 's|@''HAVE_SIGABBREV_NP''@|$(HAVE_SIGABBREV_NP)|g' \
+ -e 's|@''HAVE_SIGDESCR_NP''@|$(HAVE_SIGDESCR_NP)|g' \
+ -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
+ -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \
+ -e 's|@''REPLACE_FFSLL''@|$(REPLACE_FFSLL)|g' \
+ -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
+ -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
+ -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
+ -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
+ -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \
+ -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
+ -e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \
+ -e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \
+ -e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \
+ -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
+ -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
+ -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
+ -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
+ -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \
+ -e 's|@''REPLACE_STRERRORNAME_NP''@|$(REPLACE_STRERRORNAME_NP)|g' \
+ -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
+ -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <strings.h> when the system
+# doesn't have one that works with the given compiler.
+strings.h: strings.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_STRINGS_H''@|$(HAVE_STRINGS_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STRINGS_H''@|$(NEXT_STRINGS_H)|g' \
+ -e 's/@''GNULIB_FFS''@/$(GL_GNULIB_FFS)/g' \
+ -e 's|@''HAVE_FFS''@|$(HAVE_FFS)|g' \
+ -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \
+ -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/strings.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <sys/file.h> when the system
+# has one that is incomplete.
+sys/file.h: sys_file.in.h $(top_builddir)/config.status $(WARN_ON_USE_H)
+ $(AM_V_GEN)$(MKDIR_P) 'sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's/@''HAVE_SYS_FILE_H''@/$(HAVE_SYS_FILE_H)/g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_FILE_H''@|$(NEXT_SYS_FILE_H)|g' \
+ -e 's/@''HAVE_FLOCK''@/$(HAVE_FLOCK)/g' \
+ -e 's/@''GNULIB_FLOCK''@/$(GL_GNULIB_FLOCK)/g' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/sys_file.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <sys/ioctl.h> when the system
+# does not have a complete one.
+sys/ioctl.h: sys_ioctl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)$(MKDIR_P) 'sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_SYS_IOCTL_H''@|$(HAVE_SYS_IOCTL_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_IOCTL_H''@|$(NEXT_SYS_IOCTL_H)|g' \
+ -e 's/@''GNULIB_IOCTL''@/$(GL_GNULIB_IOCTL)/g' \
+ -e 's|@''SYS_IOCTL_H_HAVE_WINSOCK2_H''@|$(SYS_IOCTL_H_HAVE_WINSOCK2_H)|g' \
+ -e 's|@''SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
+ -e 's|@''REPLACE_IOCTL''@|$(REPLACE_IOCTL)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/sys_ioctl.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <sys/random.h> when the system
+# doesn't have one.
+sys/random.h: sys_random.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)$(MKDIR_P) 'sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_RANDOM_H''@|$(NEXT_SYS_RANDOM_H)|g' \
+ -e 's|@''HAVE_SYS_RANDOM_H''@|$(HAVE_SYS_RANDOM_H)|g' \
+ -e 's/@''GNULIB_GETRANDOM''@/$(GL_GNULIB_GETRANDOM)/g' \
+ -e 's/@''HAVE_GETRANDOM''@/$(HAVE_GETRANDOM)/g' \
+ -e 's/@''REPLACE_GETRANDOM''@/$(REPLACE_GETRANDOM)/g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/sys_random.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <sys/select.h> when the system
+# doesn't have one that works with the given compiler.
+sys/select.h: sys_select.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)$(MKDIR_P) 'sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_SELECT_H''@|$(NEXT_SYS_SELECT_H)|g' \
+ -e 's|@''HAVE_SYS_SELECT_H''@|$(HAVE_SYS_SELECT_H)|g' \
+ -e 's/@''GNULIB_PSELECT''@/$(GL_GNULIB_PSELECT)/g' \
+ -e 's/@''GNULIB_SELECT''@/$(GL_GNULIB_SELECT)/g' \
+ -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
+ -e 's|@''HAVE_PSELECT''@|$(HAVE_PSELECT)|g' \
+ -e 's|@''REPLACE_PSELECT''@|$(REPLACE_PSELECT)|g' \
+ -e 's|@''REPLACE_SELECT''@|$(REPLACE_SELECT)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/sys_select.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <sys/socket.h> when the system
+# doesn't have one that works with the given compiler.
+sys/socket.h: sys_socket.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+ $(AM_V_GEN)$(MKDIR_P) 'sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_SOCKET_H''@|$(NEXT_SYS_SOCKET_H)|g' \
+ -e 's|@''HAVE_SYS_SOCKET_H''@|$(HAVE_SYS_SOCKET_H)|g' \
+ -e 's/@''GNULIB_CLOSE''@/$(GL_GNULIB_CLOSE)/g' \
+ -e 's/@''GNULIB_SOCKET''@/$(GL_GNULIB_SOCKET)/g' \
+ -e 's/@''GNULIB_CONNECT''@/$(GL_GNULIB_CONNECT)/g' \
+ -e 's/@''GNULIB_ACCEPT''@/$(GL_GNULIB_ACCEPT)/g' \
+ -e 's/@''GNULIB_BIND''@/$(GL_GNULIB_BIND)/g' \
+ -e 's/@''GNULIB_GETPEERNAME''@/$(GL_GNULIB_GETPEERNAME)/g' \
+ -e 's/@''GNULIB_GETSOCKNAME''@/$(GL_GNULIB_GETSOCKNAME)/g' \
+ -e 's/@''GNULIB_GETSOCKOPT''@/$(GL_GNULIB_GETSOCKOPT)/g' \
+ -e 's/@''GNULIB_LISTEN''@/$(GL_GNULIB_LISTEN)/g' \
+ -e 's/@''GNULIB_RECV''@/$(GL_GNULIB_RECV)/g' \
+ -e 's/@''GNULIB_SEND''@/$(GL_GNULIB_SEND)/g' \
+ -e 's/@''GNULIB_RECVFROM''@/$(GL_GNULIB_RECVFROM)/g' \
+ -e 's/@''GNULIB_SENDTO''@/$(GL_GNULIB_SENDTO)/g' \
+ -e 's/@''GNULIB_SETSOCKOPT''@/$(GL_GNULIB_SETSOCKOPT)/g' \
+ -e 's/@''GNULIB_SHUTDOWN''@/$(GL_GNULIB_SHUTDOWN)/g' \
+ -e 's/@''GNULIB_ACCEPT4''@/$(GL_GNULIB_ACCEPT4)/g' \
+ -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
+ -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
+ -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE''@|$(HAVE_STRUCT_SOCKADDR_STORAGE)|g' \
+ -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY''@|$(HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY)|g' \
+ -e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \
+ -e 's|@''HAVE_ACCEPT4''@|$(HAVE_ACCEPT4)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/sys_socket.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <sys/stat.h> when the system
+# has one that is incomplete.
+sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)$(MKDIR_P) 'sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
+ -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \
+ -e 's|@''WINDOWS_STAT_TIMESPEC''@|$(WINDOWS_STAT_TIMESPEC)|g' \
+ -e 's/@''GNULIB_CHMOD''@/$(GL_GNULIB_CHMOD)/g' \
+ -e 's/@''GNULIB_FCHMODAT''@/$(GL_GNULIB_FCHMODAT)/g' \
+ -e 's/@''GNULIB_FSTAT''@/$(GL_GNULIB_FSTAT)/g' \
+ -e 's/@''GNULIB_FSTATAT''@/$(GL_GNULIB_FSTATAT)/g' \
+ -e 's/@''GNULIB_FUTIMENS''@/$(GL_GNULIB_FUTIMENS)/g' \
+ -e 's/@''GNULIB_GETUMASK''@/$(GL_GNULIB_GETUMASK)/g' \
+ -e 's/@''GNULIB_LCHMOD''@/$(GL_GNULIB_LCHMOD)/g' \
+ -e 's/@''GNULIB_LSTAT''@/$(GL_GNULIB_LSTAT)/g' \
+ -e 's/@''GNULIB_MKDIR''@/$(GL_GNULIB_MKDIR)/g' \
+ -e 's/@''GNULIB_MKDIRAT''@/$(GL_GNULIB_MKDIRAT)/g' \
+ -e 's/@''GNULIB_MKFIFO''@/$(GL_GNULIB_MKFIFO)/g' \
+ -e 's/@''GNULIB_MKFIFOAT''@/$(GL_GNULIB_MKFIFOAT)/g' \
+ -e 's/@''GNULIB_MKNOD''@/$(GL_GNULIB_MKNOD)/g' \
+ -e 's/@''GNULIB_MKNODAT''@/$(GL_GNULIB_MKNODAT)/g' \
+ -e 's/@''GNULIB_STAT''@/$(GL_GNULIB_STAT)/g' \
+ -e 's/@''GNULIB_UTIMENSAT''@/$(GL_GNULIB_UTIMENSAT)/g' \
+ -e 's/@''GNULIB_OVERRIDES_STRUCT_STAT''@/$(GL_GNULIB_OVERRIDES_STRUCT_STAT)/g' \
+ -e 's/@''GNULIB_MDA_CHMOD''@/$(GL_GNULIB_MDA_CHMOD)/g' \
+ -e 's/@''GNULIB_MDA_MKDIR''@/$(GL_GNULIB_MDA_MKDIR)/g' \
+ -e 's/@''GNULIB_MDA_UMASK''@/$(GL_GNULIB_MDA_UMASK)/g' \
+ -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
+ -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
+ -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \
+ -e 's|@''HAVE_GETUMASK''@|$(HAVE_GETUMASK)|g' \
+ -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \
+ -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
+ -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \
+ -e 's|@''HAVE_MKFIFO''@|$(HAVE_MKFIFO)|g' \
+ -e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \
+ -e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \
+ -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \
+ -e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \
+ -e 's|@''REPLACE_CHMOD''@|$(REPLACE_CHMOD)|g' \
+ -e 's|@''REPLACE_FCHMODAT''@|$(REPLACE_FCHMODAT)|g' \
+ -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \
+ -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \
+ -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \
+ -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \
+ -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \
+ -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \
+ -e 's|@''REPLACE_MKFIFOAT''@|$(REPLACE_MKFIFOAT)|g' \
+ -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \
+ -e 's|@''REPLACE_MKNODAT''@|$(REPLACE_MKNODAT)|g' \
+ -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \
+ -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/sys_stat.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <sys/time.h> when the system
+# doesn't have one that works with the given compiler.
+sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)$(MKDIR_P) 'sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \
+ -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GL_GNULIB_GETTIMEOFDAY)/g' \
+ -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
+ -e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \
+ -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
+ -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
+ -e 's/@''REPLACE_STRUCT_TIMEVAL''@/$(REPLACE_STRUCT_TIMEVAL)/g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/sys_time.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <sys/types.h> when the system
+# doesn't have one that works with the given compiler.
+sys/types.h: sys_types.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)$(MKDIR_P) 'sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \
+ -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
+ -e 's|@''WINDOWS_STAT_INODES''@|$(WINDOWS_STAT_INODES)|g' \
+ $(srcdir)/sys_types.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <sys/uio.h> when the system
+# doesn't have one that works with the given compiler.
+sys/uio.h: sys_uio.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)$(MKDIR_P) 'sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_UIO_H''@|$(NEXT_SYS_UIO_H)|g' \
+ -e 's|@''HAVE_SYS_UIO_H''@|$(HAVE_SYS_UIO_H)|g' \
+ $(srcdir)/sys_uio.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <sysexits.h> when the system
+# doesn't have one that works with the given compiler.
+@GL_GENERATE_SYSEXITS_H_TRUE@sysexits.h: sysexits.in.h $(top_builddir)/config.status
+@GL_GENERATE_SYSEXITS_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_SYSEXITS_H_TRUE@ -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_SYSEXITS_H_TRUE@ -e 's|@''HAVE_SYSEXITS_H''@|$(HAVE_SYSEXITS_H)|g' \
+@GL_GENERATE_SYSEXITS_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_SYSEXITS_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_SYSEXITS_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_SYSEXITS_H_TRUE@ -e 's|@''NEXT_SYSEXITS_H''@|$(NEXT_SYSEXITS_H)|g' \
+@GL_GENERATE_SYSEXITS_H_TRUE@ $(srcdir)/sysexits.in.h > $@-t
+@GL_GENERATE_SYSEXITS_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_SYSEXITS_H_FALSE@sysexits.h: $(top_builddir)/config.status
+@GL_GENERATE_SYSEXITS_H_FALSE@ rm -f $@
+
+# We need the following in order to create <termios.h> when the system
+# version does not have all declarations.
+termios.h: termios.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_TERMIOS_H''@|$(NEXT_TERMIOS_H)|g' \
+ -e 's/@''GNULIB_TCGETSID''@/$(GL_GNULIB_TCGETSID)/g' \
+ -e 's|@''HAVE_DECL_TCGETSID''@|$(HAVE_DECL_TCGETSID)|g' \
+ -e 's|@''HAVE_TERMIOS_H''@|$(HAVE_TERMIOS_H)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/termios.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <time.h> when the system
+# doesn't have one that works with the given compiler.
+time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
+ -e 's/@''GNULIB_CTIME''@/$(GL_GNULIB_CTIME)/g' \
+ -e 's/@''GNULIB_LOCALTIME''@/$(GL_GNULIB_LOCALTIME)/g' \
+ -e 's/@''GNULIB_MKTIME''@/$(GL_GNULIB_MKTIME)/g' \
+ -e 's/@''GNULIB_NANOSLEEP''@/$(GL_GNULIB_NANOSLEEP)/g' \
+ -e 's/@''GNULIB_STRFTIME''@/$(GL_GNULIB_STRFTIME)/g' \
+ -e 's/@''GNULIB_STRPTIME''@/$(GL_GNULIB_STRPTIME)/g' \
+ -e 's/@''GNULIB_TIMEGM''@/$(GL_GNULIB_TIMEGM)/g' \
+ -e 's/@''GNULIB_TIMESPEC_GET''@/$(GL_GNULIB_TIMESPEC_GET)/g' \
+ -e 's/@''GNULIB_TIMESPEC_GETRES''@/$(GL_GNULIB_TIMESPEC_GETRES)/g' \
+ -e 's/@''GNULIB_TIME_R''@/$(GL_GNULIB_TIME_R)/g' \
+ -e 's/@''GNULIB_TIME_RZ''@/$(GL_GNULIB_TIME_RZ)/g' \
+ -e 's/@''GNULIB_TZSET''@/$(GL_GNULIB_TZSET)/g' \
+ -e 's/@''GNULIB_MDA_TZSET''@/$(GL_GNULIB_MDA_TZSET)/g' \
+ -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
+ -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
+ -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
+ -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
+ -e 's|@''HAVE_TIMESPEC_GET''@|$(HAVE_TIMESPEC_GET)|g' \
+ -e 's|@''HAVE_TIMESPEC_GETRES''@|$(HAVE_TIMESPEC_GETRES)|g' \
+ -e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \
+ -e 's|@''REPLACE_CTIME''@|$(REPLACE_CTIME)|g' \
+ -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \
+ -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \
+ -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
+ -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
+ -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
+ -e 's|@''REPLACE_STRFTIME''@|$(REPLACE_STRFTIME)|g' \
+ -e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
+ -e 's|@''REPLACE_TZSET''@|$(REPLACE_TZSET)|g' \
+ -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \
+ -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
+ -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
+ -e 's|@''UNISTD_H_DEFINES_STRUCT_TIMESPEC''@|$(UNISTD_H_DEFINES_STRUCT_TIMESPEC)|g' \
+ -e 's|@''TIME_H_DEFINES_TIME_UTC''@|$(TIME_H_DEFINES_TIME_UTC)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/time.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create an empty placeholder for
+# <unistd.h> when the system doesn't have one.
+unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
+ -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
+ -e 's/@''GNULIB_ACCESS''@/$(GL_GNULIB_ACCESS)/g' \
+ -e 's/@''GNULIB_CHDIR''@/$(GL_GNULIB_CHDIR)/g' \
+ -e 's/@''GNULIB_CHOWN''@/$(GL_GNULIB_CHOWN)/g' \
+ -e 's/@''GNULIB_CLOSE''@/$(GL_GNULIB_CLOSE)/g' \
+ -e 's/@''GNULIB_COPY_FILE_RANGE''@/$(GL_GNULIB_COPY_FILE_RANGE)/g' \
+ -e 's/@''GNULIB_DUP''@/$(GL_GNULIB_DUP)/g' \
+ -e 's/@''GNULIB_DUP2''@/$(GL_GNULIB_DUP2)/g' \
+ -e 's/@''GNULIB_DUP3''@/$(GL_GNULIB_DUP3)/g' \
+ -e 's/@''GNULIB_ENVIRON''@/$(GL_GNULIB_ENVIRON)/g' \
+ -e 's/@''GNULIB_EUIDACCESS''@/$(GL_GNULIB_EUIDACCESS)/g' \
+ -e 's/@''GNULIB_EXECL''@/$(GL_GNULIB_EXECL)/g' \
+ -e 's/@''GNULIB_EXECLE''@/$(GL_GNULIB_EXECLE)/g' \
+ -e 's/@''GNULIB_EXECLP''@/$(GL_GNULIB_EXECLP)/g' \
+ -e 's/@''GNULIB_EXECV''@/$(GL_GNULIB_EXECV)/g' \
+ -e 's/@''GNULIB_EXECVE''@/$(GL_GNULIB_EXECVE)/g' \
+ -e 's/@''GNULIB_EXECVP''@/$(GL_GNULIB_EXECVP)/g' \
+ -e 's/@''GNULIB_EXECVPE''@/$(GL_GNULIB_EXECVPE)/g' \
+ -e 's/@''GNULIB_FACCESSAT''@/$(GL_GNULIB_FACCESSAT)/g' \
+ -e 's/@''GNULIB_FCHDIR''@/$(GL_GNULIB_FCHDIR)/g' \
+ -e 's/@''GNULIB_FCHOWNAT''@/$(GL_GNULIB_FCHOWNAT)/g' \
+ -e 's/@''GNULIB_FDATASYNC''@/$(GL_GNULIB_FDATASYNC)/g' \
+ -e 's/@''GNULIB_FSYNC''@/$(GL_GNULIB_FSYNC)/g' \
+ -e 's/@''GNULIB_FTRUNCATE''@/$(GL_GNULIB_FTRUNCATE)/g' \
+ -e 's/@''GNULIB_GETCWD''@/$(GL_GNULIB_GETCWD)/g' \
+ -e 's/@''GNULIB_GETDOMAINNAME''@/$(GL_GNULIB_GETDOMAINNAME)/g' \
+ -e 's/@''GNULIB_GETDTABLESIZE''@/$(GL_GNULIB_GETDTABLESIZE)/g' \
+ -e 's/@''GNULIB_GETENTROPY''@/$(GL_GNULIB_GETENTROPY)/g' \
+ -e 's/@''GNULIB_GETGROUPS''@/$(GL_GNULIB_GETGROUPS)/g' \
+ -e 's/@''GNULIB_GETHOSTNAME''@/$(GL_GNULIB_GETHOSTNAME)/g' \
+ -e 's/@''GNULIB_GETLOGIN''@/$(GL_GNULIB_GETLOGIN)/g' \
+ -e 's/@''GNULIB_GETLOGIN_R''@/$(GL_GNULIB_GETLOGIN_R)/g' \
+ -e 's/@''GNULIB_GETOPT_POSIX''@/$(GL_GNULIB_GETOPT_POSIX)/g' \
+ -e 's/@''GNULIB_GETPAGESIZE''@/$(GL_GNULIB_GETPAGESIZE)/g' \
+ -e 's/@''GNULIB_GETPASS''@/$(GL_GNULIB_GETPASS)/g' \
+ -e 's/@''GNULIB_GETPASS_GNU''@/$(GL_GNULIB_GETPASS_GNU)/g' \
+ -e 's/@''GNULIB_GETUSERSHELL''@/$(GL_GNULIB_GETUSERSHELL)/g' \
+ -e 's/@''GNULIB_GROUP_MEMBER''@/$(GL_GNULIB_GROUP_MEMBER)/g' \
+ -e 's/@''GNULIB_ISATTY''@/$(GL_GNULIB_ISATTY)/g' \
+ -e 's/@''GNULIB_LCHOWN''@/$(GL_GNULIB_LCHOWN)/g' \
+ -e 's/@''GNULIB_LINK''@/$(GL_GNULIB_LINK)/g' \
+ -e 's/@''GNULIB_LINKAT''@/$(GL_GNULIB_LINKAT)/g' \
+ -e 's/@''GNULIB_LSEEK''@/$(GL_GNULIB_LSEEK)/g' \
+ -e 's/@''GNULIB_PIPE''@/$(GL_GNULIB_PIPE)/g' \
+ -e 's/@''GNULIB_PIPE2''@/$(GL_GNULIB_PIPE2)/g' \
+ -e 's/@''GNULIB_PREAD''@/$(GL_GNULIB_PREAD)/g' \
+ -e 's/@''GNULIB_PWRITE''@/$(GL_GNULIB_PWRITE)/g' \
+ -e 's/@''GNULIB_READ''@/$(GL_GNULIB_READ)/g' \
+ -e 's/@''GNULIB_READLINK''@/$(GL_GNULIB_READLINK)/g' \
+ -e 's/@''GNULIB_READLINKAT''@/$(GL_GNULIB_READLINKAT)/g' \
+ -e 's/@''GNULIB_RMDIR''@/$(GL_GNULIB_RMDIR)/g' \
+ -e 's/@''GNULIB_SETHOSTNAME''@/$(GL_GNULIB_SETHOSTNAME)/g' \
+ -e 's/@''GNULIB_SLEEP''@/$(GL_GNULIB_SLEEP)/g' \
+ -e 's/@''GNULIB_SYMLINK''@/$(GL_GNULIB_SYMLINK)/g' \
+ -e 's/@''GNULIB_SYMLINKAT''@/$(GL_GNULIB_SYMLINKAT)/g' \
+ -e 's/@''GNULIB_TRUNCATE''@/$(GL_GNULIB_TRUNCATE)/g' \
+ -e 's/@''GNULIB_TTYNAME_R''@/$(GL_GNULIB_TTYNAME_R)/g' \
+ -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GL_GNULIB_UNISTD_H_GETOPT)/g' \
+ -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GL_GNULIB_UNISTD_H_NONBLOCKING)/g' \
+ -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GL_GNULIB_UNISTD_H_SIGPIPE)/g' \
+ -e 's/@''GNULIB_UNLINK''@/$(GL_GNULIB_UNLINK)/g' \
+ -e 's/@''GNULIB_UNLINKAT''@/$(GL_GNULIB_UNLINKAT)/g' \
+ -e 's/@''GNULIB_USLEEP''@/$(GL_GNULIB_USLEEP)/g' \
+ -e 's/@''GNULIB_WRITE''@/$(GL_GNULIB_WRITE)/g' \
+ -e 's/@''GNULIB_MDA_ACCESS''@/$(GL_GNULIB_MDA_ACCESS)/g' \
+ -e 's/@''GNULIB_MDA_CHDIR''@/$(GL_GNULIB_MDA_CHDIR)/g' \
+ -e 's/@''GNULIB_MDA_CLOSE''@/$(GL_GNULIB_MDA_CLOSE)/g' \
+ -e 's/@''GNULIB_MDA_DUP''@/$(GL_GNULIB_MDA_DUP)/g' \
+ -e 's/@''GNULIB_MDA_DUP2''@/$(GL_GNULIB_MDA_DUP2)/g' \
+ -e 's/@''GNULIB_MDA_EXECL''@/$(GL_GNULIB_MDA_EXECL)/g' \
+ -e 's/@''GNULIB_MDA_EXECLE''@/$(GL_GNULIB_MDA_EXECLE)/g' \
+ -e 's/@''GNULIB_MDA_EXECLP''@/$(GL_GNULIB_MDA_EXECLP)/g' \
+ -e 's/@''GNULIB_MDA_EXECV''@/$(GL_GNULIB_MDA_EXECV)/g' \
+ -e 's/@''GNULIB_MDA_EXECVE''@/$(GL_GNULIB_MDA_EXECVE)/g' \
+ -e 's/@''GNULIB_MDA_EXECVP''@/$(GL_GNULIB_MDA_EXECVP)/g' \
+ -e 's/@''GNULIB_MDA_EXECVPE''@/$(GL_GNULIB_MDA_EXECVPE)/g' \
+ -e 's/@''GNULIB_MDA_GETCWD''@/$(GL_GNULIB_MDA_GETCWD)/g' \
+ -e 's/@''GNULIB_MDA_GETPID''@/$(GL_GNULIB_MDA_GETPID)/g' \
+ -e 's/@''GNULIB_MDA_ISATTY''@/$(GL_GNULIB_MDA_ISATTY)/g' \
+ -e 's/@''GNULIB_MDA_LSEEK''@/$(GL_GNULIB_MDA_LSEEK)/g' \
+ -e 's/@''GNULIB_MDA_READ''@/$(GL_GNULIB_MDA_READ)/g' \
+ -e 's/@''GNULIB_MDA_RMDIR''@/$(GL_GNULIB_MDA_RMDIR)/g' \
+ -e 's/@''GNULIB_MDA_SWAB''@/$(GL_GNULIB_MDA_SWAB)/g' \
+ -e 's/@''GNULIB_MDA_UNLINK''@/$(GL_GNULIB_MDA_UNLINK)/g' \
+ -e 's/@''GNULIB_MDA_WRITE''@/$(GL_GNULIB_MDA_WRITE)/g' \
+ < $(srcdir)/unistd.in.h | \
+ sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
+ -e 's|@''HAVE_COPY_FILE_RANGE''@|$(HAVE_COPY_FILE_RANGE)|g' \
+ -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
+ -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
+ -e 's|@''HAVE_EXECVPE''@|$(HAVE_EXECVPE)|g' \
+ -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \
+ -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \
+ -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \
+ -e 's|@''HAVE_FDATASYNC''@|$(HAVE_FDATASYNC)|g' \
+ -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
+ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
+ -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
+ -e 's|@''HAVE_GETENTROPY''@|$(HAVE_GETENTROPY)|g' \
+ -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
+ -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
+ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
+ -e 's|@''HAVE_GETPASS''@|$(HAVE_GETPASS)|g' \
+ -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \
+ -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
+ -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
+ -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \
+ -e 's|@''HAVE_PIPE''@|$(HAVE_PIPE)|g' \
+ -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \
+ -e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \
+ -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \
+ -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
+ -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
+ -e 's|@''HAVE_SETHOSTNAME''@|$(HAVE_SETHOSTNAME)|g' \
+ -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
+ -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \
+ -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \
+ -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
+ -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
+ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
+ -e 's|@''HAVE_DECL_EXECVPE''@|$(HAVE_DECL_EXECVPE)|g' \
+ -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \
+ -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \
+ -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \
+ -e 's|@''HAVE_DECL_GETLOGIN''@|$(HAVE_DECL_GETLOGIN)|g' \
+ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
+ -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
+ -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
+ -e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \
+ -e 's|@''HAVE_DECL_TRUNCATE''@|$(HAVE_DECL_TRUNCATE)|g' \
+ -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \
+ -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
+ -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
+ | \
+ sed -e 's|@''REPLACE_ACCESS''@|$(REPLACE_ACCESS)|g' \
+ -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
+ -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
+ -e 's|@''REPLACE_COPY_FILE_RANGE''@|$(REPLACE_COPY_FILE_RANGE)|g' \
+ -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
+ -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
+ -e 's|@''REPLACE_EXECL''@|$(REPLACE_EXECL)|g' \
+ -e 's|@''REPLACE_EXECLE''@|$(REPLACE_EXECLE)|g' \
+ -e 's|@''REPLACE_EXECLP''@|$(REPLACE_EXECLP)|g' \
+ -e 's|@''REPLACE_EXECV''@|$(REPLACE_EXECV)|g' \
+ -e 's|@''REPLACE_EXECVE''@|$(REPLACE_EXECVE)|g' \
+ -e 's|@''REPLACE_EXECVP''@|$(REPLACE_EXECVP)|g' \
+ -e 's|@''REPLACE_EXECVPE''@|$(REPLACE_EXECVPE)|g' \
+ -e 's|@''REPLACE_FACCESSAT''@|$(REPLACE_FACCESSAT)|g' \
+ -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
+ -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
+ -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
+ -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
+ -e 's|@''REPLACE_GETDTABLESIZE''@|$(REPLACE_GETDTABLESIZE)|g' \
+ -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
+ -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
+ -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
+ -e 's|@''REPLACE_GETPASS''@|$(REPLACE_GETPASS)|g' \
+ -e 's|@''REPLACE_GETPASS_FOR_GETPASS_GNU''@|$(REPLACE_GETPASS_FOR_GETPASS_GNU)|g' \
+ -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \
+ -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
+ -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
+ -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \
+ -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
+ -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \
+ -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
+ -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \
+ -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
+ -e 's|@''REPLACE_READLINKAT''@|$(REPLACE_READLINKAT)|g' \
+ -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
+ -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
+ -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
+ -e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \
+ -e 's|@''REPLACE_TRUNCATE''@|$(REPLACE_TRUNCATE)|g' \
+ -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \
+ -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
+ -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
+ -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \
+ -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \
+ -e 's|@''UNISTD_H_HAVE_SYS_RANDOM_H''@|$(UNISTD_H_HAVE_SYS_RANDOM_H)|g' \
+ -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
+ -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <utime.h> when the system
+# doesn't have one that works with the given compiler.
+utime.h: utime.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's/@''HAVE_UTIME_H''@/$(HAVE_UTIME_H)/g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_UTIME_H''@|$(NEXT_UTIME_H)|g' \
+ -e 's/@''GNULIB_UTIME''@/$(GL_GNULIB_UTIME)/g' \
+ -e 's/@''GNULIB_MDA_UTIME''@/$(GL_GNULIB_MDA_UTIME)/g' \
+ -e 's|@''HAVE_UTIME''@|$(HAVE_UTIME)|g' \
+ -e 's|@''REPLACE_UTIME''@|$(REPLACE_UTIME)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/utime.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <wchar.h> when the system
+# version does not work standalone.
+wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
+ -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
+ -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
+ -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \
+ -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \
+ -e 's/@''GNULIB_BTOWC''@/$(GL_GNULIB_BTOWC)/g' \
+ -e 's/@''GNULIB_WCTOB''@/$(GL_GNULIB_WCTOB)/g' \
+ -e 's/@''GNULIB_MBSINIT''@/$(GL_GNULIB_MBSINIT)/g' \
+ -e 's/@''GNULIB_MBRTOWC''@/$(GL_GNULIB_MBRTOWC)/g' \
+ -e 's/@''GNULIB_MBRLEN''@/$(GL_GNULIB_MBRLEN)/g' \
+ -e 's/@''GNULIB_MBSRTOWCS''@/$(GL_GNULIB_MBSRTOWCS)/g' \
+ -e 's/@''GNULIB_MBSNRTOWCS''@/$(GL_GNULIB_MBSNRTOWCS)/g' \
+ -e 's/@''GNULIB_WCRTOMB''@/$(GL_GNULIB_WCRTOMB)/g' \
+ -e 's/@''GNULIB_WCSRTOMBS''@/$(GL_GNULIB_WCSRTOMBS)/g' \
+ -e 's/@''GNULIB_WCSNRTOMBS''@/$(GL_GNULIB_WCSNRTOMBS)/g' \
+ -e 's/@''GNULIB_WCWIDTH''@/$(GL_GNULIB_WCWIDTH)/g' \
+ -e 's/@''GNULIB_WMEMCHR''@/$(GL_GNULIB_WMEMCHR)/g' \
+ -e 's/@''GNULIB_WMEMCMP''@/$(GL_GNULIB_WMEMCMP)/g' \
+ -e 's/@''GNULIB_WMEMCPY''@/$(GL_GNULIB_WMEMCPY)/g' \
+ -e 's/@''GNULIB_WMEMMOVE''@/$(GL_GNULIB_WMEMMOVE)/g' \
+ -e 's/@''GNULIB_WMEMPCPY''@/$(GL_GNULIB_WMEMPCPY)/g' \
+ -e 's/@''GNULIB_WMEMSET''@/$(GL_GNULIB_WMEMSET)/g' \
+ -e 's/@''GNULIB_WCSLEN''@/$(GL_GNULIB_WCSLEN)/g' \
+ -e 's/@''GNULIB_WCSNLEN''@/$(GL_GNULIB_WCSNLEN)/g' \
+ -e 's/@''GNULIB_WCSCPY''@/$(GL_GNULIB_WCSCPY)/g' \
+ -e 's/@''GNULIB_WCPCPY''@/$(GL_GNULIB_WCPCPY)/g' \
+ -e 's/@''GNULIB_WCSNCPY''@/$(GL_GNULIB_WCSNCPY)/g' \
+ -e 's/@''GNULIB_WCPNCPY''@/$(GL_GNULIB_WCPNCPY)/g' \
+ -e 's/@''GNULIB_WCSCAT''@/$(GL_GNULIB_WCSCAT)/g' \
+ -e 's/@''GNULIB_WCSNCAT''@/$(GL_GNULIB_WCSNCAT)/g' \
+ -e 's/@''GNULIB_WCSCMP''@/$(GL_GNULIB_WCSCMP)/g' \
+ -e 's/@''GNULIB_WCSNCMP''@/$(GL_GNULIB_WCSNCMP)/g' \
+ -e 's/@''GNULIB_WCSCASECMP''@/$(GL_GNULIB_WCSCASECMP)/g' \
+ -e 's/@''GNULIB_WCSNCASECMP''@/$(GL_GNULIB_WCSNCASECMP)/g' \
+ -e 's/@''GNULIB_WCSCOLL''@/$(GL_GNULIB_WCSCOLL)/g' \
+ -e 's/@''GNULIB_WCSXFRM''@/$(GL_GNULIB_WCSXFRM)/g' \
+ -e 's/@''GNULIB_WCSDUP''@/$(GL_GNULIB_WCSDUP)/g' \
+ -e 's/@''GNULIB_WCSCHR''@/$(GL_GNULIB_WCSCHR)/g' \
+ -e 's/@''GNULIB_WCSRCHR''@/$(GL_GNULIB_WCSRCHR)/g' \
+ -e 's/@''GNULIB_WCSCSPN''@/$(GL_GNULIB_WCSCSPN)/g' \
+ -e 's/@''GNULIB_WCSSPN''@/$(GL_GNULIB_WCSSPN)/g' \
+ -e 's/@''GNULIB_WCSPBRK''@/$(GL_GNULIB_WCSPBRK)/g' \
+ -e 's/@''GNULIB_WCSSTR''@/$(GL_GNULIB_WCSSTR)/g' \
+ -e 's/@''GNULIB_WCSTOK''@/$(GL_GNULIB_WCSTOK)/g' \
+ -e 's/@''GNULIB_WCSWIDTH''@/$(GL_GNULIB_WCSWIDTH)/g' \
+ -e 's/@''GNULIB_WCSFTIME''@/$(GL_GNULIB_WCSFTIME)/g' \
+ -e 's/@''GNULIB_MDA_WCSDUP''@/$(GL_GNULIB_MDA_WCSDUP)/g' \
+ -e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \
+ < $(srcdir)/wchar.in.h | \
+ sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
+ -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
+ -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \
+ -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \
+ -e 's|@''HAVE_MBRLEN''@|$(HAVE_MBRLEN)|g' \
+ -e 's|@''HAVE_MBSRTOWCS''@|$(HAVE_MBSRTOWCS)|g' \
+ -e 's|@''HAVE_MBSNRTOWCS''@|$(HAVE_MBSNRTOWCS)|g' \
+ -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \
+ -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \
+ -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \
+ -e 's|@''HAVE_WMEMCHR''@|$(HAVE_WMEMCHR)|g' \
+ -e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \
+ -e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \
+ -e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \
+ -e 's|@''HAVE_WMEMPCPY''@|$(HAVE_WMEMPCPY)|g' \
+ -e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \
+ -e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \
+ -e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \
+ -e 's|@''HAVE_WCSCPY''@|$(HAVE_WCSCPY)|g' \
+ -e 's|@''HAVE_WCPCPY''@|$(HAVE_WCPCPY)|g' \
+ -e 's|@''HAVE_WCSNCPY''@|$(HAVE_WCSNCPY)|g' \
+ -e 's|@''HAVE_WCPNCPY''@|$(HAVE_WCPNCPY)|g' \
+ -e 's|@''HAVE_WCSCAT''@|$(HAVE_WCSCAT)|g' \
+ -e 's|@''HAVE_WCSNCAT''@|$(HAVE_WCSNCAT)|g' \
+ -e 's|@''HAVE_WCSCMP''@|$(HAVE_WCSCMP)|g' \
+ -e 's|@''HAVE_WCSNCMP''@|$(HAVE_WCSNCMP)|g' \
+ -e 's|@''HAVE_WCSCASECMP''@|$(HAVE_WCSCASECMP)|g' \
+ -e 's|@''HAVE_WCSNCASECMP''@|$(HAVE_WCSNCASECMP)|g' \
+ -e 's|@''HAVE_WCSCOLL''@|$(HAVE_WCSCOLL)|g' \
+ -e 's|@''HAVE_WCSXFRM''@|$(HAVE_WCSXFRM)|g' \
+ -e 's|@''HAVE_WCSDUP''@|$(HAVE_WCSDUP)|g' \
+ -e 's|@''HAVE_WCSCHR''@|$(HAVE_WCSCHR)|g' \
+ -e 's|@''HAVE_WCSRCHR''@|$(HAVE_WCSRCHR)|g' \
+ -e 's|@''HAVE_WCSCSPN''@|$(HAVE_WCSCSPN)|g' \
+ -e 's|@''HAVE_WCSSPN''@|$(HAVE_WCSSPN)|g' \
+ -e 's|@''HAVE_WCSPBRK''@|$(HAVE_WCSPBRK)|g' \
+ -e 's|@''HAVE_WCSSTR''@|$(HAVE_WCSSTR)|g' \
+ -e 's|@''HAVE_WCSTOK''@|$(HAVE_WCSTOK)|g' \
+ -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \
+ -e 's|@''HAVE_WCSFTIME''@|$(HAVE_WCSFTIME)|g' \
+ -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
+ -e 's|@''HAVE_DECL_WCSDUP''@|$(HAVE_DECL_WCSDUP)|g' \
+ -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
+ | \
+ sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
+ -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \
+ -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \
+ -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
+ -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \
+ -e 's|@''REPLACE_MBRTOWC''@|$(REPLACE_MBRTOWC)|g' \
+ -e 's|@''REPLACE_MBRLEN''@|$(REPLACE_MBRLEN)|g' \
+ -e 's|@''REPLACE_MBSRTOWCS''@|$(REPLACE_MBSRTOWCS)|g' \
+ -e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \
+ -e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \
+ -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \
+ -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
+ -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
+ -e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \
+ -e 's|@''REPLACE_WCSFTIME''@|$(REPLACE_WCSFTIME)|g' \
+ -e 's|@''REPLACE_WCSTOK''@|$(REPLACE_WCSTOK)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <wctype.h> when the system
+# doesn't have one that works with the given compiler.
+wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \
+ -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \
+ -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \
+ -e 's/@''GNULIB_ISWBLANK''@/$(GL_GNULIB_ISWBLANK)/g' \
+ -e 's/@''GNULIB_ISWDIGIT''@/$(GL_GNULIB_ISWDIGIT)/g' \
+ -e 's/@''GNULIB_ISWXDIGIT''@/$(GL_GNULIB_ISWXDIGIT)/g' \
+ -e 's/@''GNULIB_WCTYPE''@/$(GL_GNULIB_WCTYPE)/g' \
+ -e 's/@''GNULIB_ISWCTYPE''@/$(GL_GNULIB_ISWCTYPE)/g' \
+ -e 's/@''GNULIB_WCTRANS''@/$(GL_GNULIB_WCTRANS)/g' \
+ -e 's/@''GNULIB_TOWCTRANS''@/$(GL_GNULIB_TOWCTRANS)/g' \
+ -e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \
+ -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \
+ -e 's/@''HAVE_WCTYPE_T''@/$(HAVE_WCTYPE_T)/g' \
+ -e 's/@''HAVE_WCTRANS_T''@/$(HAVE_WCTRANS_T)/g' \
+ -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
+ -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \
+ -e 's/@''REPLACE_ISWDIGIT''@/$(REPLACE_ISWDIGIT)/g' \
+ -e 's/@''REPLACE_ISWXDIGIT''@/$(REPLACE_ISWXDIGIT)/g' \
+ -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \
+ -e 's/@''REPLACE_TOWLOWER''@/$(REPLACE_TOWLOWER)/g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/wctype.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+mostlyclean-local: mostlyclean-generic
+ @for dir in '' $(MOSTLYCLEANDIRS); do \
+ if test -n "$$dir" && test -d $$dir; then \
+ echo "rmdir $$dir"; rmdir $$dir; \
+ fi; \
+ done; \
+ :
+distclean-local: distclean-gnulib-libobjs
+distclean-gnulib-libobjs:
+ -rm -f @gl_LIBOBJDEPS@
+maintainer-clean-local: distclean-gnulib-libobjs
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/gl/lib/_Noreturn.h b/gl/lib/_Noreturn.h
new file mode 100644
index 0000000..e914627
--- /dev/null
+++ b/gl/lib/_Noreturn.h
@@ -0,0 +1,45 @@
+/* A C macro for declaring that a function does not return.
+ Copyright (C) 2011-2022 Free Software Foundation, Inc.
+
+ This program 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 2 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
+ 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/>. */
+
+#ifndef _Noreturn
+# if (defined __cplusplus \
+ && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
+ || (defined _MSC_VER && 1900 <= _MSC_VER)) \
+ && 0)
+ /* [[noreturn]] is not practically usable, because with it the syntax
+ extern _Noreturn void func (...);
+ would not be valid; such a declaration would only be valid with 'extern'
+ and '_Noreturn' swapped, or without the 'extern' keyword. However, some
+ AIX system header files and several gnulib header files use precisely
+ this syntax with 'extern'. */
+# define _Noreturn [[noreturn]]
+# elif ((!defined __cplusplus || defined __clang__) \
+ && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
+ || (!defined __STRICT_ANSI__ \
+ && (4 < __GNUC__ + (7 <= __GNUC_MINOR__) \
+ || (defined __apple_build_version__ \
+ ? 6000000 <= __apple_build_version__ \
+ : 3 < __clang_major__ + (5 <= __clang_minor__))))))
+ /* _Noreturn works as-is. */
+# elif (2 < __GNUC__ + (8 <= __GNUC_MINOR__) || defined __clang__ \
+ || 0x5110 <= __SUNPRO_C)
+# define _Noreturn __attribute__ ((__noreturn__))
+# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
+# define _Noreturn __declspec (noreturn)
+# else
+# define _Noreturn
+# endif
+#endif
diff --git a/gl/lib/alloca.c b/gl/lib/alloca.c
new file mode 100644
index 0000000..5eb16a9
--- /dev/null
+++ b/gl/lib/alloca.c
@@ -0,0 +1,167 @@
+/* alloca.c -- allocate automatically reclaimed memory
+ This file is in the public domain. */
+
+/* (Mostly) portable implementation -- D A Gwyn
+
+ This implementation of the PWB library alloca function,
+ which is used to allocate space off the run-time stack so
+ that it is automatically reclaimed upon procedure exit,
+ was inspired by discussions with J. Q. Johnson of Cornell.
+ J.Otto Tennant <jot@cray.com> contributed the Cray support.
+
+ There are some preprocessor constants that can
+ be defined when compiling for your specific system, for
+ improved efficiency; however, the defaults should be okay.
+
+ The general concept of this implementation is to keep
+ track of all alloca-allocated blocks, and reclaim any
+ that are found to be deeper in the stack than the current
+ invocation. This heuristic does not reclaim storage as
+ soon as it becomes invalid, but it will do so eventually.
+
+ As a special case, alloca(0) reclaims storage without
+ allocating any. It is a good idea to use alloca(0) in
+ your main control loop, etc. to force garbage collection. */
+
+#include <config.h>
+
+#include <alloca.h>
+
+#include <string.h>
+#include <stdlib.h>
+
+/* If compiling with GCC or clang, this file is not needed. */
+#if !(defined __GNUC__ || defined __clang__)
+
+/* If someone has defined alloca as a macro,
+ there must be some other way alloca is supposed to work. */
+# ifndef alloca
+
+/* Define STACK_DIRECTION if you know the direction of stack
+ growth for your system; otherwise it will be automatically
+ deduced at run-time.
+
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+
+# ifndef STACK_DIRECTION
+# define STACK_DIRECTION 0 /* Direction unknown. */
+# endif
+
+# if STACK_DIRECTION != 0
+
+# define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
+
+# else /* STACK_DIRECTION == 0; need run-time code. */
+
+static int stack_dir; /* 1 or -1 once known. */
+# define STACK_DIR stack_dir
+
+static int
+find_stack_direction (int *addr, int depth)
+{
+ int dir, dummy = 0;
+ if (! addr)
+ addr = &dummy;
+ *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
+ dir = depth ? find_stack_direction (addr, depth - 1) : 0;
+ return dir + dummy;
+}
+
+# endif /* STACK_DIRECTION == 0 */
+
+/* An "alloca header" is used to:
+ (a) chain together all alloca'ed blocks;
+ (b) keep track of stack depth.
+
+ It is very important that sizeof(header) agree with malloc
+ alignment chunk size. The following default should work okay. */
+
+# ifndef ALIGN_SIZE
+# define ALIGN_SIZE sizeof(double)
+# endif
+
+typedef union hdr
+{
+ char align[ALIGN_SIZE]; /* To force sizeof(header). */
+ struct
+ {
+ union hdr *next; /* For chaining headers. */
+ char *deep; /* For stack depth measure. */
+ } h;
+} header;
+
+static header *last_alloca_header = NULL; /* -> last alloca header. */
+
+/* Return a pointer to at least SIZE bytes of storage,
+ which will be automatically reclaimed upon exit from
+ the procedure that called alloca. Originally, this space
+ was supposed to be taken from the current stack frame of the
+ caller, but that method cannot be made to work for some
+ implementations of C, for example under Gould's UTX/32. */
+
+void *
+alloca (size_t size)
+{
+ auto char probe; /* Probes stack depth: */
+ register char *depth = &probe;
+
+# if STACK_DIRECTION == 0
+ if (STACK_DIR == 0) /* Unknown growth direction. */
+ STACK_DIR = find_stack_direction (NULL, (size & 1) + 20);
+# endif
+
+ /* Reclaim garbage, defined as all alloca'd storage that
+ was allocated from deeper in the stack than currently. */
+
+ {
+ register header *hp; /* Traverses linked list. */
+
+ for (hp = last_alloca_header; hp != NULL;)
+ if ((STACK_DIR > 0 && hp->h.deep > depth)
+ || (STACK_DIR < 0 && hp->h.deep < depth))
+ {
+ register header *np = hp->h.next;
+
+ free (hp); /* Collect garbage. */
+
+ hp = np; /* -> next header. */
+ }
+ else
+ break; /* Rest are not deeper. */
+
+ last_alloca_header = hp; /* -> last valid storage. */
+ }
+
+ if (size == 0)
+ return NULL; /* No allocation required. */
+
+ /* Allocate combined header + user data storage. */
+
+ {
+ /* Address of header. */
+ register header *new;
+
+ size_t combined_size = sizeof (header) + size;
+ if (combined_size < sizeof (header))
+ memory_full ();
+
+ new = malloc (combined_size);
+
+ if (! new)
+ memory_full ();
+
+ new->h.next = last_alloca_header;
+ new->h.deep = depth;
+
+ last_alloca_header = new;
+
+ /* User storage begins just after header. */
+
+ return (void *) (new + 1);
+ }
+}
+
+# endif /* no alloca */
+#endif /* not GCC || clang */
diff --git a/gl/lib/alloca.in.h b/gl/lib/alloca.in.h
new file mode 100644
index 0000000..e2b1461
--- /dev/null
+++ b/gl/lib/alloca.in.h
@@ -0,0 +1,72 @@
+/* Memory allocation on the stack.
+
+ Copyright (C) 1995, 1999, 2001-2004, 2006-2022 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 2.1 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/>. */
+
+/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
+ means there is a real alloca function. */
+#ifndef _GL_ALLOCA_H
+#define _GL_ALLOCA_H
+
+/* alloca (N) returns a pointer to N bytes of memory
+ allocated on the stack, which will last until the function returns.
+ Use of alloca should be avoided:
+ - inside arguments of function calls - undefined behaviour,
+ - in inline functions - the allocation may actually last until the
+ calling function returns,
+ - for huge N (say, N >= 65536) - you never know how large (or small)
+ the stack is, and when the stack cannot fulfill the memory allocation
+ request, the program just crashes.
+ */
+
+#ifndef alloca
+ /* Some version of mingw have an <alloca.h> that causes trouble when
+ included after 'alloca' gets defined as a macro. As a workaround,
+ include this <alloca.h> first and define 'alloca' as a macro afterwards
+ if needed. */
+# if defined __GNUC__ && (defined _WIN32 && ! defined __CYGWIN__) && @HAVE_ALLOCA_H@
+# include_next <alloca.h>
+# endif
+#endif
+#ifndef alloca
+# if defined __GNUC__ || (__clang_major__ >= 4)
+# define alloca __builtin_alloca
+# elif defined _AIX
+# define alloca __alloca
+# elif defined _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# elif defined __DECC && defined __VMS
+# define alloca __ALLOCA
+# elif defined __TANDEM && defined _TNS_E_TARGET
+# ifdef __cplusplus
+extern "C"
+# endif
+void *_alloca (unsigned short);
+# pragma intrinsic (_alloca)
+# define alloca _alloca
+# elif defined __MVS__
+# include <stdlib.h>
+# else
+# include <stddef.h>
+# ifdef __cplusplus
+extern "C"
+# endif
+void *alloca (size_t);
+# endif
+#endif
+
+#endif /* _GL_ALLOCA_H */
diff --git a/gl/lib/arg-nonnull.h b/gl/lib/arg-nonnull.h
new file mode 100644
index 0000000..e4513ef
--- /dev/null
+++ b/gl/lib/arg-nonnull.h
@@ -0,0 +1,26 @@
+/* A C macro for declaring that specific arguments must not be NULL.
+ Copyright (C) 2009-2022 Free Software Foundation, Inc.
+
+ This program 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 2 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
+ 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/>. */
+
+/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
+ that the values passed as arguments n, ..., m must be non-NULL pointers.
+ n = 1 stands for the first argument, n = 2 for the second argument etc. */
+#ifndef _GL_ARG_NONNULL
+# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__
+# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
+# else
+# define _GL_ARG_NONNULL(params)
+# endif
+#endif
diff --git a/gl/lib/argp-ba.c b/gl/lib/argp-ba.c
new file mode 100644
index 0000000..5e43c75
--- /dev/null
+++ b/gl/lib/argp-ba.c
@@ -0,0 +1,34 @@
+/* Default definition for ARGP_PROGRAM_BUG_ADDRESS.
+ Copyright (C) 1996-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Written by Miles Bader <miles@gnu.ai.mit.edu>.
+
+ 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 set by the user program, it should point to string that is the
+ bug-reporting address for the program. It will be printed by argp_help if
+ the ARGP_HELP_BUG_ADDR flag is set (as it is by various standard help
+ messages), embedded in a sentence that says something like "Report bugs to
+ ADDR." */
+const char *argp_program_bug_address
+/* This variable should be zero-initialized. On most systems, putting it into
+ BSS is sufficient. Not so on Mac OS X 10.3 and 10.4, see
+ <https://lists.gnu.org/r/bug-gnulib/2009-01/msg00329.html>
+ <https://lists.gnu.org/r/bug-gnulib/2009-08/msg00096.html>. */
+#if defined __ELF__
+ /* On ELF systems, variables in BSS behave well. */
+#else
+ = (const char *) 0
+#endif
+ ;
diff --git a/gl/lib/argp-eexst.c b/gl/lib/argp-eexst.c
new file mode 100644
index 0000000..2f565d9
--- /dev/null
+++ b/gl/lib/argp-eexst.c
@@ -0,0 +1,30 @@
+/* Default definition for ARGP_ERR_EXIT_STATUS
+ Copyright (C) 1997, 2009-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Written by Miles Bader <miles@gnu.ai.mit.edu>.
+
+ 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/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <sysexits.h>
+
+#include "argp.h"
+
+/* The exit status that argp will use when exiting due to a parsing error.
+ If not defined or set by the user program, this defaults to EX_USAGE from
+ <sysexits.h>. */
+error_t argp_err_exit_status = EX_USAGE;
diff --git a/gl/lib/argp-fmtstream.c b/gl/lib/argp-fmtstream.c
new file mode 100644
index 0000000..78c29e3
--- /dev/null
+++ b/gl/lib/argp-fmtstream.c
@@ -0,0 +1,434 @@
+/* Word-wrapping and line-truncating streams
+ Copyright (C) 1997-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Written by Miles Bader <miles@gnu.ai.mit.edu>.
+
+ 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/>. */
+
+/* This package emulates glibc 'line_wrap_stream' semantics for systems that
+ don't have that. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <ctype.h>
+
+#include "argp-fmtstream.h"
+#include "argp-namefrob.h"
+
+#ifndef ARGP_FMTSTREAM_USE_LINEWRAP
+
+#ifndef isblank
+#define isblank(ch) ((ch)==' ' || (ch)=='\t')
+#endif
+
+#ifdef _LIBC
+# include <wchar.h>
+# include <libio/libioP.h>
+# define __vsnprintf(s, l, f, a) _IO_vsnprintf (s, l, f, a)
+#endif
+
+#define INIT_BUF_SIZE 200
+#define PRINTF_SIZE_GUESS 150
+
+/* Return an argp_fmtstream that outputs to STREAM, and which prefixes lines
+ written on it with LMARGIN spaces and limits them to RMARGIN columns
+ total. If WMARGIN >= 0, words that extend past RMARGIN are wrapped by
+ replacing the whitespace before them with a newline and WMARGIN spaces.
+ Otherwise, chars beyond RMARGIN are simply dropped until a newline.
+ Returns NULL if there was an error. */
+argp_fmtstream_t
+__argp_make_fmtstream (FILE *stream,
+ size_t lmargin, size_t rmargin, ssize_t wmargin)
+{
+ argp_fmtstream_t fs;
+
+ fs = (struct argp_fmtstream *) malloc (sizeof (struct argp_fmtstream));
+ if (fs != NULL)
+ {
+ fs->stream = stream;
+
+ fs->lmargin = lmargin;
+ fs->rmargin = rmargin;
+ fs->wmargin = wmargin;
+ fs->point_col = 0;
+ fs->point_offs = 0;
+
+ fs->buf = (char *) malloc (INIT_BUF_SIZE);
+ if (! fs->buf)
+ {
+ free (fs);
+ fs = 0;
+ }
+ else
+ {
+ fs->p = fs->buf;
+ fs->end = fs->buf + INIT_BUF_SIZE;
+ }
+ }
+
+ return fs;
+}
+#if 0
+/* Not exported. */
+#ifdef weak_alias
+weak_alias (__argp_make_fmtstream, argp_make_fmtstream)
+#endif
+#endif
+
+/* Flush FS to its stream, and free it (but don't close the stream). */
+void
+__argp_fmtstream_free (argp_fmtstream_t fs)
+{
+ __argp_fmtstream_update (fs);
+ if (fs->p > fs->buf)
+ {
+#ifdef _LIBC
+ __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf);
+#else
+ fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
+#endif
+ }
+ free (fs->buf);
+ free (fs);
+}
+#if 0
+/* Not exported. */
+#ifdef weak_alias
+weak_alias (__argp_fmtstream_free, argp_fmtstream_free)
+#endif
+#endif
+
+/* Process FS's buffer so that line wrapping is done from POINT_OFFS to the
+ end of its buffer. This code is mostly from glibc stdio/linewrap.c. */
+void
+__argp_fmtstream_update (argp_fmtstream_t fs)
+{
+ char *buf, *nl;
+ size_t len;
+
+ /* Scan the buffer for newlines. */
+ buf = fs->buf + fs->point_offs;
+ while (buf < fs->p)
+ {
+ size_t r;
+
+ if (fs->point_col == 0 && fs->lmargin != 0)
+ {
+ /* We are starting a new line. Print spaces to the left margin. */
+ const size_t pad = fs->lmargin;
+ if (fs->p + pad < fs->end)
+ {
+ /* We can fit in them in the buffer by moving the
+ buffer text up and filling in the beginning. */
+ memmove (buf + pad, buf, fs->p - buf);
+ fs->p += pad; /* Compensate for bigger buffer. */
+ memset (buf, ' ', pad); /* Fill in the spaces. */
+ buf += pad; /* Don't bother searching them. */
+ }
+ else
+ {
+ /* No buffer space for spaces. Must flush. */
+ size_t i;
+ for (i = 0; i < pad; i++)
+ {
+#ifdef _LIBC
+ if (_IO_fwide (fs->stream, 0) > 0)
+ putwc_unlocked (L' ', fs->stream);
+ else
+#endif
+ putc_unlocked (' ', fs->stream);
+ }
+ }
+ fs->point_col = pad;
+ }
+
+ len = fs->p - buf;
+ nl = memchr (buf, '\n', len);
+
+ if (fs->point_col < 0)
+ fs->point_col = 0;
+
+ if (!nl)
+ {
+ /* The buffer ends in a partial line. */
+
+ if (fs->point_col + len < fs->rmargin)
+ {
+ /* The remaining buffer text is a partial line and fits
+ within the maximum line width. Advance point for the
+ characters to be written and stop scanning. */
+ fs->point_col += len;
+ break;
+ }
+ else
+ /* Set the end-of-line pointer for the code below to
+ the end of the buffer. */
+ nl = fs->p;
+ }
+ else if (fs->point_col + (nl - buf) < (ssize_t) fs->rmargin)
+ {
+ /* The buffer contains a full line that fits within the maximum
+ line width. Reset point and scan the next line. */
+ fs->point_col = 0;
+ buf = nl + 1;
+ continue;
+ }
+
+ /* This line is too long. */
+ r = fs->rmargin - 1;
+
+ if (fs->wmargin < 0)
+ {
+ /* Truncate the line by overwriting the excess with the
+ newline and anything after it in the buffer. */
+ if (nl < fs->p)
+ {
+ memmove (buf + (r - fs->point_col), nl, fs->p - nl);
+ fs->p -= buf + (r - fs->point_col) - nl;
+ /* Reset point for the next line and start scanning it. */
+ fs->point_col = 0;
+ buf += r + 1; /* Skip full line plus \n. */
+ }
+ else
+ {
+ /* The buffer ends with a partial line that is beyond the
+ maximum line width. Advance point for the characters
+ written, and discard those past the max from the buffer. */
+ fs->point_col += len;
+ fs->p -= fs->point_col - r;
+ break;
+ }
+ }
+ else
+ {
+ /* Do word wrap. Go to the column just past the maximum line
+ width and scan back for the beginning of the word there.
+ Then insert a line break. */
+
+ char *p, *nextline;
+ int i;
+
+ p = buf + (r + 1 - fs->point_col);
+ while (p >= buf && !isblank ((unsigned char) *p))
+ --p;
+ nextline = p + 1; /* This will begin the next line. */
+
+ if (nextline > buf)
+ {
+ /* Swallow separating blanks. */
+ if (p >= buf)
+ do
+ --p;
+ while (p >= buf && isblank ((unsigned char) *p));
+ nl = p + 1; /* The newline will replace the first blank. */
+ }
+ else
+ {
+ /* A single word that is greater than the maximum line width.
+ Oh well. Put it on an overlong line by itself. */
+ p = buf + (r + 1 - fs->point_col);
+ /* Find the end of the long word. */
+ if (p < nl)
+ do
+ ++p;
+ while (p < nl && !isblank ((unsigned char) *p));
+ if (p == nl)
+ {
+ /* It already ends a line. No fussing required. */
+ fs->point_col = 0;
+ buf = nl + 1;
+ continue;
+ }
+ /* We will move the newline to replace the first blank. */
+ nl = p;
+ /* Swallow separating blanks. */
+ do
+ ++p;
+ while (isblank ((unsigned char) *p));
+ /* The next line will start here. */
+ nextline = p;
+ }
+
+ /* Note: There are a bunch of tests below for
+ NEXTLINE == BUF + LEN + 1; this case is where NL happens to fall
+ at the end of the buffer, and NEXTLINE is in fact empty (and so
+ we need not be careful to maintain its contents). */
+
+ if ((nextline == buf + len + 1
+ ? fs->end - nl < fs->wmargin + 1
+ : nextline - (nl + 1) < fs->wmargin)
+ && fs->p > nextline)
+ {
+ /* The margin needs more blanks than we removed. */
+ if (fs->end - fs->p > fs->wmargin + 1)
+ /* Make some space for them. */
+ {
+ size_t mv = fs->p - nextline;
+ memmove (nl + 1 + fs->wmargin, nextline, mv);
+ nextline = nl + 1 + fs->wmargin;
+ len = nextline + mv - buf;
+ *nl++ = '\n';
+ }
+ else
+ /* Output the first line so we can use the space. */
+ {
+#ifdef _LIBC
+ __fxprintf (fs->stream, "%.*s\n",
+ (int) (nl - fs->buf), fs->buf);
+#else
+ if (nl > fs->buf)
+ fwrite_unlocked (fs->buf, 1, nl - fs->buf, fs->stream);
+ putc_unlocked ('\n', fs->stream);
+#endif
+
+ len += buf - fs->buf;
+ nl = buf = fs->buf;
+ }
+ }
+ else
+ /* We can fit the newline and blanks in before
+ the next word. */
+ *nl++ = '\n';
+
+ if (nextline - nl >= fs->wmargin
+ || (nextline == buf + len + 1 && fs->end - nextline >= fs->wmargin))
+ /* Add blanks up to the wrap margin column. */
+ for (i = 0; i < fs->wmargin; ++i)
+ *nl++ = ' ';
+ else
+ for (i = 0; i < fs->wmargin; ++i)
+#ifdef _LIBC
+ if (_IO_fwide (fs->stream, 0) > 0)
+ putwc_unlocked (L' ', fs->stream);
+ else
+#endif
+ putc_unlocked (' ', fs->stream);
+
+ /* Copy the tail of the original buffer into the current buffer
+ position. */
+ if (nl < nextline)
+ memmove (nl, nextline, buf + len - nextline);
+ len -= nextline - buf;
+
+ /* Continue the scan on the remaining lines in the buffer. */
+ buf = nl;
+
+ /* Restore bufp to include all the remaining text. */
+ fs->p = nl + len;
+
+ /* Reset the counter of what has been output this line. If wmargin
+ is 0, we want to avoid the lmargin getting added, so we set
+ point_col to a magic value of -1 in that case. */
+ fs->point_col = fs->wmargin ? fs->wmargin : -1;
+ }
+ }
+
+ /* Remember that we've scanned as far as the end of the buffer. */
+ fs->point_offs = fs->p - fs->buf;
+}
+
+/* Ensure that FS has space for AMOUNT more bytes in its buffer, either by
+ growing the buffer, or by flushing it. True is returned iff we succeed. */
+int
+__argp_fmtstream_ensure (struct argp_fmtstream *fs, size_t amount)
+{
+ if ((size_t) (fs->end - fs->p) < amount)
+ {
+ ssize_t wrote;
+
+ /* Flush FS's buffer. */
+ __argp_fmtstream_update (fs);
+
+#ifdef _LIBC
+ __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf);
+ wrote = fs->p - fs->buf;
+#else
+ wrote = fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
+#endif
+ if (wrote == fs->p - fs->buf)
+ {
+ fs->p = fs->buf;
+ fs->point_offs = 0;
+ }
+ else
+ {
+ fs->p -= wrote;
+ fs->point_offs -= wrote;
+ memmove (fs->buf, fs->buf + wrote, fs->p - fs->buf);
+ return 0;
+ }
+
+ if ((size_t) (fs->end - fs->buf) < amount)
+ /* Gotta grow the buffer. */
+ {
+ size_t old_size = fs->end - fs->buf;
+ size_t new_size = old_size + amount;
+ char *new_buf;
+
+ if (new_size < old_size || ! (new_buf = realloc (fs->buf, new_size)))
+ {
+ __set_errno (ENOMEM);
+ return 0;
+ }
+
+ fs->buf = new_buf;
+ fs->end = new_buf + new_size;
+ fs->p = fs->buf;
+ }
+ }
+
+ return 1;
+}
+
+ssize_t
+__argp_fmtstream_printf (struct argp_fmtstream *fs, const char *fmt, ...)
+{
+ int out;
+ size_t avail;
+ size_t size_guess = PRINTF_SIZE_GUESS; /* How much space to reserve. */
+
+ do
+ {
+ va_list args;
+
+ if (! __argp_fmtstream_ensure (fs, size_guess))
+ return -1;
+
+ va_start (args, fmt);
+ avail = fs->end - fs->p;
+ out = __vsnprintf (fs->p, avail, fmt, args);
+ va_end (args);
+ if ((size_t) out >= avail)
+ size_guess = out + 1;
+ }
+ while ((size_t) out >= avail);
+
+ fs->p += out;
+
+ return out;
+}
+#if 0
+/* Not exported. */
+#ifdef weak_alias
+weak_alias (__argp_fmtstream_printf, argp_fmtstream_printf)
+#endif
+#endif
+
+#endif /* !ARGP_FMTSTREAM_USE_LINEWRAP */
diff --git a/gl/lib/argp-fmtstream.h b/gl/lib/argp-fmtstream.h
new file mode 100644
index 0000000..0540b56
--- /dev/null
+++ b/gl/lib/argp-fmtstream.h
@@ -0,0 +1,300 @@
+/* Word-wrapping and line-truncating streams.
+ Copyright (C) 1997-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Written by Miles Bader <miles@gnu.ai.mit.edu>.
+
+ 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/>. */
+
+/* This package emulates glibc 'line_wrap_stream' semantics for systems that
+ don't have that. If the system does have it, it is just a wrapper for
+ that. This header file is only used internally while compiling argp, and
+ shouldn't be installed. */
+
+#ifndef _ARGP_FMTSTREAM_H
+#define _ARGP_FMTSTREAM_H
+
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#if defined (__GNU_LIBRARY__) && defined (HAVE_LINEWRAP_H)
+/* line_wrap_stream is available, so use that. */
+#define ARGP_FMTSTREAM_USE_LINEWRAP
+#endif
+
+#ifdef ARGP_FMTSTREAM_USE_LINEWRAP
+/* Just be a simple wrapper for line_wrap_stream; the semantics are
+ *slightly* different, as line_wrap_stream doesn't actually make a new
+ object, it just modifies the given stream (reversibly) to do
+ line-wrapping. Since we control who uses this code, it doesn't matter. */
+
+#include <linewrap.h>
+
+typedef FILE *argp_fmtstream_t;
+
+#define argp_make_fmtstream line_wrap_stream
+#define __argp_make_fmtstream line_wrap_stream
+#define argp_fmtstream_free line_unwrap_stream
+#define __argp_fmtstream_free line_unwrap_stream
+
+#define __argp_fmtstream_putc(fs,ch) putc(ch,fs)
+#define argp_fmtstream_putc(fs,ch) putc(ch,fs)
+#define __argp_fmtstream_puts(fs,str) fputs(str,fs)
+#define argp_fmtstream_puts(fs,str) fputs(str,fs)
+#define __argp_fmtstream_write(fs,str,len) fwrite(str,1,len,fs)
+#define argp_fmtstream_write(fs,str,len) fwrite(str,1,len,fs)
+#define __argp_fmtstream_printf fprintf
+#define argp_fmtstream_printf fprintf
+
+#define __argp_fmtstream_lmargin line_wrap_lmargin
+#define argp_fmtstream_lmargin line_wrap_lmargin
+#define __argp_fmtstream_set_lmargin line_wrap_set_lmargin
+#define argp_fmtstream_set_lmargin line_wrap_set_lmargin
+#define __argp_fmtstream_rmargin line_wrap_rmargin
+#define argp_fmtstream_rmargin line_wrap_rmargin
+#define __argp_fmtstream_set_rmargin line_wrap_set_rmargin
+#define argp_fmtstream_set_rmargin line_wrap_set_rmargin
+#define __argp_fmtstream_wmargin line_wrap_wmargin
+#define argp_fmtstream_wmargin line_wrap_wmargin
+#define __argp_fmtstream_set_wmargin line_wrap_set_wmargin
+#define argp_fmtstream_set_wmargin line_wrap_set_wmargin
+#define __argp_fmtstream_point line_wrap_point
+#define argp_fmtstream_point line_wrap_point
+
+#else /* !ARGP_FMTSTREAM_USE_LINEWRAP */
+/* Guess we have to define our own version. */
+
+
+struct argp_fmtstream
+{
+ FILE *stream; /* The stream we're outputting to. */
+
+ size_t lmargin, rmargin; /* Left and right margins. */
+ ssize_t wmargin; /* Margin to wrap to, or -1 to truncate. */
+
+ /* Point in buffer to which we've processed for wrapping, but not output. */
+ size_t point_offs;
+ /* Output column at POINT_OFFS, or -1 meaning 0 but don't add lmargin. */
+ ssize_t point_col;
+
+ char *buf; /* Output buffer. */
+ char *p; /* Current end of text in BUF. */
+ char *end; /* Absolute end of BUF. */
+};
+
+typedef struct argp_fmtstream *argp_fmtstream_t;
+
+/* Flush __FS to its stream, and free it (but don't close the stream). */
+extern void __argp_fmtstream_free (argp_fmtstream_t __fs);
+extern void argp_fmtstream_free (argp_fmtstream_t __fs);
+
+/* Return an argp_fmtstream that outputs to STREAM, and which prefixes lines
+ written on it with LMARGIN spaces and limits them to RMARGIN columns
+ total. If WMARGIN >= 0, words that extend past RMARGIN are wrapped by
+ replacing the whitespace before them with a newline and WMARGIN spaces.
+ Otherwise, chars beyond RMARGIN are simply dropped until a newline.
+ Returns NULL if there was an error. */
+extern argp_fmtstream_t __argp_make_fmtstream (FILE *__stream,
+ size_t __lmargin,
+ size_t __rmargin,
+ ssize_t __wmargin)
+ _GL_ATTRIBUTE_DEALLOC (__argp_fmtstream_free, 1);
+extern argp_fmtstream_t argp_make_fmtstream (FILE *__stream,
+ size_t __lmargin,
+ size_t __rmargin,
+ ssize_t __wmargin)
+ _GL_ATTRIBUTE_DEALLOC (argp_fmtstream_free, 1);
+
+extern ssize_t __argp_fmtstream_printf (argp_fmtstream_t __fs,
+ const char *__fmt, ...)
+ _GL_ATTRIBUTE_FORMAT ((printf, 2, 3));
+extern ssize_t argp_fmtstream_printf (argp_fmtstream_t __fs,
+ const char *__fmt, ...)
+ _GL_ATTRIBUTE_FORMAT ((printf, 2, 3));
+
+#if _LIBC
+extern int __argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
+extern int argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
+
+extern int __argp_fmtstream_puts (argp_fmtstream_t __fs, const char *__str);
+extern int argp_fmtstream_puts (argp_fmtstream_t __fs, const char *__str);
+
+extern size_t __argp_fmtstream_write (argp_fmtstream_t __fs,
+ const char *__str, size_t __len);
+extern size_t argp_fmtstream_write (argp_fmtstream_t __fs,
+ const char *__str, size_t __len);
+#endif
+
+/* Access macros for various bits of state. */
+#define argp_fmtstream_lmargin(__fs) ((__fs)->lmargin)
+#define argp_fmtstream_rmargin(__fs) ((__fs)->rmargin)
+#define argp_fmtstream_wmargin(__fs) ((__fs)->wmargin)
+#define __argp_fmtstream_lmargin argp_fmtstream_lmargin
+#define __argp_fmtstream_rmargin argp_fmtstream_rmargin
+#define __argp_fmtstream_wmargin argp_fmtstream_wmargin
+
+#if _LIBC
+/* Set __FS's left margin to LMARGIN and return the old value. */
+extern size_t argp_fmtstream_set_lmargin (argp_fmtstream_t __fs,
+ size_t __lmargin);
+extern size_t __argp_fmtstream_set_lmargin (argp_fmtstream_t __fs,
+ size_t __lmargin);
+
+/* Set __FS's right margin to __RMARGIN and return the old value. */
+extern size_t argp_fmtstream_set_rmargin (argp_fmtstream_t __fs,
+ size_t __rmargin);
+extern size_t __argp_fmtstream_set_rmargin (argp_fmtstream_t __fs,
+ size_t __rmargin);
+
+/* Set __FS's wrap margin to __WMARGIN and return the old value. */
+extern size_t argp_fmtstream_set_wmargin (argp_fmtstream_t __fs,
+ size_t __wmargin);
+extern size_t __argp_fmtstream_set_wmargin (argp_fmtstream_t __fs,
+ size_t __wmargin);
+
+/* Return the column number of the current output point in __FS. */
+extern size_t argp_fmtstream_point (argp_fmtstream_t __fs);
+extern size_t __argp_fmtstream_point (argp_fmtstream_t __fs);
+#endif
+
+/* Internal routines. */
+extern void _argp_fmtstream_update (argp_fmtstream_t __fs);
+extern void __argp_fmtstream_update (argp_fmtstream_t __fs);
+extern int _argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
+extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
+
+#if !_LIBC || defined __OPTIMIZE__
+/* Inline versions of above routines. */
+
+#if !_LIBC
+#define __argp_fmtstream_putc argp_fmtstream_putc
+#define __argp_fmtstream_puts argp_fmtstream_puts
+#define __argp_fmtstream_write argp_fmtstream_write
+#define __argp_fmtstream_set_lmargin argp_fmtstream_set_lmargin
+#define __argp_fmtstream_set_rmargin argp_fmtstream_set_rmargin
+#define __argp_fmtstream_set_wmargin argp_fmtstream_set_wmargin
+#define __argp_fmtstream_point argp_fmtstream_point
+#define __argp_fmtstream_update _argp_fmtstream_update
+#define __argp_fmtstream_ensure _argp_fmtstream_ensure
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef ARGP_FS_EI
+# define ARGP_FS_EI _GL_INLINE
+#endif
+#endif
+
+#ifndef ARGP_FS_EI
+#define ARGP_FS_EI extern inline
+#endif
+
+ARGP_FS_EI size_t
+__argp_fmtstream_write (argp_fmtstream_t __fs, const char *__str, size_t __len)
+{
+ if (__fs->p + __len <= __fs->end || __argp_fmtstream_ensure (__fs, __len))
+ {
+ memcpy (__fs->p, __str, __len);
+ __fs->p += __len;
+ return __len;
+ }
+ else
+ return 0;
+}
+
+ARGP_FS_EI int
+__argp_fmtstream_puts (argp_fmtstream_t __fs, const char *__str)
+{
+ size_t __len = strlen (__str);
+ if (__len)
+ {
+ size_t __wrote = __argp_fmtstream_write (__fs, __str, __len);
+ return __wrote == __len ? 0 : -1;
+ }
+ else
+ return 0;
+}
+
+ARGP_FS_EI int
+__argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch)
+{
+ if (__fs->p < __fs->end || __argp_fmtstream_ensure (__fs, 1))
+ return *__fs->p++ = __ch;
+ else
+ return EOF;
+}
+
+/* Set __FS's left margin to __LMARGIN and return the old value. */
+ARGP_FS_EI size_t
+__argp_fmtstream_set_lmargin (argp_fmtstream_t __fs, size_t __lmargin)
+{
+ size_t __old;
+ if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
+ __argp_fmtstream_update (__fs);
+ __old = __fs->lmargin;
+ __fs->lmargin = __lmargin;
+ return __old;
+}
+
+/* Set __FS's right margin to __RMARGIN and return the old value. */
+ARGP_FS_EI size_t
+__argp_fmtstream_set_rmargin (argp_fmtstream_t __fs, size_t __rmargin)
+{
+ size_t __old;
+ if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
+ __argp_fmtstream_update (__fs);
+ __old = __fs->rmargin;
+ __fs->rmargin = __rmargin;
+ return __old;
+}
+
+/* Set FS's wrap margin to __WMARGIN and return the old value. */
+ARGP_FS_EI size_t
+__argp_fmtstream_set_wmargin (argp_fmtstream_t __fs, size_t __wmargin)
+{
+ size_t __old;
+ if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
+ __argp_fmtstream_update (__fs);
+ __old = __fs->wmargin;
+ __fs->wmargin = __wmargin;
+ return __old;
+}
+
+/* Return the column number of the current output point in __FS. */
+ARGP_FS_EI size_t
+__argp_fmtstream_point (argp_fmtstream_t __fs)
+{
+ if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
+ __argp_fmtstream_update (__fs);
+ return __fs->point_col >= 0 ? __fs->point_col : 0;
+}
+
+#if !_LIBC
+#undef __argp_fmtstream_putc
+#undef __argp_fmtstream_puts
+#undef __argp_fmtstream_write
+#undef __argp_fmtstream_set_lmargin
+#undef __argp_fmtstream_set_rmargin
+#undef __argp_fmtstream_set_wmargin
+#undef __argp_fmtstream_point
+#undef __argp_fmtstream_update
+#undef __argp_fmtstream_ensure
+_GL_INLINE_HEADER_END
+#endif
+
+#endif /* !_LIBC || __OPTIMIZE__ */
+
+#endif /* ARGP_FMTSTREAM_USE_LINEWRAP */
+
+#endif /* argp-fmtstream.h */
diff --git a/gl/lib/argp-fs-xinl.c b/gl/lib/argp-fs-xinl.c
new file mode 100644
index 0000000..ea037f6
--- /dev/null
+++ b/gl/lib/argp-fs-xinl.c
@@ -0,0 +1,46 @@
+/* Real definitions for extern inline functions in argp-fmtstream.h
+ Copyright (C) 1997-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Written by Miles Bader <miles@gnu.ai.mit.edu>.
+
+ 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/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef _LIBC
+# define ARGP_FS_EI
+#else
+# define ARGP_FS_EI _GL_EXTERN_INLINE
+#endif
+#undef __OPTIMIZE__
+#define __OPTIMIZE__ 1
+#include "argp-fmtstream.h"
+
+#if 0
+/* Not exported. */
+/* Add weak aliases. */
+#if _LIBC - 0 && !defined (ARGP_FMTSTREAM_USE_LINEWRAP) && defined (weak_alias)
+
+weak_alias (__argp_fmtstream_putc, argp_fmtstream_putc)
+weak_alias (__argp_fmtstream_puts, argp_fmtstream_puts)
+weak_alias (__argp_fmtstream_write, argp_fmtstream_write)
+weak_alias (__argp_fmtstream_set_lmargin, argp_fmtstream_set_lmargin)
+weak_alias (__argp_fmtstream_set_rmargin, argp_fmtstream_set_rmargin)
+weak_alias (__argp_fmtstream_set_wmargin, argp_fmtstream_set_wmargin)
+weak_alias (__argp_fmtstream_point, argp_fmtstream_point)
+
+#endif
+#endif
diff --git a/gl/lib/argp-help.c b/gl/lib/argp-help.c
new file mode 100644
index 0000000..397017f
--- /dev/null
+++ b/gl/lib/argp-help.c
@@ -0,0 +1,2034 @@
+/* Hierarchical argument parsing help output
+ Copyright (C) 1995-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Written by Miles Bader <miles@gnu.ai.mit.edu>.
+
+ 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/>. */
+
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <alloca.h>
+#include <errno.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <strings.h>
+#include <assert.h>
+#include <stdarg.h>
+#include <ctype.h>
+#include <limits.h>
+#ifdef _LIBC
+# include <../libio/libioP.h>
+# include <wchar.h>
+#endif
+
+#ifdef _LIBC
+# include <libintl.h>
+# undef dgettext
+# define dgettext(domain, msgid) \
+ __dcgettext (domain, msgid, LC_MESSAGES)
+#else
+# include "gettext.h"
+#endif
+
+#ifdef _LIBC
+# define ARGP_TEXT_DOMAIN "libc"
+#else
+# ifdef DEFAULT_TEXT_DOMAIN
+# define ARGP_TEXT_DOMAIN DEFAULT_TEXT_DOMAIN
+# else
+# define ARGP_TEXT_DOMAIN NULL
+# endif
+#endif
+
+#include "argp.h"
+#include "argp-fmtstream.h"
+#include "argp-namefrob.h"
+
+#ifndef SIZE_MAX
+# define SIZE_MAX ((size_t) -1)
+#endif
+
+/* ========================================================================== */
+
+/* User-selectable (using an environment variable) formatting parameters.
+
+ These may be specified in an environment variable called 'ARGP_HELP_FMT',
+ with a contents like: VAR1=VAL1,VAR2=VAL2,BOOLVAR2,no-BOOLVAR2
+ Where VALn must be a positive integer. The list of variables is in the
+ UPARAM_NAMES vector, below. */
+
+/* Default parameters. */
+#define DUP_ARGS 0 /* True if option argument can be duplicated. */
+#define DUP_ARGS_NOTE 1 /* True to print a note about duplicate args. */
+#define SHORT_OPT_COL 2 /* column in which short options start */
+#define LONG_OPT_COL 6 /* column in which long options start */
+#define DOC_OPT_COL 2 /* column in which doc options start */
+#define OPT_DOC_COL 29 /* column in which option text starts */
+#define HEADER_COL 1 /* column in which group headers are printed */
+#define USAGE_INDENT 12 /* indentation of wrapped usage lines */
+#define RMARGIN 79 /* right margin used for wrapping */
+
+/* User-selectable (using an environment variable) formatting parameters.
+ They must all be of type 'int' for the parsing code to work. */
+struct uparams
+{
+ /* If true, arguments for an option are shown with both short and long
+ options, even when a given option has both, e.g. '-x ARG, --longx=ARG'.
+ If false, then if an option has both, the argument is only shown with
+ the long one, e.g., '-x, --longx=ARG', and a message indicating that
+ this really means both is printed below the options. */
+ int dup_args;
+
+ /* This is true if when DUP_ARGS is false, and some duplicate arguments have
+ been suppressed, an explanatory message should be printed. */
+ int dup_args_note;
+
+ /* Various output columns. */
+ int short_opt_col; /* column in which short options start */
+ int long_opt_col; /* column in which long options start */
+ int doc_opt_col; /* column in which doc options start */
+ int opt_doc_col; /* column in which option text starts */
+ int header_col; /* column in which group headers are printed */
+ int usage_indent; /* indentation of wrapped usage lines */
+ int rmargin; /* right margin used for wrapping */
+
+ int valid; /* True when the values in here are valid. */
+};
+
+/* This is a global variable, as user options are only ever read once. */
+static struct uparams uparams = {
+ DUP_ARGS, DUP_ARGS_NOTE,
+ SHORT_OPT_COL, LONG_OPT_COL, DOC_OPT_COL, OPT_DOC_COL, HEADER_COL,
+ USAGE_INDENT, RMARGIN
+};
+
+/* A particular uparam, and what the user name is. */
+struct uparam_name
+{
+ const char name[14]; /* User name. */
+ bool is_bool; /* Whether it's 'boolean'. */
+ unsigned char uparams_offs; /* Location of the (int) field in UPARAMS. */
+};
+
+/* The name-field mappings we know about. */
+static const struct uparam_name uparam_names[] =
+{
+ { "dup-args", true, offsetof (struct uparams, dup_args) },
+ { "dup-args-note", true, offsetof (struct uparams, dup_args_note) },
+ { "short-opt-col", false, offsetof (struct uparams, short_opt_col) },
+ { "long-opt-col", false, offsetof (struct uparams, long_opt_col) },
+ { "doc-opt-col", false, offsetof (struct uparams, doc_opt_col) },
+ { "opt-doc-col", false, offsetof (struct uparams, opt_doc_col) },
+ { "header-col", false, offsetof (struct uparams, header_col) },
+ { "usage-indent", false, offsetof (struct uparams, usage_indent) },
+ { "rmargin", false, offsetof (struct uparams, rmargin) }
+};
+#define nuparam_names (sizeof (uparam_names) / sizeof (uparam_names[0]))
+
+static void
+validate_uparams (const struct argp_state *state, struct uparams *upptr)
+{
+ const struct uparam_name *up;
+
+ for (up = uparam_names; up < uparam_names + nuparam_names; up++)
+ {
+ if (up->is_bool
+ || up->uparams_offs == offsetof (struct uparams, rmargin))
+ continue;
+ if (*(int *)((char *)upptr + up->uparams_offs) >= upptr->rmargin)
+ {
+ __argp_failure (state, 0, 0,
+ dgettext (state == NULL ? NULL
+ : ARGP_TEXT_DOMAIN,
+ "\
+ARGP_HELP_FMT: %s value is less than or equal to %s"),
+ "rmargin", up->name);
+ return;
+ }
+ }
+ uparams = *upptr;
+ uparams.valid = 1;
+}
+
+/* Read user options from the environment, and fill in UPARAMS appropriately. */
+static void
+fill_in_uparams (const struct argp_state *state)
+{
+ const char *var = getenv ("ARGP_HELP_FMT");
+ struct uparams new_params = uparams;
+
+#define SKIPWS(p) do { while (isspace ((unsigned char) *p)) p++; } while (0);
+
+ if (var)
+ {
+ /* Parse var. */
+ while (*var)
+ {
+ SKIPWS (var);
+
+ if (isalpha ((unsigned char) *var))
+ {
+ size_t var_len;
+ const struct uparam_name *un;
+ int unspec = 0, val = 0;
+ const char *arg = var;
+
+ while (isalnum ((unsigned char) *arg) || *arg == '-' || *arg == '_')
+ arg++;
+ var_len = arg - var;
+
+ SKIPWS (arg);
+
+ if (*arg == '\0' || *arg == ',')
+ unspec = 1;
+ else if (*arg == '=')
+ {
+ arg++;
+ SKIPWS (arg);
+ }
+
+ if (unspec)
+ {
+ if (var[0] == 'n' && var[1] == 'o' && var[2] == '-')
+ {
+ val = 0;
+ var += 3;
+ var_len -= 3;
+ }
+ else
+ val = 1;
+ }
+ else if (isdigit ((unsigned char) *arg))
+ {
+ val = atoi (arg);
+ while (isdigit ((unsigned char) *arg))
+ arg++;
+ SKIPWS (arg);
+ }
+
+ for (un = uparam_names;
+ un < uparam_names + nuparam_names;
+ un++)
+ if (strlen (un->name) == var_len
+ && strncmp (var, un->name, var_len) == 0)
+ {
+ if (unspec && !un->is_bool)
+ __argp_failure (state, 0, 0,
+ dgettext (state == NULL ? NULL
+ : ARGP_TEXT_DOMAIN,
+ "\
+%.*s: ARGP_HELP_FMT parameter requires a value"),
+ (int) var_len, var);
+ else
+ *(int *)((char *)&new_params + un->uparams_offs) = val;
+ break;
+ }
+ if (un == uparam_names + nuparam_names)
+ __argp_failure (state, 0, 0,
+ dgettext (state == NULL ? NULL
+ : ARGP_TEXT_DOMAIN, "\
+%.*s: Unknown ARGP_HELP_FMT parameter"),
+ (int) var_len, var);
+
+ var = arg;
+ if (*var == ',')
+ var++;
+ }
+ else if (*var)
+ {
+ __argp_failure (state, 0, 0,
+ dgettext (state == NULL ? NULL
+ : ARGP_TEXT_DOMAIN,
+ "Garbage in ARGP_HELP_FMT: %s"), var);
+ break;
+ }
+ }
+ validate_uparams (state, &new_params);
+ }
+}
+
+/* ========================================================================== */
+
+/* Returns true if OPT hasn't been marked invisible. Visibility only affects
+ whether OPT is displayed or used in sorting, not option shadowing. */
+#define ovisible(opt) (! ((opt)->flags & OPTION_HIDDEN))
+
+/* Returns true if OPT is an alias for an earlier option. */
+#define oalias(opt) ((opt)->flags & OPTION_ALIAS)
+
+/* Returns true if OPT is a documentation-only entry. */
+#define odoc(opt) ((opt)->flags & OPTION_DOC)
+
+/* Returns true if OPT should not be translated */
+#define onotrans(opt) ((opt)->flags & OPTION_NO_TRANS)
+
+/* Returns true if OPT is the end-of-list marker for a list of options. */
+#define oend(opt) __option_is_end (opt)
+
+/* Returns true if OPT has a short option. */
+#define oshort(opt) __option_is_short (opt)
+
+/*
+ The help format for a particular option is like:
+
+ -xARG, -yARG, --long1=ARG, --long2=ARG Documentation...
+
+ Where ARG will be omitted if there's no argument, for this option, or
+ will be surrounded by "[" and "]" appropriately if the argument is
+ optional. The documentation string is word-wrapped appropriately, and if
+ the list of options is long enough, it will be started on a separate line.
+ If there are no short options for a given option, the first long option is
+ indented slightly in a way that's supposed to make most long options appear
+ to be in a separate column.
+
+ For example, the following output (from ps):
+
+ -p PID, --pid=PID List the process PID
+ --pgrp=PGRP List processes in the process group PGRP
+ -P, -x, --no-parent Include processes without parents
+ -Q, --all-fields Don't elide unusable fields (normally if there's
+ some reason ps can't print a field for any
+ process, it's removed from the output entirely)
+ -r, --reverse, --gratuitously-long-reverse-option
+ Reverse the order of any sort
+ --session[=SID] Add the processes from the session SID (which
+ defaults to the sid of the current process)
+
+ Here are some more options:
+ -f ZOT, --foonly=ZOT Glork a foonly
+ -z, --zaza Snit a zar
+
+ -?, --help Give this help list
+ --usage Give a short usage message
+ -V, --version Print program version
+
+ The struct argp_option array for the above could look like:
+
+ {
+ {"pid", 'p', "PID", 0, "List the process PID"},
+ {"pgrp", OPT_PGRP, "PGRP", 0, "List processes in the process group PGRP"},
+ {"no-parent", 'P', 0, 0, "Include processes without parents"},
+ {0, 'x', 0, OPTION_ALIAS},
+ {"all-fields",'Q', 0, 0, "Don't elide unusable fields (normally"
+ " if there's some reason ps can't"
+ " print a field for any process, it's"
+ " removed from the output entirely)" },
+ {"reverse", 'r', 0, 0, "Reverse the order of any sort"},
+ {"gratuitously-long-reverse-option", 0, 0, OPTION_ALIAS},
+ {"session", OPT_SESS, "SID", OPTION_ARG_OPTIONAL,
+ "Add the processes from the session"
+ " SID (which defaults to the sid of"
+ " the current process)" },
+
+ {0,0,0,0, "Here are some more options:"},
+ {"foonly", 'f', "ZOT", 0, "Glork a foonly"},
+ {"zaza", 'z', 0, 0, "Snit a zar"},
+
+ {0}
+ }
+
+ Note that the last three options are automatically supplied by argp_parse,
+ unless you tell it not to with ARGP_NO_HELP.
+
+*/
+
+/* Returns true if CH occurs between BEG and END. */
+static int
+find_char (char ch, char *beg, char *end)
+{
+ while (beg < end)
+ if (*beg == ch)
+ return 1;
+ else
+ beg++;
+ return 0;
+}
+
+/* -------------------------------------------------------------------------- */
+/* Data structure: HOL = Help Option List */
+
+struct hol_cluster; /* fwd decl */
+
+struct hol_entry
+{
+ /* First option. */
+ const struct argp_option *opt;
+ /* Number of options (including aliases). */
+ unsigned num;
+
+ /* A pointers into the HOL's short_options field, to the first short option
+ letter for this entry. The order of the characters following this point
+ corresponds to the order of options pointed to by OPT, and there are at
+ most NUM. A short option recorded in an option following OPT is only
+ valid if it occurs in the right place in SHORT_OPTIONS (otherwise it's
+ probably been shadowed by some other entry). */
+ char *short_options;
+
+ /* Entries are sorted by their group first, in the order:
+ 0, 1, 2, ..., n, -m, ..., -2, -1
+ and then alphabetically within each group. The default is 0. */
+ int group;
+
+ /* The cluster of options this entry belongs to, or NULL if none. */
+ struct hol_cluster *cluster;
+
+ /* The argp from which this option came. */
+ const struct argp *argp;
+
+ /* Position in the array */
+ unsigned ord;
+};
+
+/* A cluster of entries to reflect the argp tree structure. */
+struct hol_cluster
+{
+ /* A descriptive header printed before options in this cluster. */
+ const char *header;
+
+ /* Used to order clusters within the same group with the same parent,
+ according to the order in which they occurred in the parent argp's child
+ list. */
+ int index;
+
+ /* How to sort this cluster with respect to options and other clusters at the
+ same depth (clusters always follow options in the same group). */
+ int group;
+
+ /* The cluster to which this cluster belongs, or NULL if it's at the base
+ level. */
+ struct hol_cluster *parent;
+
+ /* The argp from which this cluster is (eventually) derived. */
+ const struct argp *argp;
+
+ /* The distance this cluster is from the root. */
+ int depth;
+
+ /* Clusters in a given hol are kept in a linked list, to make freeing them
+ possible. */
+ struct hol_cluster *next;
+};
+
+/* A list of options for help. */
+struct hol
+{
+ /* An array of hol_entry's. */
+ struct hol_entry *entries;
+ /* The number of entries in this hol. If this field is zero, the others
+ are undefined. */
+ unsigned num_entries;
+
+ /* A string containing all short options in this HOL. Each entry contains
+ pointers into this string, so the order can't be messed with blindly. */
+ char *short_options;
+
+ /* Clusters of entries in this hol. */
+ struct hol_cluster *clusters;
+};
+
+/* Create a struct hol from the options in ARGP. CLUSTER is the
+ hol_cluster in which these entries occur, or NULL if at the root. */
+static struct hol *
+make_hol (const struct argp *argp, struct hol_cluster *cluster)
+{
+ char *so;
+ const struct argp_option *o;
+ const struct argp_option *opts = argp->options;
+ struct hol_entry *entry;
+ unsigned num_short_options = 0;
+ struct hol *hol = malloc (sizeof (struct hol));
+
+ assert (hol);
+
+ hol->num_entries = 0;
+ hol->clusters = 0;
+
+ if (opts)
+ {
+ int cur_group = 0;
+
+ /* The first option must not be an alias. */
+ assert (! oalias (opts));
+
+ /* Calculate the space needed. */
+ for (o = opts; ! oend (o); o++)
+ {
+ if (! oalias (o))
+ hol->num_entries++;
+ if (oshort (o))
+ num_short_options++; /* This is an upper bound. */
+ }
+
+ hol->entries = malloc (sizeof (struct hol_entry) * hol->num_entries);
+ hol->short_options = malloc (num_short_options + 1);
+
+ assert (hol->entries && hol->short_options);
+ if (SIZE_MAX <= UINT_MAX)
+ assert (hol->num_entries <= SIZE_MAX / sizeof (struct hol_entry));
+
+ /* Fill in the entries. */
+ so = hol->short_options;
+ for (o = opts, entry = hol->entries; ! oend (o); entry++)
+ {
+ entry->opt = o;
+ entry->num = 0;
+ entry->short_options = so;
+ entry->group = cur_group =
+ o->group
+ ? o->group
+ : ((!o->name && !o->key)
+ ? cur_group + 1
+ : cur_group);
+ entry->cluster = cluster;
+ entry->argp = argp;
+
+ do
+ {
+ entry->num++;
+ if (oshort (o) && ! find_char (o->key, hol->short_options, so))
+ /* O has a valid short option which hasn't already been used.*/
+ *so++ = o->key;
+ o++;
+ }
+ while (! oend (o) && oalias (o));
+ }
+ *so = '\0'; /* null terminated so we can find the length */
+ }
+
+ return hol;
+}
+
+/* Add a new cluster to HOL, with the given GROUP and HEADER (taken from the
+ associated argp child list entry), INDEX, and PARENT, and return a pointer
+ to it. ARGP is the argp that this cluster results from. */
+static struct hol_cluster *
+hol_add_cluster (struct hol *hol, int group, const char *header, int index,
+ struct hol_cluster *parent, const struct argp *argp)
+{
+ struct hol_cluster *cl = malloc (sizeof (struct hol_cluster));
+ if (cl)
+ {
+ cl->group = group;
+ cl->header = header;
+
+ cl->index = index;
+ cl->parent = parent;
+ cl->argp = argp;
+ cl->depth = parent ? parent->depth + 1 : 0;
+
+ cl->next = hol->clusters;
+ hol->clusters = cl;
+ }
+ return cl;
+}
+
+/* Free HOL and any resources it uses. */
+static void
+hol_free (struct hol *hol)
+{
+ struct hol_cluster *cl = hol->clusters;
+
+ while (cl)
+ {
+ struct hol_cluster *next = cl->next;
+ free (cl);
+ cl = next;
+ }
+
+ if (hol->num_entries > 0)
+ {
+ free (hol->entries);
+ free (hol->short_options);
+ }
+
+ free (hol);
+}
+
+/* Iterate across the short_options of the given ENTRY. Call FUNC for each.
+ Stop when such a call returns a non-zero value, and return this value.
+ If all FUNC invocations returned 0, return 0. */
+static int
+hol_entry_short_iterate (const struct hol_entry *entry,
+ int (*func)(const struct argp_option *opt,
+ const struct argp_option *real,
+ const char *domain, void *cookie),
+ const char *domain, void *cookie)
+{
+ unsigned nopts;
+ int val = 0;
+ const struct argp_option *opt, *real = entry->opt;
+ char *so = entry->short_options;
+
+ for (opt = real, nopts = entry->num; nopts > 0 && !val; opt++, nopts--)
+ if (oshort (opt) && *so == opt->key)
+ {
+ if (!oalias (opt))
+ real = opt;
+ if (ovisible (opt))
+ val = (*func)(opt, real, domain, cookie);
+ so++;
+ }
+
+ return val;
+}
+
+/* Iterate across the long options of the given ENTRY. Call FUNC for each.
+ Stop when such a call returns a non-zero value, and return this value.
+ If all FUNC invocations returned 0, return 0. */
+static inline int
+#if (__GNUC__ >= 3) || (__clang_major__ >= 4)
+__attribute__ ((always_inline))
+#endif
+hol_entry_long_iterate (const struct hol_entry *entry,
+ int (*func)(const struct argp_option *opt,
+ const struct argp_option *real,
+ const char *domain, void *cookie),
+ const char *domain, void *cookie)
+{
+ unsigned nopts;
+ int val = 0;
+ const struct argp_option *opt, *real = entry->opt;
+
+ for (opt = real, nopts = entry->num; nopts > 0 && !val; opt++, nopts--)
+ if (opt->name)
+ {
+ if (!oalias (opt))
+ real = opt;
+ if (ovisible (opt))
+ val = (*func)(opt, real, domain, cookie);
+ }
+
+ return val;
+}
+
+/* A filter that returns true for the first short option of a given ENTRY. */
+static int
+until_short (const struct argp_option *opt, const struct argp_option *real,
+ const char *domain, void *cookie)
+{
+ return oshort (opt) ? opt->key : 0;
+}
+
+/* Returns the first valid short option in ENTRY, or 0 if there is none. */
+static char
+hol_entry_first_short (const struct hol_entry *entry)
+{
+ return hol_entry_short_iterate (entry, until_short,
+ entry->argp->argp_domain, 0);
+}
+
+/* Returns the first valid long option in ENTRY, or NULL if there is none. */
+static const char *
+hol_entry_first_long (const struct hol_entry *entry)
+{
+ const struct argp_option *opt;
+ unsigned num;
+ for (opt = entry->opt, num = entry->num; num > 0; opt++, num--)
+ if (opt->name && ovisible (opt))
+ return opt->name;
+ return 0;
+}
+
+/* Returns the entry in HOL with the long option name NAME, or NULL if there is
+ none. */
+static struct hol_entry *
+hol_find_entry (struct hol *hol, const char *name)
+{
+ struct hol_entry *entry = hol->entries;
+ unsigned num_entries = hol->num_entries;
+
+ while (num_entries-- > 0)
+ {
+ const struct argp_option *opt = entry->opt;
+ unsigned num_opts = entry->num;
+
+ while (num_opts-- > 0)
+ if (opt->name && ovisible (opt) && strcmp (opt->name, name) == 0)
+ return entry;
+ else
+ opt++;
+
+ entry++;
+ }
+
+ return 0;
+}
+
+/* If an entry with the long option NAME occurs in HOL, set its special
+ sort position to GROUP. */
+static void
+hol_set_group (struct hol *hol, const char *name, int group)
+{
+ struct hol_entry *entry = hol_find_entry (hol, name);
+ if (entry)
+ entry->group = group;
+}
+
+/* -------------------------------------------------------------------------- */
+/* Sorting the entries in a HOL. */
+
+/* Order by group: 0, 1, 2, ..., n, -m, ..., -2, -1. */
+static int
+group_cmp (int group1, int group2)
+{
+ if ((group1 < 0 && group2 < 0) || (group1 >= 0 && group2 >= 0))
+ return group1 - group2;
+ else
+ /* Return > 0 if group1 < 0 <= group2.
+ Return < 0 if group2 < 0 <= group1. */
+ return group2 - group1;
+}
+
+/* Compare clusters CL1 and CL2 by the order that they should appear in
+ output. Assume CL1 and CL2 have the same parent. */
+static int
+hol_sibling_cluster_cmp (const struct hol_cluster *cl1,
+ const struct hol_cluster *cl2)
+{
+ /* Compare by group first. */
+ int cmp = group_cmp (cl1->group, cl2->group);
+ if (cmp != 0)
+ return cmp;
+
+ /* Within a group, compare by index within the group. */
+ return cl2->index - cl1->index;
+}
+
+/* Compare clusters CL1 and CL2 by the order that they should appear in
+ output. Assume CL1 and CL2 are at the same depth. */
+static int
+hol_cousin_cluster_cmp (const struct hol_cluster *cl1,
+ const struct hol_cluster *cl2)
+{
+ if (cl1->parent == cl2->parent)
+ return hol_sibling_cluster_cmp (cl1, cl2);
+ else
+ {
+ /* Compare the parent clusters first. */
+ int cmp = hol_cousin_cluster_cmp (cl1->parent, cl2->parent);
+ if (cmp != 0)
+ return cmp;
+
+ /* Next, compare by group. */
+ cmp = group_cmp (cl1->group, cl2->group);
+ if (cmp != 0)
+ return cmp;
+
+ /* Next, within a group, compare by index within the group. */
+ return cl2->index - cl1->index;
+ }
+}
+
+/* Compare clusters CL1 and CL2 by the order that they should appear in
+ output. */
+static int
+hol_cluster_cmp (const struct hol_cluster *cl1, const struct hol_cluster *cl2)
+{
+ /* If one cluster is deeper than the other, use its ancestor at the same
+ level. Then, go by the rule that entries that are not in a sub-cluster
+ come before entries in a sub-cluster. */
+ if (cl1->depth > cl2->depth)
+ {
+ do
+ cl1 = cl1->parent;
+ while (cl1->depth > cl2->depth);
+ int cmp = hol_cousin_cluster_cmp (cl1, cl2);
+ if (cmp != 0)
+ return cmp;
+
+ return 1;
+ }
+ else if (cl1->depth < cl2->depth)
+ {
+ do
+ cl2 = cl2->parent;
+ while (cl1->depth < cl2->depth);
+ int cmp = hol_cousin_cluster_cmp (cl1, cl2);
+ if (cmp != 0)
+ return cmp;
+
+ return -1;
+ }
+ else
+ return hol_cousin_cluster_cmp (cl1, cl2);
+}
+
+/* Return the ancestor of CL that's just below the root (i.e., has a parent
+ of 0). */
+static struct hol_cluster *
+hol_cluster_base (struct hol_cluster *cl)
+{
+ while (cl->parent)
+ cl = cl->parent;
+ return cl;
+}
+
+/* Given the name of an OPTION_DOC option, modifies *NAME to start at the tail
+ that should be used for comparisons, and returns true iff it should be
+ treated as a non-option. */
+static int
+canon_doc_option (const char **name)
+{
+ int non_opt;
+ /* Skip initial whitespace. */
+ while (isspace ((unsigned char) **name))
+ (*name)++;
+ /* Decide whether this looks like an option (leading '-') or not. */
+ non_opt = (**name != '-');
+ /* Skip until part of name used for sorting. */
+ while (**name && !isalnum ((unsigned char) **name))
+ (*name)++;
+ return non_opt;
+}
+
+/* Order ENTRY1 and ENTRY2 by the order which they should appear in a help
+ listing.
+ This function implements a total order, that is:
+ - if cmp (entry1, entry2) < 0 and cmp (entry2, entry3) < 0,
+ then cmp (entry1, entry3) < 0.
+ - if cmp (entry1, entry2) < 0 and cmp (entry2, entry3) == 0,
+ then cmp (entry1, entry3) < 0.
+ - if cmp (entry1, entry2) == 0 and cmp (entry2, entry3) < 0,
+ then cmp (entry1, entry3) < 0.
+ - if cmp (entry1, entry2) == 0 and cmp (entry2, entry3) == 0,
+ then cmp (entry1, entry3) == 0. */
+static int
+hol_entry_cmp (const struct hol_entry *entry1,
+ const struct hol_entry *entry2)
+{
+ /* First, compare the group numbers. For entries within a cluster, what
+ matters is the group number of the base cluster in which the entry
+ resides. */
+ int group1 = (entry1->cluster
+ ? hol_cluster_base (entry1->cluster)->group
+ : entry1->group);
+ int group2 = (entry2->cluster
+ ? hol_cluster_base (entry2->cluster)->group
+ : entry2->group);
+ int cmp = group_cmp (group1, group2);
+ if (cmp != 0)
+ return cmp;
+
+ /* The group numbers are the same. */
+
+ /* Entries that are not in a cluster come before entries in a cluster. */
+ cmp = (entry1->cluster != NULL) - (entry2->cluster != NULL);
+ if (cmp != 0)
+ return cmp;
+
+ /* Compare the clusters. */
+ if (entry1->cluster != NULL)
+ {
+ cmp = hol_cluster_cmp (entry1->cluster, entry2->cluster);
+ if (cmp != 0)
+ return cmp;
+ }
+
+ /* For entries in the same cluster, compare also the group numbers
+ within the cluster. */
+ cmp = group_cmp (entry1->group, entry2->group);
+ if (cmp != 0)
+ return cmp;
+
+ /* The entries are both in the same group and the same cluster. */
+
+ /* 'documentation' options always follow normal options (or documentation
+ options that *look* like normal options). */
+ const char *long1 = hol_entry_first_long (entry1);
+ const char *long2 = hol_entry_first_long (entry2);
+ int doc1 =
+ (odoc (entry1->opt) ? long1 != NULL && canon_doc_option (&long1) : 0);
+ int doc2 =
+ (odoc (entry2->opt) ? long2 != NULL && canon_doc_option (&long2) : 0);
+ cmp = doc1 - doc2;
+ if (cmp != 0)
+ return cmp;
+
+ /* Compare the entries alphabetically. */
+
+ /* First, compare the first character of the options.
+ Put entries without *any* valid options (such as options with
+ OPTION_HIDDEN set) first. But as they're not displayed, it doesn't
+ matter where they are. */
+ int short1 = hol_entry_first_short (entry1);
+ int short2 = hol_entry_first_short (entry2);
+ unsigned char first1 = short1 ? short1 : long1 != NULL ? *long1 : 0;
+ unsigned char first2 = short2 ? short2 : long2 != NULL ? *long2 : 0;
+ /* Compare ignoring case. */
+ /* Use tolower, not _tolower, since the latter has undefined behaviour
+ for characters that are not uppercase letters. */
+ cmp = tolower (first1) - tolower (first2);
+ if (cmp != 0)
+ return cmp;
+ /* When the options start with the same letter (ignoring case), lower-case
+ comes first. */
+ cmp = first2 - first1;
+ if (cmp != 0)
+ return cmp;
+
+ /* The first character of the options agree. */
+
+ /* Put entries with a short option before entries without a short option. */
+ cmp = (short1 != 0) - (short2 != 0);
+ if (cmp != 0)
+ return cmp;
+
+ /* Compare entries without a short option by comparing the long option. */
+ if (short1 == 0)
+ {
+ cmp = (long1 != NULL) - (long2 != NULL);
+ if (cmp != 0)
+ return cmp;
+
+ if (long1 != NULL)
+ {
+ cmp = __strcasecmp (long1, long2);
+ if (cmp != 0)
+ return cmp;
+ }
+ }
+
+ /* We're out of comparison criteria. At this point, if ENTRY1 != ENTRY2,
+ the order of these entries will be unpredictable. */
+ return 0;
+}
+
+/* Variant of hol_entry_cmp with correct signature for qsort. */
+static int
+hol_entry_qcmp (const void *entry1_v, const void *entry2_v)
+{
+ return hol_entry_cmp (entry1_v, entry2_v);
+}
+
+/* Sort HOL by group and alphabetically by option name (with short options
+ taking precedence over long). Since the sorting is for display purposes
+ only, the shadowing of options isn't effected. */
+static void
+hol_sort (struct hol *hol)
+{
+ if (hol->num_entries > 0)
+ {
+ unsigned i;
+ struct hol_entry *e;
+ for (i = 0, e = hol->entries; i < hol->num_entries; i++, e++)
+ e->ord = i;
+
+ qsort (hol->entries, hol->num_entries, sizeof (struct hol_entry),
+ hol_entry_qcmp);
+ }
+}
+
+/* -------------------------------------------------------------------------- */
+/* Constructing the HOL. */
+
+/* Append MORE to HOL, destroying MORE in the process. Options in HOL shadow
+ any in MORE with the same name. */
+static void
+hol_append (struct hol *hol, struct hol *more)
+{
+ struct hol_cluster **cl_end = &hol->clusters;
+
+ /* Steal MORE's cluster list, and add it to the end of HOL's. */
+ while (*cl_end)
+ cl_end = &(*cl_end)->next;
+ *cl_end = more->clusters;
+ more->clusters = 0;
+
+ /* Merge entries. */
+ if (more->num_entries > 0)
+ {
+ if (hol->num_entries == 0)
+ {
+ hol->num_entries = more->num_entries;
+ hol->entries = more->entries;
+ hol->short_options = more->short_options;
+ more->num_entries = 0; /* Mark MORE's fields as invalid. */
+ }
+ else
+ /* Append the entries in MORE to those in HOL, taking care to only add
+ non-shadowed SHORT_OPTIONS values. */
+ {
+ unsigned left;
+ char *so, *more_so;
+ struct hol_entry *e;
+ unsigned num_entries = hol->num_entries + more->num_entries;
+ struct hol_entry *entries =
+ malloc (num_entries * sizeof (struct hol_entry));
+ unsigned hol_so_len = strlen (hol->short_options);
+ char *short_options =
+ malloc (hol_so_len + strlen (more->short_options) + 1);
+
+ assert (entries && short_options);
+ if (SIZE_MAX <= UINT_MAX)
+ assert (num_entries <= SIZE_MAX / sizeof (struct hol_entry));
+
+ __mempcpy (__mempcpy (entries, hol->entries,
+ hol->num_entries * sizeof (struct hol_entry)),
+ more->entries,
+ more->num_entries * sizeof (struct hol_entry));
+
+ __mempcpy (short_options, hol->short_options, hol_so_len);
+
+ /* Fix up the short options pointers from HOL. */
+ for (e = entries, left = hol->num_entries; left > 0; e++, left--)
+ e->short_options
+ = short_options + (e->short_options - hol->short_options);
+
+ /* Now add the short options from MORE, fixing up its entries
+ too. */
+ so = short_options + hol_so_len;
+ more_so = more->short_options;
+ for (left = more->num_entries; left > 0; e++, left--)
+ {
+ int opts_left;
+ const struct argp_option *opt;
+
+ e->short_options = so;
+
+ for (opts_left = e->num, opt = e->opt; opts_left; opt++, opts_left--)
+ {
+ int ch = *more_so;
+ if (oshort (opt) && ch == opt->key)
+ /* The next short option in MORE_SO, CH, is from OPT. */
+ {
+ if (! find_char (ch, short_options,
+ short_options + hol_so_len))
+ /* The short option CH isn't shadowed by HOL's options,
+ so add it to the sum. */
+ *so++ = ch;
+ more_so++;
+ }
+ }
+ }
+
+ *so = '\0';
+
+ free (hol->entries);
+ free (hol->short_options);
+
+ hol->entries = entries;
+ hol->num_entries = num_entries;
+ hol->short_options = short_options;
+ }
+ }
+
+ hol_free (more);
+}
+
+/* Make a HOL containing all levels of options in ARGP. CLUSTER is the
+ cluster in which ARGP's entries should be clustered, or NULL. */
+static struct hol *
+argp_hol (const struct argp *argp, struct hol_cluster *cluster)
+{
+ const struct argp_child *child = argp->children;
+ struct hol *hol = make_hol (argp, cluster);
+ if (child)
+ while (child->argp)
+ {
+ struct hol_cluster *child_cluster =
+ ((child->group || child->header)
+ /* Put CHILD->argp within its own cluster. */
+ ? hol_add_cluster (hol, child->group, child->header,
+ child - argp->children, cluster, argp)
+ /* Just merge it into the parent's cluster. */
+ : cluster);
+ hol_append (hol, argp_hol (child->argp, child_cluster)) ;
+ child++;
+ }
+ return hol;
+}
+
+/* -------------------------------------------------------------------------- */
+/* Printing the HOL. */
+
+/* Inserts enough spaces to make sure STREAM is at column COL. */
+static void
+indent_to (argp_fmtstream_t stream, unsigned col)
+{
+ int needed = col - __argp_fmtstream_point (stream);
+ while (needed-- > 0)
+ __argp_fmtstream_putc (stream, ' ');
+}
+
+/* Output to STREAM either a space, or a newline if there isn't room for at
+ least ENSURE characters before the right margin. */
+static void
+space (argp_fmtstream_t stream, size_t ensure)
+{
+ if (__argp_fmtstream_point (stream) + ensure
+ >= __argp_fmtstream_rmargin (stream))
+ __argp_fmtstream_putc (stream, '\n');
+ else
+ __argp_fmtstream_putc (stream, ' ');
+}
+
+/* If the option REAL has an argument, we print it in using the printf
+ format REQ_FMT or OPT_FMT depending on whether it's a required or
+ optional argument. */
+static void
+arg (const struct argp_option *real, const char *req_fmt, const char *opt_fmt,
+ const char *domain, argp_fmtstream_t stream)
+{
+ if (real->arg)
+ {
+ if (real->flags & OPTION_ARG_OPTIONAL)
+ __argp_fmtstream_printf (stream, opt_fmt,
+ dgettext (domain, real->arg));
+ else
+ __argp_fmtstream_printf (stream, req_fmt,
+ dgettext (domain, real->arg));
+ }
+}
+
+/* Helper functions for hol_entry_help. */
+
+/* State used during the execution of hol_help. */
+struct hol_help_state
+{
+ /* PREV_ENTRY should contain the previous entry printed, or NULL. */
+ struct hol_entry *prev_entry;
+
+ /* If an entry is in a different group from the previous one, and SEP_GROUPS
+ is true, then a blank line will be printed before any output. */
+ int sep_groups;
+
+ /* True if a duplicate option argument was suppressed (only ever set if
+ UPARAMS.dup_args is false). */
+ int suppressed_dup_arg;
+};
+
+/* Some state used while printing a help entry (used to communicate with
+ helper functions). See the doc for hol_entry_help for more info, as most
+ of the fields are copied from its arguments. */
+struct pentry_state
+{
+ const struct hol_entry *entry;
+ argp_fmtstream_t stream;
+ struct hol_help_state *hhstate;
+
+ /* True if nothing's been printed so far. */
+ int first;
+
+ /* If non-zero, the state that was used to print this help. */
+ const struct argp_state *state;
+};
+
+/* If a user doc filter should be applied to DOC, do so. */
+static const char *
+filter_doc (const char *doc, int key, const struct argp *argp,
+ const struct argp_state *state)
+{
+ if (argp && argp->help_filter)
+ /* We must apply a user filter to this output. */
+ {
+ void *input = __argp_input (argp, state);
+ return (*argp->help_filter) (key, doc, input);
+ }
+ else
+ /* No filter. */
+ return doc;
+}
+
+/* Prints STR as a header line, with the margin lines set appropriately, and
+ notes the fact that groups should be separated with a blank line. ARGP is
+ the argp that should dictate any user doc filtering to take place. Note
+ that the previous wrap margin isn't restored, but the left margin is reset
+ to 0. */
+static void
+print_header (const char *str, const struct argp *argp,
+ struct pentry_state *pest)
+{
+ const char *tstr = str ? dgettext (argp->argp_domain, str) : NULL;
+ const char *fstr = filter_doc (tstr, ARGP_KEY_HELP_HEADER, argp, pest->state);
+
+ if (fstr)
+ {
+ if (*fstr)
+ {
+ if (pest->hhstate->prev_entry)
+ /* Precede with a blank line. */
+ __argp_fmtstream_putc (pest->stream, '\n');
+ indent_to (pest->stream, uparams.header_col);
+ __argp_fmtstream_set_lmargin (pest->stream, uparams.header_col);
+ __argp_fmtstream_set_wmargin (pest->stream, uparams.header_col);
+ __argp_fmtstream_puts (pest->stream, fstr);
+ __argp_fmtstream_set_lmargin (pest->stream, 0);
+ __argp_fmtstream_putc (pest->stream, '\n');
+ }
+
+ pest->hhstate->sep_groups = 1; /* Separate subsequent groups. */
+ }
+
+ if (fstr != tstr)
+ free ((char *) fstr);
+}
+
+/* Return true if CL1 is a child of CL2. */
+static int
+hol_cluster_is_child (const struct hol_cluster *cl1,
+ const struct hol_cluster *cl2)
+{
+ while (cl1 && cl1 != cl2)
+ cl1 = cl1->parent;
+ return cl1 == cl2;
+}
+
+/* Inserts a comma if this isn't the first item on the line, and then makes
+ sure we're at least to column COL. If this *is* the first item on a line,
+ prints any pending whitespace/headers that should precede this line. Also
+ clears FIRST. */
+static void
+comma (unsigned col, struct pentry_state *pest)
+{
+ if (pest->first)
+ {
+ const struct hol_entry *pe = pest->hhstate->prev_entry;
+ const struct hol_cluster *cl = pest->entry->cluster;
+
+ if (pest->hhstate->sep_groups && pe && pest->entry->group != pe->group)
+ __argp_fmtstream_putc (pest->stream, '\n');
+
+ if (cl && cl->header && *cl->header
+ && (!pe
+ || (pe->cluster != cl
+ && !hol_cluster_is_child (pe->cluster, cl))))
+ /* If we're changing clusters, then this must be the start of the
+ ENTRY's cluster unless that is an ancestor of the previous one
+ (in which case we had just popped into a sub-cluster for a bit).
+ If so, then print the cluster's header line. */
+ {
+ int old_wm = __argp_fmtstream_wmargin (pest->stream);
+ print_header (cl->header, cl->argp, pest);
+ __argp_fmtstream_set_wmargin (pest->stream, old_wm);
+ }
+
+ pest->first = 0;
+ }
+ else
+ __argp_fmtstream_puts (pest->stream, ", ");
+
+ indent_to (pest->stream, col);
+}
+
+/* Print help for ENTRY to STREAM. */
+static void
+hol_entry_help (struct hol_entry *entry, const struct argp_state *state,
+ argp_fmtstream_t stream, struct hol_help_state *hhstate)
+{
+ unsigned num;
+ const struct argp_option *real = entry->opt, *opt;
+ char *so = entry->short_options;
+ int have_long_opt = 0; /* We have any long options. */
+ /* Saved margins. */
+ int old_lm = __argp_fmtstream_set_lmargin (stream, 0);
+ int old_wm = __argp_fmtstream_wmargin (stream);
+ /* PEST is a state block holding some of our variables that we'd like to
+ share with helper functions. */
+ struct pentry_state pest = { entry, stream, hhstate, 1, state };
+
+ if (! odoc (real))
+ for (opt = real, num = entry->num; num > 0; opt++, num--)
+ if (opt->name && ovisible (opt))
+ {
+ have_long_opt = 1;
+ break;
+ }
+
+ /* First emit short options. */
+ __argp_fmtstream_set_wmargin (stream, uparams.short_opt_col); /* For truly bizarre cases. */
+ for (opt = real, num = entry->num; num > 0; opt++, num--)
+ if (oshort (opt) && opt->key == *so)
+ /* OPT has a valid (non shadowed) short option. */
+ {
+ if (ovisible (opt))
+ {
+ comma (uparams.short_opt_col, &pest);
+ __argp_fmtstream_putc (stream, '-');
+ __argp_fmtstream_putc (stream, *so);
+ if (!have_long_opt || uparams.dup_args)
+ arg (real, " %s", "[%s]",
+ state == NULL ? NULL : entry->argp->argp_domain,
+ stream);
+ else if (real->arg)
+ hhstate->suppressed_dup_arg = 1;
+ }
+ so++;
+ }
+
+ /* Now, long options. */
+ if (odoc (real))
+ /* A "documentation" option. */
+ {
+ __argp_fmtstream_set_wmargin (stream, uparams.doc_opt_col);
+ for (opt = real, num = entry->num; num > 0; opt++, num--)
+ if (opt->name && ovisible (opt))
+ {
+ comma (uparams.doc_opt_col, &pest);
+ /* Calling dgettext here isn't quite right, since sorting will
+ have been done on the original; but documentation options
+ should be pretty rare anyway... */
+ __argp_fmtstream_puts (stream,
+ dgettext (state == NULL ? NULL
+ : entry->argp->argp_domain,
+ opt->name));
+ }
+ }
+ else
+ /* A real long option. */
+ {
+ __argp_fmtstream_set_wmargin (stream, uparams.long_opt_col);
+ for (opt = real, num = entry->num; num > 0; opt++, num--)
+ if (opt->name && ovisible (opt))
+ {
+ comma (uparams.long_opt_col, &pest);
+ __argp_fmtstream_printf (stream, "--%s", opt->name);
+ arg (real, "=%s", "[=%s]",
+ state == NULL ? NULL : entry->argp->argp_domain, stream);
+ }
+ }
+
+ /* Next, documentation strings. */
+ __argp_fmtstream_set_lmargin (stream, 0);
+
+ if (pest.first)
+ {
+ /* Didn't print any switches, what's up? */
+ if (!oshort (real) && !real->name)
+ /* This is a group header, print it nicely. */
+ print_header (real->doc, entry->argp, &pest);
+ else
+ /* Just a totally shadowed option or null header; print nothing. */
+ goto cleanup; /* Just return, after cleaning up. */
+ }
+ else
+ {
+ const char *tstr = real->doc ? dgettext (state == NULL ? NULL
+ : entry->argp->argp_domain,
+ real->doc) : 0;
+ const char *fstr = filter_doc (tstr, real->key, entry->argp, state);
+ if (fstr && *fstr)
+ {
+ unsigned int col = __argp_fmtstream_point (stream);
+
+ __argp_fmtstream_set_lmargin (stream, uparams.opt_doc_col);
+ __argp_fmtstream_set_wmargin (stream, uparams.opt_doc_col);
+
+ if (col > (unsigned int) (uparams.opt_doc_col + 3))
+ __argp_fmtstream_putc (stream, '\n');
+ else if (col >= (unsigned int) uparams.opt_doc_col)
+ __argp_fmtstream_puts (stream, " ");
+ else
+ indent_to (stream, uparams.opt_doc_col);
+
+ __argp_fmtstream_puts (stream, fstr);
+ }
+ if (fstr && fstr != tstr)
+ free ((char *) fstr);
+
+ /* Reset the left margin. */
+ __argp_fmtstream_set_lmargin (stream, 0);
+ __argp_fmtstream_putc (stream, '\n');
+ }
+
+ hhstate->prev_entry = entry;
+
+cleanup:
+ __argp_fmtstream_set_lmargin (stream, old_lm);
+ __argp_fmtstream_set_wmargin (stream, old_wm);
+}
+
+/* Output a long help message about the options in HOL to STREAM. */
+static void
+hol_help (struct hol *hol, const struct argp_state *state,
+ argp_fmtstream_t stream)
+{
+ unsigned num;
+ struct hol_entry *entry;
+ struct hol_help_state hhstate = { 0, 0, 0 };
+
+ for (entry = hol->entries, num = hol->num_entries; num > 0; entry++, num--)
+ hol_entry_help (entry, state, stream, &hhstate);
+
+ if (hhstate.suppressed_dup_arg && uparams.dup_args_note)
+ {
+ const char *tstr = dgettext (state == NULL ? NULL
+ : ARGP_TEXT_DOMAIN, "\
+Mandatory or optional arguments to long options are also mandatory or \
+optional for any corresponding short options.");
+ const char *fstr = filter_doc (tstr, ARGP_KEY_HELP_DUP_ARGS_NOTE,
+ state ? state->root_argp : 0, state);
+ if (fstr && *fstr)
+ {
+ __argp_fmtstream_putc (stream, '\n');
+ __argp_fmtstream_puts (stream, fstr);
+ __argp_fmtstream_putc (stream, '\n');
+ }
+ if (fstr && fstr != tstr)
+ free ((char *) fstr);
+ }
+}
+
+/* Helper functions for hol_usage. */
+
+/* If OPT is a short option without an arg, append its key to the string
+ pointer pointer to by COOKIE, and advance the pointer. */
+static int
+add_argless_short_opt (const struct argp_option *opt,
+ const struct argp_option *real,
+ const char *domain, void *cookie)
+{
+ char **snao_end = cookie;
+ if (!(opt->arg || real->arg)
+ && !((opt->flags | real->flags) & OPTION_NO_USAGE))
+ *(*snao_end)++ = opt->key;
+ return 0;
+}
+
+/* If OPT is a short option with an arg, output a usage entry for it to the
+ stream pointed at by COOKIE. */
+static int
+usage_argful_short_opt (const struct argp_option *opt,
+ const struct argp_option *real,
+ const char *domain, void *cookie)
+{
+ argp_fmtstream_t stream = cookie;
+ const char *arg = opt->arg;
+ int flags = opt->flags | real->flags;
+
+ if (! arg)
+ arg = real->arg;
+
+ if (arg && !(flags & OPTION_NO_USAGE))
+ {
+ arg = dgettext (domain, arg);
+
+ if (flags & OPTION_ARG_OPTIONAL)
+ __argp_fmtstream_printf (stream, " [-%c[%s]]", opt->key, arg);
+ else
+ {
+ /* Manually do line wrapping so that it (probably) won't
+ get wrapped at the embedded space. */
+ space (stream, 6 + strlen (arg));
+ __argp_fmtstream_printf (stream, "[-%c %s]", opt->key, arg);
+ }
+ }
+
+ return 0;
+}
+
+/* Output a usage entry for the long option opt to the stream pointed at by
+ COOKIE. */
+static int
+usage_long_opt (const struct argp_option *opt,
+ const struct argp_option *real,
+ const char *domain, void *cookie)
+{
+ argp_fmtstream_t stream = cookie;
+ const char *arg = opt->arg;
+ int flags = opt->flags | real->flags;
+
+ if (! arg)
+ arg = real->arg;
+
+ if (! (flags & OPTION_NO_USAGE))
+ {
+ if (arg)
+ {
+ arg = dgettext (domain, arg);
+ if (flags & OPTION_ARG_OPTIONAL)
+ __argp_fmtstream_printf (stream, " [--%s[=%s]]", opt->name, arg);
+ else
+ __argp_fmtstream_printf (stream, " [--%s=%s]", opt->name, arg);
+ }
+ else
+ __argp_fmtstream_printf (stream, " [--%s]", opt->name);
+ }
+
+ return 0;
+}
+
+/* Print a short usage description for the arguments in HOL to STREAM. */
+static void
+hol_usage (struct hol *hol, argp_fmtstream_t stream)
+{
+ if (hol->num_entries > 0)
+ {
+ unsigned nentries;
+ struct hol_entry *entry;
+ char *short_no_arg_opts = alloca (strlen (hol->short_options) + 1);
+ char *snao_end = short_no_arg_opts;
+
+ /* First we put a list of short options without arguments. */
+ for (entry = hol->entries, nentries = hol->num_entries
+ ; nentries > 0
+ ; entry++, nentries--)
+ hol_entry_short_iterate (entry, add_argless_short_opt,
+ entry->argp->argp_domain, &snao_end);
+ if (snao_end > short_no_arg_opts)
+ {
+ *snao_end++ = 0;
+ __argp_fmtstream_printf (stream, " [-%s]", short_no_arg_opts);
+ }
+
+ /* Now a list of short options *with* arguments. */
+ for (entry = hol->entries, nentries = hol->num_entries
+ ; nentries > 0
+ ; entry++, nentries--)
+ hol_entry_short_iterate (entry, usage_argful_short_opt,
+ entry->argp->argp_domain, stream);
+
+ /* Finally, a list of long options (whew!). */
+ for (entry = hol->entries, nentries = hol->num_entries
+ ; nentries > 0
+ ; entry++, nentries--)
+ hol_entry_long_iterate (entry, usage_long_opt,
+ entry->argp->argp_domain, stream);
+ }
+}
+
+/* Calculate how many different levels with alternative args strings exist in
+ ARGP. */
+static size_t
+argp_args_levels (const struct argp *argp)
+{
+ size_t levels = 0;
+ const struct argp_child *child = argp->children;
+
+ if (argp->args_doc && strchr (argp->args_doc, '\n'))
+ levels++;
+
+ if (child)
+ while (child->argp)
+ levels += argp_args_levels ((child++)->argp);
+
+ return levels;
+}
+
+/* Print all the non-option args documented in ARGP to STREAM. Any output is
+ preceded by a space. LEVELS is a pointer to a byte vector the length
+ returned by argp_args_levels; it should be initialized to zero, and
+ updated by this routine for the next call if ADVANCE is true. True is
+ returned as long as there are more patterns to output. */
+static int
+argp_args_usage (const struct argp *argp, const struct argp_state *state,
+ char **levels, int advance, argp_fmtstream_t stream)
+{
+ char *our_level = *levels;
+ int multiple = 0;
+ const struct argp_child *child = argp->children;
+ const char *tdoc =
+ argp->args_doc ? dgettext (argp->argp_domain, argp->args_doc) : NULL;
+ const char *fdoc = filter_doc (tdoc, ARGP_KEY_HELP_ARGS_DOC, argp, state);
+ const char *nl = NULL;
+
+ if (fdoc)
+ {
+ const char *cp = fdoc;
+ nl = __strchrnul (cp, '\n');
+ if (*nl != '\0')
+ /* This is a 'multi-level' args doc; advance to the correct position
+ as determined by our state in LEVELS, and update LEVELS. */
+ {
+ int i;
+ multiple = 1;
+ for (i = 0; i < *our_level; i++)
+ cp = nl + 1, nl = __strchrnul (cp, '\n');
+ (*levels)++;
+ }
+
+ /* Manually do line wrapping so that it (probably) won't get wrapped at
+ any embedded spaces. */
+ space (stream, 1 + nl - cp);
+
+ __argp_fmtstream_write (stream, cp, nl - cp);
+ }
+ if (fdoc && fdoc != tdoc)
+ free ((char *)fdoc); /* Free user's modified doc string. */
+
+ if (child)
+ while (child->argp)
+ advance = !argp_args_usage ((child++)->argp, state, levels, advance, stream);
+
+ if (advance && multiple)
+ {
+ /* Need to increment our level. */
+ if (*nl)
+ /* There's more we can do here. */
+ {
+ (*our_level)++;
+ advance = 0; /* Our parent shouldn't advance also. */
+ }
+ else if (*our_level > 0)
+ /* We had multiple levels, but used them up; reset to zero. */
+ *our_level = 0;
+ }
+
+ return !advance;
+}
+
+/* Print the documentation for ARGP to STREAM; if POST is false, then
+ everything preceding a '\v' character in the documentation strings (or
+ the whole string, for those with none) is printed, otherwise, everything
+ following the '\v' character (nothing for strings without). Each separate
+ bit of documentation is separated a blank line, and if PRE_BLANK is true,
+ then the first is as well. If FIRST_ONLY is true, only the first
+ occurrence is output. Returns true if anything was output. */
+static int
+argp_doc (const struct argp *argp, const struct argp_state *state,
+ int post, int pre_blank, int first_only,
+ argp_fmtstream_t stream)
+{
+ const char *text;
+ const char *inp_text;
+ void *input = 0;
+ int anything = 0;
+ size_t inp_text_limit = 0;
+ const char *doc = argp->doc ? dgettext (argp->argp_domain, argp->doc) : NULL;
+ const struct argp_child *child = argp->children;
+
+ if (doc)
+ {
+ char *vt = strchr (doc, '\v');
+ inp_text = post ? (vt ? vt + 1 : 0) : doc;
+ inp_text_limit = (!post && vt) ? (vt - doc) : 0;
+ }
+ else
+ inp_text = 0;
+
+ if (argp->help_filter)
+ /* We have to filter the doc strings. */
+ {
+ if (inp_text_limit)
+ /* Copy INP_TEXT so that it's nul-terminated. */
+ inp_text = __strndup (inp_text, inp_text_limit);
+ input = __argp_input (argp, state);
+ text =
+ (*argp->help_filter) (post
+ ? ARGP_KEY_HELP_POST_DOC
+ : ARGP_KEY_HELP_PRE_DOC,
+ inp_text, input);
+ }
+ else
+ text = (const char *) inp_text;
+
+ if (text)
+ {
+ if (pre_blank)
+ __argp_fmtstream_putc (stream, '\n');
+
+ if (text == inp_text && inp_text_limit)
+ __argp_fmtstream_write (stream, inp_text, inp_text_limit);
+ else
+ __argp_fmtstream_puts (stream, text);
+
+ if (__argp_fmtstream_point (stream) > __argp_fmtstream_lmargin (stream))
+ __argp_fmtstream_putc (stream, '\n');
+
+ anything = 1;
+ }
+
+ if (text && text != inp_text)
+ free ((char *) text); /* Free TEXT returned from the help filter. */
+ if (inp_text && inp_text_limit && argp->help_filter)
+ free ((char *) inp_text); /* We copied INP_TEXT, so free it now. */
+
+ if (post && argp->help_filter)
+ /* Now see if we have to output a ARGP_KEY_HELP_EXTRA text. */
+ {
+ text = (*argp->help_filter) (ARGP_KEY_HELP_EXTRA, 0, input);
+ if (text)
+ {
+ if (anything || pre_blank)
+ __argp_fmtstream_putc (stream, '\n');
+ __argp_fmtstream_puts (stream, text);
+ free ((char *) text);
+ if (__argp_fmtstream_point (stream)
+ > __argp_fmtstream_lmargin (stream))
+ __argp_fmtstream_putc (stream, '\n');
+ anything = 1;
+ }
+ }
+
+ if (child)
+ while (child->argp && !(first_only && anything))
+ anything |=
+ argp_doc ((child++)->argp, state,
+ post, anything || pre_blank, first_only,
+ stream);
+
+ return anything;
+}
+
+/* Output a usage message for ARGP to STREAM. If called from
+ argp_state_help, STATE is the relevant parsing state. FLAGS are from the
+ set ARGP_HELP_*. NAME is what to use wherever a 'program name' is
+ needed. */
+static void
+_help (const struct argp *argp, const struct argp_state *state, FILE *stream,
+ unsigned flags, char *name)
+{
+ int anything = 0; /* Whether we've output anything. */
+ struct hol *hol = 0;
+ argp_fmtstream_t fs;
+
+ if (! stream)
+ return;
+
+#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
+ __flockfile (stream);
+#endif
+
+ if (! uparams.valid)
+ fill_in_uparams (state);
+
+ fs = __argp_make_fmtstream (stream, 0, uparams.rmargin, 0);
+ if (! fs)
+ {
+#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
+ __funlockfile (stream);
+#endif
+ return;
+ }
+
+ if (flags & (ARGP_HELP_USAGE | ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG))
+ {
+ hol = argp_hol (argp, 0);
+
+ /* If present, these options always come last. */
+ hol_set_group (hol, "help", -1);
+ hol_set_group (hol, "version", -1);
+
+ hol_sort (hol);
+ }
+
+ if (flags & (ARGP_HELP_USAGE | ARGP_HELP_SHORT_USAGE))
+ /* Print a short "Usage:" message. */
+ {
+ int first_pattern = 1, more_patterns;
+ size_t num_pattern_levels = argp_args_levels (argp);
+ char *pattern_levels = alloca (num_pattern_levels);
+
+ memset (pattern_levels, 0, num_pattern_levels);
+
+ do
+ {
+ int old_lm;
+ int old_wm = __argp_fmtstream_set_wmargin (fs, uparams.usage_indent);
+ char *levels = pattern_levels;
+
+ if (first_pattern)
+ __argp_fmtstream_printf (fs, "%s %s",
+ dgettext (ARGP_TEXT_DOMAIN, "Usage:"),
+ name);
+ else
+ __argp_fmtstream_printf (fs, "%s %s",
+ dgettext (ARGP_TEXT_DOMAIN, " or: "),
+ name);
+
+ /* We set the lmargin as well as the wmargin, because hol_usage
+ manually wraps options with newline to avoid annoying breaks. */
+ old_lm = __argp_fmtstream_set_lmargin (fs, uparams.usage_indent);
+
+ if (flags & ARGP_HELP_SHORT_USAGE)
+ /* Just show where the options go. */
+ {
+ if (hol->num_entries > 0)
+ __argp_fmtstream_puts (fs, dgettext (ARGP_TEXT_DOMAIN,
+ " [OPTION...]"));
+ }
+ else
+ /* Actually print the options. */
+ {
+ hol_usage (hol, fs);
+ flags |= ARGP_HELP_SHORT_USAGE; /* But only do so once. */
+ }
+
+ more_patterns = argp_args_usage (argp, state, &levels, 1, fs);
+
+ __argp_fmtstream_set_wmargin (fs, old_wm);
+ __argp_fmtstream_set_lmargin (fs, old_lm);
+
+ __argp_fmtstream_putc (fs, '\n');
+ anything = 1;
+
+ first_pattern = 0;
+ }
+ while (more_patterns);
+ }
+
+ if (flags & ARGP_HELP_PRE_DOC)
+ anything |= argp_doc (argp, state, 0, 0, 1, fs);
+
+ if (flags & ARGP_HELP_SEE)
+ {
+ __argp_fmtstream_printf (fs, dgettext (ARGP_TEXT_DOMAIN, "\
+Try '%s --help' or '%s --usage' for more information.\n"),
+ name, name);
+ anything = 1;
+ }
+
+ if (flags & ARGP_HELP_LONG)
+ /* Print a long, detailed help message. */
+ {
+ /* Print info about all the options. */
+ if (hol->num_entries > 0)
+ {
+ if (anything)
+ __argp_fmtstream_putc (fs, '\n');
+ hol_help (hol, state, fs);
+ anything = 1;
+ }
+ }
+
+ if (flags & ARGP_HELP_POST_DOC)
+ /* Print any documentation strings at the end. */
+ anything |= argp_doc (argp, state, 1, anything, 0, fs);
+
+ if ((flags & ARGP_HELP_BUG_ADDR) && argp_program_bug_address)
+ {
+ if (anything)
+ __argp_fmtstream_putc (fs, '\n');
+ __argp_fmtstream_printf (fs, dgettext (ARGP_TEXT_DOMAIN,
+ "Report bugs to %s.\n"),
+ argp_program_bug_address);
+ anything = 1;
+ }
+
+#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
+ __funlockfile (stream);
+#endif
+
+ if (hol)
+ hol_free (hol);
+
+ __argp_fmtstream_free (fs);
+}
+
+/* Output a usage message for ARGP to STREAM. FLAGS are from the set
+ ARGP_HELP_*. NAME is what to use wherever a 'program name' is needed. */
+void __argp_help (const struct argp *argp, FILE *stream,
+ unsigned flags, char *name)
+{
+ _help (argp, 0, stream, flags, name);
+}
+#ifdef weak_alias
+weak_alias (__argp_help, argp_help)
+#endif
+
+#if ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME)
+char *
+__argp_short_program_name (void)
+{
+# if HAVE_DECL_PROGRAM_INVOCATION_NAME
+ char *name = strrchr (program_invocation_name, '/');
+ return name ? name + 1 : program_invocation_name;
+# else
+ /* FIXME: What now? Miles suggests that it is better to use NULL,
+ but currently the value is passed on directly to fputs_unlocked,
+ so that requires more changes. */
+# if __GNUC__ || (__clang_major__ >= 4)
+# warning No reasonable value to return
+# endif /* __GNUC__ */
+ return "";
+# endif
+}
+#endif
+
+/* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are
+ from the set ARGP_HELP_*. */
+void
+__argp_state_help (const struct argp_state *state, FILE *stream, unsigned flags)
+{
+ if ((!state || ! (state->flags & ARGP_NO_ERRS)) && stream)
+ {
+ if (state && (state->flags & ARGP_LONG_ONLY))
+ flags |= ARGP_HELP_LONG_ONLY;
+
+ _help (state ? state->root_argp : 0, state, stream, flags,
+ state ? state->name : __argp_short_program_name ());
+
+ if (!state || ! (state->flags & ARGP_NO_EXIT))
+ {
+ if (flags & ARGP_HELP_EXIT_ERR)
+ exit (argp_err_exit_status);
+ if (flags & ARGP_HELP_EXIT_OK)
+ exit (0);
+ }
+ }
+}
+#ifdef weak_alias
+weak_alias (__argp_state_help, argp_state_help)
+#endif
+
+/* If appropriate, print the printf string FMT and following args, preceded
+ by the program name and ':', to stderr, and followed by a "Try ... --help"
+ message, then exit (1). */
+void
+__argp_error (const struct argp_state *state, const char *fmt, ...)
+{
+ if (!state || !(state->flags & ARGP_NO_ERRS))
+ {
+ FILE *stream = state ? state->err_stream : stderr;
+
+ if (stream)
+ {
+ va_list ap;
+
+#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
+ __flockfile (stream);
+#endif
+
+ va_start (ap, fmt);
+
+#ifdef _LIBC
+ char *buf;
+
+ if (_IO_vasprintf (&buf, fmt, ap) < 0)
+ buf = NULL;
+
+ __fxprintf (stream, "%s: %s\n",
+ state ? state->name : __argp_short_program_name (), buf);
+
+ free (buf);
+#else
+ fputs_unlocked (state ? state->name : __argp_short_program_name (),
+ stream);
+ putc_unlocked (':', stream);
+ putc_unlocked (' ', stream);
+
+ vfprintf (stream, fmt, ap);
+
+ putc_unlocked ('\n', stream);
+#endif
+
+ __argp_state_help (state, stream, ARGP_HELP_STD_ERR);
+
+ va_end (ap);
+
+#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
+ __funlockfile (stream);
+#endif
+ }
+ }
+}
+#ifdef weak_alias
+weak_alias (__argp_error, argp_error)
+#endif
+
+/* Similar to the standard gnu error-reporting function error(), but will
+ respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print
+ to STATE->err_stream. This is useful for argument parsing code that is
+ shared between program startup (when exiting is desired) and runtime
+ option parsing (when typically an error code is returned instead). The
+ difference between this function and argp_error is that the latter is for
+ *parsing errors*, and the former is for other problems that occur during
+ parsing but don't reflect a (syntactic) problem with the input. */
+void
+__argp_failure (const struct argp_state *state, int status, int errnum,
+ const char *fmt, ...)
+{
+ if (!state || !(state->flags & ARGP_NO_ERRS))
+ {
+ FILE *stream = state ? state->err_stream : stderr;
+
+ if (stream)
+ {
+#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
+ __flockfile (stream);
+#endif
+
+#ifdef _LIBC
+ __fxprintf (stream, "%s",
+ state ? state->name : __argp_short_program_name ());
+#else
+ fputs_unlocked (state ? state->name : __argp_short_program_name (),
+ stream);
+#endif
+
+ if (fmt)
+ {
+ va_list ap;
+
+ va_start (ap, fmt);
+#ifdef _LIBC
+ char *buf;
+
+ if (_IO_vasprintf (&buf, fmt, ap) < 0)
+ buf = NULL;
+
+ __fxprintf (stream, ": %s", buf);
+
+ free (buf);
+#else
+ putc_unlocked (':', stream);
+ putc_unlocked (' ', stream);
+
+ vfprintf (stream, fmt, ap);
+#endif
+
+ va_end (ap);
+ }
+
+ if (errnum)
+ {
+ char buf[200];
+
+#ifdef _LIBC
+ __fxprintf (stream, ": %s",
+ __strerror_r (errnum, buf, sizeof (buf)));
+#else
+ char const *s = NULL;
+ putc_unlocked (':', stream);
+ putc_unlocked (' ', stream);
+# if GNULIB_STRERROR_R_POSIX || HAVE_DECL_STRERROR_R
+# if !GNULIB_STRERROR_R_POSIX && STRERROR_R_CHAR_P
+ s = __strerror_r (errnum, buf, sizeof buf);
+# else
+ if (__strerror_r (errnum, buf, sizeof buf) == 0)
+ s = buf;
+# endif
+# endif
+ if (! s && ! (s = strerror (errnum)))
+ s = dgettext (ARGP_TEXT_DOMAIN, "Unknown system error");
+ fputs_unlocked (s, stream);
+#endif
+ }
+
+#if _LIBC
+ if (_IO_fwide (stream, 0) > 0)
+ putwc_unlocked (L'\n', stream);
+ else
+#endif
+ putc_unlocked ('\n', stream);
+
+#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
+ __funlockfile (stream);
+#endif
+
+ if (status && (!state || !(state->flags & ARGP_NO_EXIT)))
+ exit (status);
+ }
+ }
+}
+#ifdef weak_alias
+weak_alias (__argp_failure, argp_failure)
+#endif
diff --git a/gl/lib/argp-namefrob.h b/gl/lib/argp-namefrob.h
new file mode 100644
index 0000000..9c82ac7
--- /dev/null
+++ b/gl/lib/argp-namefrob.h
@@ -0,0 +1,170 @@
+/* Name frobnication for compiling argp outside of glibc
+ Copyright (C) 1997-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Written by Miles Bader <miles@gnu.ai.mit.edu>.
+
+ 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 !_LIBC
+/* This code is written for inclusion in gnu-libc, and uses names in the
+ namespace reserved for libc. If we're not compiling in libc, define those
+ names to be the normal ones instead. */
+
+/* argp-parse functions */
+#undef __argp_parse
+#define __argp_parse argp_parse
+#undef __option_is_end
+#define __option_is_end _option_is_end
+#undef __option_is_short
+#define __option_is_short _option_is_short
+#undef __argp_input
+#define __argp_input _argp_input
+
+/* argp-help functions */
+#undef __argp_help
+#define __argp_help argp_help
+#undef __argp_error
+#define __argp_error argp_error
+#undef __argp_failure
+#define __argp_failure argp_failure
+#undef __argp_state_help
+#define __argp_state_help argp_state_help
+#undef __argp_usage
+#define __argp_usage argp_usage
+
+/* argp-fmtstream functions */
+#undef __argp_make_fmtstream
+#define __argp_make_fmtstream argp_make_fmtstream
+#undef __argp_fmtstream_free
+#define __argp_fmtstream_free argp_fmtstream_free
+#undef __argp_fmtstream_putc
+#define __argp_fmtstream_putc argp_fmtstream_putc
+#undef __argp_fmtstream_puts
+#define __argp_fmtstream_puts argp_fmtstream_puts
+#undef __argp_fmtstream_write
+#define __argp_fmtstream_write argp_fmtstream_write
+#undef __argp_fmtstream_printf
+#define __argp_fmtstream_printf argp_fmtstream_printf
+#undef __argp_fmtstream_set_lmargin
+#define __argp_fmtstream_set_lmargin argp_fmtstream_set_lmargin
+#undef __argp_fmtstream_set_rmargin
+#define __argp_fmtstream_set_rmargin argp_fmtstream_set_rmargin
+#undef __argp_fmtstream_set_wmargin
+#define __argp_fmtstream_set_wmargin argp_fmtstream_set_wmargin
+#undef __argp_fmtstream_point
+#define __argp_fmtstream_point argp_fmtstream_point
+#undef __argp_fmtstream_update
+#define __argp_fmtstream_update _argp_fmtstream_update
+#undef __argp_fmtstream_ensure
+#define __argp_fmtstream_ensure _argp_fmtstream_ensure
+#undef __argp_fmtstream_lmargin
+#define __argp_fmtstream_lmargin argp_fmtstream_lmargin
+#undef __argp_fmtstream_rmargin
+#define __argp_fmtstream_rmargin argp_fmtstream_rmargin
+#undef __argp_fmtstream_wmargin
+#define __argp_fmtstream_wmargin argp_fmtstream_wmargin
+
+/* normal libc functions we call */
+#undef __flockfile
+#define __flockfile flockfile
+#undef __funlockfile
+#define __funlockfile funlockfile
+#undef __mempcpy
+#define __mempcpy mempcpy
+#undef __sleep
+#define __sleep sleep
+#undef __strcasecmp
+#define __strcasecmp strcasecmp
+#undef __strchrnul
+#define __strchrnul strchrnul
+#undef __strerror_r
+#define __strerror_r strerror_r
+#undef __strndup
+#define __strndup strndup
+#undef __vsnprintf
+#define __vsnprintf vsnprintf
+
+#if (defined HAVE_DECL_CLEARERR_UNLOCKED && !HAVE_DECL_CLEARERR_UNLOCKED \
+ && !defined clearerr_unlocked)
+# define clearerr_unlocked(x) clearerr (x)
+#endif
+#if (defined HAVE_DECL_FEOF_UNLOCKED && !HAVE_DECL_FEOF_UNLOCKED \
+ && !defined feof_unlocked)
+# define feof_unlocked(x) feof (x)
+#endif
+#if (defined HAVE_DECL_FERROR_UNLOCKED && !HAVE_DECL_FERROR_UNLOCKED \
+ && !defined ferror_unlocked)
+# define ferror_unlocked(x) ferror (x)
+#endif
+#if (defined HAVE_DECL_FFLUSH_UNLOCKED && !HAVE_DECL_FFLUSH_UNLOCKED \
+ && !defined fflush_unlocked)
+# define fflush_unlocked(x) fflush (x)
+#endif
+#if (defined HAVE_DECL_FGETS_UNLOCKED && !HAVE_DECL_FGETS_UNLOCKED \
+ && !defined fgets_unlocked)
+# define fgets_unlocked(x,y,z) fgets (x,y,z)
+#endif
+#if (defined HAVE_DECL_FPUTC_UNLOCKED && !HAVE_DECL_FPUTC_UNLOCKED \
+ && !defined fputc_unlocked)
+# define fputc_unlocked(x,y) fputc (x,y)
+#endif
+#if (defined HAVE_DECL_FPUTS_UNLOCKED && !HAVE_DECL_FPUTS_UNLOCKED \
+ && !defined fputs_unlocked)
+# define fputs_unlocked(x,y) fputs (x,y)
+#endif
+#if (defined HAVE_DECL_FREAD_UNLOCKED && !HAVE_DECL_FREAD_UNLOCKED \
+ && !defined fread_unlocked)
+# define fread_unlocked(w,x,y,z) fread (w,x,y,z)
+#endif
+#if (defined HAVE_DECL_FWRITE_UNLOCKED && !HAVE_DECL_FWRITE_UNLOCKED \
+ && !defined fwrite_unlocked)
+# define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z)
+#endif
+#if (defined HAVE_DECL_GETC_UNLOCKED && !HAVE_DECL_GETC_UNLOCKED \
+ && !defined getc_unlocked)
+# define getc_unlocked(x) getc (x)
+#endif
+#if (defined HAVE_DECL_GETCHAR_UNLOCKED && !HAVE_DECL_GETCHAR_UNLOCKED \
+ && !defined getchar_unlocked)
+# define getchar_unlocked() getchar ()
+#endif
+#if (defined HAVE_DECL_PUTC_UNLOCKED && !HAVE_DECL_PUTC_UNLOCKED \
+ && !defined putc_unlocked)
+# define putc_unlocked(x,y) putc (x,y)
+#endif
+#if (defined HAVE_DECL_PUTCHAR_UNLOCKED && !HAVE_DECL_PUTCHAR_UNLOCKED \
+ && !defined putchar_unlocked)
+# define putchar_unlocked(x) putchar (x)
+#endif
+
+#endif /* !_LIBC */
+
+#ifndef __set_errno
+#define __set_errno(e) (errno = (e))
+#endif
+
+#if defined GNULIB_ARGP_DISABLE_DIRNAME
+# define __argp_base_name(arg) arg
+#elif defined GNULIB_ARGP_EXTERN_BASENAME
+extern char *__argp_base_name (const char *arg);
+#else
+# include "basename-lgpl.h"
+# define __argp_base_name last_component
+#endif
+
+#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
+# define __argp_short_program_name() (program_invocation_short_name)
+#else
+extern char *__argp_short_program_name (void);
+#endif
diff --git a/gl/lib/argp-parse.c b/gl/lib/argp-parse.c
new file mode 100644
index 0000000..42027bc
--- /dev/null
+++ b/gl/lib/argp-parse.c
@@ -0,0 +1,968 @@
+/* Hierarchical argument parsing, layered over getopt
+ Copyright (C) 1995-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Written by Miles Bader <miles@gnu.ai.mit.edu>.
+
+ 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/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <alloca.h>
+#include <stdalign.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <limits.h>
+#include <getopt.h>
+#include <getopt_int.h>
+
+#ifdef _LIBC
+# include <libintl.h>
+# undef dgettext
+# define dgettext(domain, msgid) \
+ __dcgettext (domain, msgid, LC_MESSAGES)
+#else
+# include "gettext.h"
+#endif
+#define N_(msgid) msgid
+
+#ifdef _LIBC
+# define ARGP_TEXT_DOMAIN "libc"
+#else
+# ifdef DEFAULT_TEXT_DOMAIN
+# define ARGP_TEXT_DOMAIN DEFAULT_TEXT_DOMAIN
+# else
+# define ARGP_TEXT_DOMAIN NULL
+# endif
+#endif
+
+#include "argp.h"
+#include "argp-namefrob.h"
+
+#define alignto(n, d) ((((n) + (d) - 1) / (d)) * (d))
+
+/* Getopt return values. */
+#define KEY_END (-1) /* The end of the options. */
+#define KEY_ARG 1 /* A non-option argument. */
+#define KEY_ERR '?' /* An error parsing the options. */
+
+/* The meta-argument used to prevent any further arguments being interpreted
+ as options. */
+#define QUOTE "--"
+
+/* The number of bits we steal in a long-option value for our own use. */
+#define GROUP_BITS CHAR_BIT
+
+/* The number of bits available for the user value. */
+#define USER_BITS ((sizeof ((struct option *)0)->val * CHAR_BIT) - GROUP_BITS)
+#define USER_MASK ((1 << USER_BITS) - 1)
+
+/* EZ alias for ARGP_ERR_UNKNOWN. */
+#define EBADKEY ARGP_ERR_UNKNOWN
+
+/* Default options. */
+
+/* When argp is given the --HANG switch, _ARGP_HANG is set and argp will sleep
+ for one second intervals, decrementing _ARGP_HANG until it's zero. Thus
+ you can force the program to continue by attaching a debugger and setting
+ it to 0 yourself. */
+static volatile int _argp_hang;
+
+#define OPT_PROGNAME -2
+#define OPT_USAGE -3
+#define OPT_HANG -4
+
+static const struct argp_option argp_default_options[] =
+{
+ {"help", '?', 0, 0, N_("give this help list"), -1},
+ {"usage", OPT_USAGE, 0, 0, N_("give a short usage message"), 0},
+ {"program-name",OPT_PROGNAME, N_("NAME"), OPTION_HIDDEN,
+ N_("set the program name"), 0},
+ {"HANG", OPT_HANG, N_("SECS"), OPTION_ARG_OPTIONAL | OPTION_HIDDEN,
+ N_("hang for SECS seconds (default 3600)"), 0},
+ {NULL, 0, 0, 0, NULL, 0}
+};
+
+static error_t
+argp_default_parser (int key, char *arg, struct argp_state *state)
+{
+ switch (key)
+ {
+ case '?':
+ __argp_state_help (state, state->out_stream, ARGP_HELP_STD_HELP);
+ break;
+ case OPT_USAGE:
+ __argp_state_help (state, state->out_stream,
+ ARGP_HELP_USAGE | ARGP_HELP_EXIT_OK);
+ break;
+
+ case OPT_PROGNAME: /* Set the program name. */
+#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_NAME
+ program_invocation_name = arg;
+#endif
+ /* [Note that some systems only have PROGRAM_INVOCATION_SHORT_NAME (aka
+ __PROGNAME), in which case, PROGRAM_INVOCATION_NAME is just defined
+ to be that, so we have to be a bit careful here.] */
+
+ /* Update what we use for messages. */
+ state->name = __argp_base_name (arg);
+
+#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
+ program_invocation_short_name = state->name;
+#endif
+
+ if ((state->flags & (ARGP_PARSE_ARGV0 | ARGP_NO_ERRS))
+ == ARGP_PARSE_ARGV0)
+ /* Update what getopt uses too. */
+ state->argv[0] = arg;
+
+ break;
+
+ case OPT_HANG:
+ _argp_hang = atoi (arg ? arg : "3600");
+ while (_argp_hang-- > 0)
+ __sleep (1);
+ break;
+
+ default:
+ return EBADKEY;
+ }
+ return 0;
+}
+
+static const struct argp argp_default_argp =
+ {argp_default_options, &argp_default_parser, NULL, NULL, NULL, NULL,
+ ARGP_TEXT_DOMAIN};
+
+
+static const struct argp_option argp_version_options[] =
+{
+ {"version", 'V', 0, 0, N_("print program version"), -1},
+ {NULL, 0, 0, 0, NULL, 0}
+};
+
+static error_t
+argp_version_parser (int key, char *arg, struct argp_state *state)
+{
+ switch (key)
+ {
+ case 'V':
+ if (argp_program_version_hook)
+ (*argp_program_version_hook) (state->out_stream, state);
+ else if (argp_program_version)
+ fprintf (state->out_stream, "%s\n", argp_program_version);
+ else
+ __argp_error (state, "%s",
+ dgettext (ARGP_TEXT_DOMAIN,
+ "(PROGRAM ERROR) No version known!?"));
+ if (! (state->flags & ARGP_NO_EXIT))
+ exit (0);
+ break;
+ default:
+ return EBADKEY;
+ }
+ return 0;
+}
+
+static const struct argp argp_version_argp =
+ {argp_version_options, &argp_version_parser, NULL, NULL, NULL, NULL,
+ ARGP_TEXT_DOMAIN};
+
+/* Returns the offset into the getopt long options array LONG_OPTIONS of a
+ long option with called NAME, or -1 if none is found. Passing NULL as
+ NAME will return the number of options. */
+static int
+find_long_option (struct option *long_options, const char *name)
+{
+ struct option *l = long_options;
+ while (l->name != NULL)
+ if (name != NULL && strcmp (l->name, name) == 0)
+ return l - long_options;
+ else
+ l++;
+ if (name == NULL)
+ return l - long_options;
+ else
+ return -1;
+}
+
+
+/* The state of a "group" during parsing. Each group corresponds to a
+ particular argp structure from the tree of such descending from the top
+ level argp passed to argp_parse. */
+struct group
+{
+ /* This group's parsing function. */
+ argp_parser_t parser;
+
+ /* Which argp this group is from. */
+ const struct argp *argp;
+
+ /* Points to the point in SHORT_OPTS corresponding to the end of the short
+ options for this group. We use it to determine from which group a
+ particular short options is from. */
+ char *short_end;
+
+ /* The number of non-option args successfully handled by this parser. */
+ unsigned args_processed;
+
+ /* This group's parser's parent's group. */
+ struct group *parent;
+ unsigned parent_index; /* And the our position in the parent. */
+
+ /* These fields are swapped into and out of the state structure when
+ calling this group's parser. */
+ void *input, **child_inputs;
+ void *hook;
+};
+
+/* Call GROUP's parser with KEY and ARG, swapping any group-specific info
+ from STATE before calling, and back into state afterwards. If GROUP has
+ no parser, EBADKEY is returned. */
+static error_t
+group_parse (struct group *group, struct argp_state *state, int key, char *arg)
+{
+ if (group->parser)
+ {
+ error_t err;
+ state->hook = group->hook;
+ state->input = group->input;
+ state->child_inputs = group->child_inputs;
+ state->arg_num = group->args_processed;
+ err = (*group->parser)(key, arg, state);
+ group->hook = state->hook;
+ return err;
+ }
+ else
+ return EBADKEY;
+}
+
+struct parser
+{
+ const struct argp *argp;
+
+ /* SHORT_OPTS is the getopt short options string for the union of all the
+ groups of options. */
+ char *short_opts;
+ /* LONG_OPTS is the array of getop long option structures for the union of
+ all the groups of options. */
+ struct option *long_opts;
+ /* OPT_DATA is the getopt data used for the re-entrant getopt. */
+ struct _getopt_data opt_data;
+
+ /* States of the various parsing groups. */
+ struct group *groups;
+ /* The end of the GROUPS array. */
+ struct group *egroup;
+ /* A vector containing storage for the CHILD_INPUTS field in all groups. */
+ void **child_inputs;
+
+ /* True if we think using getopt is still useful; if false, then
+ remaining arguments are just passed verbatim with ARGP_KEY_ARG. This is
+ cleared whenever getopt returns KEY_END, but may be set again if the user
+ moves the next argument pointer backwards. */
+ int try_getopt;
+
+ /* State block supplied to parsing routines. */
+ struct argp_state state;
+
+ /* Memory used by this parser. */
+ void *storage;
+};
+
+/* The next usable entries in the various parser tables being filled in by
+ convert_options. */
+struct parser_convert_state
+{
+ struct parser *parser;
+ char *short_end;
+ struct option *long_end;
+ void **child_inputs_end;
+};
+
+/* Converts all options in ARGP (which is put in GROUP) and ancestors
+ into getopt options stored in SHORT_OPTS and LONG_OPTS; SHORT_END and
+ CVT->LONG_END are the points at which new options are added. Returns the
+ next unused group entry. CVT holds state used during the conversion. */
+static struct group *
+convert_options (const struct argp *argp,
+ struct group *parent, unsigned parent_index,
+ struct group *group, struct parser_convert_state *cvt)
+{
+ /* REAL is the most recent non-alias value of OPT. */
+ const struct argp_option *real = argp->options;
+ const struct argp_child *children = argp->children;
+
+ if (real || argp->parser)
+ {
+ const struct argp_option *opt;
+
+ if (real)
+ for (opt = real; !__option_is_end (opt); opt++)
+ {
+ if (! (opt->flags & OPTION_ALIAS))
+ /* OPT isn't an alias, so we can use values from it. */
+ real = opt;
+
+ if (! (real->flags & OPTION_DOC))
+ /* A real option (not just documentation). */
+ {
+ if (__option_is_short (opt))
+ /* OPT can be used as a short option. */
+ {
+ *cvt->short_end++ = opt->key;
+ if (real->arg)
+ {
+ *cvt->short_end++ = ':';
+ if (real->flags & OPTION_ARG_OPTIONAL)
+ *cvt->short_end++ = ':';
+ }
+ *cvt->short_end = '\0'; /* keep 0 terminated */
+ }
+
+ if (opt->name
+ && find_long_option (cvt->parser->long_opts, opt->name) < 0)
+ /* OPT can be used as a long option. */
+ {
+ cvt->long_end->name = opt->name;
+ cvt->long_end->has_arg =
+ (real->arg
+ ? (real->flags & OPTION_ARG_OPTIONAL
+ ? optional_argument
+ : required_argument)
+ : no_argument);
+ cvt->long_end->flag = 0;
+ /* we add a disambiguating code to all the user's
+ values (which is removed before we actually call
+ the function to parse the value); this means that
+ the user loses use of the high 8 bits in all his
+ values (the sign of the lower bits is preserved
+ however)... */
+ cvt->long_end->val =
+ ((opt->key ? opt->key : real->key) & USER_MASK)
+ + (((group - cvt->parser->groups) + 1) << USER_BITS);
+
+ /* Keep the LONG_OPTS list terminated. */
+ (++cvt->long_end)->name = NULL;
+ }
+ }
+ }
+
+ group->parser = argp->parser;
+ group->argp = argp;
+ group->short_end = cvt->short_end;
+ group->args_processed = 0;
+ group->parent = parent;
+ group->parent_index = parent_index;
+ group->input = 0;
+ group->hook = 0;
+ group->child_inputs = 0;
+
+ if (children)
+ /* Assign GROUP's CHILD_INPUTS field some space from
+ CVT->child_inputs_end.*/
+ {
+ unsigned num_children = 0;
+ while (children[num_children].argp)
+ num_children++;
+ group->child_inputs = cvt->child_inputs_end;
+ cvt->child_inputs_end += num_children;
+ }
+
+ parent = group++;
+ }
+ else
+ parent = 0;
+
+ if (children)
+ {
+ unsigned index = 0;
+ while (children->argp)
+ group =
+ convert_options (children++->argp, parent, index++, group, cvt);
+ }
+
+ return group;
+}
+
+/* Find the merged set of getopt options, with keys appropriately prefixed. */
+static void
+parser_convert (struct parser *parser, const struct argp *argp, int flags)
+{
+ struct parser_convert_state cvt;
+
+ cvt.parser = parser;
+ cvt.short_end = parser->short_opts;
+ cvt.long_end = parser->long_opts;
+ cvt.child_inputs_end = parser->child_inputs;
+
+ if (flags & ARGP_IN_ORDER)
+ *cvt.short_end++ = '-';
+ else if (flags & ARGP_NO_ARGS)
+ *cvt.short_end++ = '+';
+ *cvt.short_end = '\0';
+
+ cvt.long_end->name = NULL;
+
+ parser->argp = argp;
+
+ if (argp)
+ parser->egroup = convert_options (argp, 0, 0, parser->groups, &cvt);
+ else
+ parser->egroup = parser->groups; /* No parsers at all! */
+}
+
+/* Lengths of various parser fields which we will allocated. */
+struct parser_sizes
+{
+ size_t short_len; /* Getopt short options string. */
+ size_t long_len; /* Getopt long options vector. */
+ size_t num_groups; /* Group structures we allocate. */
+ size_t num_child_inputs; /* Child input slots. */
+};
+
+/* For ARGP, increments the NUM_GROUPS field in SZS by the total number of
+ argp structures descended from it, and the SHORT_LEN & LONG_LEN fields by
+ the maximum lengths of the resulting merged getopt short options string and
+ long-options array, respectively. */
+static void
+calc_sizes (const struct argp *argp, struct parser_sizes *szs)
+{
+ const struct argp_child *child = argp->children;
+ const struct argp_option *opt = argp->options;
+
+ if (opt || argp->parser)
+ {
+ szs->num_groups++;
+ if (opt)
+ {
+ int num_opts = 0;
+ while (!__option_is_end (opt++))
+ num_opts++;
+ szs->short_len += num_opts * 3; /* opt + up to 2 ':'s */
+ szs->long_len += num_opts;
+ }
+ }
+
+ if (child)
+ while (child->argp)
+ {
+ calc_sizes ((child++)->argp, szs);
+ szs->num_child_inputs++;
+ }
+}
+
+/* Initializes PARSER to parse ARGP in a manner described by FLAGS. */
+static error_t
+parser_init (struct parser *parser, const struct argp *argp,
+ int argc, char **argv, int flags, void *input)
+{
+ error_t err = 0;
+ struct group *group;
+ struct parser_sizes szs;
+ struct _getopt_data opt_data = _GETOPT_DATA_INITIALIZER;
+ char *storage;
+ size_t glen, gsum;
+ size_t clen, csum;
+ size_t llen, lsum;
+ size_t slen, ssum;
+
+ szs.short_len = (flags & ARGP_NO_ARGS) ? 0 : 1;
+ szs.long_len = 0;
+ szs.num_groups = 0;
+ szs.num_child_inputs = 0;
+
+ if (argp)
+ calc_sizes (argp, &szs);
+
+ /* Lengths of the various bits of storage used by PARSER. */
+ glen = (szs.num_groups + 1) * sizeof (struct group);
+ clen = szs.num_child_inputs * sizeof (void *);
+ llen = (szs.long_len + 1) * sizeof (struct option);
+ slen = szs.short_len + 1;
+
+ /* Sums of previous lengths, properly aligned. There's no need to
+ align gsum, since struct group is aligned at least as strictly as
+ void * (since it contains a void * member). And there's no need
+ to align lsum, since struct option is aligned at least as
+ strictly as char. */
+ gsum = glen;
+ csum = alignto (gsum + clen, alignof (struct option));
+ lsum = csum + llen;
+ ssum = lsum + slen;
+
+ parser->storage = malloc (ssum);
+ if (! parser->storage)
+ return ENOMEM;
+
+ storage = parser->storage;
+ parser->groups = parser->storage;
+ parser->child_inputs = (void **) (storage + gsum);
+ parser->long_opts = (struct option *) (storage + csum);
+ parser->short_opts = storage + lsum;
+ parser->opt_data = opt_data;
+
+ memset (parser->child_inputs, 0, clen);
+ parser_convert (parser, argp, flags);
+
+ memset (&parser->state, 0, sizeof (struct argp_state));
+ parser->state.root_argp = parser->argp;
+ parser->state.argc = argc;
+ parser->state.argv = argv;
+ parser->state.flags = flags;
+ parser->state.err_stream = stderr;
+ parser->state.out_stream = stdout;
+ parser->state.next = 0; /* Tell getopt to initialize. */
+ parser->state.pstate = parser;
+
+ parser->try_getopt = 1;
+
+ /* Call each parser for the first time, giving it a chance to propagate
+ values to child parsers. */
+ if (parser->groups < parser->egroup)
+ parser->groups->input = input;
+ for (group = parser->groups;
+ group < parser->egroup && (!err || err == EBADKEY);
+ group++)
+ {
+ if (group->parent)
+ /* If a child parser, get the initial input value from the parent. */
+ group->input = group->parent->child_inputs[group->parent_index];
+
+ if (!group->parser
+ && group->argp->children && group->argp->children->argp)
+ /* For the special case where no parsing function is supplied for an
+ argp, propagate its input to its first child, if any (this just
+ makes very simple wrapper argps more convenient). */
+ group->child_inputs[0] = group->input;
+
+ err = group_parse (group, &parser->state, ARGP_KEY_INIT, 0);
+ }
+ if (err == EBADKEY)
+ err = 0; /* Some parser didn't understand. */
+
+ if (err)
+ return err;
+
+ if (parser->state.flags & ARGP_NO_ERRS)
+ {
+ parser->opt_data.opterr = 0;
+ if (parser->state.flags & ARGP_PARSE_ARGV0)
+ /* getopt always skips ARGV[0], so we have to fake it out. As long
+ as OPTERR is 0, then it shouldn't actually try to access it. */
+ parser->state.argv--, parser->state.argc++;
+ }
+ else
+ parser->opt_data.opterr = 1; /* Print error messages. */
+
+ if (parser->state.argv == argv && argv[0])
+ /* There's an argv[0]; use it for messages. */
+ parser->state.name = __argp_base_name (argv[0]);
+ else
+ parser->state.name = __argp_short_program_name ();
+
+ return 0;
+}
+
+/* Free any storage consumed by PARSER (but not PARSER itself). */
+static error_t
+parser_finalize (struct parser *parser,
+ error_t err, int arg_ebadkey, int *end_index)
+{
+ struct group *group;
+
+ if (err == EBADKEY && arg_ebadkey)
+ /* Suppress errors generated by unparsed arguments. */
+ err = 0;
+
+ if (! err)
+ {
+ if (parser->state.next == parser->state.argc)
+ /* We successfully parsed all arguments! Call all the parsers again,
+ just a few more times... */
+ {
+ for (group = parser->groups;
+ group < parser->egroup && (!err || err==EBADKEY);
+ group++)
+ if (group->args_processed == 0)
+ err = group_parse (group, &parser->state, ARGP_KEY_NO_ARGS, 0);
+ for (group = parser->egroup - 1;
+ group >= parser->groups && (!err || err==EBADKEY);
+ group--)
+ err = group_parse (group, &parser->state, ARGP_KEY_END, 0);
+
+ if (err == EBADKEY)
+ err = 0; /* Some parser didn't understand. */
+
+ /* Tell the user that all arguments are parsed. */
+ if (end_index)
+ *end_index = parser->state.next;
+ }
+ else if (end_index)
+ /* Return any remaining arguments to the user. */
+ *end_index = parser->state.next;
+ else
+ /* No way to return the remaining arguments, they must be bogus. */
+ {
+ if (!(parser->state.flags & ARGP_NO_ERRS)
+ && parser->state.err_stream)
+ fprintf (parser->state.err_stream,
+ dgettext (ARGP_TEXT_DOMAIN, "%s: Too many arguments\n"),
+ parser->state.name);
+ err = EBADKEY;
+ }
+ }
+
+ /* Okay, we're all done, with either an error or success; call the parsers
+ to indicate which one. */
+
+ if (err)
+ {
+ /* Maybe print an error message. */
+ if (err == EBADKEY)
+ /* An appropriate message describing what the error was should have
+ been printed earlier. */
+ __argp_state_help (&parser->state, parser->state.err_stream,
+ ARGP_HELP_STD_ERR);
+
+ /* Since we didn't exit, give each parser an error indication. */
+ for (group = parser->groups; group < parser->egroup; group++)
+ group_parse (group, &parser->state, ARGP_KEY_ERROR, 0);
+ }
+ else
+ /* Notify parsers of success, and propagate back values from parsers. */
+ {
+ /* We pass over the groups in reverse order so that child groups are
+ given a chance to do there processing before passing back a value to
+ the parent. */
+ for (group = parser->egroup - 1
+ ; group >= parser->groups && (!err || err == EBADKEY)
+ ; group--)
+ err = group_parse (group, &parser->state, ARGP_KEY_SUCCESS, 0);
+ if (err == EBADKEY)
+ err = 0; /* Some parser didn't understand. */
+ }
+
+ /* Call parsers once more, to do any final cleanup. Errors are ignored. */
+ for (group = parser->egroup - 1; group >= parser->groups; group--)
+ group_parse (group, &parser->state, ARGP_KEY_FINI, 0);
+
+ if (err == EBADKEY)
+ err = EINVAL;
+
+ free (parser->storage);
+
+ return err;
+}
+
+/* Call the user parsers to parse the non-option argument VAL, at the current
+ position, returning any error. The state NEXT pointer is assumed to have
+ been adjusted (by getopt) to point after this argument; this function will
+ adjust it correctly to reflect however many args actually end up being
+ consumed. */
+static error_t
+parser_parse_arg (struct parser *parser, char *val)
+{
+ /* Save the starting value of NEXT, first adjusting it so that the arg
+ we're parsing is again the front of the arg vector. */
+ int index = --parser->state.next;
+ error_t err = EBADKEY;
+ struct group *group;
+ int key = 0; /* Which of ARGP_KEY_ARG[S] we used. */
+
+ /* Try to parse the argument in each parser. */
+ for (group = parser->groups
+ ; group < parser->egroup && err == EBADKEY
+ ; group++)
+ {
+ parser->state.next++; /* For ARGP_KEY_ARG, consume the arg. */
+ key = ARGP_KEY_ARG;
+ err = group_parse (group, &parser->state, key, val);
+
+ if (err == EBADKEY)
+ /* This parser doesn't like ARGP_KEY_ARG; try ARGP_KEY_ARGS instead. */
+ {
+ parser->state.next--; /* For ARGP_KEY_ARGS, put back the arg. */
+ key = ARGP_KEY_ARGS;
+ err = group_parse (group, &parser->state, key, 0);
+ }
+ }
+
+ if (! err)
+ {
+ if (key == ARGP_KEY_ARGS)
+ /* The default for ARGP_KEY_ARGS is to assume that if NEXT isn't
+ changed by the user, *all* arguments should be considered
+ consumed. */
+ parser->state.next = parser->state.argc;
+
+ if (parser->state.next > index)
+ /* Remember that we successfully processed a non-option
+ argument -- but only if the user hasn't gotten tricky and set
+ the clock back. */
+ (--group)->args_processed += (parser->state.next - index);
+ else
+ /* The user wants to reparse some args, give getopt another try. */
+ parser->try_getopt = 1;
+ }
+
+ return err;
+}
+
+/* Call the user parsers to parse the option OPT, with argument VAL, at the
+ current position, returning any error. */
+static error_t
+parser_parse_opt (struct parser *parser, int opt, char *val)
+{
+ /* The group key encoded in the high bits; 0 for short opts or
+ group_number + 1 for long opts. */
+ int group_key = opt >> USER_BITS;
+ error_t err = EBADKEY;
+
+ if (group_key == 0)
+ /* A short option. By comparing OPT's position in SHORT_OPTS to the
+ various starting positions in each group's SHORT_END field, we can
+ determine which group OPT came from. */
+ {
+ struct group *group;
+ char *short_index = strchr (parser->short_opts, opt);
+
+ if (short_index)
+ for (group = parser->groups; group < parser->egroup; group++)
+ if (group->short_end > short_index)
+ {
+ err = group_parse (group, &parser->state, opt,
+ parser->opt_data.optarg);
+ break;
+ }
+ }
+ else
+ /* A long option. Preserve the sign in the user key, without
+ invoking undefined behavior. Assume two's complement. */
+ {
+ int user_key =
+ ((opt & (1 << (USER_BITS - 1))) ? ~USER_MASK : 0) | (opt & USER_MASK);
+ err =
+ group_parse (&parser->groups[group_key - 1], &parser->state,
+ user_key, parser->opt_data.optarg);
+ }
+
+ if (err == EBADKEY)
+ /* At least currently, an option not recognized is an error in the
+ parser, because we pre-compute which parser is supposed to deal
+ with each option. */
+ {
+ static const char bad_key_err[] =
+ N_("(PROGRAM ERROR) Option should have been recognized!?");
+ if (group_key == 0)
+ __argp_error (&parser->state, "-%c: %s", opt,
+ dgettext (ARGP_TEXT_DOMAIN, bad_key_err));
+ else
+ {
+ struct option *long_opt = parser->long_opts;
+ while (long_opt->val != opt && long_opt->name)
+ long_opt++;
+ __argp_error (&parser->state, "--%s: %s",
+ long_opt->name ? long_opt->name : "???",
+ dgettext (ARGP_TEXT_DOMAIN, bad_key_err));
+ }
+ }
+
+ return err;
+}
+
+/* Parse the next argument in PARSER (as indicated by PARSER->state.next).
+ Any error from the parsers is returned, and *ARGP_EBADKEY indicates
+ whether a value of EBADKEY is due to an unrecognized argument (which is
+ generally not fatal). */
+static error_t
+parser_parse_next (struct parser *parser, int *arg_ebadkey)
+{
+ int opt;
+ error_t err = 0;
+
+ if (parser->state.quoted && parser->state.next < parser->state.quoted)
+ /* The next argument pointer has been moved to before the quoted
+ region, so pretend we never saw the quoting "--", and give getopt
+ another chance. If the user hasn't removed it, getopt will just
+ process it again. */
+ parser->state.quoted = 0;
+
+ if (parser->try_getopt && !parser->state.quoted)
+ /* Give getopt a chance to parse this. */
+ {
+ /* Put it back in OPTIND for getopt. */
+ parser->opt_data.optind = parser->state.next;
+ /* Distinguish KEY_ERR from a real option. */
+ parser->opt_data.optopt = KEY_END;
+ if (parser->state.flags & ARGP_LONG_ONLY)
+ opt = _getopt_long_only_r (parser->state.argc, parser->state.argv,
+ parser->short_opts, parser->long_opts, 0,
+ &parser->opt_data);
+ else
+ opt = _getopt_long_r (parser->state.argc, parser->state.argv,
+ parser->short_opts, parser->long_opts, 0,
+ &parser->opt_data);
+ /* And see what getopt did. */
+ parser->state.next = parser->opt_data.optind;
+
+ if (opt == KEY_END)
+ /* Getopt says there are no more options, so stop using
+ getopt; we'll continue if necessary on our own. */
+ {
+ parser->try_getopt = 0;
+ if (parser->state.next > 1
+ && strcmp (parser->state.argv[parser->state.next - 1], QUOTE)
+ == 0)
+ /* Not only is this the end of the options, but it's a
+ "quoted" region, which may have args that *look* like
+ options, so we definitely shouldn't try to use getopt past
+ here, whatever happens. */
+ parser->state.quoted = parser->state.next;
+ }
+ else if (opt == KEY_ERR && parser->opt_data.optopt != KEY_END)
+ /* KEY_ERR can have the same value as a valid user short
+ option, but in the case of a real error, getopt sets OPTOPT
+ to the offending character, which can never be KEY_END. */
+ {
+ *arg_ebadkey = 0;
+ return EBADKEY;
+ }
+ }
+ else
+ opt = KEY_END;
+
+ if (opt == KEY_END)
+ {
+ /* We're past what getopt considers the options. */
+ if (parser->state.next >= parser->state.argc
+ || (parser->state.flags & ARGP_NO_ARGS))
+ /* Indicate that we're done. */
+ {
+ *arg_ebadkey = 1;
+ return EBADKEY;
+ }
+ else
+ /* A non-option arg; simulate what getopt might have done. */
+ {
+ opt = KEY_ARG;
+ parser->opt_data.optarg = parser->state.argv[parser->state.next++];
+ }
+ }
+
+ if (opt == KEY_ARG)
+ /* A non-option argument; try each parser in turn. */
+ err = parser_parse_arg (parser, parser->opt_data.optarg);
+ else
+ err = parser_parse_opt (parser, opt, parser->opt_data.optarg);
+
+ if (err == EBADKEY)
+ *arg_ebadkey = (opt == KEY_END || opt == KEY_ARG);
+
+ return err;
+}
+
+/* Parse the options strings in ARGC & ARGV according to the argp in ARGP.
+ FLAGS is one of the ARGP_ flags above. If END_INDEX is non-NULL, the
+ index in ARGV of the first unparsed option is returned in it. If an
+ unknown option is present, EINVAL is returned; if some parser routine
+ returned a non-zero value, it is returned; otherwise 0 is returned. */
+error_t
+__argp_parse (const struct argp *argp, int argc, char **argv, unsigned flags,
+ int *end_index, void *input)
+{
+ error_t err;
+ struct parser parser;
+
+ /* If true, then err == EBADKEY is a result of a non-option argument failing
+ to be parsed (which in some cases isn't actually an error). */
+ int arg_ebadkey = 0;
+
+#ifndef _LIBC
+ if (!(flags & ARGP_PARSE_ARGV0))
+ {
+#if HAVE_DECL_PROGRAM_INVOCATION_NAME
+ if (!program_invocation_name)
+ program_invocation_name = argv[0];
+#endif
+#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
+ if (!program_invocation_short_name)
+ program_invocation_short_name = __argp_base_name (argv[0]);
+#endif
+ }
+#endif
+
+ if (! (flags & ARGP_NO_HELP))
+ /* Add our own options. */
+ {
+ struct argp_child *child = alloca (4 * sizeof (struct argp_child));
+ struct argp *top_argp = alloca (sizeof (struct argp));
+
+ /* TOP_ARGP has no options, it just serves to group the user & default
+ argps. */
+ memset (top_argp, 0, sizeof (*top_argp));
+ top_argp->children = child;
+
+ memset (child, 0, 4 * sizeof (struct argp_child));
+
+ if (argp)
+ (child++)->argp = argp;
+ (child++)->argp = &argp_default_argp;
+ if (argp_program_version || argp_program_version_hook)
+ (child++)->argp = &argp_version_argp;
+ child->argp = 0;
+
+ argp = top_argp;
+ }
+
+ /* Construct a parser for these arguments. */
+ err = parser_init (&parser, argp, argc, argv, flags, input);
+
+ if (! err)
+ /* Parse! */
+ {
+ while (! err)
+ err = parser_parse_next (&parser, &arg_ebadkey);
+ err = parser_finalize (&parser, err, arg_ebadkey, end_index);
+ }
+
+ return err;
+}
+#ifdef weak_alias
+weak_alias (__argp_parse, argp_parse)
+#endif
+
+/* Return the input field for ARGP in the parser corresponding to STATE; used
+ by the help routines. */
+void *
+__argp_input (const struct argp *argp, const struct argp_state *state)
+{
+ if (state)
+ {
+ struct group *group;
+ struct parser *parser = state->pstate;
+
+ for (group = parser->groups; group < parser->egroup; group++)
+ if (group->argp == argp)
+ return group->input;
+ }
+
+ return 0;
+}
+#ifdef weak_alias
+weak_alias (__argp_input, _argp_input)
+#endif
diff --git a/gl/lib/argp-pin.c b/gl/lib/argp-pin.c
new file mode 100644
index 0000000..f9cb45a
--- /dev/null
+++ b/gl/lib/argp-pin.c
@@ -0,0 +1,33 @@
+/* Full and short program names for argp module
+ Copyright (C) 2005, 2009-2022 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/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME
+char *program_invocation_short_name = 0;
+#endif
+#ifndef HAVE_PROGRAM_INVOCATION_NAME
+char *program_invocation_name = 0;
+#endif
+
+#if (defined HAVE_PROGRAM_INVOCATION_SHORT_NAME \
+ && defined HAVE_PROGRAM_INVOCATION_NAME)
+/* This declaration is solely to ensure that after preprocessing
+ this file is never empty. */
+typedef int dummy;
+#endif
diff --git a/gl/lib/argp-pv.c b/gl/lib/argp-pv.c
new file mode 100644
index 0000000..8363032
--- /dev/null
+++ b/gl/lib/argp-pv.c
@@ -0,0 +1,33 @@
+/* Default definition for ARGP_PROGRAM_VERSION.
+ Copyright (C) 1996-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Written by Miles Bader <miles@gnu.ai.mit.edu>.
+
+ 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 set by the user program to a non-zero value, then a default option
+ --version is added (unless the ARGP_NO_HELP flag is used), which will
+ print this string followed by a newline and exit (unless the
+ ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */
+const char *argp_program_version
+/* This variable should be zero-initialized. On most systems, putting it into
+ BSS is sufficient. Not so on Mac OS X 10.3 and 10.4, see
+ <https://lists.gnu.org/r/bug-gnulib/2009-01/msg00329.html>
+ <https://lists.gnu.org/r/bug-gnulib/2009-08/msg00096.html>. */
+#if defined __ELF__
+ /* On ELF systems, variables in BSS behave well. */
+#else
+ = (const char *) 0
+#endif
+ ;
diff --git a/gl/lib/argp-pvh.c b/gl/lib/argp-pvh.c
new file mode 100644
index 0000000..7001712
--- /dev/null
+++ b/gl/lib/argp-pvh.c
@@ -0,0 +1,30 @@
+/* Default definition for ARGP_PROGRAM_VERSION_HOOK.
+ Copyright (C) 1996-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Written by Miles Bader <miles@gnu.ai.mit.edu>.
+
+ 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/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "argp.h"
+
+/* If set by the user program to a non-zero value, then a default option
+ --version is added (unless the ARGP_NO_HELP flag is used), which calls
+ this function with a stream to print the version to and a pointer to the
+ current parsing state, and then exits (unless the ARGP_NO_EXIT flag is
+ used). This variable takes precedent over ARGP_PROGRAM_VERSION. */
+void (*argp_program_version_hook) (FILE *stream, struct argp_state *state) = NULL;
diff --git a/gl/lib/argp-xinl.c b/gl/lib/argp-xinl.c
new file mode 100644
index 0000000..90b7d17
--- /dev/null
+++ b/gl/lib/argp-xinl.c
@@ -0,0 +1,46 @@
+/* Real definitions for extern inline functions in argp.h
+ Copyright (C) 1997-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Written by Miles Bader <miles@gnu.ai.mit.edu>.
+
+ 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/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined _LIBC || defined HAVE_FEATURES_H
+# include <features.h>
+#endif
+
+#ifndef __USE_EXTERN_INLINES
+# define __USE_EXTERN_INLINES 1
+#endif
+#ifdef _LIBC
+# define ARGP_EI
+#else
+# define ARGP_EI _GL_EXTERN_INLINE
+#endif
+#undef __OPTIMIZE__
+#define __OPTIMIZE__ 1
+#include "argp.h"
+
+/* Add weak aliases. */
+#if _LIBC - 0 && defined (weak_alias)
+
+weak_alias (__argp_usage, argp_usage)
+weak_alias (__option_is_short, _option_is_short)
+weak_alias (__option_is_end, _option_is_end)
+
+#endif
diff --git a/gl/lib/argp.h b/gl/lib/argp.h
new file mode 100644
index 0000000..8a28488
--- /dev/null
+++ b/gl/lib/argp.h
@@ -0,0 +1,643 @@
+/* Hierarchical argument parsing, layered over getopt.
+ Copyright (C) 1995-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Written by Miles Bader <miles@gnu.ai.mit.edu>.
+
+ 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/>. */
+
+#ifndef _ARGP_H
+#define _ARGP_H
+
+#include <stdio.h>
+#include <ctype.h>
+#include <getopt.h>
+#include <limits.h>
+
+#define __need_error_t
+#include <errno.h>
+
+#ifndef __THROW
+# define __THROW
+#endif
+#ifndef __NTH
+# define __NTH(fct) fct __THROW
+#endif
+
+/* GCC 2.95 and later have "__restrict"; C99 compilers have
+ "restrict", and "configure" may have defined "restrict".
+ Other compilers use __restrict, __restrict__, and _Restrict, and
+ 'configure' might #define 'restrict' to those words. */
+#ifndef __restrict
+# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__) \
+ || __clang_major__ >= 3)
+# if 199901L <= __STDC_VERSION__
+# define __restrict restrict
+# else
+# define __restrict
+# endif
+# endif
+#endif
+
+#ifndef __error_t_defined
+typedef int error_t;
+# define __error_t_defined
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Glibc documentation:
+ https://www.gnu.org/software/libc/manual/html_node/Argp.html */
+
+/* A description of a particular option. A pointer to an array of
+ these is passed in the OPTIONS field of an argp structure. Each option
+ entry can correspond to one long option and/or one short option; more
+ names for the same option can be added by following an entry in an option
+ array with options having the OPTION_ALIAS flag set. */
+struct argp_option
+{
+ /* The long option name. For more than one name for the same option, you
+ can use following options with the OPTION_ALIAS flag set. */
+ const char *name;
+
+ /* What key is returned for this option. If > 0 and printable, then it's
+ also accepted as a short option. */
+ int key;
+
+ /* If non-NULL, this is the name of the argument associated with this
+ option, which is required unless the OPTION_ARG_OPTIONAL flag is set. */
+ const char *arg;
+
+ /* OPTION_ flags. */
+ int flags;
+
+ /* The doc string for this option. If both NAME and KEY are 0, This string
+ will be printed outdented from the normal option column, making it
+ useful as a group header (it will be the first thing printed in its
+ group); in this usage, it's conventional to end the string with a ':'.
+
+ Write the initial value as N_("TEXT") if you want xgettext to collect
+ it into a POT file. */
+ const char *doc;
+
+ /* The group this option is in. In a long help message, options are sorted
+ alphabetically within each group, and the groups presented in the order
+ 0, 1, 2, ..., n, -m, ..., -2, -1. Every entry in an options array with
+ if this field 0 will inherit the group number of the previous entry, or
+ zero if it's the first one, unless its a group header (NAME and KEY both
+ 0), in which case, the previous entry + 1 is the default. Automagic
+ options such as --help are put into group -1. */
+ int group;
+};
+
+/* The argument associated with this option is optional. */
+#define OPTION_ARG_OPTIONAL 0x1
+
+/* This option isn't displayed in any help messages. */
+#define OPTION_HIDDEN 0x2
+
+/* This option is an alias for the closest previous non-alias option. This
+ means that it will be displayed in the same help entry, and will inherit
+ fields other than NAME and KEY from the aliased option. */
+#define OPTION_ALIAS 0x4
+
+/* This option isn't actually an option (and so should be ignored by the
+ actual option parser), but rather an arbitrary piece of documentation that
+ should be displayed in much the same manner as the options. If this flag
+ is set, then the option NAME field is displayed unmodified (e.g., no '--'
+ prefix is added) at the left-margin (where a *short* option would normally
+ be displayed), and the documentation string in the normal place. The NAME
+ field will be translated using gettext, unless OPTION_NO_TRANS is set (see
+ below). For purposes of sorting, any leading whitespace and punctuation is
+ ignored, except that if the first non-whitespace character is not '-', this
+ entry is displayed after all options (and OPTION_DOC entries with a leading
+ '-') in the same group. */
+#define OPTION_DOC 0x8
+
+/* This option shouldn't be included in "long" usage messages (but is still
+ included in help messages). This is mainly intended for options that are
+ completely documented in an argp's ARGS_DOC field, in which case including
+ the option in the generic usage list would be redundant. For instance,
+ if ARGS_DOC is "FOO BAR\n-x BLAH", and the '-x' option's purpose is to
+ distinguish these two cases, -x should probably be marked
+ OPTION_NO_USAGE. */
+#define OPTION_NO_USAGE 0x10
+
+/* Valid only in conjunction with OPTION_DOC. This option disables translation
+ of option name. */
+#define OPTION_NO_TRANS 0x20
+
+struct argp; /* fwd declare this type */
+struct argp_state; /* " */
+struct argp_child; /* " */
+
+/* The type of a pointer to an argp parsing function. */
+typedef error_t (*argp_parser_t) (int __key, char *__arg,
+ struct argp_state *__state);
+
+/* What to return for unrecognized keys. For special ARGP_KEY_ keys, such
+ returns will simply be ignored. For user keys, this error will be turned
+ into EINVAL (if the call to argp_parse is such that errors are propagated
+ back to the user instead of exiting); returning EINVAL itself would result
+ in an immediate stop to parsing in *all* cases. */
+#define ARGP_ERR_UNKNOWN E2BIG /* Hurd should never need E2BIG. XXX */
+
+/* Special values for the KEY argument to an argument parsing function.
+ ARGP_ERR_UNKNOWN should be returned if they aren't understood.
+
+ The sequence of keys to a parsing function is either (where each
+ uppercased word should be prefixed by 'ARGP_KEY_' and opt is a user key):
+
+ INIT opt... NO_ARGS END SUCCESS -- No non-option arguments at all
+ or INIT (opt | ARG)... END SUCCESS -- All non-option args parsed
+ or INIT (opt | ARG)... SUCCESS -- Some non-option arg unrecognized
+
+ The third case is where every parser returned ARGP_KEY_UNKNOWN for an
+ argument, in which case parsing stops at that argument (returning the
+ unparsed arguments to the caller of argp_parse if requested, or stopping
+ with an error message if not).
+
+ If an error occurs (either detected by argp, or because the parsing
+ function returned an error value), then the parser is called with
+ ARGP_KEY_ERROR, and no further calls are made. */
+
+/* This is not an option at all, but rather a command line argument. If a
+ parser receiving this key returns success, the fact is recorded, and the
+ ARGP_KEY_NO_ARGS case won't be used. HOWEVER, if while processing the
+ argument, a parser function decrements the NEXT field of the state it's
+ passed, the option won't be considered processed; this is to allow you to
+ actually modify the argument (perhaps into an option), and have it
+ processed again. */
+#define ARGP_KEY_ARG 0
+/* There are remaining arguments not parsed by any parser, which may be found
+ starting at (STATE->argv + STATE->next). If success is returned, but
+ STATE->next left untouched, it's assumed that all arguments were consume,
+ otherwise, the parser should adjust STATE->next to reflect any arguments
+ consumed. */
+#define ARGP_KEY_ARGS 0x1000006
+/* There are no more command line arguments at all. */
+#define ARGP_KEY_END 0x1000001
+/* Because it's common to want to do some special processing if there aren't
+ any non-option args, user parsers are called with this key if they didn't
+ successfully process any non-option arguments. Called just before
+ ARGP_KEY_END (where more general validity checks on previously parsed
+ arguments can take place). */
+#define ARGP_KEY_NO_ARGS 0x1000002
+/* Passed in before any parsing is done. Afterwards, the values of each
+ element of the CHILD_INPUT field, if any, in the state structure is
+ copied to each child's state to be the initial value of the INPUT field. */
+#define ARGP_KEY_INIT 0x1000003
+/* Use after all other keys, including SUCCESS & END. */
+#define ARGP_KEY_FINI 0x1000007
+/* Passed in when parsing has successfully been completed (even if there are
+ still arguments remaining). */
+#define ARGP_KEY_SUCCESS 0x1000004
+/* Passed in if an error occurs. */
+#define ARGP_KEY_ERROR 0x1000005
+
+/* An argp structure contains a set of options declarations, a function to
+ deal with parsing one, documentation string, a possible vector of child
+ argp's, and perhaps a function to filter help output. When actually
+ parsing options, getopt is called with the union of all the argp
+ structures chained together through their CHILD pointers, with conflicts
+ being resolved in favor of the first occurrence in the chain. */
+struct argp
+{
+ /* An array of argp_option structures, terminated by an entry with both
+ NAME and KEY having a value of 0. */
+ const struct argp_option *options;
+
+ /* What to do with an option from this structure. KEY is the key
+ associated with the option, and ARG is any associated argument (NULL if
+ none was supplied). If KEY isn't understood, ARGP_ERR_UNKNOWN should be
+ returned. If a non-zero, non-ARGP_ERR_UNKNOWN value is returned, then
+ parsing is stopped immediately, and that value is returned from
+ argp_parse(). For special (non-user-supplied) values of KEY, see the
+ ARGP_KEY_ definitions below. */
+ argp_parser_t parser;
+
+ /* If non-NULL, a string describing what other arguments are wanted by this
+ program. It is only used by argp_usage to print the "Usage:" message.
+ If it contains newlines, the strings separated by them are considered
+ alternative usage patterns, and printed on separate lines (lines after
+ the first are prefix by " or: " instead of "Usage:"). */
+ const char *args_doc;
+
+ /* If non-NULL, a string containing extra text to be printed before and
+ after the options in a long help message (separated by a vertical tab
+ '\v' character).
+ Write the initial value as N_("BEFORE-TEXT") "\v" N_("AFTER-TEXT") if
+ you want xgettext to collect the two pieces of text into a POT file. */
+ const char *doc;
+
+ /* A vector of argp_children structures, terminated by a member with a 0
+ argp field, pointing to child argps should be parsed with this one. Any
+ conflicts are resolved in favor of this argp, or early argps in the
+ CHILDREN list. This field is useful if you use libraries that supply
+ their own argp structure, which you want to use in conjunction with your
+ own. */
+ const struct argp_child *children;
+
+ /* If non-zero, this should be a function to filter the output of help
+ messages. KEY is either a key from an option, in which case TEXT is
+ that option's help text, or a special key from the ARGP_KEY_HELP_
+ defines, below, describing which other help text TEXT is. The function
+ should return either TEXT, if it should be used as-is, a replacement
+ string, which should be malloced, and will be freed by argp, or NULL,
+ meaning "print nothing". The value for TEXT is *after* any translation
+ has been done, so if any of the replacement text also needs translation,
+ that should be done by the filter function. INPUT is either the input
+ supplied to argp_parse, or NULL, if argp_help was called directly. */
+ char *(*help_filter) (int __key, const char *__text, void *__input);
+
+ /* If non-zero the strings used in the argp library are translated using
+ the domain described by this string. Otherwise the currently installed
+ default domain is used. */
+ const char *argp_domain;
+};
+
+/* Possible KEY arguments to a help filter function. */
+#define ARGP_KEY_HELP_PRE_DOC 0x2000001 /* Help text preceding options. */
+#define ARGP_KEY_HELP_POST_DOC 0x2000002 /* Help text following options. */
+#define ARGP_KEY_HELP_HEADER 0x2000003 /* Option header string. */
+#define ARGP_KEY_HELP_EXTRA 0x2000004 /* After all other documentation;
+ TEXT is NULL for this key. */
+/* Explanatory note emitted when duplicate option arguments have been
+ suppressed. */
+#define ARGP_KEY_HELP_DUP_ARGS_NOTE 0x2000005
+#define ARGP_KEY_HELP_ARGS_DOC 0x2000006 /* Argument doc string. */
+
+/* When an argp has a non-zero CHILDREN field, it should point to a vector of
+ argp_child structures, each of which describes a subsidiary argp. */
+struct argp_child
+{
+ /* The child parser. */
+ const struct argp *argp;
+
+ /* Flags for this child. */
+ int flags;
+
+ /* If non-zero, an optional header to be printed in help output before the
+ child options. As a side-effect, a non-zero value forces the child
+ options to be grouped together; to achieve this effect without actually
+ printing a header string, use a value of "". */
+ const char *header;
+
+ /* Where to group the child options relative to the other ("consolidated")
+ options in the parent argp; the values are the same as the GROUP field
+ in argp_option structs, but all child-groupings follow parent options at
+ a particular group level. If both this field and HEADER are zero, then
+ they aren't grouped at all, but rather merged with the parent options
+ (merging the child's grouping levels with the parents). */
+ int group;
+};
+
+/* Parsing state. This is provided to parsing functions called by argp,
+ which may examine and, as noted, modify fields. */
+struct argp_state
+{
+ /* The top level ARGP being parsed. */
+ const struct argp *root_argp;
+
+ /* The argument vector being parsed. May be modified. */
+ int argc;
+ char **argv;
+
+ /* The index in ARGV of the next arg that to be parsed. May be modified. */
+ int next;
+
+ /* The flags supplied to argp_parse. May be modified. */
+ unsigned flags;
+
+ /* While calling a parsing function with a key of ARGP_KEY_ARG, this is the
+ number of the current arg, starting at zero, and incremented after each
+ such call returns. At all other times, this is the number of such
+ arguments that have been processed. */
+ unsigned arg_num;
+
+ /* If non-zero, the index in ARGV of the first argument following a special
+ '--' argument (which prevents anything following being interpreted as an
+ option). Only set once argument parsing has proceeded past this point. */
+ int quoted;
+
+ /* An arbitrary pointer passed in from the user. */
+ void *input;
+ /* Values to pass to child parsers. This vector will be the same length as
+ the number of children for the current parser. */
+ void **child_inputs;
+
+ /* For the parser's use. Initialized to 0. */
+ void *hook;
+
+ /* The name used when printing messages. This is initialized to ARGV[0],
+ or PROGRAM_INVOCATION_NAME if that is unavailable. */
+ char *name;
+
+ /* Streams used when argp prints something. */
+ FILE *err_stream; /* For errors; initialized to stderr. */
+ FILE *out_stream; /* For information; initialized to stdout. */
+
+ void *pstate; /* Private, for use by argp. */
+};
+
+/* Flags for argp_parse (note that the defaults are those that are
+ convenient for program command line parsing): */
+
+/* Don't ignore the first element of ARGV. Normally (and always unless
+ ARGP_NO_ERRS is set) the first element of the argument vector is
+ skipped for option parsing purposes, as it corresponds to the program name
+ in a command line. */
+#define ARGP_PARSE_ARGV0 0x01
+
+/* Don't print error messages for unknown options to stderr; unless this flag
+ is set, ARGP_PARSE_ARGV0 is ignored, as ARGV[0] is used as the program
+ name in the error messages. This flag implies ARGP_NO_EXIT (on the
+ assumption that silent exiting upon errors is bad behaviour). */
+#define ARGP_NO_ERRS 0x02
+
+/* Don't parse any non-option args. Normally non-option args are parsed by
+ calling the parse functions with a key of ARGP_KEY_ARG, and the actual arg
+ as the value. Since it's impossible to know which parse function wants to
+ handle it, each one is called in turn, until one returns 0 or an error
+ other than ARGP_ERR_UNKNOWN; if an argument is handled by no one, the
+ argp_parse returns prematurely (but with a return value of 0). If all
+ args have been parsed without error, all parsing functions are called one
+ last time with a key of ARGP_KEY_END. This flag needn't normally be set,
+ as the normal behavior is to stop parsing as soon as some argument can't
+ be handled. */
+#define ARGP_NO_ARGS 0x04
+
+/* Parse options and arguments in the same order they occur on the command
+ line -- normally they're rearranged so that all options come first. */
+#define ARGP_IN_ORDER 0x08
+
+/* Don't provide the standard long option --help, which causes usage and
+ option help information to be output to stdout, and exit (0) called. */
+#define ARGP_NO_HELP 0x10
+
+/* Don't exit on errors (they may still result in error messages). */
+#define ARGP_NO_EXIT 0x20
+
+/* Use the gnu getopt "long-only" rules for parsing arguments. */
+#define ARGP_LONG_ONLY 0x40
+
+/* Turns off any message-printing/exiting options. */
+#define ARGP_SILENT (ARGP_NO_EXIT | ARGP_NO_ERRS | ARGP_NO_HELP)
+
+/* Parse the options strings in ARGC & ARGV according to the options in ARGP.
+ FLAGS is one of the ARGP_ flags above. If ARG_INDEX is non-NULL, the
+ index in ARGV of the first unparsed option is returned in it. If an
+ unknown option is present, ARGP_ERR_UNKNOWN is returned; if some parser
+ routine returned a non-zero value, it is returned; otherwise 0 is
+ returned. This function may also call exit unless the ARGP_NO_HELP flag
+ is set. INPUT is a pointer to a value to be passed in to the parser. */
+extern error_t argp_parse (const struct argp *__restrict __argp,
+ int /*argc*/, char **__restrict /*argv*/,
+ unsigned __flags, int *__restrict __arg_index,
+ void *__restrict __input);
+extern error_t __argp_parse (const struct argp *__restrict __argp,
+ int /*argc*/, char **__restrict /*argv*/,
+ unsigned __flags, int *__restrict __arg_index,
+ void *__restrict __input);
+
+/* Global variables. */
+
+/* GNULIB makes sure both program_invocation_name and
+ program_invocation_short_name are available */
+#ifdef GNULIB_PROGRAM_INVOCATION_NAME
+extern char *program_invocation_name;
+# undef HAVE_DECL_PROGRAM_INVOCATION_NAME
+# define HAVE_DECL_PROGRAM_INVOCATION_NAME 1
+#endif
+
+#ifdef GNULIB_PROGRAM_INVOCATION_SHORT_NAME
+extern char *program_invocation_short_name;
+# undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
+# define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME 1
+#endif
+
+/* If defined or set by the user program to a non-zero value, then a default
+ option --version is added (unless the ARGP_NO_HELP flag is used), which
+ will print this string followed by a newline and exit (unless the
+ ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */
+extern const char *argp_program_version;
+
+/* If defined or set by the user program to a non-zero value, then a default
+ option --version is added (unless the ARGP_NO_HELP flag is used), which
+ calls this function with a stream to print the version to and a pointer to
+ the current parsing state, and then exits (unless the ARGP_NO_EXIT flag is
+ used). This variable takes precedent over ARGP_PROGRAM_VERSION. */
+extern void (*argp_program_version_hook) (FILE *__restrict __stream,
+ struct argp_state *__restrict
+ __state);
+
+/* If defined or set by the user program, it should point to string that is
+ the bug-reporting address for the program. It will be printed by
+ argp_help if the ARGP_HELP_BUG_ADDR flag is set (as it is by various
+ standard help messages), embedded in a sentence that says something like
+ "Report bugs to ADDR." */
+extern const char *argp_program_bug_address;
+
+/* The exit status that argp will use when exiting due to a parsing error.
+ If not defined or set by the user program, this defaults to EX_USAGE from
+ <sysexits.h>. */
+extern error_t argp_err_exit_status;
+
+/* Flags for argp_help. */
+#define ARGP_HELP_USAGE 0x01 /* a Usage: message. */
+#define ARGP_HELP_SHORT_USAGE 0x02 /* " but don't actually print options. */
+#define ARGP_HELP_SEE 0x04 /* a "Try ... for more help" message. */
+#define ARGP_HELP_LONG 0x08 /* a long help message. */
+#define ARGP_HELP_PRE_DOC 0x10 /* doc string preceding long help. */
+#define ARGP_HELP_POST_DOC 0x20 /* doc string following long help. */
+#define ARGP_HELP_DOC (ARGP_HELP_PRE_DOC | ARGP_HELP_POST_DOC)
+#define ARGP_HELP_BUG_ADDR 0x40 /* bug report address */
+#define ARGP_HELP_LONG_ONLY 0x80 /* modify output appropriately to
+ reflect ARGP_LONG_ONLY mode. */
+
+/* These ARGP_HELP flags are only understood by argp_state_help. */
+#define ARGP_HELP_EXIT_ERR 0x100 /* Call exit(1) instead of returning. */
+#define ARGP_HELP_EXIT_OK 0x200 /* Call exit(0) instead of returning. */
+
+/* The standard thing to do after a program command line parsing error, if an
+ error message has already been printed. */
+#define ARGP_HELP_STD_ERR \
+ (ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR)
+/* The standard thing to do after a program command line parsing error, if no
+ more specific error message has been printed. */
+#define ARGP_HELP_STD_USAGE \
+ (ARGP_HELP_SHORT_USAGE | ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR)
+/* The standard thing to do in response to a --help option. */
+#define ARGP_HELP_STD_HELP \
+ (ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG | ARGP_HELP_EXIT_OK \
+ | ARGP_HELP_DOC | ARGP_HELP_BUG_ADDR)
+
+/* Output a usage message for ARGP to STREAM. FLAGS are from the set
+ ARGP_HELP_*. */
+extern void argp_help (const struct argp *__restrict __argp,
+ FILE *__restrict __stream,
+ unsigned __flags, char *__restrict __name);
+extern void __argp_help (const struct argp *__restrict __argp,
+ FILE *__restrict __stream, unsigned __flags,
+ char *__name);
+
+/* The following routines are intended to be called from within an argp
+ parsing routine (thus taking an argp_state structure as the first
+ argument). They may or may not print an error message and exit, depending
+ on the flags in STATE -- in any case, the caller should be prepared for
+ them *not* to exit, and should return an appropriate error after calling
+ them. [argp_usage & argp_error should probably be called argp_state_...,
+ but they're used often enough that they should be short] */
+
+/* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are
+ from the set ARGP_HELP_*. */
+extern void argp_state_help (const struct argp_state *__restrict __state,
+ FILE *__restrict __stream,
+ unsigned int __flags);
+extern void __argp_state_help (const struct argp_state *__restrict __state,
+ FILE *__restrict __stream,
+ unsigned int __flags);
+
+#if _LIBC
+/* Possibly output the standard usage message for ARGP to stderr and exit. */
+extern void argp_usage (const struct argp_state *__state);
+extern void __argp_usage (const struct argp_state *__state);
+#endif
+
+/* If appropriate, print the printf string FMT and following args, preceded
+ by the program name and ':', to stderr, and followed by a "Try ... --help"
+ message, then exit (1). */
+extern void argp_error (const struct argp_state *__restrict __state,
+ const char *__restrict __fmt, ...)
+#if GNULIB_VFPRINTF_POSIX
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 2, 3))
+#else
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, 2, 3))
+#endif
+ ;
+extern void __argp_error (const struct argp_state *__restrict __state,
+ const char *__restrict __fmt, ...)
+#if GNULIB_VFPRINTF_POSIX
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 2, 3))
+#else
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, 2, 3))
+#endif
+ ;
+
+/* Similar to the standard gnu error-reporting function error(), but will
+ respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print
+ to STATE->err_stream. This is useful for argument parsing code that is
+ shared between program startup (when exiting is desired) and runtime
+ option parsing (when typically an error code is returned instead). The
+ difference between this function and argp_error is that the latter is for
+ *parsing errors*, and the former is for other problems that occur during
+ parsing but don't reflect a (syntactic) problem with the input. */
+extern void argp_failure (const struct argp_state *__restrict __state,
+ int __status, int __errnum,
+ const char *__restrict __fmt, ...)
+#if GNULIB_VFPRINTF_POSIX
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 4, 5))
+#else
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, 4, 5))
+#endif
+ ;
+extern void __argp_failure (const struct argp_state *__restrict __state,
+ int __status, int __errnum,
+ const char *__restrict __fmt, ...)
+#if GNULIB_VFPRINTF_POSIX
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 4, 5))
+#else
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, 4, 5))
+#endif
+ ;
+
+#if _LIBC
+/* Returns true if the option OPT is a valid short option. */
+extern int _option_is_short (const struct argp_option *__opt) __THROW;
+extern int __option_is_short (const struct argp_option *__opt) __THROW;
+
+/* Returns true if the option OPT is in fact the last (unused) entry in an
+ options array. */
+extern int _option_is_end (const struct argp_option *__opt) __THROW;
+extern int __option_is_end (const struct argp_option *__opt) __THROW;
+#endif
+
+/* Return the input field for ARGP in the parser corresponding to STATE; used
+ by the help routines. */
+extern void *_argp_input (const struct argp *__restrict __argp,
+ const struct argp_state *__restrict __state)
+ __THROW;
+extern void *__argp_input (const struct argp *__restrict __argp,
+ const struct argp_state *__restrict __state)
+ __THROW;
+
+#if !_LIBC || defined __USE_EXTERN_INLINES
+
+# if !_LIBC
+# define __argp_usage argp_usage
+# define __argp_state_help argp_state_help
+# define __option_is_short _option_is_short
+# define __option_is_end _option_is_end
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+# ifndef ARGP_EI
+# define ARGP_EI _GL_INLINE
+# endif
+# endif
+
+# ifndef ARGP_EI
+# define ARGP_EI __extern_inline
+# endif
+
+ARGP_EI void
+__argp_usage (const struct argp_state *__state)
+{
+ __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+}
+
+ARGP_EI int
+__NTH (__option_is_short (const struct argp_option *__opt))
+{
+ if (__opt->flags & OPTION_DOC)
+ return 0;
+ else
+ {
+ int __key = __opt->key;
+ return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
+ }
+}
+
+ARGP_EI int
+__NTH (__option_is_end (const struct argp_option *__opt))
+{
+ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+}
+
+# if !_LIBC
+# undef __argp_usage
+# undef __argp_state_help
+# undef __option_is_short
+# undef __option_is_end
+_GL_INLINE_HEADER_END
+# endif
+#endif /* Use extern inlines. */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* argp.h */
diff --git a/gl/lib/asnprintf.c b/gl/lib/asnprintf.c
new file mode 100644
index 0000000..0c5c76e
--- /dev/null
+++ b/gl/lib/asnprintf.c
@@ -0,0 +1,34 @@
+/* Formatted output to strings.
+ Copyright (C) 1999, 2002, 2006, 2009-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "vasnprintf.h"
+
+#include <stdarg.h>
+
+char *
+asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
+{
+ va_list args;
+ char *result;
+
+ va_start (args, format);
+ result = vasnprintf (resultbuf, lengthp, format, args);
+ va_end (args);
+ return result;
+}
diff --git a/gl/lib/asprintf.c b/gl/lib/asprintf.c
new file mode 100644
index 0000000..9c163f3
--- /dev/null
+++ b/gl/lib/asprintf.c
@@ -0,0 +1,39 @@
+/* Formatted output to strings.
+ Copyright (C) 1999, 2002, 2006-2007, 2009-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#ifdef IN_LIBASPRINTF
+# include "vasprintf.h"
+#else
+# include <stdio.h>
+#endif
+
+#include <stdarg.h>
+
+int
+asprintf (char **resultp, const char *format, ...)
+{
+ va_list args;
+ int result;
+
+ va_start (args, format);
+ result = vasprintf (resultp, format, args);
+ va_end (args);
+ return result;
+}
diff --git a/gl/lib/assure.h b/gl/lib/assure.h
new file mode 100644
index 0000000..20e806a
--- /dev/null
+++ b/gl/lib/assure.h
@@ -0,0 +1,57 @@
+/* Run-time assert-like macros.
+
+ Copyright (C) 2014-2022 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 2.1 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 Paul Eggert. */
+
+#ifndef _GL_ASSURE_H
+#define _GL_ASSURE_H
+
+#include <assert.h>
+#include "verify.h"
+
+/* Evaluate an assertion E that is guaranteed to be true.
+ If NDEBUG is not defined, abort the program if E is false.
+ If NDEBUG is defined, the compiler can assume E and behavior is
+ undefined if E is false, fails to evaluate, or has side effects.
+
+ Unlike standard 'assert', this macro evaluates E even when NDEBUG
+ is defined, so as to catch typos, avoid some GCC warnings, and
+ improve performance when E is simple enough.
+
+ Also see the documentation for 'assume' in verify.h. */
+
+#ifdef NDEBUG
+# define affirm(E) assume (E)
+#else
+# define affirm(E) assert (E)
+#endif
+
+/* Check E's value at runtime, and report an error and abort if not.
+ However, do nothing if NDEBUG is defined.
+
+ Unlike standard 'assert', this macro compiles E even when NDEBUG
+ is defined, so as to catch typos and avoid some GCC warnings.
+ Unlike 'affirm', it is OK for E to use hard-to-optimize features,
+ since E is not executed if NDEBUG is defined. */
+
+#ifdef NDEBUG
+# define assure(E) ((void) (0 && (E)))
+#else
+# define assure(E) assert (E)
+#endif
+
+#endif
diff --git a/gl/lib/at-func.c b/gl/lib/at-func.c
new file mode 100644
index 0000000..afcc819
--- /dev/null
+++ b/gl/lib/at-func.c
@@ -0,0 +1,146 @@
+/* Define at-style functions like fstatat, unlinkat, fchownat, etc.
+ Copyright (C) 2006, 2009-2022 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 "filename.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
+
+#ifdef GNULIB_SUPPORT_ONLY_AT_FDCWD
+# include <errno.h>
+# ifndef ENOTSUP
+# define ENOTSUP EINVAL
+# endif
+#else
+# include "openat.h"
+# include "openat-priv.h"
+# include "save-cwd.h"
+#endif
+
+#ifdef AT_FUNC_USE_F1_COND
+# define CALL_FUNC(F) \
+ (flag == AT_FUNC_USE_F1_COND \
+ ? AT_FUNC_F1 (F AT_FUNC_POST_FILE_ARGS) \
+ : AT_FUNC_F2 (F AT_FUNC_POST_FILE_ARGS))
+# define VALIDATE_FLAG(F) \
+ if (flag & ~AT_FUNC_USE_F1_COND) \
+ { \
+ errno = EINVAL; \
+ return FUNC_FAIL; \
+ }
+#else
+# define CALL_FUNC(F) (AT_FUNC_F1 (F AT_FUNC_POST_FILE_ARGS))
+# define VALIDATE_FLAG(F) /* empty */
+#endif
+
+#ifdef AT_FUNC_RESULT
+# define FUNC_RESULT AT_FUNC_RESULT
+#else
+# define FUNC_RESULT int
+#endif
+
+#ifdef AT_FUNC_FAIL
+# define FUNC_FAIL AT_FUNC_FAIL
+#else
+# define FUNC_FAIL -1
+#endif
+
+/* Call AT_FUNC_F1 to operate on FILE, which is in the directory
+ open on descriptor FD. If AT_FUNC_USE_F1_COND is defined to a value,
+ AT_FUNC_POST_FILE_PARAM_DECLS must include a parameter named flag;
+ call AT_FUNC_F2 if FLAG is 0 or fail if FLAG contains more bits than
+ AT_FUNC_USE_F1_COND. Return int and fail with -1 unless AT_FUNC_RESULT
+ or AT_FUNC_FAIL are defined. If possible, do it without changing the
+ working directory. Otherwise, resort to using save_cwd/fchdir,
+ then AT_FUNC_F?/restore_cwd. If either the save_cwd or the restore_cwd
+ fails, then give a diagnostic and exit nonzero. */
+FUNC_RESULT
+AT_FUNC_NAME (int fd, char const *file AT_FUNC_POST_FILE_PARAM_DECLS)
+{
+ VALIDATE_FLAG (flag);
+
+ if (fd == AT_FDCWD || IS_ABSOLUTE_FILE_NAME (file))
+ return CALL_FUNC (file);
+
+#ifdef GNULIB_SUPPORT_ONLY_AT_FDCWD
+ errno = ENOTSUP;
+ return FUNC_FAIL;
+#else
+ {
+ /* Be careful to choose names unlikely to conflict with
+ AT_FUNC_POST_FILE_PARAM_DECLS. */
+ struct saved_cwd saved_cwd;
+ int saved_errno;
+ FUNC_RESULT err;
+
+ {
+ char proc_buf[OPENAT_BUFFER_SIZE];
+ char *proc_file = openat_proc_name (proc_buf, fd, file);
+ if (proc_file)
+ {
+ FUNC_RESULT proc_result = CALL_FUNC (proc_file);
+ int proc_errno = errno;
+ if (proc_file != proc_buf)
+ free (proc_file);
+ /* If the syscall succeeds, or if it fails with an unexpected
+ errno value, then return right away. Otherwise, fall through
+ and resort to using save_cwd/restore_cwd. */
+ if (FUNC_FAIL != proc_result)
+ return proc_result;
+ if (! EXPECTED_ERRNO (proc_errno))
+ {
+ errno = proc_errno;
+ return proc_result;
+ }
+ }
+ }
+
+ if (save_cwd (&saved_cwd) != 0)
+ openat_save_fail (errno);
+ if (0 <= fd && fd == saved_cwd.desc)
+ {
+ /* If saving the working directory collides with the user's
+ requested fd, then the user's fd must have been closed to
+ begin with. */
+ free_cwd (&saved_cwd);
+ errno = EBADF;
+ return FUNC_FAIL;
+ }
+
+ if (fchdir (fd) != 0)
+ {
+ saved_errno = errno;
+ free_cwd (&saved_cwd);
+ errno = saved_errno;
+ return FUNC_FAIL;
+ }
+
+ err = CALL_FUNC (file);
+ saved_errno = (err == FUNC_FAIL ? errno : 0);
+
+ if (restore_cwd (&saved_cwd) != 0)
+ openat_restore_fail (errno);
+
+ free_cwd (&saved_cwd);
+
+ if (saved_errno)
+ errno = saved_errno;
+ return err;
+ }
+#endif
+}
+#undef CALL_FUNC
+#undef FUNC_RESULT
+#undef FUNC_FAIL
diff --git a/gl/lib/at-func2.c b/gl/lib/at-func2.c
new file mode 100644
index 0000000..8a0882e
--- /dev/null
+++ b/gl/lib/at-func2.c
@@ -0,0 +1,289 @@
+/* Define 2-FD at-style functions like linkat or renameat.
+ Copyright (C) 2006, 2009-2022 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 and Eric Blake */
+
+#include <config.h>
+
+#include "openat-priv.h"
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "filename.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
+#include "filenamecat.h"
+#include "openat.h"
+#include "same-inode.h"
+#include "save-cwd.h"
+
+/* Call FUNC to operate on a pair of files, where FILE1 is relative to FD1,
+ and FILE2 is relative to FD2. If possible, do it without changing the
+ working directory. Otherwise, resort to using save_cwd/fchdir,
+ FUNC, restore_cwd (up to two times). If either the save_cwd or the
+ restore_cwd fails, then give a diagnostic and exit nonzero. */
+int
+at_func2 (int fd1, char const *file1,
+ int fd2, char const *file2,
+ int (*func) (char const *file1, char const *file2))
+{
+ struct saved_cwd saved_cwd;
+ int saved_errno;
+ int err;
+ char *file1_alt;
+ char *file2_alt;
+ struct stat st1;
+ struct stat st2;
+
+ /* There are 16 possible scenarios, based on whether an fd is
+ AT_FDCWD or real, and whether a file is absolute or relative:
+
+ fd1 file1 fd2 file2 action
+ 0 cwd abs cwd abs direct call
+ 1 cwd abs cwd rel direct call
+ 2 cwd abs fd abs direct call
+ 3 cwd abs fd rel chdir to fd2
+ 4 cwd rel cwd abs direct call
+ 5 cwd rel cwd rel direct call
+ 6 cwd rel fd abs direct call
+ 7 cwd rel fd rel convert file1 to abs, then case 3
+ 8 fd abs cwd abs direct call
+ 9 fd abs cwd rel direct call
+ 10 fd abs fd abs direct call
+ 11 fd abs fd rel chdir to fd2
+ 12 fd rel cwd abs chdir to fd1
+ 13 fd rel cwd rel convert file2 to abs, then case 12
+ 14 fd rel fd abs chdir to fd1
+ 15a fd1 rel fd1 rel chdir to fd1
+ 15b fd1 rel fd2 rel chdir to fd1, then case 7
+
+ Try some optimizations to reduce fd to AT_FDCWD, or to at least
+ avoid converting an absolute name or doing a double chdir. */
+
+ if ((fd1 == AT_FDCWD || IS_ABSOLUTE_FILE_NAME (file1))
+ && (fd2 == AT_FDCWD || IS_ABSOLUTE_FILE_NAME (file2)))
+ return func (file1, file2); /* Case 0-2, 4-6, 8-10. */
+
+ /* If /proc/self/fd works, we don't need any stat or chdir. */
+ {
+ char proc_buf1[OPENAT_BUFFER_SIZE];
+ char *proc_file1 = ((fd1 == AT_FDCWD || IS_ABSOLUTE_FILE_NAME (file1))
+ ? (char *) file1
+ : openat_proc_name (proc_buf1, fd1, file1));
+ if (proc_file1)
+ {
+ char proc_buf2[OPENAT_BUFFER_SIZE];
+ char *proc_file2 = ((fd2 == AT_FDCWD || IS_ABSOLUTE_FILE_NAME (file2))
+ ? (char *) file2
+ : openat_proc_name (proc_buf2, fd2, file2));
+ if (proc_file2)
+ {
+ int proc_result = func (proc_file1, proc_file2);
+ int proc_errno = errno;
+ if (proc_file1 != proc_buf1 && proc_file1 != file1)
+ free (proc_file1);
+ if (proc_file2 != proc_buf2 && proc_file2 != file2)
+ free (proc_file2);
+ /* If the syscall succeeds, or if it fails with an unexpected
+ errno value, then return right away. Otherwise, fall through
+ and resort to using save_cwd/restore_cwd. */
+ if (0 <= proc_result)
+ return proc_result;
+ if (! EXPECTED_ERRNO (proc_errno))
+ {
+ errno = proc_errno;
+ return proc_result;
+ }
+ }
+ else if (proc_file1 != proc_buf1 && proc_file1 != file1)
+ free (proc_file1);
+ }
+ }
+
+ /* Cases 3, 7, 11-15 remain. Time to normalize directory fds, if
+ possible. */
+ if (IS_ABSOLUTE_FILE_NAME (file1))
+ fd1 = AT_FDCWD; /* Case 11 reduced to 3. */
+ else if (IS_ABSOLUTE_FILE_NAME (file2))
+ fd2 = AT_FDCWD; /* Case 14 reduced to 12. */
+
+ /* Cases 3, 7, 12, 13, 15 remain. */
+
+ if (fd1 == AT_FDCWD) /* Cases 3, 7. */
+ {
+ if (stat (".", &st1) == -1 || fstat (fd2, &st2) == -1)
+ return -1;
+ if (!S_ISDIR (st2.st_mode))
+ {
+ errno = ENOTDIR;
+ return -1;
+ }
+ if (SAME_INODE (st1, st2)) /* Reduced to cases 1, 5. */
+ return func (file1, file2);
+ }
+ else if (fd2 == AT_FDCWD) /* Cases 12, 13. */
+ {
+ if (stat (".", &st2) == -1 || fstat (fd1, &st1) == -1)
+ return -1;
+ if (!S_ISDIR (st1.st_mode))
+ {
+ errno = ENOTDIR;
+ return -1;
+ }
+ if (SAME_INODE (st1, st2)) /* Reduced to cases 4, 5. */
+ return func (file1, file2);
+ }
+ else if (fd1 != fd2) /* Case 15b. */
+ {
+ if (fstat (fd1, &st1) == -1 || fstat (fd2, &st2) == -1)
+ return -1;
+ if (!S_ISDIR (st1.st_mode) || !S_ISDIR (st2.st_mode))
+ {
+ errno = ENOTDIR;
+ return -1;
+ }
+ if (SAME_INODE (st1, st2)) /* Reduced to case 15a. */
+ {
+ fd2 = fd1;
+ if (stat (".", &st1) == 0 && SAME_INODE (st1, st2))
+ return func (file1, file2); /* Further reduced to case 5. */
+ }
+ }
+ else /* Case 15a. */
+ {
+ if (fstat (fd1, &st1) == -1)
+ return -1;
+ if (!S_ISDIR (st1.st_mode))
+ {
+ errno = ENOTDIR;
+ return -1;
+ }
+ if (stat (".", &st2) == 0 && SAME_INODE (st1, st2))
+ return func (file1, file2); /* Reduced to case 5. */
+ }
+
+ /* Catch invalid arguments before changing directories. */
+ if (file1[0] == '\0' || file2[0] == '\0')
+ {
+ errno = ENOENT;
+ return -1;
+ }
+
+ /* Cases 3, 7, 12, 13, 15a, 15b remain. With all reductions in
+ place, it is time to start changing directories. */
+
+ if (save_cwd (&saved_cwd) != 0)
+ openat_save_fail (errno);
+
+ if (fd1 != AT_FDCWD && fd2 != AT_FDCWD && fd1 != fd2) /* Case 15b. */
+ {
+ if (fchdir (fd1) != 0)
+ {
+ saved_errno = errno;
+ free_cwd (&saved_cwd);
+ errno = saved_errno;
+ return -1;
+ }
+ fd1 = AT_FDCWD; /* Reduced to case 7. */
+ }
+
+ /* Cases 3, 7, 12, 13, 15a remain. Convert one relative name to
+ absolute, if necessary. */
+
+ file1_alt = (char *) file1;
+ file2_alt = (char *) file2;
+
+ if (fd1 == AT_FDCWD && !IS_ABSOLUTE_FILE_NAME (file1)) /* Case 7. */
+ {
+ /* It would be nicer to use:
+ file1_alt = file_name_concat (xgetcwd (), file1, NULL);
+ but libraries should not call xalloc_die. */
+ char *cwd = getcwd (NULL, 0);
+ if (!cwd)
+ {
+ saved_errno = errno;
+ free_cwd (&saved_cwd);
+ errno = saved_errno;
+ return -1;
+ }
+ file1_alt = mfile_name_concat (cwd, file1, NULL);
+ if (!file1_alt)
+ {
+ saved_errno = errno;
+ free (cwd);
+ free_cwd (&saved_cwd);
+ errno = saved_errno;
+ return -1;
+ }
+ free (cwd); /* Reduced to case 3. */
+ }
+ else if (fd2 == AT_FDCWD && !IS_ABSOLUTE_FILE_NAME (file2)) /* Case 13. */
+ {
+ char *cwd = getcwd (NULL, 0);
+ if (!cwd)
+ {
+ saved_errno = errno;
+ free_cwd (&saved_cwd);
+ errno = saved_errno;
+ return -1;
+ }
+ file2_alt = mfile_name_concat (cwd, file2, NULL);
+ if (!file2_alt)
+ {
+ saved_errno = errno;
+ free (cwd);
+ free_cwd (&saved_cwd);
+ errno = saved_errno;
+ return -1;
+ }
+ free (cwd); /* Reduced to case 12. */
+ }
+
+ /* Cases 3, 12, 15a remain. Change to the correct directory. */
+ if (fchdir (fd1 == AT_FDCWD ? fd2 : fd1) != 0)
+ {
+ saved_errno = errno;
+ free_cwd (&saved_cwd);
+ if (file1 != file1_alt)
+ free (file1_alt);
+ else if (file2 != file2_alt)
+ free (file2_alt);
+ errno = saved_errno;
+ return -1;
+ }
+
+ /* Finally safe to perform the user's function, then clean up. */
+
+ err = func (file1_alt, file2_alt);
+ saved_errno = (err < 0 ? errno : 0);
+
+ if (file1 != file1_alt)
+ free (file1_alt);
+ else if (file2 != file2_alt)
+ free (file2_alt);
+
+ if (restore_cwd (&saved_cwd) != 0)
+ openat_restore_fail (errno);
+
+ free_cwd (&saved_cwd);
+
+ if (saved_errno)
+ errno = saved_errno;
+ return err;
+}
+#undef CALL_FUNC
+#undef FUNC_RESULT
diff --git a/gl/lib/attribute.h b/gl/lib/attribute.h
new file mode 100644
index 0000000..378d4f0
--- /dev/null
+++ b/gl/lib/attribute.h
@@ -0,0 +1,226 @@
+/* ATTRIBUTE_* macros for using attributes in GCC and similar compilers
+
+ Copyright 2020-2022 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 2.1 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 Paul Eggert. */
+
+/* Provide public ATTRIBUTE_* names for the private _GL_ATTRIBUTE_*
+ macros used within Gnulib. */
+
+/* These attributes can be placed in two ways:
+ - At the start of a declaration (i.e. even before storage-class
+ specifiers!); then they apply to all entities that are declared
+ by the declaration.
+ - Immediately after the name of an entity being declared by the
+ declaration; then they apply to that entity only. */
+
+#ifndef _GL_ATTRIBUTE_H
+#define _GL_ATTRIBUTE_H
+
+
+/* This file defines two types of attributes:
+ * C2x standard attributes. These have macro names that do not begin with
+ 'ATTRIBUTE_'.
+ * Selected GCC attributes; see:
+ https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
+ https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html
+ https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html
+ These names begin with 'ATTRIBUTE_' to avoid name clashes. */
+
+
+/* =============== Attributes for specific kinds of functions =============== */
+
+/* Attributes for functions that should not be used. */
+
+/* Warn if the entity is used. */
+/* Applies to:
+ - function, variable,
+ - struct, union, struct/union member,
+ - enumeration, enumeration item,
+ - typedef,
+ in C++ also: namespace, class, template specialization. */
+#define DEPRECATED _GL_ATTRIBUTE_DEPRECATED
+
+/* If a function call is not optimized way, warn with MSG. */
+/* Applies to: functions. */
+#define ATTRIBUTE_WARNING(msg) _GL_ATTRIBUTE_WARNING (msg)
+
+/* If a function call is not optimized way, report an error with MSG. */
+/* Applies to: functions. */
+#define ATTRIBUTE_ERROR(msg) _GL_ATTRIBUTE_ERROR (msg)
+
+
+/* Attributes for memory-allocating functions. */
+
+/* The function returns a pointer to freshly allocated memory. */
+/* Applies to: functions. */
+#define ATTRIBUTE_MALLOC _GL_ATTRIBUTE_MALLOC
+
+/* ATTRIBUTE_ALLOC_SIZE ((N)) - The Nth argument of the function
+ is the size of the returned memory block.
+ ATTRIBUTE_ALLOC_SIZE ((M, N)) - Multiply the Mth and Nth arguments
+ to determine the size of the returned memory block. */
+/* Applies to: function, pointer to function, function types. */
+#define ATTRIBUTE_ALLOC_SIZE(args) _GL_ATTRIBUTE_ALLOC_SIZE (args)
+
+/* ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
+ that can be freed by passing them as the Ith argument to the
+ function F.
+ ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that
+ can be freed via 'free'; it can be used only after declaring 'free'. */
+/* Applies to: functions. Cannot be used on inline functions. */
+#define ATTRIBUTE_DEALLOC(f, i) _GL_ATTRIBUTE_DEALLOC(f, i)
+#define ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC_FREE
+
+/* Attributes for variadic functions. */
+
+/* The variadic function expects a trailing NULL argument.
+ ATTRIBUTE_SENTINEL () - The last argument is NULL (requires C99).
+ ATTRIBUTE_SENTINEL ((N)) - The (N+1)st argument from the end is NULL. */
+/* Applies to: functions. */
+#define ATTRIBUTE_SENTINEL(pos) _GL_ATTRIBUTE_SENTINEL (pos)
+
+
+/* ================== Attributes for compiler diagnostics ================== */
+
+/* Attributes that help the compiler diagnose programmer mistakes.
+ Some of them may also help for some compiler optimizations. */
+
+/* ATTRIBUTE_FORMAT ((ARCHETYPE, STRING-INDEX, FIRST-TO-CHECK)) -
+ The STRING-INDEXth function argument is a format string of style
+ ARCHETYPE, which is one of:
+ printf, gnu_printf
+ scanf, gnu_scanf,
+ strftime, gnu_strftime,
+ strfmon,
+ or the same thing prefixed and suffixed with '__'.
+ If FIRST-TO-CHECK is not 0, arguments starting at FIRST-TO_CHECK
+ are suitable for the format string. */
+/* Applies to: functions. */
+#define ATTRIBUTE_FORMAT(spec) _GL_ATTRIBUTE_FORMAT (spec)
+
+/* ATTRIBUTE_NONNULL ((N1, N2,...)) - Arguments N1, N2,... must not be NULL.
+ ATTRIBUTE_NONNULL () - All pointer arguments must not be null. */
+/* Applies to: functions. */
+#define ATTRIBUTE_NONNULL(args) _GL_ATTRIBUTE_NONNULL (args)
+
+/* The function's return value is a non-NULL pointer. */
+/* Applies to: functions. */
+#define ATTRIBUTE_RETURNS_NONNULL _GL_ATTRIBUTE_RETURNS_NONNULL
+
+/* Warn if the caller does not use the return value,
+ unless the caller uses something like ignore_value. */
+/* Applies to: function, enumeration, class. */
+#define NODISCARD _GL_ATTRIBUTE_NODISCARD
+
+
+/* Attributes that disable false alarms when the compiler diagnoses
+ programmer "mistakes". */
+
+/* Do not warn if the entity is not used. */
+/* Applies to:
+ - function, variable,
+ - struct, union, struct/union member,
+ - enumeration, enumeration item,
+ - typedef,
+ in C++ also: class. */
+#define MAYBE_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
+
+/* The contents of a character array is not meant to be NUL-terminated. */
+/* Applies to: struct/union members and variables that are arrays of element
+ type '[[un]signed] char'. */
+#define ATTRIBUTE_NONSTRING _GL_ATTRIBUTE_NONSTRING
+
+/* Do not warn if control flow falls through to the immediately
+ following 'case' or 'default' label. */
+/* Applies to: Empty statement (;), inside a 'switch' statement. */
+#define FALLTHROUGH _GL_ATTRIBUTE_FALLTHROUGH
+
+
+/* ================== Attributes for debugging information ================== */
+
+/* Attributes regarding debugging information emitted by the compiler. */
+
+/* Omit the function from stack traces when debugging. */
+/* Applies to: function. */
+#define ATTRIBUTE_ARTIFICIAL _GL_ATTRIBUTE_ARTIFICIAL
+
+/* Make the entity visible to debuggers etc., even with '-fwhole-program'. */
+/* Applies to: functions, variables. */
+#define ATTRIBUTE_EXTERNALLY_VISIBLE _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
+
+
+/* ========== Attributes that mainly direct compiler optimizations ========== */
+
+/* The function does not throw exceptions. */
+/* Applies to: functions. */
+#define ATTRIBUTE_NOTHROW _GL_ATTRIBUTE_NOTHROW
+
+/* Do not inline the function. */
+/* Applies to: functions. */
+#define ATTRIBUTE_NOINLINE _GL_ATTRIBUTE_NOINLINE
+
+/* Always inline the function, and report an error if the compiler
+ cannot inline. */
+/* Applies to: function. */
+#define ATTRIBUTE_ALWAYS_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE
+
+/* It is OK for a compiler to omit duplicate calls with the same arguments.
+ This attribute is safe for a function that neither depends on
+ nor affects observable state, and always returns exactly once -
+ e.g., does not loop forever, and does not call longjmp.
+ (This attribute is stricter than ATTRIBUTE_PURE.) */
+/* Applies to: functions. */
+#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST
+
+/* It is OK for a compiler to omit duplicate calls with the same
+ arguments if observable state is not changed between calls.
+ This attribute is safe for a function that does not affect
+ observable state, and always returns exactly once.
+ (This attribute is looser than ATTRIBUTE_CONST.) */
+/* Applies to: functions. */
+#define ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
+
+/* The function is rarely executed. */
+/* Applies to: functions. */
+#define ATTRIBUTE_COLD _GL_ATTRIBUTE_COLD
+
+/* If called from some other compilation unit, the function executes
+ code from that unit only by return or by exception handling,
+ letting the compiler optimize that unit more aggressively. */
+/* Applies to: functions. */
+#define ATTRIBUTE_LEAF _GL_ATTRIBUTE_LEAF
+
+/* For struct members: The member has the smallest possible alignment.
+ For struct, union, class: All members have the smallest possible alignment,
+ minimizing the memory required. */
+/* Applies to: struct members, struct, union,
+ in C++ also: class. */
+#define ATTRIBUTE_PACKED _GL_ATTRIBUTE_PACKED
+
+
+/* ================ Attributes that make invalid code valid ================ */
+
+/* Attributes that prevent fatal compiler optimizations for code that is not
+ fully ISO C compliant. */
+
+/* Pointers to the type may point to the same storage as pointers to
+ other types, thus disabling strict aliasing optimization. */
+/* Applies to: types. */
+#define ATTRIBUTE_MAY_ALIAS _GL_ATTRIBUTE_MAY_ALIAS
+
+
+#endif /* _GL_ATTRIBUTE_H */
diff --git a/gl/lib/basename-lgpl.c b/gl/lib/basename-lgpl.c
new file mode 100644
index 0000000..eb07e25
--- /dev/null
+++ b/gl/lib/basename-lgpl.c
@@ -0,0 +1,71 @@
+/* basename.c -- return the last element in a file name
+
+ Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "basename-lgpl.h"
+
+#include <stdbool.h>
+#include <string.h>
+
+#include "filename.h"
+
+char *
+last_component (char const *name)
+{
+ char const *base = name + FILE_SYSTEM_PREFIX_LEN (name);
+ char const *p;
+ bool last_was_slash = false;
+
+ while (ISSLASH (*base))
+ base++;
+
+ for (p = base; *p; p++)
+ {
+ if (ISSLASH (*p))
+ last_was_slash = true;
+ else if (last_was_slash)
+ {
+ base = p;
+ last_was_slash = false;
+ }
+ }
+
+ return (char *) base;
+}
+
+size_t
+base_len (char const *name)
+{
+ size_t len;
+ size_t prefix_len = FILE_SYSTEM_PREFIX_LEN (name);
+
+ for (len = strlen (name); 1 < len && ISSLASH (name[len - 1]); len--)
+ continue;
+
+ if (DOUBLE_SLASH_IS_DISTINCT_ROOT && len == 1
+ && ISSLASH (name[0]) && ISSLASH (name[1]) && ! name[2])
+ return 2;
+
+ if (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE && prefix_len
+ && len == prefix_len && ISSLASH (name[prefix_len]))
+ return prefix_len + 1;
+
+ return len;
+}
diff --git a/gl/lib/basename-lgpl.h b/gl/lib/basename-lgpl.h
new file mode 100644
index 0000000..5569f21
--- /dev/null
+++ b/gl/lib/basename-lgpl.h
@@ -0,0 +1,78 @@
+/* Extract the last component (base name) of a file name.
+
+ Copyright (C) 1998, 2001, 2003-2006, 2009-2022 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 2.1 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/>. */
+
+#ifndef _BASENAME_LGPL_H
+#define _BASENAME_LGPL_H
+
+#include <stddef.h>
+
+#ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
+# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Return the address of the last file name component of FILENAME.
+ If FILENAME has some trailing slash(es), they are considered to be
+ part of the last component.
+ If FILENAME has no relative file name components because it is a file
+ system root, return the empty string.
+ Examples:
+ FILENAME RESULT
+ "foo.c" "foo.c"
+ "foo/bar.c" "bar.c"
+ "/foo/bar.c" "bar.c"
+ "foo/bar/" "bar/"
+ "foo/bar//" "bar//"
+ "/" ""
+ "//" ""
+ "" ""
+ The return value is a tail of the given FILENAME; do NOT free() it! */
+
+/* This function was traditionally called 'basename', but we avoid this
+ function name because
+ * Various platforms have different functions in their libc.
+ In particular, the glibc basename(), defined in <string.h>, does
+ not consider trailing slashes to be part of the component:
+ FILENAME RESULT
+ "foo/bar/" ""
+ "foo/bar//" ""
+ * The 'basename' command eliminates trailing slashes and for a root
+ produces a non-empty result:
+ FILENAME RESULT
+ "foo/bar/" "bar"
+ "foo/bar//" "bar"
+ "/" "/"
+ "//" "/"
+ */
+extern char *last_component (char const *filename) _GL_ATTRIBUTE_PURE;
+
+/* Return the length of the basename FILENAME.
+ Typically FILENAME is the value returned by base_name or last_component.
+ Act like strlen (FILENAME), except omit all trailing slashes. */
+extern size_t base_len (char const *filename) _GL_ATTRIBUTE_PURE;
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* _BASENAME_LGPL_H */
diff --git a/gl/lib/basename.c b/gl/lib/basename.c
new file mode 100644
index 0000000..0e372ca
--- /dev/null
+++ b/gl/lib/basename.c
@@ -0,0 +1,64 @@
+/* basename.c -- return the last element in a file name
+
+ Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2022 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 "dirname.h"
+
+#include <string.h>
+#include "xalloc.h"
+
+char *
+base_name (char const *name)
+{
+ char const *base = last_component (name);
+ idx_t length;
+ int dotslash_len;
+ if (*base)
+ {
+ length = base_len (base);
+
+ /* Collapse a sequence of trailing slashes into one. */
+ length += ISSLASH (base[length]);
+
+ /* On systems with drive letters, "a/b:c" must return "./b:c" rather
+ than "b:c" to avoid confusion with a drive letter. On systems
+ with pure POSIX semantics, this is not an issue. */
+ dotslash_len = FILE_SYSTEM_PREFIX_LEN (base) != 0 ? 2 : 0;
+ }
+ else
+ {
+ /* There is no last component, so NAME is a file system root or
+ the empty string. */
+ base = name;
+ length = base_len (base);
+ dotslash_len = 0;
+ }
+
+ char *p = ximalloc (dotslash_len + length + 1);
+ if (dotslash_len)
+ {
+ p[0] = '.';
+ p[1] = '/';
+ }
+
+ /* Finally, copy the basename. */
+ memcpy (p + dotslash_len, base, length);
+ p[dotslash_len + length] = '\0';
+ return p;
+}
diff --git a/gl/lib/bitrotate.c b/gl/lib/bitrotate.c
new file mode 100644
index 0000000..101be6d
--- /dev/null
+++ b/gl/lib/bitrotate.c
@@ -0,0 +1,21 @@
+/* Rotate bits in integers.
+
+ Copyright (C) 2012-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+#define BITROTATE_INLINE _GL_EXTERN_INLINE
+#include "bitrotate.h"
diff --git a/gl/lib/bitrotate.h b/gl/lib/bitrotate.h
new file mode 100644
index 0000000..ee6e61e
--- /dev/null
+++ b/gl/lib/bitrotate.h
@@ -0,0 +1,138 @@
+/* bitrotate.h - Rotate bits in integers
+ Copyright (C) 2008-2022 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 2.1 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 Simon Josefsson <simon@josefsson.org>, 2008. */
+
+#ifndef _GL_BITROTATE_H
+#define _GL_BITROTATE_H
+
+#include <limits.h>
+#include <stdint.h>
+#include <sys/types.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef BITROTATE_INLINE
+# define BITROTATE_INLINE _GL_INLINE
+#endif
+
+#ifdef UINT64_MAX
+/* Given an unsigned 64-bit argument X, return the value corresponding
+ to rotating the bits N steps to the left. N must be between 1 and
+ 63 inclusive. */
+BITROTATE_INLINE uint64_t
+rotl64 (uint64_t x, int n)
+{
+ return ((x << n) | (x >> (64 - n))) & UINT64_MAX;
+}
+
+/* Given an unsigned 64-bit argument X, return the value corresponding
+ to rotating the bits N steps to the right. N must be between 1 to
+ 63 inclusive.*/
+BITROTATE_INLINE uint64_t
+rotr64 (uint64_t x, int n)
+{
+ return ((x >> n) | (x << (64 - n))) & UINT64_MAX;
+}
+#endif
+
+/* Given an unsigned 32-bit argument X, return the value corresponding
+ to rotating the bits N steps to the left. N must be between 1 and
+ 31 inclusive. */
+BITROTATE_INLINE uint32_t
+rotl32 (uint32_t x, int n)
+{
+ return ((x << n) | (x >> (32 - n))) & UINT32_MAX;
+}
+
+/* Given an unsigned 32-bit argument X, return the value corresponding
+ to rotating the bits N steps to the right. N must be between 1 to
+ 31 inclusive.*/
+BITROTATE_INLINE uint32_t
+rotr32 (uint32_t x, int n)
+{
+ return ((x >> n) | (x << (32 - n))) & UINT32_MAX;
+}
+
+/* Given a size_t argument X, return the value corresponding
+ to rotating the bits N steps to the left. N must be between 1 and
+ (CHAR_BIT * sizeof (size_t) - 1) inclusive. */
+BITROTATE_INLINE size_t
+rotl_sz (size_t x, int n)
+{
+ return ((x << n) | (x >> ((CHAR_BIT * sizeof x) - n))) & SIZE_MAX;
+}
+
+/* Given a size_t argument X, return the value corresponding
+ to rotating the bits N steps to the right. N must be between 1 to
+ (CHAR_BIT * sizeof (size_t) - 1) inclusive. */
+BITROTATE_INLINE size_t
+rotr_sz (size_t x, int n)
+{
+ return ((x >> n) | (x << ((CHAR_BIT * sizeof x) - n))) & SIZE_MAX;
+}
+
+/* Given an unsigned 16-bit argument X, return the value corresponding
+ to rotating the bits N steps to the left. N must be between 1 to
+ 15 inclusive, but on most relevant targets N can also be 0 and 16
+ because 'int' is at least 32 bits and the arguments must widen
+ before shifting. */
+BITROTATE_INLINE uint16_t
+rotl16 (uint16_t x, int n)
+{
+ return (((unsigned int) x << n) | ((unsigned int) x >> (16 - n)))
+ & UINT16_MAX;
+}
+
+/* Given an unsigned 16-bit argument X, return the value corresponding
+ to rotating the bits N steps to the right. N must be in 1 to 15
+ inclusive, but on most relevant targets N can also be 0 and 16
+ because 'int' is at least 32 bits and the arguments must widen
+ before shifting. */
+BITROTATE_INLINE uint16_t
+rotr16 (uint16_t x, int n)
+{
+ return (((unsigned int) x >> n) | ((unsigned int) x << (16 - n)))
+ & UINT16_MAX;
+}
+
+/* Given an unsigned 8-bit argument X, return the value corresponding
+ to rotating the bits N steps to the left. N must be between 1 to 7
+ inclusive, but on most relevant targets N can also be 0 and 8
+ because 'int' is at least 32 bits and the arguments must widen
+ before shifting. */
+BITROTATE_INLINE uint8_t
+rotl8 (uint8_t x, int n)
+{
+ return (((unsigned int) x << n) | ((unsigned int) x >> (8 - n))) & UINT8_MAX;
+}
+
+/* Given an unsigned 8-bit argument X, return the value corresponding
+ to rotating the bits N steps to the right. N must be in 1 to 7
+ inclusive, but on most relevant targets N can also be 0 and 8
+ because 'int' is at least 32 bits and the arguments must widen
+ before shifting. */
+BITROTATE_INLINE uint8_t
+rotr8 (uint8_t x, int n)
+{
+ return (((unsigned int) x >> n) | ((unsigned int) x << (8 - n))) & UINT8_MAX;
+}
+
+_GL_INLINE_HEADER_END
+
+#endif /* _GL_BITROTATE_H */
diff --git a/gl/lib/btowc.c b/gl/lib/btowc.c
new file mode 100644
index 0000000..4af58bb
--- /dev/null
+++ b/gl/lib/btowc.c
@@ -0,0 +1,39 @@
+/* Convert unibyte character to wide character.
+ Copyright (C) 2008, 2010-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+wint_t
+btowc (int c)
+{
+ if (c != EOF)
+ {
+ char buf[1];
+ wchar_t wc;
+
+ buf[0] = c;
+ if (mbtowc (&wc, buf, 1) >= 0)
+ return wc;
+ }
+ return WEOF;
+}
diff --git a/gl/lib/c++defs.h b/gl/lib/c++defs.h
new file mode 100644
index 0000000..ad18155
--- /dev/null
+++ b/gl/lib/c++defs.h
@@ -0,0 +1,331 @@
+/* C++ compatible function declaration macros.
+ Copyright (C) 2010-2022 Free Software Foundation, Inc.
+
+ This program 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 2 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
+ 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/>. */
+
+#ifndef _GL_CXXDEFS_H
+#define _GL_CXXDEFS_H
+
+/* Begin/end the GNULIB_NAMESPACE namespace. */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
+# define _GL_END_NAMESPACE }
+#else
+# define _GL_BEGIN_NAMESPACE
+# define _GL_END_NAMESPACE
+#endif
+
+/* The three most frequent use cases of these macros are:
+
+ * For providing a substitute for a function that is missing on some
+ platforms, but is declared and works fine on the platforms on which
+ it exists:
+
+ #if @GNULIB_FOO@
+ # if !@HAVE_FOO@
+ _GL_FUNCDECL_SYS (foo, ...);
+ # endif
+ _GL_CXXALIAS_SYS (foo, ...);
+ _GL_CXXALIASWARN (foo);
+ #elif defined GNULIB_POSIXCHECK
+ ...
+ #endif
+
+ * For providing a replacement for a function that exists on all platforms,
+ but is broken/insufficient and needs to be replaced on some platforms:
+
+ #if @GNULIB_FOO@
+ # if @REPLACE_FOO@
+ # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+ # undef foo
+ # define foo rpl_foo
+ # endif
+ _GL_FUNCDECL_RPL (foo, ...);
+ _GL_CXXALIAS_RPL (foo, ...);
+ # else
+ _GL_CXXALIAS_SYS (foo, ...);
+ # endif
+ _GL_CXXALIASWARN (foo);
+ #elif defined GNULIB_POSIXCHECK
+ ...
+ #endif
+
+ * For providing a replacement for a function that exists on some platforms
+ but is broken/insufficient and needs to be replaced on some of them and
+ is additionally either missing or undeclared on some other platforms:
+
+ #if @GNULIB_FOO@
+ # if @REPLACE_FOO@
+ # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+ # undef foo
+ # define foo rpl_foo
+ # endif
+ _GL_FUNCDECL_RPL (foo, ...);
+ _GL_CXXALIAS_RPL (foo, ...);
+ # else
+ # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
+ _GL_FUNCDECL_SYS (foo, ...);
+ # endif
+ _GL_CXXALIAS_SYS (foo, ...);
+ # endif
+ _GL_CXXALIASWARN (foo);
+ #elif defined GNULIB_POSIXCHECK
+ ...
+ #endif
+*/
+
+/* _GL_EXTERN_C declaration;
+ performs the declaration with C linkage. */
+#if defined __cplusplus
+# define _GL_EXTERN_C extern "C"
+#else
+# define _GL_EXTERN_C extern
+#endif
+
+/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
+ declares a replacement function, named rpl_func, with the given prototype,
+ consisting of return type, parameters, and attributes.
+ Example:
+ _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
+ _GL_ARG_NONNULL ((1)));
+ */
+#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
+ _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
+#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
+ _GL_EXTERN_C rettype rpl_func parameters_and_attributes
+
+/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
+ declares the system function, named func, with the given prototype,
+ consisting of return type, parameters, and attributes.
+ Example:
+ _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
+ _GL_ARG_NONNULL ((1)));
+ */
+#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
+ _GL_EXTERN_C rettype func parameters_and_attributes
+
+/* _GL_CXXALIAS_RPL (func, rettype, parameters);
+ declares a C++ alias called GNULIB_NAMESPACE::func
+ that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
+ Example:
+ _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
+
+ Wrapping rpl_func in an object with an inline conversion operator
+ avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
+ actually used in the program. */
+#define _GL_CXXALIAS_RPL(func,rettype,parameters) \
+ _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
+ namespace GNULIB_NAMESPACE \
+ { \
+ static const struct _gl_ ## func ## _wrapper \
+ { \
+ typedef rettype (*type) parameters; \
+ \
+ inline operator type () const \
+ { \
+ return ::rpl_func; \
+ } \
+ } func = {}; \
+ } \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIAS_MDA (func, rettype, parameters);
+ is to be used when func is a Microsoft deprecated alias, on native Windows.
+ It declares a C++ alias called GNULIB_NAMESPACE::func
+ that redirects to _func, if GNULIB_NAMESPACE is defined.
+ Example:
+ _GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...));
+ */
+#define _GL_CXXALIAS_MDA(func,rettype,parameters) \
+ _GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters)
+
+/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
+ is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
+ except that the C function rpl_func may have a slightly different
+ declaration. A cast is used to silence the "invalid conversion" error
+ that would otherwise occur. */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
+ namespace GNULIB_NAMESPACE \
+ { \
+ static const struct _gl_ ## func ## _wrapper \
+ { \
+ typedef rettype (*type) parameters; \
+ \
+ inline operator type () const \
+ { \
+ return reinterpret_cast<type>(::rpl_func); \
+ } \
+ } func = {}; \
+ } \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIAS_MDA_CAST (func, rettype, parameters);
+ is like _GL_CXXALIAS_MDA (func, rettype, parameters);
+ except that the C function func may have a slightly different declaration.
+ A cast is used to silence the "invalid conversion" error that would
+ otherwise occur. */
+#define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \
+ _GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters)
+
+/* _GL_CXXALIAS_SYS (func, rettype, parameters);
+ declares a C++ alias called GNULIB_NAMESPACE::func
+ that redirects to the system provided function func, if GNULIB_NAMESPACE
+ is defined.
+ Example:
+ _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
+
+ Wrapping func in an object with an inline conversion operator
+ avoids a reference to func unless GNULIB_NAMESPACE::func is
+ actually used in the program. */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
+ namespace GNULIB_NAMESPACE \
+ { \
+ static const struct _gl_ ## func ## _wrapper \
+ { \
+ typedef rettype (*type) parameters; \
+ \
+ inline operator type () const \
+ { \
+ return ::func; \
+ } \
+ } func = {}; \
+ } \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
+ is like _GL_CXXALIAS_SYS (func, rettype, parameters);
+ except that the C function func may have a slightly different declaration.
+ A cast is used to silence the "invalid conversion" error that would
+ otherwise occur. */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
+ namespace GNULIB_NAMESPACE \
+ { \
+ static const struct _gl_ ## func ## _wrapper \
+ { \
+ typedef rettype (*type) parameters; \
+ \
+ inline operator type () const \
+ { \
+ return reinterpret_cast<type>(::func); \
+ } \
+ } func = {}; \
+ } \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
+ is like _GL_CXXALIAS_SYS (func, rettype, parameters);
+ except that the C function is picked among a set of overloaded functions,
+ namely the one with rettype2 and parameters2. Two consecutive casts
+ are used to silence the "cannot find a match" and "invalid conversion"
+ errors that would otherwise occur. */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+ /* The outer cast must be a reinterpret_cast.
+ The inner cast: When the function is defined as a set of overloaded
+ functions, it works as a static_cast<>, choosing the designated variant.
+ When the function is defined as a single variant, it works as a
+ reinterpret_cast<>. The parenthesized cast syntax works both ways. */
+# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
+ namespace GNULIB_NAMESPACE \
+ { \
+ static const struct _gl_ ## func ## _wrapper \
+ { \
+ typedef rettype (*type) parameters; \
+ \
+ inline operator type () const \
+ { \
+ return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \
+ } \
+ } func = {}; \
+ } \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIASWARN (func);
+ causes a warning to be emitted when ::func is used but not when
+ GNULIB_NAMESPACE::func is used. func must be defined without overloaded
+ variants. */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIASWARN(func) \
+ _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
+# define _GL_CXXALIASWARN_1(func,namespace) \
+ _GL_CXXALIASWARN_2 (func, namespace)
+/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+ we enable the warning only when not optimizing. */
+# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
+# define _GL_CXXALIASWARN_2(func,namespace) \
+ _GL_WARN_ON_USE (func, \
+ "The symbol ::" #func " refers to the system function. " \
+ "Use " #namespace "::" #func " instead.")
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+# define _GL_CXXALIASWARN_2(func,namespace) \
+ extern __typeof__ (func) func
+# else
+# define _GL_CXXALIASWARN_2(func,namespace) \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+# endif
+#else
+# define _GL_CXXALIASWARN(func) \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
+ causes a warning to be emitted when the given overloaded variant of ::func
+ is used but not when GNULIB_NAMESPACE::func is used. */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
+ _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
+ GNULIB_NAMESPACE)
+# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
+ _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
+/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+ we enable the warning only when not optimizing. */
+# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
+# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+ _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \
+ "The symbol ::" #func " refers to the system function. " \
+ "Use " #namespace "::" #func " instead.")
+# else
+# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+# endif
+#else
+# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+#endif /* _GL_CXXDEFS_H */
diff --git a/gl/lib/calloc.c b/gl/lib/calloc.c
new file mode 100644
index 0000000..0a934b3
--- /dev/null
+++ b/gl/lib/calloc.c
@@ -0,0 +1,55 @@
+/* calloc() function that is glibc compatible.
+ This wrapper function is required at least on Tru64 UNIX 5.1 and mingw.
+ Copyright (C) 2004-2007, 2009-2022 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 2.1 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 Jim Meyering and Bruno Haible */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdlib.h>
+
+#include <errno.h>
+
+#include "xalloc-oversized.h"
+
+/* Call the system's calloc below. */
+#undef calloc
+
+/* Allocate and zero-fill an NxS-byte block of memory from the heap,
+ even if N or S is zero. */
+
+void *
+rpl_calloc (size_t n, size_t s)
+{
+ if (n == 0 || s == 0)
+ n = s = 1;
+
+ if (xalloc_oversized (n, s))
+ {
+ errno = ENOMEM;
+ return NULL;
+ }
+
+ void *result = calloc (n, s);
+
+#if !HAVE_MALLOC_POSIX
+ if (result == NULL)
+ errno = ENOMEM;
+#endif
+
+ return result;
+}
diff --git a/gl/lib/canonicalize-lgpl.c b/gl/lib/canonicalize-lgpl.c
new file mode 100644
index 0000000..a7fa7fe
--- /dev/null
+++ b/gl/lib/canonicalize-lgpl.c
@@ -0,0 +1,472 @@
+/* Return the canonical absolute name of a given file.
+ Copyright (C) 1996-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
+ optimizes away the name == NULL test below. */
+# define _GL_ARG_NONNULL(params)
+
+# include <libc-config.h>
+#endif
+
+/* Specification. */
+#include <stdlib.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdbool.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <eloop-threshold.h>
+#include <filename.h>
+#include <idx.h>
+#include <intprops.h>
+#include <scratch_buffer.h>
+
+#ifdef _LIBC
+# include <shlib-compat.h>
+# define GCC_LINT 1
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define __canonicalize_file_name canonicalize_file_name
+# define __realpath realpath
+# include "pathmax.h"
+# define __faccessat faccessat
+# if defined _WIN32 && !defined __CYGWIN__
+# define __getcwd _getcwd
+# elif HAVE_GETCWD
+# if IN_RELOCWRAPPER
+ /* When building the relocatable program wrapper, use the system's getcwd
+ function, not the gnulib override, otherwise we would get a link error.
+ */
+# undef getcwd
+# endif
+# if defined VMS && !defined getcwd
+ /* We want the directory in Unix syntax, not in VMS syntax.
+ The gnulib override of 'getcwd' takes 2 arguments; the original VMS
+ 'getcwd' takes 3 arguments. */
+# define __getcwd(buf, max) getcwd (buf, max, 0)
+# else
+# define __getcwd getcwd
+# endif
+# else
+# define __getcwd(buf, max) getwd (buf)
+# endif
+# define __mempcpy mempcpy
+# define __pathconf pathconf
+# define __rawmemchr rawmemchr
+# define __readlink readlink
+# if IN_RELOCWRAPPER
+ /* When building the relocatable program wrapper, use the system's memmove
+ function, not the gnulib override, otherwise we would get a link error.
+ */
+# undef memmove
+# endif
+#endif
+
+/* Suppress bogus GCC -Wmaybe-uninitialized warnings. */
+#if defined GCC_LINT || defined lint
+# define IF_LINT(Code) Code
+#else
+# define IF_LINT(Code) /* empty */
+#endif
+
+#ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
+# define DOUBLE_SLASH_IS_DISTINCT_ROOT false
+#endif
+
+#if defined _LIBC || !FUNC_REALPATH_WORKS
+
+/* Return true if FILE's existence can be shown, false (setting errno)
+ otherwise. Follow symbolic links. */
+static bool
+file_accessible (char const *file)
+{
+# if defined _LIBC || HAVE_FACCESSAT
+ return __faccessat (AT_FDCWD, file, F_OK, AT_EACCESS) == 0;
+# else
+ struct stat st;
+ return stat (file, &st) == 0 || errno == EOVERFLOW;
+# endif
+}
+
+/* True if concatenating END as a suffix to a file name means that the
+ code needs to check that the file name is that of a searchable
+ directory, since the canonicalize_filename_mode_stk code won't
+ check this later anyway when it checks an ordinary file name
+ component within END. END must either be empty, or start with a
+ slash. */
+
+static bool _GL_ATTRIBUTE_PURE
+suffix_requires_dir_check (char const *end)
+{
+ /* If END does not start with a slash, the suffix is OK. */
+ while (ISSLASH (*end))
+ {
+ /* Two or more slashes act like a single slash. */
+ do
+ end++;
+ while (ISSLASH (*end));
+
+ switch (*end++)
+ {
+ default: return false; /* An ordinary file name component is OK. */
+ case '\0': return true; /* Trailing "/" is trouble. */
+ case '.': break; /* Possibly "." or "..". */
+ }
+ /* Trailing "/.", or "/.." even if not trailing, is trouble. */
+ if (!*end || (*end == '.' && (!end[1] || ISSLASH (end[1]))))
+ return true;
+ }
+
+ return false;
+}
+
+/* Append this to a file name to test whether it is a searchable directory.
+ On POSIX platforms "/" suffices, but "/./" is sometimes needed on
+ macOS 10.13 <https://bugs.gnu.org/30350>, and should also work on
+ platforms like AIX 7.2 that need at least "/.". */
+
+# if defined _LIBC || defined LSTAT_FOLLOWS_SLASHED_SYMLINK
+static char const dir_suffix[] = "/";
+# else
+static char const dir_suffix[] = "/./";
+# endif
+
+/* Return true if DIR is a searchable dir, false (setting errno) otherwise.
+ DIREND points to the NUL byte at the end of the DIR string.
+ Store garbage into DIREND[0 .. strlen (dir_suffix)]. */
+
+static bool
+dir_check (char *dir, char *dirend)
+{
+ strcpy (dirend, dir_suffix);
+ return file_accessible (dir);
+}
+
+static idx_t
+get_path_max (void)
+{
+# ifdef PATH_MAX
+ long int path_max = PATH_MAX;
+# else
+ /* The caller invoked realpath with a null RESOLVED, even though
+ PATH_MAX is not defined as a constant. The glibc manual says
+ programs should not do this, and POSIX says the behavior is undefined.
+ Historically, glibc here used the result of pathconf, or 1024 if that
+ failed; stay consistent with this (dubious) historical practice. */
+ int err = errno;
+ long int path_max = __pathconf ("/", _PC_PATH_MAX);
+ __set_errno (err);
+# endif
+ return path_max < 0 ? 1024 : path_max <= IDX_MAX ? path_max : IDX_MAX;
+}
+
+/* Act like __realpath (see below), with an additional argument
+ rname_buf that can be used as temporary storage.
+
+ If GCC_LINT is defined, do not inline this function with GCC 10.1
+ and later, to avoid creating a pointer to the stack that GCC
+ -Wreturn-local-addr incorrectly complains about. See:
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644
+ Although the noinline attribute can hurt performance a bit, no better way
+ to pacify GCC is known; even an explicit #pragma does not pacify GCC.
+ When the GCC bug is fixed this workaround should be limited to the
+ broken GCC versions. */
+# if __GNUC_PREREQ (10, 1)
+# if defined GCC_LINT || defined lint
+__attribute__ ((__noinline__))
+# elif __OPTIMIZE__ && !__NO_INLINE__
+# define GCC_BOGUS_WRETURN_LOCAL_ADDR
+# endif
+# endif
+static char *
+realpath_stk (const char *name, char *resolved,
+ struct scratch_buffer *rname_buf)
+{
+ char *dest;
+ char const *start;
+ char const *end;
+ int num_links = 0;
+
+ if (name == NULL)
+ {
+ /* As per Single Unix Specification V2 we must return an error if
+ either parameter is a null pointer. We extend this to allow
+ the RESOLVED parameter to be NULL in case the we are expected to
+ allocate the room for the return value. */
+ __set_errno (EINVAL);
+ return NULL;
+ }
+
+ if (name[0] == '\0')
+ {
+ /* As per Single Unix Specification V2 we must return an error if
+ the name argument points to an empty string. */
+ __set_errno (ENOENT);
+ return NULL;
+ }
+
+ struct scratch_buffer extra_buffer, link_buffer;
+ scratch_buffer_init (&extra_buffer);
+ scratch_buffer_init (&link_buffer);
+ scratch_buffer_init (rname_buf);
+ char *rname_on_stack = rname_buf->data;
+ char *rname = rname_on_stack;
+ bool end_in_extra_buffer = false;
+ bool failed = true;
+
+ /* This is always zero for Posix hosts, but can be 2 for MS-Windows
+ and MS-DOS X:/foo/bar file names. */
+ idx_t prefix_len = FILE_SYSTEM_PREFIX_LEN (name);
+
+ if (!IS_ABSOLUTE_FILE_NAME (name))
+ {
+ while (!__getcwd (rname, rname_buf->length))
+ {
+ if (errno != ERANGE)
+ {
+ dest = rname;
+ goto error;
+ }
+ if (!scratch_buffer_grow (rname_buf))
+ goto error_nomem;
+ rname = rname_buf->data;
+ }
+ dest = __rawmemchr (rname, '\0');
+ start = name;
+ prefix_len = FILE_SYSTEM_PREFIX_LEN (rname);
+ }
+ else
+ {
+ dest = __mempcpy (rname, name, prefix_len);
+ *dest++ = '/';
+ if (DOUBLE_SLASH_IS_DISTINCT_ROOT)
+ {
+ if (prefix_len == 0 /* implies ISSLASH (name[0]) */
+ && ISSLASH (name[1]) && !ISSLASH (name[2]))
+ *dest++ = '/';
+ *dest = '\0';
+ }
+ start = name + prefix_len;
+ }
+
+ for ( ; *start; start = end)
+ {
+ /* Skip sequence of multiple file name separators. */
+ while (ISSLASH (*start))
+ ++start;
+
+ /* Find end of component. */
+ for (end = start; *end && !ISSLASH (*end); ++end)
+ /* Nothing. */;
+
+ /* Length of this file name component; it can be zero if a file
+ name ends in '/'. */
+ idx_t startlen = end - start;
+
+ if (startlen == 0)
+ break;
+ else if (startlen == 1 && start[0] == '.')
+ /* nothing */;
+ else if (startlen == 2 && start[0] == '.' && start[1] == '.')
+ {
+ /* Back up to previous component, ignore if at root already. */
+ if (dest > rname + prefix_len + 1)
+ for (--dest; dest > rname && !ISSLASH (dest[-1]); --dest)
+ continue;
+ if (DOUBLE_SLASH_IS_DISTINCT_ROOT
+ && dest == rname + 1 && !prefix_len
+ && ISSLASH (*dest) && !ISSLASH (dest[1]))
+ dest++;
+ }
+ else
+ {
+ if (!ISSLASH (dest[-1]))
+ *dest++ = '/';
+
+ while (rname + rname_buf->length - dest
+ < startlen + sizeof dir_suffix)
+ {
+ idx_t dest_offset = dest - rname;
+ if (!scratch_buffer_grow_preserve (rname_buf))
+ goto error_nomem;
+ rname = rname_buf->data;
+ dest = rname + dest_offset;
+ }
+
+ dest = __mempcpy (dest, start, startlen);
+ *dest = '\0';
+
+ char *buf;
+ ssize_t n;
+ while (true)
+ {
+ buf = link_buffer.data;
+ idx_t bufsize = link_buffer.length;
+ n = __readlink (rname, buf, bufsize - 1);
+ if (n < bufsize - 1)
+ break;
+ if (!scratch_buffer_grow (&link_buffer))
+ goto error_nomem;
+ }
+ if (0 <= n)
+ {
+ if (++num_links > __eloop_threshold ())
+ {
+ __set_errno (ELOOP);
+ goto error;
+ }
+
+ buf[n] = '\0';
+
+ char *extra_buf = extra_buffer.data;
+ idx_t end_idx IF_LINT (= 0);
+ if (end_in_extra_buffer)
+ end_idx = end - extra_buf;
+ size_t len = strlen (end);
+ if (INT_ADD_OVERFLOW (len, n))
+ {
+ __set_errno (ENOMEM);
+ goto error_nomem;
+ }
+ while (extra_buffer.length <= len + n)
+ {
+ if (!scratch_buffer_grow_preserve (&extra_buffer))
+ goto error_nomem;
+ extra_buf = extra_buffer.data;
+ }
+ if (end_in_extra_buffer)
+ end = extra_buf + end_idx;
+
+ /* Careful here, end may be a pointer into extra_buf... */
+ memmove (&extra_buf[n], end, len + 1);
+ name = end = memcpy (extra_buf, buf, n);
+ end_in_extra_buffer = true;
+
+ if (IS_ABSOLUTE_FILE_NAME (buf))
+ {
+ idx_t pfxlen = FILE_SYSTEM_PREFIX_LEN (buf);
+
+ dest = __mempcpy (rname, buf, pfxlen);
+ *dest++ = '/'; /* It's an absolute symlink */
+ if (DOUBLE_SLASH_IS_DISTINCT_ROOT)
+ {
+ if (ISSLASH (buf[1]) && !ISSLASH (buf[2]) && !pfxlen)
+ *dest++ = '/';
+ *dest = '\0';
+ }
+ /* Install the new prefix to be in effect hereafter. */
+ prefix_len = pfxlen;
+ }
+ else
+ {
+ /* Back up to previous component, ignore if at root
+ already: */
+ if (dest > rname + prefix_len + 1)
+ for (--dest; dest > rname && !ISSLASH (dest[-1]); --dest)
+ continue;
+ if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rname + 1
+ && ISSLASH (*dest) && !ISSLASH (dest[1]) && !prefix_len)
+ dest++;
+ }
+ }
+ else if (! (suffix_requires_dir_check (end)
+ ? dir_check (rname, dest)
+ : errno == EINVAL))
+ goto error;
+ }
+ }
+ if (dest > rname + prefix_len + 1 && ISSLASH (dest[-1]))
+ --dest;
+ if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rname + 1 && !prefix_len
+ && ISSLASH (*dest) && !ISSLASH (dest[1]))
+ dest++;
+ failed = false;
+
+error:
+ *dest++ = '\0';
+ if (resolved != NULL && dest - rname <= get_path_max ())
+ rname = strcpy (resolved, rname);
+
+error_nomem:
+ scratch_buffer_free (&extra_buffer);
+ scratch_buffer_free (&link_buffer);
+
+ if (failed || rname == resolved)
+ {
+ scratch_buffer_free (rname_buf);
+ return failed ? NULL : resolved;
+ }
+
+ return scratch_buffer_dupfree (rname_buf, dest - rname);
+}
+
+/* Return the canonical absolute name of file NAME. A canonical name
+ does not contain any ".", ".." components nor any repeated file name
+ separators ('/') or symlinks. All file name components must exist. If
+ RESOLVED is null, the result is malloc'd; otherwise, if the
+ canonical name is PATH_MAX chars or more, returns null with 'errno'
+ set to ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars,
+ returns the name in RESOLVED. If the name cannot be resolved and
+ RESOLVED is non-NULL, it contains the name of the first component
+ that cannot be resolved. If the name can be resolved, RESOLVED
+ holds the same value as the value returned. */
+
+char *
+__realpath (const char *name, char *resolved)
+{
+ #ifdef GCC_BOGUS_WRETURN_LOCAL_ADDR
+ #warning "GCC might issue a bogus -Wreturn-local-addr warning here."
+ #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>."
+ #endif
+ struct scratch_buffer rname_buffer;
+ return realpath_stk (name, resolved, &rname_buffer);
+}
+libc_hidden_def (__realpath)
+versioned_symbol (libc, __realpath, realpath, GLIBC_2_3);
+
+#endif /* defined _LIBC || !FUNC_REALPATH_WORKS */
+
+
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_3)
+char *
+attribute_compat_text_section
+__old_realpath (const char *name, char *resolved)
+{
+ if (resolved == NULL)
+ {
+ __set_errno (EINVAL);
+ return NULL;
+ }
+
+ return __realpath (name, resolved);
+}
+compat_symbol (libc, __old_realpath, realpath, GLIBC_2_0);
+#endif
+
+
+char *
+__canonicalize_file_name (const char *name)
+{
+ return __realpath (name, NULL);
+}
+weak_alias (__canonicalize_file_name, canonicalize_file_name)
diff --git a/gl/lib/canonicalize.c b/gl/lib/canonicalize.c
new file mode 100644
index 0000000..eaf18c6
--- /dev/null
+++ b/gl/lib/canonicalize.c
@@ -0,0 +1,489 @@
+/* Return the canonical absolute name of a given file.
+ Copyright (C) 1996-2022 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 "canonicalize.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <filename.h>
+#include <idx.h>
+#include <intprops.h>
+#include <scratch_buffer.h>
+
+#include "attribute.h"
+#include "file-set.h"
+#include "hash-triple.h"
+#include "xalloc.h"
+
+/* Suppress bogus GCC -Wmaybe-uninitialized warnings. */
+#if defined GCC_LINT || defined lint
+# define IF_LINT(Code) Code
+#else
+# define IF_LINT(Code) /* empty */
+#endif
+
+#ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
+# define DOUBLE_SLASH_IS_DISTINCT_ROOT false
+#endif
+
+#if ISSLASH ('\\')
+# define SLASHES "/\\"
+#else
+# define SLASHES "/"
+#endif
+
+/* Return true if FILE's existence can be shown, false (setting errno)
+ otherwise. Follow symbolic links. */
+static bool
+file_accessible (char const *file)
+{
+# if HAVE_FACCESSAT
+ return faccessat (AT_FDCWD, file, F_OK, AT_EACCESS) == 0;
+# else
+ struct stat st;
+ return stat (file, &st) == 0 || errno == EOVERFLOW;
+# endif
+}
+
+/* True if concatenating END as a suffix to a file name means that the
+ code needs to check that the file name is that of a searchable
+ directory, since the canonicalize_filename_mode_stk code won't
+ check this later anyway when it checks an ordinary file name
+ component within END. END must either be empty, or start with a
+ slash. */
+
+static bool _GL_ATTRIBUTE_PURE
+suffix_requires_dir_check (char const *end)
+{
+ /* If END does not start with a slash, the suffix is OK. */
+ while (ISSLASH (*end))
+ {
+ /* Two or more slashes act like a single slash. */
+ do
+ end++;
+ while (ISSLASH (*end));
+
+ switch (*end++)
+ {
+ default: return false; /* An ordinary file name component is OK. */
+ case '\0': return true; /* Trailing "/" is trouble. */
+ case '.': break; /* Possibly "." or "..". */
+ }
+ /* Trailing "/.", or "/.." even if not trailing, is trouble. */
+ if (!*end || (*end == '.' && (!end[1] || ISSLASH (end[1]))))
+ return true;
+ }
+
+ return false;
+}
+
+/* Append this to a file name to test whether it is a searchable directory.
+ On POSIX platforms "/" suffices, but "/./" is sometimes needed on
+ macOS 10.13 <https://bugs.gnu.org/30350>, and should also work on
+ platforms like AIX 7.2 that need at least "/.". */
+
+#ifdef LSTAT_FOLLOWS_SLASHED_SYMLINK
+static char const dir_suffix[] = "/";
+#else
+static char const dir_suffix[] = "/./";
+#endif
+
+/* Return true if DIR is a searchable dir, false (setting errno) otherwise.
+ DIREND points to the NUL byte at the end of the DIR string.
+ Store garbage into DIREND[0 .. strlen (dir_suffix)]. */
+
+static bool
+dir_check (char *dir, char *dirend)
+{
+ strcpy (dirend, dir_suffix);
+ return file_accessible (dir);
+}
+
+#if !((HAVE_CANONICALIZE_FILE_NAME && FUNC_REALPATH_WORKS) \
+ || GNULIB_CANONICALIZE_LGPL)
+/* Return the canonical absolute name of file NAME. A canonical name
+ does not contain any ".", ".." components nor any repeated file name
+ separators ('/') or symlinks. All components must exist.
+ The result is malloc'd. */
+
+char *
+canonicalize_file_name (const char *name)
+{
+ return canonicalize_filename_mode (name, CAN_EXISTING);
+}
+#endif /* !HAVE_CANONICALIZE_FILE_NAME */
+
+static bool
+multiple_bits_set (canonicalize_mode_t i)
+{
+ return (i & (i - 1)) != 0;
+}
+
+/* Return true if we've already seen the triple, <FILENAME, dev, ino>.
+ If *HT is not initialized, initialize it. */
+static bool
+seen_triple (Hash_table **ht, char const *filename, struct stat const *st)
+{
+ if (*ht == NULL)
+ {
+ idx_t initial_capacity = 7;
+ *ht = hash_initialize (initial_capacity,
+ NULL,
+ triple_hash,
+ triple_compare_ino_str,
+ triple_free);
+ if (*ht == NULL)
+ xalloc_die ();
+ }
+
+ if (seen_file (*ht, filename, st))
+ return true;
+
+ record_file (*ht, filename, st);
+ return false;
+}
+
+
+/* Act like canonicalize_filename_mode (see below), with an additional argument
+ rname_buf that can be used as temporary storage.
+
+ If GCC_LINT is defined, do not inline this function with GCC 10.1
+ and later, to avoid creating a pointer to the stack that GCC
+ -Wreturn-local-addr incorrectly complains about. See:
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644
+ Although the noinline attribute can hurt performance a bit, no better way
+ to pacify GCC is known; even an explicit #pragma does not pacify GCC.
+ When the GCC bug is fixed this workaround should be limited to the
+ broken GCC versions. */
+#if _GL_GNUC_PREREQ (10, 1)
+# if defined GCC_LINT || defined lint
+__attribute__ ((__noinline__))
+# elif __OPTIMIZE__ && !__NO_INLINE__
+# define GCC_BOGUS_WRETURN_LOCAL_ADDR
+# endif
+#endif
+static char *
+canonicalize_filename_mode_stk (const char *name, canonicalize_mode_t can_mode,
+ struct scratch_buffer *rname_buf)
+{
+ char *dest;
+ char const *start;
+ char const *end;
+ Hash_table *ht = NULL;
+ bool logical = (can_mode & CAN_NOLINKS) != 0;
+ int num_links = 0;
+
+ canonicalize_mode_t can_exist = can_mode & CAN_MODE_MASK;
+ if (multiple_bits_set (can_exist))
+ {
+ errno = EINVAL;
+ return NULL;
+ }
+
+ if (name == NULL)
+ {
+ errno = EINVAL;
+ return NULL;
+ }
+
+ if (name[0] == '\0')
+ {
+ errno = ENOENT;
+ return NULL;
+ }
+
+ struct scratch_buffer extra_buffer, link_buffer;
+ scratch_buffer_init (&extra_buffer);
+ scratch_buffer_init (&link_buffer);
+ scratch_buffer_init (rname_buf);
+ char *rname_on_stack = rname_buf->data;
+ char *rname = rname_on_stack;
+ bool end_in_extra_buffer = false;
+ bool failed = true;
+
+ /* This is always zero for Posix hosts, but can be 2 for MS-Windows
+ and MS-DOS X:/foo/bar file names. */
+ idx_t prefix_len = FILE_SYSTEM_PREFIX_LEN (name);
+
+ if (!IS_ABSOLUTE_FILE_NAME (name))
+ {
+ while (!getcwd (rname, rname_buf->length))
+ {
+ switch (errno)
+ {
+ case ERANGE:
+ if (scratch_buffer_grow (rname_buf))
+ break;
+ FALLTHROUGH;
+ case ENOMEM:
+ xalloc_die ();
+
+ default:
+ dest = rname;
+ goto error;
+ }
+ rname = rname_buf->data;
+ }
+ dest = rawmemchr (rname, '\0');
+ start = name;
+ prefix_len = FILE_SYSTEM_PREFIX_LEN (rname);
+ }
+ else
+ {
+ dest = mempcpy (rname, name, prefix_len);
+ *dest++ = '/';
+ if (DOUBLE_SLASH_IS_DISTINCT_ROOT)
+ {
+ if (prefix_len == 0 /* implies ISSLASH (name[0]) */
+ && ISSLASH (name[1]) && !ISSLASH (name[2]))
+ {
+ *dest++ = '/';
+#if defined _WIN32 && !defined __CYGWIN__
+ /* For UNC file names '\\server\path\to\file', extend the prefix
+ to include the server: '\\server\'. */
+ {
+ idx_t i;
+ for (i = 2; name[i] != '\0' && !ISSLASH (name[i]); )
+ i++;
+ if (name[i] != '\0' /* implies ISSLASH (name[i]) */
+ && i + 1 < rname_buf->length)
+ {
+ prefix_len = i;
+ memcpy (dest, name + 2, i - 2 + 1);
+ dest += i - 2 + 1;
+ }
+ else
+ {
+ /* Either name = '\\server'; this is an invalid file name.
+ Or name = '\\server\...' and server is more than
+ rname_buf->length - 4 bytes long. In either
+ case, stop the UNC processing. */
+ }
+ }
+#endif
+ }
+ *dest = '\0';
+ }
+ start = name + prefix_len;
+ }
+
+ for ( ; *start; start = end)
+ {
+ /* Skip sequence of multiple file name separators. */
+ while (ISSLASH (*start))
+ ++start;
+
+ /* Find end of component. */
+ for (end = start; *end && !ISSLASH (*end); ++end)
+ /* Nothing. */;
+
+ /* Length of this file name component; it can be zero if a file
+ name ends in '/'. */
+ idx_t startlen = end - start;
+
+ if (startlen == 0)
+ break;
+ else if (startlen == 1 && start[0] == '.')
+ /* nothing */;
+ else if (startlen == 2 && start[0] == '.' && start[1] == '.')
+ {
+ /* Back up to previous component, ignore if at root already. */
+ if (dest > rname + prefix_len + 1)
+ for (--dest; dest > rname && !ISSLASH (dest[-1]); --dest)
+ continue;
+ if (DOUBLE_SLASH_IS_DISTINCT_ROOT
+ && dest == rname + 1 && !prefix_len
+ && ISSLASH (*dest) && !ISSLASH (dest[1]))
+ dest++;
+ }
+ else
+ {
+ if (!ISSLASH (dest[-1]))
+ *dest++ = '/';
+
+ while (rname + rname_buf->length - dest
+ < startlen + sizeof dir_suffix)
+ {
+ idx_t dest_offset = dest - rname;
+ if (!scratch_buffer_grow_preserve (rname_buf))
+ xalloc_die ();
+ rname = rname_buf->data;
+ dest = rname + dest_offset;
+ }
+
+ dest = mempcpy (dest, start, startlen);
+ *dest = '\0';
+
+ char *buf;
+ ssize_t n = -1;
+ if (!logical)
+ {
+ while (true)
+ {
+ buf = link_buffer.data;
+ idx_t bufsize = link_buffer.length;
+ n = readlink (rname, buf, bufsize - 1);
+ if (n < bufsize - 1)
+ break;
+ if (!scratch_buffer_grow (&link_buffer))
+ xalloc_die ();
+ }
+ }
+ if (0 <= n)
+ {
+ /* A physical traversal and RNAME is a symbolic link. */
+
+ if (num_links < 20)
+ num_links++;
+ else if (*start)
+ {
+ /* Enough symlinks have been seen that it is time to
+ worry about being in a symlink cycle.
+ Get the device and inode of the parent directory, as
+ pre-2017 POSIX says this info is not reliable for
+ symlinks. */
+ struct stat st;
+ dest[- startlen] = '\0';
+ if (stat (*rname ? rname : ".", &st) != 0)
+ goto error;
+ dest[- startlen] = *start;
+
+ /* Detect loops. We cannot use the cycle-check module here,
+ since it's possible to encounter the same parent
+ directory more than once in a given traversal. However,
+ encountering the same (parentdir, START) pair twice does
+ indicate a loop. */
+ if (seen_triple (&ht, start, &st))
+ {
+ if (can_exist == CAN_MISSING)
+ continue;
+ errno = ELOOP;
+ goto error;
+ }
+ }
+
+ buf[n] = '\0';
+
+ char *extra_buf = extra_buffer.data;
+ idx_t end_idx IF_LINT (= 0);
+ if (end_in_extra_buffer)
+ end_idx = end - extra_buf;
+ size_t len = strlen (end);
+ if (INT_ADD_OVERFLOW (len, n))
+ xalloc_die ();
+ while (extra_buffer.length <= len + n)
+ {
+ if (!scratch_buffer_grow_preserve (&extra_buffer))
+ xalloc_die ();
+ extra_buf = extra_buffer.data;
+ }
+ if (end_in_extra_buffer)
+ end = extra_buf + end_idx;
+
+ /* Careful here, end may be a pointer into extra_buf... */
+ memmove (&extra_buf[n], end, len + 1);
+ name = end = memcpy (extra_buf, buf, n);
+ end_in_extra_buffer = true;
+
+ if (IS_ABSOLUTE_FILE_NAME (buf))
+ {
+ idx_t pfxlen = FILE_SYSTEM_PREFIX_LEN (buf);
+
+ dest = mempcpy (rname, buf, pfxlen);
+ *dest++ = '/'; /* It's an absolute symlink */
+ if (DOUBLE_SLASH_IS_DISTINCT_ROOT)
+ {
+ if (ISSLASH (buf[1]) && !ISSLASH (buf[2]) && !pfxlen)
+ *dest++ = '/';
+ *dest = '\0';
+ }
+ /* Install the new prefix to be in effect hereafter. */
+ prefix_len = pfxlen;
+ }
+ else
+ {
+ /* Back up to previous component, ignore if at root
+ already: */
+ if (dest > rname + prefix_len + 1)
+ for (--dest; dest > rname && !ISSLASH (dest[-1]); --dest)
+ continue;
+ if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rname + 1
+ && ISSLASH (*dest) && !ISSLASH (dest[1]) && !prefix_len)
+ dest++;
+ }
+ }
+ else if (! (can_exist == CAN_MISSING
+ || (suffix_requires_dir_check (end)
+ ? dir_check (rname, dest)
+ : !logical
+ ? errno == EINVAL
+ : *end || file_accessible (rname))
+ || (can_exist == CAN_ALL_BUT_LAST
+ && errno == ENOENT
+ && !end[strspn (end, SLASHES)])))
+ goto error;
+ }
+ }
+ if (dest > rname + prefix_len + 1 && ISSLASH (dest[-1]))
+ --dest;
+ if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rname + 1 && !prefix_len
+ && ISSLASH (*dest) && !ISSLASH (dest[1]))
+ dest++;
+ failed = false;
+
+error:
+ if (ht)
+ hash_free (ht);
+ scratch_buffer_free (&extra_buffer);
+ scratch_buffer_free (&link_buffer);
+
+ if (failed)
+ {
+ scratch_buffer_free (rname_buf);
+ return NULL;
+ }
+
+ *dest++ = '\0';
+ char *result = scratch_buffer_dupfree (rname_buf, dest - rname);
+ if (!result)
+ xalloc_die ();
+ return result;
+}
+
+/* Return the canonical absolute name of file NAME, while treating
+ missing elements according to CAN_MODE. A canonical name
+ does not contain any ".", ".." components nor any repeated file name
+ separators ('/') or, depending on other CAN_MODE flags, symlinks.
+ Whether components must exist or not depends on canonicalize mode.
+ The result is malloc'd. */
+
+char *
+canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode)
+{
+ #ifdef GCC_BOGUS_WRETURN_LOCAL_ADDR
+ #warning "GCC might issue a bogus -Wreturn-local-addr warning here."
+ #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>."
+ #endif
+ struct scratch_buffer rname_buffer;
+ return canonicalize_filename_mode_stk (name, can_mode, &rname_buffer);
+}
diff --git a/gl/lib/canonicalize.h b/gl/lib/canonicalize.h
new file mode 100644
index 0000000..817da1f
--- /dev/null
+++ b/gl/lib/canonicalize.h
@@ -0,0 +1,58 @@
+/* Return the canonical absolute name of a given file.
+ Copyright (C) 1996-2007, 2009-2022 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 CANONICALIZE_H_
+# define CANONICALIZE_H_
+
+#include <stdlib.h> /* for canonicalize_file_name */
+
+#define CAN_MODE_MASK (CAN_EXISTING | CAN_ALL_BUT_LAST | CAN_MISSING)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum canonicalize_mode_t
+ {
+ /* All components must exist. */
+ CAN_EXISTING = 0,
+
+ /* All components excluding last one must exist. */
+ CAN_ALL_BUT_LAST = 1,
+
+ /* No requirements on components existence. */
+ CAN_MISSING = 2,
+
+ /* Don't expand symlinks. */
+ CAN_NOLINKS = 4
+ };
+typedef enum canonicalize_mode_t canonicalize_mode_t;
+
+/* Return the canonical absolute name of file NAME, while treating
+ missing elements according to CAN_MODE. A canonical name
+ does not contain any `.', `..' components nor any repeated file name
+ separators ('/') or, depending on other CAN_MODE flags, symlinks.
+ Whether components must exist or not depends on canonicalize mode.
+ The result is malloc'd.
+ Upon failure, return NULL with errno set. */
+char *canonicalize_filename_mode (const char *, canonicalize_mode_t)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !CANONICALIZE_H_ */
diff --git a/gl/lib/cdefs.h b/gl/lib/cdefs.h
new file mode 100644
index 0000000..7b8ed5b
--- /dev/null
+++ b/gl/lib/cdefs.h
@@ -0,0 +1,707 @@
+/* Copyright (C) 1992-2022 Free Software Foundation, Inc.
+ Copyright The GNU Toolchain Authors.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _SYS_CDEFS_H
+#define _SYS_CDEFS_H 1
+
+/* We are almost always included from features.h. */
+#ifndef _FEATURES_H
+# include <features.h>
+#endif
+
+/* The GNU libc does not support any K&R compilers or the traditional mode
+ of ISO C compilers anymore. Check for some of the combinations not
+ supported anymore. */
+#if defined __GNUC__ && !defined __STDC__
+# error "You need a ISO C conforming compiler to use the glibc headers"
+#endif
+
+/* Some user header file might have defined this before. */
+#undef __P
+#undef __PMT
+
+/* Compilers that lack __has_attribute may object to
+ #if defined __has_attribute && __has_attribute (...)
+ even though they do not need to evaluate the right-hand side of the &&.
+ Similarly for __has_builtin, etc. */
+#if (defined __has_attribute \
+ && (!defined __clang_minor__ \
+ || (defined __apple_build_version__ \
+ ? 6000000 <= __apple_build_version__ \
+ : 3 < __clang_major__ + (5 <= __clang_minor__))))
+# define __glibc_has_attribute(attr) __has_attribute (attr)
+#else
+# define __glibc_has_attribute(attr) 0
+#endif
+#ifdef __has_builtin
+# define __glibc_has_builtin(name) __has_builtin (name)
+#else
+# define __glibc_has_builtin(name) 0
+#endif
+#ifdef __has_extension
+# define __glibc_has_extension(ext) __has_extension (ext)
+#else
+# define __glibc_has_extension(ext) 0
+#endif
+
+#if defined __GNUC__ || defined __clang__
+
+/* All functions, except those with callbacks or those that
+ synchronize memory, are leaf functions. */
+# if __GNUC_PREREQ (4, 6) && !defined _LIBC
+# define __LEAF , __leaf__
+# define __LEAF_ATTR __attribute__ ((__leaf__))
+# else
+# define __LEAF
+# define __LEAF_ATTR
+# endif
+
+/* GCC can always grok prototypes. For C++ programs we add throw()
+ to help it optimize the function calls. But this only works with
+ gcc 2.8.x and egcs. For gcc 3.4 and up we even mark C functions
+ as non-throwing using a function attribute since programs can use
+ the -fexceptions options for C code as well. */
+# if !defined __cplusplus \
+ && (__GNUC_PREREQ (3, 4) || __glibc_has_attribute (__nothrow__))
+# define __THROW __attribute__ ((__nothrow__ __LEAF))
+# define __THROWNL __attribute__ ((__nothrow__))
+# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct
+# define __NTHNL(fct) __attribute__ ((__nothrow__)) fct
+# else
+# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major >= 4)
+# if __cplusplus >= 201103L
+# define __THROW noexcept (true)
+# else
+# define __THROW throw ()
+# endif
+# define __THROWNL __THROW
+# define __NTH(fct) __LEAF_ATTR fct __THROW
+# define __NTHNL(fct) fct __THROW
+# else
+# define __THROW
+# define __THROWNL
+# define __NTH(fct) fct
+# define __NTHNL(fct) fct
+# endif
+# endif
+
+#else /* Not GCC or clang. */
+
+# if (defined __cplusplus \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
+# define __inline inline
+# else
+# define __inline /* No inline functions. */
+# endif
+
+# define __THROW
+# define __THROWNL
+# define __NTH(fct) fct
+
+#endif /* GCC || clang. */
+
+/* These two macros are not used in glibc anymore. They are kept here
+ only because some other projects expect the macros to be defined. */
+#define __P(args) args
+#define __PMT(args) args
+
+/* For these things, GCC behaves the ANSI way normally,
+ and the non-ANSI way under -traditional. */
+
+#define __CONCAT(x,y) x ## y
+#define __STRING(x) #x
+
+/* This is not a typedef so `const __ptr_t' does the right thing. */
+#define __ptr_t void *
+
+
+/* C++ needs to know that types and declarations are C, not C++. */
+#ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+#else
+# define __BEGIN_DECLS
+# define __END_DECLS
+#endif
+
+
+/* Fortify support. */
+#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
+#define __bos0(ptr) __builtin_object_size (ptr, 0)
+
+/* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */
+#if __USE_FORTIFY_LEVEL == 3 && (__glibc_clang_prereq (9, 0) \
+ || __GNUC_PREREQ (12, 0))
+# define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0)
+# define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1)
+#else
+# define __glibc_objsize0(__o) __bos0 (__o)
+# define __glibc_objsize(__o) __bos (__o)
+#endif
+
+/* Compile time conditions to choose between the regular, _chk and _chk_warn
+ variants. These conditions should get evaluated to constant and optimized
+ away. */
+
+#define __glibc_safe_len_cond(__l, __s, __osz) ((__l) <= (__osz) / (__s))
+#define __glibc_unsigned_or_positive(__l) \
+ ((__typeof (__l)) 0 < (__typeof (__l)) -1 \
+ || (__builtin_constant_p (__l) && (__l) > 0))
+
+/* Length is known to be safe at compile time if the __L * __S <= __OBJSZ
+ condition can be folded to a constant and if it is true, or unknown (-1) */
+#define __glibc_safe_or_unknown_len(__l, __s, __osz) \
+ ((__osz) == (__SIZE_TYPE__) -1 \
+ || (__glibc_unsigned_or_positive (__l) \
+ && __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \
+ (__s), (__osz))) \
+ && __glibc_safe_len_cond ((__SIZE_TYPE__) (__l), (__s), (__osz))))
+
+/* Conversely, we know at compile time that the length is unsafe if the
+ __L * __S <= __OBJSZ condition can be folded to a constant and if it is
+ false. */
+#define __glibc_unsafe_len(__l, __s, __osz) \
+ (__glibc_unsigned_or_positive (__l) \
+ && __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \
+ __s, __osz)) \
+ && !__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), __s, __osz))
+
+/* Fortify function f. __f_alias, __f_chk and __f_chk_warn must be
+ declared. */
+
+#define __glibc_fortify(f, __l, __s, __osz, ...) \
+ (__glibc_safe_or_unknown_len (__l, __s, __osz) \
+ ? __ ## f ## _alias (__VA_ARGS__) \
+ : (__glibc_unsafe_len (__l, __s, __osz) \
+ ? __ ## f ## _chk_warn (__VA_ARGS__, __osz) \
+ : __ ## f ## _chk (__VA_ARGS__, __osz))) \
+
+/* Fortify function f, where object size argument passed to f is the number of
+ elements and not total size. */
+
+#define __glibc_fortify_n(f, __l, __s, __osz, ...) \
+ (__glibc_safe_or_unknown_len (__l, __s, __osz) \
+ ? __ ## f ## _alias (__VA_ARGS__) \
+ : (__glibc_unsafe_len (__l, __s, __osz) \
+ ? __ ## f ## _chk_warn (__VA_ARGS__, (__osz) / (__s)) \
+ : __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s)))) \
+
+#if __GNUC_PREREQ (4,3)
+# define __warnattr(msg) __attribute__((__warning__ (msg)))
+# define __errordecl(name, msg) \
+ extern void name (void) __attribute__((__error__ (msg)))
+#else
+# define __warnattr(msg)
+# define __errordecl(name, msg) extern void name (void)
+#endif
+
+/* Support for flexible arrays.
+ Headers that should use flexible arrays only if they're "real"
+ (e.g. only if they won't affect sizeof()) should test
+ #if __glibc_c99_flexarr_available. */
+#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc
+# define __flexarr []
+# define __glibc_c99_flexarr_available 1
+#elif __GNUC_PREREQ (2,97) || defined __clang__
+/* GCC 2.97 and clang support C99 flexible array members as an extension,
+ even when in C89 mode or compiling C++ (any version). */
+# define __flexarr []
+# define __glibc_c99_flexarr_available 1
+#elif defined __GNUC__
+/* Pre-2.97 GCC did not support C99 flexible arrays but did have
+ an equivalent extension with slightly different notation. */
+# define __flexarr [0]
+# define __glibc_c99_flexarr_available 1
+#else
+/* Some other non-C99 compiler. Approximate with [1]. */
+# define __flexarr [1]
+# define __glibc_c99_flexarr_available 0
+#endif
+
+
+/* __asm__ ("xyz") is used throughout the headers to rename functions
+ at the assembly language level. This is wrapped by the __REDIRECT
+ macro, in order to support compilers that can do this some other
+ way. When compilers don't support asm-names at all, we have to do
+ preprocessor tricks instead (which don't have exactly the right
+ semantics, but it's the best we can do).
+
+ Example:
+ int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */
+
+#if (defined __GNUC__ && __GNUC__ >= 2) || (__clang_major__ >= 4)
+
+# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias))
+# ifdef __cplusplus
+# define __REDIRECT_NTH(name, proto, alias) \
+ name proto __THROW __asm__ (__ASMNAME (#alias))
+# define __REDIRECT_NTHNL(name, proto, alias) \
+ name proto __THROWNL __asm__ (__ASMNAME (#alias))
+# else
+# define __REDIRECT_NTH(name, proto, alias) \
+ name proto __asm__ (__ASMNAME (#alias)) __THROW
+# define __REDIRECT_NTHNL(name, proto, alias) \
+ name proto __asm__ (__ASMNAME (#alias)) __THROWNL
+# endif
+# define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+# define __ASMNAME2(prefix, cname) __STRING (prefix) cname
+
+/*
+#elif __SOME_OTHER_COMPILER__
+
+# define __REDIRECT(name, proto, alias) name proto; \
+ _Pragma("let " #name " = " #alias)
+*/
+#endif
+
+/* GCC and clang have various useful declarations that can be made with
+ the '__attribute__' syntax. All of the ways we use this do fine if
+ they are omitted for compilers that don't understand it. */
+#if !(defined __GNUC__ || defined __clang__)
+# define __attribute__(xyz) /* Ignore */
+#endif
+
+/* At some point during the gcc 2.96 development the `malloc' attribute
+ for functions was introduced. We don't want to use it unconditionally
+ (although this would be possible) since it generates warnings. */
+#if __GNUC_PREREQ (2,96) || __glibc_has_attribute (__malloc__)
+# define __attribute_malloc__ __attribute__ ((__malloc__))
+#else
+# define __attribute_malloc__ /* Ignore */
+#endif
+
+/* Tell the compiler which arguments to an allocation function
+ indicate the size of the allocation. */
+#if __GNUC_PREREQ (4, 3)
+# define __attribute_alloc_size__(params) \
+ __attribute__ ((__alloc_size__ params))
+#else
+# define __attribute_alloc_size__(params) /* Ignore. */
+#endif
+
+/* Tell the compiler which argument to an allocation function
+ indicates the alignment of the allocation. */
+#if __GNUC_PREREQ (4, 9) || __glibc_has_attribute (__alloc_align__)
+# define __attribute_alloc_align__(param) \
+ __attribute__ ((__alloc_align__ param))
+#else
+# define __attribute_alloc_align__(param) /* Ignore. */
+#endif
+
+/* At some point during the gcc 2.96 development the `pure' attribute
+ for functions was introduced. We don't want to use it unconditionally
+ (although this would be possible) since it generates warnings. */
+#if __GNUC_PREREQ (2,96) || __glibc_has_attribute (__pure__)
+# define __attribute_pure__ __attribute__ ((__pure__))
+#else
+# define __attribute_pure__ /* Ignore */
+#endif
+
+/* This declaration tells the compiler that the value is constant. */
+#if __GNUC_PREREQ (2,5) || __glibc_has_attribute (__const__)
+# define __attribute_const__ __attribute__ ((__const__))
+#else
+# define __attribute_const__ /* Ignore */
+#endif
+
+#if __GNUC_PREREQ (2,7) || __glibc_has_attribute (__unused__)
+# define __attribute_maybe_unused__ __attribute__ ((__unused__))
+#else
+# define __attribute_maybe_unused__ /* Ignore */
+#endif
+
+/* At some point during the gcc 3.1 development the `used' attribute
+ for functions was introduced. We don't want to use it unconditionally
+ (although this would be possible) since it generates warnings. */
+#if __GNUC_PREREQ (3,1) || __glibc_has_attribute (__used__)
+# define __attribute_used__ __attribute__ ((__used__))
+# define __attribute_noinline__ __attribute__ ((__noinline__))
+#else
+# define __attribute_used__ __attribute__ ((__unused__))
+# define __attribute_noinline__ /* Ignore */
+#endif
+
+/* Since version 3.2, gcc allows marking deprecated functions. */
+#if __GNUC_PREREQ (3,2) || __glibc_has_attribute (__deprecated__)
+# define __attribute_deprecated__ __attribute__ ((__deprecated__))
+#else
+# define __attribute_deprecated__ /* Ignore */
+#endif
+
+/* Since version 4.5, gcc also allows one to specify the message printed
+ when a deprecated function is used. clang claims to be gcc 4.2, but
+ may also support this feature. */
+#if __GNUC_PREREQ (4,5) \
+ || __glibc_has_extension (__attribute_deprecated_with_message__)
+# define __attribute_deprecated_msg__(msg) \
+ __attribute__ ((__deprecated__ (msg)))
+#else
+# define __attribute_deprecated_msg__(msg) __attribute_deprecated__
+#endif
+
+/* At some point during the gcc 2.8 development the `format_arg' attribute
+ for functions was introduced. We don't want to use it unconditionally
+ (although this would be possible) since it generates warnings.
+ If several `format_arg' attributes are given for the same function, in
+ gcc-3.0 and older, all but the last one are ignored. In newer gccs,
+ all designated arguments are considered. */
+#if __GNUC_PREREQ (2,8) || __glibc_has_attribute (__format_arg__)
+# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x)))
+#else
+# define __attribute_format_arg__(x) /* Ignore */
+#endif
+
+/* At some point during the gcc 2.97 development the `strfmon' format
+ attribute for functions was introduced. We don't want to use it
+ unconditionally (although this would be possible) since it
+ generates warnings. */
+#if __GNUC_PREREQ (2,97) || __glibc_has_attribute (__format__)
+# define __attribute_format_strfmon__(a,b) \
+ __attribute__ ((__format__ (__strfmon__, a, b)))
+#else
+# define __attribute_format_strfmon__(a,b) /* Ignore */
+#endif
+
+/* The nonnull function attribute marks pointer parameters that
+ must not be NULL. This has the name __nonnull in glibc,
+ and __attribute_nonnull__ in files shared with Gnulib to avoid
+ collision with a different __nonnull in DragonFlyBSD 5.9. */
+#ifndef __attribute_nonnull__
+# if __GNUC_PREREQ (3,3) || __glibc_has_attribute (__nonnull__)
+# define __attribute_nonnull__(params) __attribute__ ((__nonnull__ params))
+# else
+# define __attribute_nonnull__(params)
+# endif
+#endif
+#ifndef __nonnull
+# define __nonnull(params) __attribute_nonnull__ (params)
+#endif
+
+/* The returns_nonnull function attribute marks the return type of the function
+ as always being non-null. */
+#ifndef __returns_nonnull
+# if __GNUC_PREREQ (4, 9) || __glibc_has_attribute (__returns_nonnull__)
+# define __returns_nonnull __attribute__ ((__returns_nonnull__))
+# else
+# define __returns_nonnull
+# endif
+#endif
+
+/* If fortification mode, we warn about unused results of certain
+ function calls which can lead to problems. */
+#if __GNUC_PREREQ (3,4) || __glibc_has_attribute (__warn_unused_result__)
+# define __attribute_warn_unused_result__ \
+ __attribute__ ((__warn_unused_result__))
+# if defined __USE_FORTIFY_LEVEL && __USE_FORTIFY_LEVEL > 0
+# define __wur __attribute_warn_unused_result__
+# endif
+#else
+# define __attribute_warn_unused_result__ /* empty */
+#endif
+#ifndef __wur
+# define __wur /* Ignore */
+#endif
+
+/* Forces a function to be always inlined. */
+#if __GNUC_PREREQ (3,2) || __glibc_has_attribute (__always_inline__)
+/* The Linux kernel defines __always_inline in stddef.h (283d7573), and
+ it conflicts with this definition. Therefore undefine it first to
+ allow either header to be included first. */
+# undef __always_inline
+# define __always_inline __inline __attribute__ ((__always_inline__))
+#else
+# undef __always_inline
+# define __always_inline __inline
+#endif
+
+/* Associate error messages with the source location of the call site rather
+ than with the source location inside the function. */
+#if __GNUC_PREREQ (4,3) || __glibc_has_attribute (__artificial__)
+# define __attribute_artificial__ __attribute__ ((__artificial__))
+#else
+# define __attribute_artificial__ /* Ignore */
+#endif
+
+/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
+ inline semantics, unless -fgnu89-inline is used. Using __GNUC_STDC_INLINE__
+ or __GNUC_GNU_INLINE is not a good enough check for gcc because gcc versions
+ older than 4.3 may define these macros and still not guarantee GNU inlining
+ semantics.
+
+ clang++ identifies itself as gcc-4.2, but has support for GNU inlining
+ semantics, that can be checked for by using the __GNUC_STDC_INLINE_ and
+ __GNUC_GNU_INLINE__ macro definitions. */
+#if (!defined __cplusplus || __GNUC_PREREQ (4,3) \
+ || (defined __clang__ && (defined __GNUC_STDC_INLINE__ \
+ || defined __GNUC_GNU_INLINE__)))
+# if defined __GNUC_STDC_INLINE__ || defined __cplusplus
+# define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
+# define __extern_always_inline \
+ extern __always_inline __attribute__ ((__gnu_inline__))
+# else
+# define __extern_inline extern __inline
+# define __extern_always_inline extern __always_inline
+# endif
+#endif
+
+#ifdef __extern_always_inline
+# define __fortify_function __extern_always_inline __attribute_artificial__
+#endif
+
+/* GCC 4.3 and above allow passing all anonymous arguments of an
+ __extern_always_inline function to some other vararg function. */
+#if __GNUC_PREREQ (4,3)
+# define __va_arg_pack() __builtin_va_arg_pack ()
+# define __va_arg_pack_len() __builtin_va_arg_pack_len ()
+#endif
+
+/* It is possible to compile containing GCC extensions even if GCC is
+ run in pedantic mode if the uses are carefully marked using the
+ `__extension__' keyword. But this is not generally available before
+ version 2.8. */
+#if !(__GNUC_PREREQ (2,8) || defined __clang__)
+# define __extension__ /* Ignore */
+#endif
+
+/* __restrict is known in EGCS 1.2 and above, and in clang.
+ It works also in C++ mode (outside of arrays), but only when spelled
+ as '__restrict', not 'restrict'. */
+#if !(__GNUC_PREREQ (2,92) || __clang_major__ >= 3)
+# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+# define __restrict restrict
+# else
+# define __restrict /* Ignore */
+# endif
+#endif
+
+/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is
+ array_name[restrict]
+ GCC 3.1 and clang support this.
+ This syntax is not usable in C++ mode. */
+#if (__GNUC_PREREQ (3,1) || __clang_major__ >= 3) && !defined __cplusplus
+# define __restrict_arr __restrict
+#else
+# ifdef __GNUC__
+# define __restrict_arr /* Not supported in old GCC. */
+# else
+# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+# define __restrict_arr restrict
+# else
+/* Some other non-C99 compiler. */
+# define __restrict_arr /* Not supported. */
+# endif
+# endif
+#endif
+
+#if (__GNUC__ >= 3) || __glibc_has_builtin (__builtin_expect)
+# define __glibc_unlikely(cond) __builtin_expect ((cond), 0)
+# define __glibc_likely(cond) __builtin_expect ((cond), 1)
+#else
+# define __glibc_unlikely(cond) (cond)
+# define __glibc_likely(cond) (cond)
+#endif
+
+#if (!defined _Noreturn \
+ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
+ && !(__GNUC_PREREQ (4,7) \
+ || (3 < __clang_major__ + (5 <= __clang_minor__))))
+# if __GNUC_PREREQ (2,8)
+# define _Noreturn __attribute__ ((__noreturn__))
+# else
+# define _Noreturn
+# endif
+#endif
+
+#if __GNUC_PREREQ (8, 0)
+/* Describes a char array whose address can safely be passed as the first
+ argument to strncpy and strncat, as the char array is not necessarily
+ a NUL-terminated string. */
+# define __attribute_nonstring__ __attribute__ ((__nonstring__))
+#else
+# define __attribute_nonstring__
+#endif
+
+/* Undefine (also defined in libc-symbols.h). */
+#undef __attribute_copy__
+#if __GNUC_PREREQ (9, 0)
+/* Copies attributes from the declaration or type referenced by
+ the argument. */
+# define __attribute_copy__(arg) __attribute__ ((__copy__ (arg)))
+#else
+# define __attribute_copy__(arg)
+#endif
+
+#if (!defined _Static_assert && !defined __cplusplus \
+ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
+ && (!(__GNUC_PREREQ (4, 6) || __clang_major__ >= 4) \
+ || defined __STRICT_ANSI__))
+# define _Static_assert(expr, diagnostic) \
+ extern int (*__Static_assert_function (void)) \
+ [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })]
+#endif
+
+/* Gnulib avoids including these, as they don't work on non-glibc or
+ older glibc platforms. */
+#ifndef __GNULIB_CDEFS
+# include <bits/wordsize.h>
+# include <bits/long-double.h>
+#endif
+
+#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
+# ifdef __REDIRECT
+
+/* Alias name defined automatically. */
+# define __LDBL_REDIR(name, proto) ... unused__ldbl_redir
+# define __LDBL_REDIR_DECL(name) \
+ extern __typeof (name) name __asm (__ASMNAME ("__" #name "ieee128"));
+
+/* Alias name defined automatically, with leading underscores. */
+# define __LDBL_REDIR2_DECL(name) \
+ extern __typeof (__##name) __##name \
+ __asm (__ASMNAME ("__" #name "ieee128"));
+
+/* Alias name defined manually. */
+# define __LDBL_REDIR1(name, proto, alias) ... unused__ldbl_redir1
+# define __LDBL_REDIR1_DECL(name, alias) \
+ extern __typeof (name) name __asm (__ASMNAME (#alias));
+
+# define __LDBL_REDIR1_NTH(name, proto, alias) \
+ __REDIRECT_NTH (name, proto, alias)
+# define __REDIRECT_NTH_LDBL(name, proto, alias) \
+ __LDBL_REDIR1_NTH (name, proto, __##alias##ieee128)
+
+/* Unused. */
+# define __REDIRECT_LDBL(name, proto, alias) ... unused__redirect_ldbl
+# define __LDBL_REDIR_NTH(name, proto) ... unused__ldbl_redir_nth
+
+# else
+_Static_assert (0, "IEEE 128-bits long double requires redirection on this platform");
+# endif
+#elif defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+# define __LDBL_COMPAT 1
+# ifdef __REDIRECT
+# define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias)
+# define __LDBL_REDIR(name, proto) \
+ __LDBL_REDIR1 (name, proto, __nldbl_##name)
+# define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias)
+# define __LDBL_REDIR_NTH(name, proto) \
+ __LDBL_REDIR1_NTH (name, proto, __nldbl_##name)
+# define __LDBL_REDIR2_DECL(name) \
+ extern __typeof (__##name) __##name __asm (__ASMNAME ("__nldbl___" #name));
+# define __LDBL_REDIR1_DECL(name, alias) \
+ extern __typeof (name) name __asm (__ASMNAME (#alias));
+# define __LDBL_REDIR_DECL(name) \
+ extern __typeof (name) name __asm (__ASMNAME ("__nldbl_" #name));
+# define __REDIRECT_LDBL(name, proto, alias) \
+ __LDBL_REDIR1 (name, proto, __nldbl_##alias)
+# define __REDIRECT_NTH_LDBL(name, proto, alias) \
+ __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias)
+# endif
+#endif
+#if (!defined __LDBL_COMPAT && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0) \
+ || !defined __REDIRECT
+# define __LDBL_REDIR1(name, proto, alias) name proto
+# define __LDBL_REDIR(name, proto) name proto
+# define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW
+# define __LDBL_REDIR_NTH(name, proto) name proto __THROW
+# define __LDBL_REDIR2_DECL(name)
+# define __LDBL_REDIR_DECL(name)
+# ifdef __REDIRECT
+# define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias)
+# define __REDIRECT_NTH_LDBL(name, proto, alias) \
+ __REDIRECT_NTH (name, proto, alias)
+# endif
+#endif
+
+/* __glibc_macro_warning (MESSAGE) issues warning MESSAGE. This is
+ intended for use in preprocessor macros.
+
+ Note: MESSAGE must be a _single_ string; concatenation of string
+ literals is not supported. */
+#if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5)
+# define __glibc_macro_warning1(message) _Pragma (#message)
+# define __glibc_macro_warning(message) \
+ __glibc_macro_warning1 (GCC warning message)
+#else
+# define __glibc_macro_warning(msg)
+#endif
+
+/* Generic selection (ISO C11) is a C-only feature, available in GCC
+ since version 4.9. Previous versions do not provide generic
+ selection, even though they might set __STDC_VERSION__ to 201112L,
+ when in -std=c11 mode. Thus, we must check for !defined __GNUC__
+ when testing __STDC_VERSION__ for generic selection support.
+ On the other hand, Clang also defines __GNUC__, so a clang-specific
+ check is required to enable the use of generic selection. */
+#if !defined __cplusplus \
+ && (__GNUC_PREREQ (4, 9) \
+ || __glibc_has_extension (c_generic_selections) \
+ || (!defined __GNUC__ && defined __STDC_VERSION__ \
+ && __STDC_VERSION__ >= 201112L))
+# define __HAVE_GENERIC_SELECTION 1
+#else
+# define __HAVE_GENERIC_SELECTION 0
+#endif
+
+#if __GNUC_PREREQ (10, 0)
+/* Designates a 1-based positional argument ref-index of pointer type
+ that can be used to access size-index elements of the pointed-to
+ array according to access mode, or at least one element when
+ size-index is not provided:
+ access (access-mode, <ref-index> [, <size-index>]) */
+# define __attr_access(x) __attribute__ ((__access__ x))
+/* For _FORTIFY_SOURCE == 3 we use __builtin_dynamic_object_size, which may
+ use the access attribute to get object sizes from function definition
+ arguments, so we can't use them on functions we fortify. Drop the object
+ size hints for such functions. */
+# if __USE_FORTIFY_LEVEL == 3
+# define __fortified_attr_access(a, o, s) __attribute__ ((__access__ (a, o)))
+# else
+# define __fortified_attr_access(a, o, s) __attr_access ((a, o, s))
+# endif
+# if __GNUC_PREREQ (11, 0)
+# define __attr_access_none(argno) __attribute__ ((__access__ (__none__, argno)))
+# else
+# define __attr_access_none(argno)
+# endif
+#else
+# define __fortified_attr_access(a, o, s)
+# define __attr_access(x)
+# define __attr_access_none(argno)
+#endif
+
+#if __GNUC_PREREQ (11, 0)
+/* Designates dealloc as a function to call to deallocate objects
+ allocated by the declared function. */
+# define __attr_dealloc(dealloc, argno) \
+ __attribute__ ((__malloc__ (dealloc, argno)))
+# define __attr_dealloc_free __attr_dealloc (__builtin_free, 1)
+#else
+# define __attr_dealloc(dealloc, argno)
+# define __attr_dealloc_free
+#endif
+
+/* Specify that a function such as setjmp or vfork may return
+ twice. */
+#if __GNUC_PREREQ (4, 1)
+# define __attribute_returns_twice__ __attribute__ ((__returns_twice__))
+#else
+# define __attribute_returns_twice__ /* Ignore. */
+#endif
+
+#endif /* sys/cdefs.h */
diff --git a/gl/lib/chdir-long.c b/gl/lib/chdir-long.c
new file mode 100644
index 0000000..f4efb20
--- /dev/null
+++ b/gl/lib/chdir-long.c
@@ -0,0 +1,264 @@
+/* provide a chdir function that tries not to fail due to ENAMETOOLONG
+ Copyright (C) 2004-2022 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 "chdir-long.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "assure.h"
+
+#ifndef PATH_MAX
+# error "compile this file only if your system defines PATH_MAX"
+#endif
+
+/* The results of openat() in this file are not leaked to any
+ single-threaded code that could use stdio.
+ FIXME - if the kernel ever adds support for multi-thread safety for
+ avoiding standard fds, then we should use openat_safer. */
+
+struct cd_buf
+{
+ int fd;
+};
+
+static void
+cdb_init (struct cd_buf *cdb)
+{
+ cdb->fd = AT_FDCWD;
+}
+
+static int
+cdb_fchdir (struct cd_buf const *cdb)
+{
+ return fchdir (cdb->fd);
+}
+
+static void
+cdb_free (struct cd_buf const *cdb)
+{
+ if (0 <= cdb->fd)
+ {
+ bool close_fail = close (cdb->fd);
+ assure (! close_fail);
+ }
+}
+
+/* Given a file descriptor of an open directory (or AT_FDCWD), CDB->fd,
+ try to open the CDB->fd-relative directory, DIR. If the open succeeds,
+ update CDB->fd with the resulting descriptor, close the incoming file
+ descriptor, and return zero. Upon failure, return -1 and set errno. */
+static int
+cdb_advance_fd (struct cd_buf *cdb, char const *dir)
+{
+ int new_fd = openat (cdb->fd, dir,
+ O_SEARCH | O_DIRECTORY | O_NOCTTY | O_NONBLOCK);
+ if (new_fd < 0)
+ return -1;
+
+ cdb_free (cdb);
+ cdb->fd = new_fd;
+
+ return 0;
+}
+
+/* Return a pointer to the first non-slash in S. */
+static char * _GL_ATTRIBUTE_PURE
+find_non_slash (char const *s)
+{
+ size_t n_slash = strspn (s, "/");
+ return (char *) s + n_slash;
+}
+
+/* This is a function much like chdir, but without the PATH_MAX limitation
+ on the length of the directory name. A significant difference is that
+ it must be able to modify (albeit only temporarily) the directory
+ name. It handles an arbitrarily long directory name by operating
+ on manageable portions of the name. On systems without the openat
+ syscall, this means changing the working directory to more and more
+ "distant" points along the long directory name and then restoring
+ the working directory. If any of those attempts to save or restore
+ the working directory fails, this function exits nonzero.
+
+ Note that this function may still fail with errno == ENAMETOOLONG, but
+ only if the specified directory name contains a component that is long
+ enough to provoke such a failure all by itself (e.g. if the component
+ has length PATH_MAX or greater on systems that define PATH_MAX). */
+
+int
+chdir_long (char *dir)
+{
+ int e = chdir (dir);
+ if (e == 0 || errno != ENAMETOOLONG)
+ return e;
+
+ {
+ size_t len = strlen (dir);
+ char *dir_end = dir + len;
+ struct cd_buf cdb;
+ size_t n_leading_slash;
+
+ cdb_init (&cdb);
+
+ /* If DIR is the empty string, then the chdir above
+ must have failed and set errno to ENOENT. */
+ assure (0 < len);
+ assure (PATH_MAX <= len);
+
+ /* Count leading slashes. */
+ n_leading_slash = strspn (dir, "/");
+
+ /* Handle any leading slashes as well as any name that matches
+ the regular expression, m!^//hostname[/]*! . Handling this
+ prefix separately usually results in a single additional
+ cdb_advance_fd call, but it's worthwhile, since it makes the
+ code in the following loop cleaner. */
+ if (n_leading_slash == 2)
+ {
+ int err;
+ /* Find next slash.
+ We already know that dir[2] is neither a slash nor '\0'. */
+ char *slash = memchr (dir + 3, '/', dir_end - (dir + 3));
+ if (slash == NULL)
+ {
+ errno = ENAMETOOLONG;
+ return -1;
+ }
+ *slash = '\0';
+ err = cdb_advance_fd (&cdb, dir);
+ *slash = '/';
+ if (err != 0)
+ goto Fail;
+ dir = find_non_slash (slash + 1);
+ }
+ else if (n_leading_slash)
+ {
+ if (cdb_advance_fd (&cdb, "/") != 0)
+ goto Fail;
+ dir += n_leading_slash;
+ }
+
+ assure (*dir != '/');
+ assure (dir <= dir_end);
+
+ while (PATH_MAX <= dir_end - dir)
+ {
+ int err;
+ /* Find a slash that is PATH_MAX or fewer bytes away from dir.
+ I.e. see if there is a slash that will give us a name of
+ length PATH_MAX-1 or less. */
+ char *slash = memrchr (dir, '/', PATH_MAX);
+ if (slash == NULL)
+ {
+ errno = ENAMETOOLONG;
+ return -1;
+ }
+
+ *slash = '\0';
+ assure (slash - dir < PATH_MAX);
+ err = cdb_advance_fd (&cdb, dir);
+ *slash = '/';
+ if (err != 0)
+ goto Fail;
+
+ dir = find_non_slash (slash + 1);
+ }
+
+ if (dir < dir_end)
+ {
+ if (cdb_advance_fd (&cdb, dir) != 0)
+ goto Fail;
+ }
+
+ if (cdb_fchdir (&cdb) != 0)
+ goto Fail;
+
+ cdb_free (&cdb);
+ return 0;
+
+ Fail:
+ {
+ int saved_errno = errno;
+ cdb_free (&cdb);
+ errno = saved_errno;
+ return -1;
+ }
+ }
+}
+
+#if TEST_CHDIR
+
+# include "closeout.h"
+# include "error.h"
+
+int
+main (int argc, char *argv[])
+{
+ char *line = NULL;
+ size_t n = 0;
+ int len;
+
+ atexit (close_stdout);
+
+ len = getline (&line, &n, stdin);
+ if (len < 0)
+ {
+ int saved_errno = errno;
+ if (feof (stdin))
+ exit (0);
+
+ error (EXIT_FAILURE, saved_errno,
+ "reading standard input");
+ }
+ else if (len == 0)
+ exit (0);
+
+ if (line[len-1] == '\n')
+ line[len-1] = '\0';
+
+ if (chdir_long (line) != 0)
+ error (EXIT_FAILURE, errno,
+ "chdir_long failed: %s", line);
+
+ if (argc <= 1)
+ {
+ /* Using 'pwd' here makes sense only if it is a robust implementation,
+ like the one in coreutils after the 2004-04-19 changes. */
+ char const *cmd = "pwd";
+ execlp (cmd, (char *) NULL);
+ error (EXIT_FAILURE, errno, "%s", cmd);
+ }
+
+ fclose (stdin);
+ fclose (stderr);
+
+ exit (EXIT_SUCCESS);
+}
+#endif
+
+/*
+Local Variables:
+compile-command: "gcc -DTEST_CHDIR=1 -g -O -W -Wall chdir-long.c libcoreutils.a"
+End:
+*/
diff --git a/gl/lib/chdir-long.h b/gl/lib/chdir-long.h
new file mode 100644
index 0000000..84a7298
--- /dev/null
+++ b/gl/lib/chdir-long.h
@@ -0,0 +1,30 @@
+/* provide a chdir function that tries not to fail due to ENAMETOOLONG
+ Copyright (C) 2004-2005, 2009-2022 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 <unistd.h>
+#include <limits.h>
+
+#include "pathmax.h"
+
+/* On systems without PATH_MAX, presume that chdir accepts
+ arbitrarily long directory names. */
+#ifndef PATH_MAX
+# define chdir_long(Dir) chdir (Dir)
+#else
+int chdir_long (char *dir);
+#endif
diff --git a/gl/lib/chown.c b/gl/lib/chown.c
new file mode 100644
index 0000000..705ca85
--- /dev/null
+++ b/gl/lib/chown.c
@@ -0,0 +1,151 @@
+/* provide consistent interface to chown for systems that don't interpret
+ an ID of -1 as meaning "don't change the corresponding ID".
+
+ Copyright (C) 1997, 2004-2007, 2009-2022 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 2.1 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 Jim Meyering */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <string.h>
+#include <sys/stat.h>
+
+#if !HAVE_CHOWN
+
+/* Simple stub that always fails with ENOSYS, for mingw. */
+int
+chown (_GL_UNUSED const char *file, _GL_UNUSED uid_t uid,
+ _GL_UNUSED gid_t gid)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+#else /* HAVE_CHOWN */
+
+/* Below we refer to the system's chown(). */
+# undef chown
+
+/* Provide a more-closely POSIX-conforming version of chown on
+ systems with one or both of the following problems:
+ - chown doesn't treat an ID of -1 as meaning
+ "don't change the corresponding ID".
+ - chown doesn't dereference symlinks. */
+
+int
+rpl_chown (const char *file, uid_t uid, gid_t gid)
+{
+ struct stat st;
+ bool stat_valid = false;
+ int result;
+
+# if CHOWN_CHANGE_TIME_BUG
+ if (gid != (gid_t) -1 || uid != (uid_t) -1)
+ {
+ if (stat (file, &st))
+ return -1;
+ stat_valid = true;
+ }
+# endif
+
+# if CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE
+ if (gid == (gid_t) -1 || uid == (uid_t) -1)
+ {
+ /* Stat file to get id(s) that should remain unchanged. */
+ if (!stat_valid && stat (file, &st))
+ return -1;
+ if (gid == (gid_t) -1)
+ gid = st.st_gid;
+ if (uid == (uid_t) -1)
+ uid = st.st_uid;
+ }
+# endif
+
+# if CHOWN_MODIFIES_SYMLINK
+ {
+ /* Handle the case in which the system-supplied chown function
+ does *not* follow symlinks. Instead, it changes permissions
+ on the symlink itself. To work around that, we open the
+ file (but this can fail due to lack of read or write permission) and
+ use fchown on the resulting descriptor. */
+ int open_flags = O_NONBLOCK | O_NOCTTY | O_CLOEXEC;
+ int fd = open (file, O_RDONLY | open_flags);
+ if (0 <= fd
+ || (errno == EACCES
+ && 0 <= (fd = open (file, O_WRONLY | open_flags))))
+ {
+ int saved_errno;
+ bool fchown_socket_failure;
+
+ result = fchown (fd, uid, gid);
+ saved_errno = errno;
+
+ /* POSIX says fchown can fail with errno == EINVAL on sockets
+ and pipes, so fall back on chown in that case. */
+ fchown_socket_failure =
+ (result != 0 && saved_errno == EINVAL
+ && fstat (fd, &st) == 0
+ && (S_ISFIFO (st.st_mode) || S_ISSOCK (st.st_mode)));
+
+ close (fd);
+
+ if (! fchown_socket_failure)
+ {
+ errno = saved_errno;
+ return result;
+ }
+ }
+ else if (errno != EACCES)
+ return -1;
+ }
+# endif
+
+# if CHOWN_TRAILING_SLASH_BUG
+ if (!stat_valid)
+ {
+ size_t len = strlen (file);
+ if (len && file[len - 1] == '/' && stat (file, &st))
+ return -1;
+ }
+# endif
+
+ result = chown (file, uid, gid);
+
+# if CHOWN_CHANGE_TIME_BUG
+ if (result == 0 && stat_valid
+ && (uid == st.st_uid || uid == (uid_t) -1)
+ && (gid == st.st_gid || gid == (gid_t) -1))
+ {
+ /* No change in ownership, but at least one argument was not -1,
+ so we are required to update ctime. Since chown succeeded,
+ we assume that chmod will do likewise. Fortunately, on all
+ known systems where a 'no-op' chown skips the ctime update, a
+ 'no-op' chmod still does the trick. */
+ result = chmod (file, st.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO
+ | S_ISUID | S_ISGID | S_ISVTX));
+ }
+# endif
+
+ return result;
+}
+
+#endif /* HAVE_CHOWN */
diff --git a/gl/lib/cloexec.c b/gl/lib/cloexec.c
new file mode 100644
index 0000000..812be01
--- /dev/null
+++ b/gl/lib/cloexec.c
@@ -0,0 +1,83 @@
+/* cloexec.c - set or clear the close-on-exec descriptor flag
+
+ Copyright (C) 1991, 2004-2006, 2009-2022 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 2.1 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/>. */
+
+/* The code is taken from glibc/manual/llio.texi */
+
+#include <config.h>
+
+#include "cloexec.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+/* Set the 'FD_CLOEXEC' flag of DESC if VALUE is true,
+ or clear the flag if VALUE is false.
+ Return 0 on success, or -1 on error with 'errno' set.
+
+ Note that on MingW, this function does NOT protect DESC from being
+ inherited into spawned children. Instead, either use dup_cloexec
+ followed by closing the original DESC, or use interfaces such as
+ open or pipe2 that accept flags like O_CLOEXEC to create DESC
+ non-inheritable in the first place. */
+
+int
+set_cloexec_flag (int desc, bool value)
+{
+#ifdef F_SETFD
+
+ int flags = fcntl (desc, F_GETFD, 0);
+
+ if (0 <= flags)
+ {
+ int newflags = (value ? flags | FD_CLOEXEC : flags & ~FD_CLOEXEC);
+
+ if (flags == newflags
+ || fcntl (desc, F_SETFD, newflags) != -1)
+ return 0;
+ }
+
+ return -1;
+
+#else /* !F_SETFD */
+
+ /* Use dup2 to reject invalid file descriptors; the cloexec flag
+ will be unaffected. */
+ if (desc < 0)
+ {
+ errno = EBADF;
+ return -1;
+ }
+ if (dup2 (desc, desc) < 0)
+ /* errno is EBADF here. */
+ return -1;
+
+ /* There is nothing we can do on this kind of platform. Punt. */
+ return 0;
+#endif /* !F_SETFD */
+}
+
+
+/* Duplicates a file handle FD, while marking the copy to be closed
+ prior to exec or spawn. Returns -1 and sets errno if FD could not
+ be duplicated. */
+
+int
+dup_cloexec (int fd)
+{
+ return fcntl (fd, F_DUPFD_CLOEXEC, 0);
+}
diff --git a/gl/lib/cloexec.h b/gl/lib/cloexec.h
new file mode 100644
index 0000000..7a22d77
--- /dev/null
+++ b/gl/lib/cloexec.h
@@ -0,0 +1,36 @@
+/* cloexec.c - set or clear the close-on-exec descriptor flag
+
+ Copyright (C) 2004, 2009-2022 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 2.1 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/>. */
+
+#include <stdbool.h>
+
+/* Set the 'FD_CLOEXEC' flag of DESC if VALUE is true,
+ or clear the flag if VALUE is false.
+ Return 0 on success, or -1 on error with 'errno' set.
+
+ Note that on MingW, this function does NOT protect DESC from being
+ inherited into spawned children. Instead, either use dup_cloexec
+ followed by closing the original DESC, or use interfaces such as
+ open or pipe2 that accept flags like O_CLOEXEC to create DESC
+ non-inheritable in the first place. */
+
+int set_cloexec_flag (int desc, bool value);
+
+/* Duplicates a file handle FD, while marking the copy to be closed
+ prior to exec or spawn. Returns -1 and sets errno if FD could not
+ be duplicated. */
+
+int dup_cloexec (int fd);
diff --git a/gl/lib/close.c b/gl/lib/close.c
new file mode 100644
index 0000000..44990ba
--- /dev/null
+++ b/gl/lib/close.c
@@ -0,0 +1,75 @@
+/* close replacement.
+ Copyright (C) 2008-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#include <errno.h>
+
+#include "fd-hook.h"
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+#endif
+
+#undef close
+
+#if defined _WIN32 && !defined __CYGWIN__
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static int
+close_nothrow (int fd)
+{
+ int result;
+
+ TRY_MSVC_INVAL
+ {
+ result = _close (fd);
+ }
+ CATCH_MSVC_INVAL
+ {
+ result = -1;
+ errno = EBADF;
+ }
+ DONE_MSVC_INVAL;
+
+ return result;
+}
+# else
+# define close_nothrow _close
+# endif
+#else
+# define close_nothrow close
+#endif
+
+/* Override close() to call into other gnulib modules. */
+
+int
+rpl_close (int fd)
+{
+#if WINDOWS_SOCKETS
+ int retval = execute_all_close_hooks (close_nothrow, fd);
+#else
+ int retval = close_nothrow (fd);
+#endif
+
+#if REPLACE_FCHDIR
+ if (retval >= 0)
+ _gl_unregister_fd (fd);
+#endif
+
+ return retval;
+}
diff --git a/gl/lib/closedir.c b/gl/lib/closedir.c
new file mode 100644
index 0000000..a273122
--- /dev/null
+++ b/gl/lib/closedir.c
@@ -0,0 +1,71 @@
+/* Stop reading the entries of a directory.
+ Copyright (C) 2006-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <dirent.h>
+
+#if REPLACE_FCHDIR
+# include <unistd.h>
+#endif
+
+#if HAVE_CLOSEDIR
+
+/* Override closedir(), to keep track of the open file descriptors.
+ Needed because there is a function dirfd(). */
+
+#else
+
+# include <stdlib.h>
+
+# include "dirent-private.h"
+
+#endif
+
+int
+closedir (DIR *dirp)
+{
+# if REPLACE_FCHDIR || REPLACE_DIRFD
+ int fd = dirfd (dirp);
+# endif
+ int retval;
+
+#if HAVE_CLOSEDIR
+# undef closedir
+
+ retval = closedir (dirp);
+
+# ifdef __KLIBC__
+ if (!retval)
+ _gl_unregister_dirp_fd (fd);
+# endif
+#else
+
+ if (dirp->current != INVALID_HANDLE_VALUE)
+ FindClose (dirp->current);
+ free (dirp);
+
+ retval = 0;
+
+#endif
+
+#if REPLACE_FCHDIR
+ if (retval >= 0)
+ _gl_unregister_fd (fd);
+#endif
+ return retval;
+}
diff --git a/gl/lib/ctype.in.h b/gl/lib/ctype.in.h
new file mode 100644
index 0000000..dc81170
--- /dev/null
+++ b/gl/lib/ctype.in.h
@@ -0,0 +1,57 @@
+/* A substitute for ISO C99 <ctype.h>, for platforms on which it is incomplete.
+
+ Copyright (C) 2009-2022 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 2.1 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. */
+
+/*
+ * ISO C 99 <ctype.h> for platforms on which it is incomplete.
+ * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/ctype.h.html>
+ */
+
+#ifndef _@GUARD_PREFIX@_CTYPE_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* Include the original <ctype.h>. */
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_CTYPE_H@
+
+#ifndef _@GUARD_PREFIX@_CTYPE_H
+#define _@GUARD_PREFIX@_CTYPE_H
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* Return non-zero if c is a blank, i.e. a space or tab character. */
+#if @GNULIB_ISBLANK@
+# if !@HAVE_ISBLANK@
+_GL_EXTERN_C int isblank (int c);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef isblank
+# if HAVE_RAW_DECL_ISBLANK
+_GL_WARN_ON_USE (isblank, "isblank is unportable - "
+ "use gnulib module isblank for portability");
+# endif
+#endif
+
+#endif /* _@GUARD_PREFIX@_CTYPE_H */
+#endif /* _@GUARD_PREFIX@_CTYPE_H */
diff --git a/gl/lib/dirent-private.h b/gl/lib/dirent-private.h
new file mode 100644
index 0000000..30cf5d9
--- /dev/null
+++ b/gl/lib/dirent-private.h
@@ -0,0 +1,44 @@
+/* Private details of the DIR type.
+ Copyright (C) 2011-2022 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 2.1 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/>. */
+
+#ifndef _DIRENT_PRIVATE_H
+#define _DIRENT_PRIVATE_H 1
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+/* Don't assume that UNICODE is not defined. */
+#undef WIN32_FIND_DATA
+#define WIN32_FIND_DATA WIN32_FIND_DATAA
+
+struct gl_directory
+{
+ /* Status, or error code to produce in next readdir() call.
+ -2 means the end of the directory is already reached,
+ -1 means the entry was already filled by FindFirstFile,
+ 0 means the entry needs to be filled using FindNextFile.
+ A positive value is an error code. */
+ int status;
+ /* Handle, reading the directory, at current position. */
+ HANDLE current;
+ /* Found directory entry. */
+ WIN32_FIND_DATA entry;
+ /* Argument to pass to FindFirstFile. It consists of the absolutized
+ directory name, followed by a directory separator and the wildcards. */
+ char dir_name_mask[1];
+};
+
+#endif /* _DIRENT_PRIVATE_H */
diff --git a/gl/lib/dirent.in.h b/gl/lib/dirent.in.h
new file mode 100644
index 0000000..f28288d
--- /dev/null
+++ b/gl/lib/dirent.in.h
@@ -0,0 +1,321 @@
+/* A GNU-like <dirent.h>.
+ Copyright (C) 2006-2022 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 2.1 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/>. */
+
+#ifndef _@GUARD_PREFIX@_DIRENT_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_DIRENT_H@
+# @INCLUDE_NEXT@ @NEXT_DIRENT_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_DIRENT_H
+#define _@GUARD_PREFIX@_DIRENT_H
+
+/* Get ino_t. Needed on some systems, including glibc 2.8. */
+#include <sys/types.h>
+
+#if !@HAVE_DIRENT_H@
+/* Define types DIR and 'struct dirent'. */
+# if !GNULIB_defined_struct_dirent
+struct dirent
+{
+ char d_type;
+ char d_name[1];
+};
+/* Possible values for 'd_type'. */
+# define DT_UNKNOWN 0
+# define DT_FIFO 1 /* FIFO */
+# define DT_CHR 2 /* character device */
+# define DT_DIR 4 /* directory */
+# define DT_BLK 6 /* block device */
+# define DT_REG 8 /* regular file */
+# define DT_LNK 10 /* symbolic link */
+# define DT_SOCK 12 /* socket */
+# define DT_WHT 14 /* whiteout */
+typedef struct gl_directory DIR;
+# define GNULIB_defined_struct_dirent 1
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
+ that can be freed by passing them as the Ith argument to the
+ function F. */
+#ifndef _GL_ATTRIBUTE_DEALLOC
+# if __GNUC__ >= 11
+# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
+# else
+# define _GL_ATTRIBUTE_DEALLOC(f, i)
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
+ allocated memory. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_MALLOC
+# if __GNUC__ >= 3 || defined __clang__
+# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+# else
+# define _GL_ATTRIBUTE_MALLOC
+# endif
+#endif
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The attribute __pure__ was added in gcc 2.96. */
+#ifndef _GL_ATTRIBUTE_PURE
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+# define _GL_ATTRIBUTE_PURE /* empty */
+# endif
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+/* Declare overridden functions. */
+
+#if @GNULIB_CLOSEDIR@
+# if @REPLACE_CLOSEDIR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef closedir
+# define closedir rpl_closedir
+# define GNULIB_defined_closedir 1
+# endif
+_GL_FUNCDECL_RPL (closedir, int, (DIR *dirp) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (closedir, int, (DIR *dirp));
+# else
+# if !@HAVE_CLOSEDIR@
+_GL_FUNCDECL_SYS (closedir, int, (DIR *dirp) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (closedir, int, (DIR *dirp));
+# endif
+_GL_CXXALIASWARN (closedir);
+#elif defined GNULIB_POSIXCHECK
+# undef closedir
+# if HAVE_RAW_DECL_CLOSEDIR
+_GL_WARN_ON_USE (closedir, "closedir is not portable - "
+ "use gnulib module closedir for portability");
+# endif
+#endif
+
+#if @GNULIB_OPENDIR@
+# if @REPLACE_OPENDIR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef opendir
+# define opendir rpl_opendir
+# define GNULIB_defined_opendir 1
+# endif
+_GL_FUNCDECL_RPL (opendir, DIR *,
+ (const char *dir_name)
+ _GL_ARG_NONNULL ((1))
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1));
+_GL_CXXALIAS_RPL (opendir, DIR *, (const char *dir_name));
+# else
+# if !@HAVE_OPENDIR@ || __GNUC__ >= 11
+_GL_FUNCDECL_SYS (opendir, DIR *,
+ (const char *dir_name)
+ _GL_ARG_NONNULL ((1))
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1));
+# endif
+_GL_CXXALIAS_SYS (opendir, DIR *, (const char *dir_name));
+# endif
+_GL_CXXALIASWARN (opendir);
+#else
+# if @GNULIB_CLOSEDIR@ && __GNUC__ >= 11 && !defined opendir
+/* For -Wmismatched-dealloc: Associate opendir with closedir or
+ rpl_closedir. */
+_GL_FUNCDECL_SYS (opendir, DIR *,
+ (const char *dir_name)
+ _GL_ARG_NONNULL ((1))
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1));
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef opendir
+# if HAVE_RAW_DECL_OPENDIR
+_GL_WARN_ON_USE (opendir, "opendir is not portable - "
+ "use gnulib module opendir for portability");
+# endif
+# endif
+#endif
+
+#if @GNULIB_READDIR@
+# if !@HAVE_READDIR@
+_GL_FUNCDECL_SYS (readdir, struct dirent *, (DIR *dirp) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (readdir, struct dirent *, (DIR *dirp));
+_GL_CXXALIASWARN (readdir);
+#elif defined GNULIB_POSIXCHECK
+# undef readdir
+# if HAVE_RAW_DECL_READDIR
+_GL_WARN_ON_USE (readdir, "readdir is not portable - "
+ "use gnulib module readdir for portability");
+# endif
+#endif
+
+#if @GNULIB_REWINDDIR@
+# if !@HAVE_REWINDDIR@
+_GL_FUNCDECL_SYS (rewinddir, void, (DIR *dirp) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (rewinddir, void, (DIR *dirp));
+_GL_CXXALIASWARN (rewinddir);
+#elif defined GNULIB_POSIXCHECK
+# undef rewinddir
+# if HAVE_RAW_DECL_REWINDDIR
+_GL_WARN_ON_USE (rewinddir, "rewinddir is not portable - "
+ "use gnulib module rewinddir for portability");
+# endif
+#endif
+
+#if @GNULIB_DIRFD@
+/* Return the file descriptor associated with the given directory stream,
+ or -1 if none exists. */
+# if @REPLACE_DIRFD@
+/* On kLIBC, dirfd() is a macro that does not work. Undefine it. */
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) || defined dirfd
+# undef dirfd
+# define dirfd rpl_dirfd
+# endif
+_GL_FUNCDECL_RPL (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (dirfd, int, (DIR *));
+
+# ifdef __KLIBC__
+/* Gnulib internal hooks needed to maintain the dirfd metadata. */
+_GL_EXTERN_C int _gl_register_dirp_fd (int fd, DIR *dirp)
+ _GL_ARG_NONNULL ((2));
+_GL_EXTERN_C void _gl_unregister_dirp_fd (int fd);
+# endif
+# else
+# if defined __cplusplus && defined GNULIB_NAMESPACE && defined dirfd
+ /* dirfd is defined as a macro and not as a function.
+ Turn it into a function and get rid of the macro. */
+static inline int (dirfd) (DIR *dp) { return dirfd (dp); }
+# undef dirfd
+# endif
+# if !(@HAVE_DECL_DIRFD@ || defined dirfd)
+_GL_FUNCDECL_SYS (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (dirfd, int, (DIR *));
+# endif
+_GL_CXXALIASWARN (dirfd);
+#elif defined GNULIB_POSIXCHECK
+# undef dirfd
+# if HAVE_RAW_DECL_DIRFD
+_GL_WARN_ON_USE (dirfd, "dirfd is unportable - "
+ "use gnulib module dirfd for portability");
+# endif
+#endif
+
+#if @GNULIB_FDOPENDIR@
+/* Open a directory stream visiting the given directory file
+ descriptor. Return NULL and set errno if fd is not visiting a
+ directory. On success, this function consumes fd (it will be
+ implicitly closed either by this function or by a subsequent
+ closedir). */
+# if @REPLACE_FDOPENDIR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fdopendir
+# define fdopendir rpl_fdopendir
+# endif
+_GL_FUNCDECL_RPL (fdopendir, DIR *,
+ (int fd)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1));
+_GL_CXXALIAS_RPL (fdopendir, DIR *, (int fd));
+# else
+# if !@HAVE_FDOPENDIR@ || !@HAVE_DECL_FDOPENDIR@ || __GNUC__ >= 11
+_GL_FUNCDECL_SYS (fdopendir, DIR *,
+ (int fd)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1));
+# endif
+_GL_CXXALIAS_SYS (fdopendir, DIR *, (int fd));
+# endif
+_GL_CXXALIASWARN (fdopendir);
+#else
+# if @GNULIB_CLOSEDIR@ && __GNUC__ >= 11 && !defined fdopendir
+/* For -Wmismatched-dealloc: Associate fdopendir with closedir or
+ rpl_closedir. */
+_GL_FUNCDECL_SYS (fdopendir, DIR *,
+ (int fd)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1));
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef fdopendir
+# if HAVE_RAW_DECL_FDOPENDIR
+_GL_WARN_ON_USE (fdopendir, "fdopendir is unportable - "
+ "use gnulib module fdopendir for portability");
+# endif
+# endif
+#endif
+
+#if @GNULIB_SCANDIR@
+/* Scan the directory DIR, calling FILTER on each directory entry.
+ Entries for which FILTER returns nonzero are individually malloc'd,
+ sorted using qsort with CMP, and collected in a malloc'd array in
+ *NAMELIST. Returns the number of entries selected, or -1 on error. */
+# if !@HAVE_SCANDIR@
+_GL_FUNCDECL_SYS (scandir, int,
+ (const char *dir, struct dirent ***namelist,
+ int (*filter) (const struct dirent *),
+ int (*cmp) (const struct dirent **, const struct dirent **))
+ _GL_ARG_NONNULL ((1, 2, 4)));
+# endif
+/* Need to cast, because on glibc systems, the fourth parameter is
+ int (*cmp) (const void *, const void *). */
+_GL_CXXALIAS_SYS_CAST (scandir, int,
+ (const char *dir, struct dirent ***namelist,
+ int (*filter) (const struct dirent *),
+ int (*cmp) (const struct dirent **, const struct dirent **)));
+_GL_CXXALIASWARN (scandir);
+#elif defined GNULIB_POSIXCHECK
+# undef scandir
+# if HAVE_RAW_DECL_SCANDIR
+_GL_WARN_ON_USE (scandir, "scandir is unportable - "
+ "use gnulib module scandir for portability");
+# endif
+#endif
+
+#if @GNULIB_ALPHASORT@
+/* Compare two 'struct dirent' entries alphabetically. */
+# if !@HAVE_ALPHASORT@
+_GL_FUNCDECL_SYS (alphasort, int,
+ (const struct dirent **, const struct dirent **)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+/* Need to cast, because on glibc systems, the parameters are
+ (const void *, const void *). */
+_GL_CXXALIAS_SYS_CAST (alphasort, int,
+ (const struct dirent **, const struct dirent **));
+_GL_CXXALIASWARN (alphasort);
+#elif defined GNULIB_POSIXCHECK
+# undef alphasort
+# if HAVE_RAW_DECL_ALPHASORT
+_GL_WARN_ON_USE (alphasort, "alphasort is unportable - "
+ "use gnulib module alphasort for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_DIRENT_H */
+#endif /* _@GUARD_PREFIX@_DIRENT_H */
diff --git a/gl/lib/dirfd.c b/gl/lib/dirfd.c
new file mode 100644
index 0000000..4104683
--- /dev/null
+++ b/gl/lib/dirfd.c
@@ -0,0 +1,98 @@
+/* dirfd.c -- return the file descriptor associated with an open DIR*
+
+ Copyright (C) 2001, 2006, 2008-2022 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 2.1 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 Jim Meyering. */
+
+#include <config.h>
+
+#include <dirent.h>
+#include <errno.h>
+
+#ifdef __KLIBC__
+# include <stdlib.h>
+# include <io.h>
+
+static struct dirp_fd_list
+{
+ DIR *dirp;
+ int fd;
+ struct dirp_fd_list *next;
+} *dirp_fd_start = NULL;
+
+/* Register fd associated with dirp to dirp_fd_list. */
+int
+_gl_register_dirp_fd (int fd, DIR *dirp)
+{
+ struct dirp_fd_list *new_dirp_fd = malloc (sizeof *new_dirp_fd);
+ if (!new_dirp_fd)
+ return -1;
+
+ new_dirp_fd->dirp = dirp;
+ new_dirp_fd->fd = fd;
+ new_dirp_fd->next = dirp_fd_start;
+
+ dirp_fd_start = new_dirp_fd;
+
+ return 0;
+}
+
+/* Unregister fd from dirp_fd_list with closing it */
+void
+_gl_unregister_dirp_fd (int fd)
+{
+ struct dirp_fd_list *dirp_fd;
+ struct dirp_fd_list *dirp_fd_prev;
+
+ for (dirp_fd_prev = NULL, dirp_fd = dirp_fd_start; dirp_fd;
+ dirp_fd_prev = dirp_fd, dirp_fd = dirp_fd->next)
+ {
+ if (dirp_fd->fd == fd)
+ {
+ if (dirp_fd_prev)
+ dirp_fd_prev->next = dirp_fd->next;
+ else /* dirp_fd == dirp_fd_start */
+ dirp_fd_start = dirp_fd_start->next;
+
+ close (fd);
+ free (dirp_fd);
+ break;
+ }
+ }
+}
+#endif
+
+int
+dirfd (DIR *dir_p)
+{
+ int fd = DIR_TO_FD (dir_p);
+ if (fd == -1)
+#ifndef __KLIBC__
+ errno = ENOTSUP;
+#else
+ {
+ struct dirp_fd_list *dirp_fd;
+
+ for (dirp_fd = dirp_fd_start; dirp_fd; dirp_fd = dirp_fd->next)
+ if (dirp_fd->dirp == dir_p)
+ return dirp_fd->fd;
+
+ errno = EINVAL;
+ }
+#endif
+
+ return fd;
+}
diff --git a/gl/lib/dirname-lgpl.c b/gl/lib/dirname-lgpl.c
new file mode 100644
index 0000000..d54f6a9
--- /dev/null
+++ b/gl/lib/dirname-lgpl.c
@@ -0,0 +1,86 @@
+/* dirname.c -- return all but the last element in a file name
+
+ Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+#include "dirname.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+/* Return the length of the prefix of FILE that will be used by
+ dir_name. If FILE is in the working directory, this returns zero
+ even though 'dir_name (FILE)' will return ".". Works properly even
+ if there are trailing slashes (by effectively ignoring them). */
+
+size_t
+dir_len (char const *file)
+{
+ size_t prefix_length = FILE_SYSTEM_PREFIX_LEN (file);
+ size_t length;
+
+ /* Advance prefix_length beyond important leading slashes. */
+ prefix_length += (prefix_length != 0
+ ? (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+ && ISSLASH (file[prefix_length]))
+ : (ISSLASH (file[0])
+ ? ((DOUBLE_SLASH_IS_DISTINCT_ROOT
+ && ISSLASH (file[1]) && ! ISSLASH (file[2])
+ ? 2 : 1))
+ : 0));
+
+ /* Strip the basename and any redundant slashes before it. */
+ for (length = last_component (file) - file;
+ prefix_length < length; length--)
+ if (! ISSLASH (file[length - 1]))
+ break;
+ return length;
+}
+
+
+/* In general, we can't use the builtin 'dirname' function if available,
+ since it has different meanings in different environments.
+ In some environments the builtin 'dirname' modifies its argument.
+
+ Return the leading directories part of FILE, allocated with malloc.
+ Works properly even if there are trailing slashes (by effectively
+ ignoring them). Return NULL on failure.
+
+ If lstat (FILE) would succeed, then { chdir (dir_name (FILE));
+ lstat (base_name (FILE)); } will access the same file. Likewise,
+ if the sequence { chdir (dir_name (FILE));
+ rename (base_name (FILE), "foo"); } succeeds, you have renamed FILE
+ to "foo" in the same directory FILE was in. */
+
+char *
+mdir_name (char const *file)
+{
+ size_t length = dir_len (file);
+ bool append_dot = (length == 0
+ || (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+ && length == FILE_SYSTEM_PREFIX_LEN (file)
+ && file[2] != '\0' && ! ISSLASH (file[2])));
+ char *dir = malloc (length + append_dot + 1);
+ if (!dir)
+ return NULL;
+ memcpy (dir, file, length);
+ if (append_dot)
+ dir[length++] = '.';
+ dir[length] = '\0';
+ return dir;
+}
diff --git a/gl/lib/dirname.c b/gl/lib/dirname.c
new file mode 100644
index 0000000..3d2aaf1
--- /dev/null
+++ b/gl/lib/dirname.c
@@ -0,0 +1,38 @@
+/* dirname.c -- return all but the last element in a file name
+
+ Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2022 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 "dirname.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include "xalloc.h"
+
+/* Just like mdir_name (dirname-lgpl.c), except, rather than
+ returning NULL upon malloc failure, here, we report the
+ "memory exhausted" condition and exit. */
+
+char *
+dir_name (char const *file)
+{
+ char *result = mdir_name (file);
+ if (!result)
+ xalloc_die ();
+ return result;
+}
diff --git a/gl/lib/dirname.h b/gl/lib/dirname.h
new file mode 100644
index 0000000..e18a97e
--- /dev/null
+++ b/gl/lib/dirname.h
@@ -0,0 +1,54 @@
+/* Take file names apart into directory and base names.
+
+ Copyright (C) 1998, 2001, 2003-2006, 2009-2022 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 2.1 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/>. */
+
+#ifndef DIRNAME_H_
+# define DIRNAME_H_ 1
+
+# include <stdbool.h>
+# include <stdlib.h>
+# include "filename.h"
+# include "basename-lgpl.h"
+
+# ifndef DIRECTORY_SEPARATOR
+# define DIRECTORY_SEPARATOR '/'
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# if GNULIB_DIRNAME
+char *base_name (char const *file)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+char *dir_name (char const *file)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+# endif
+
+char *mdir_name (char const *file)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
+size_t dir_len (char const *file) _GL_ATTRIBUTE_PURE;
+
+bool strip_trailing_slashes (char *file);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* not DIRNAME_H_ */
diff --git a/gl/lib/dup-safer-flag.c b/gl/lib/dup-safer-flag.c
new file mode 100644
index 0000000..f87792a
--- /dev/null
+++ b/gl/lib/dup-safer-flag.c
@@ -0,0 +1,38 @@
+/* Duplicate a file descriptor result, avoiding clobbering
+ STD{IN,OUT,ERR}_FILENO, with specific flags.
+
+ Copyright (C) 2001, 2004-2006, 2009-2022 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 and Eric Blake. */
+
+#include <config.h>
+
+/* Specification. */
+#include "unistd-safer.h"
+
+#include <fcntl.h>
+#include <unistd.h>
+
+/* Like dup, but do not return STDIN_FILENO, STDOUT_FILENO, or
+ STDERR_FILENO. If FLAG contains O_CLOEXEC, behave like
+ fcntl(F_DUPFD_CLOEXEC) rather than fcntl(F_DUPFD). */
+
+int
+dup_safer_flag (int fd, int flag)
+{
+ return fcntl (fd, (flag & O_CLOEXEC) ? F_DUPFD_CLOEXEC : F_DUPFD,
+ STDERR_FILENO + 1);
+}
diff --git a/gl/lib/dup-safer.c b/gl/lib/dup-safer.c
new file mode 100644
index 0000000..38ff74c
--- /dev/null
+++ b/gl/lib/dup-safer.c
@@ -0,0 +1,34 @@
+/* Invoke dup, but avoid some glitches.
+
+ Copyright (C) 2001, 2004-2006, 2009-2022 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 "unistd-safer.h"
+
+#include <fcntl.h>
+#include <unistd.h>
+
+/* Like dup, but do not return STDIN_FILENO, STDOUT_FILENO, or
+ STDERR_FILENO. */
+
+int
+dup_safer (int fd)
+{
+ return fcntl (fd, F_DUPFD, STDERR_FILENO + 1);
+}
diff --git a/gl/lib/dup.c b/gl/lib/dup.c
new file mode 100644
index 0000000..17a9c58
--- /dev/null
+++ b/gl/lib/dup.c
@@ -0,0 +1,92 @@
+/* Duplicate an open file descriptor.
+
+ Copyright (C) 2011-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#include <errno.h>
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+#endif
+
+#undef dup
+
+#if defined _WIN32 && !defined __CYGWIN__
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static int
+dup_nothrow (int fd)
+{
+ int result;
+
+ TRY_MSVC_INVAL
+ {
+ result = _dup (fd);
+ }
+ CATCH_MSVC_INVAL
+ {
+ result = -1;
+ errno = EBADF;
+ }
+ DONE_MSVC_INVAL;
+
+ return result;
+}
+# else
+# define dup_nothrow _dup
+# endif
+#elif defined __KLIBC__
+# include <fcntl.h>
+# include <sys/stat.h>
+
+# include <InnoTekLIBC/backend.h>
+
+static int
+dup_nothrow (int fd)
+{
+ int dupfd;
+ struct stat sbuf;
+
+ dupfd = dup (fd);
+ if (dupfd == -1 && errno == ENOTSUP \
+ && !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode))
+ {
+ char path[_MAX_PATH];
+
+ /* Get a path from fd */
+ if (!__libc_Back_ioFHToPath (fd, path, sizeof (path)))
+ dupfd = open (path, O_RDONLY);
+ }
+
+ return dupfd;
+}
+#else
+# define dup_nothrow dup
+#endif
+
+int
+rpl_dup (int fd)
+{
+ int result = dup_nothrow (fd);
+#if REPLACE_FCHDIR
+ if (result >= 0)
+ result = _gl_register_dup (fd, result);
+#endif
+ return result;
+}
diff --git a/gl/lib/dup2.c b/gl/lib/dup2.c
new file mode 100644
index 0000000..1c766ab
--- /dev/null
+++ b/gl/lib/dup2.c
@@ -0,0 +1,189 @@
+/* Duplicate an open file descriptor to a specified file descriptor.
+
+ Copyright (C) 1999, 2004-2007, 2009-2022 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 2.1 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 Paul Eggert */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#include <errno.h>
+#include <fcntl.h>
+
+#undef dup2
+
+#if defined _WIN32 && ! defined __CYGWIN__
+
+/* Get declarations of the native Windows API functions. */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+# endif
+
+/* Get _get_osfhandle. */
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static int
+dup2_nothrow (int fd, int desired_fd)
+{
+ int result;
+
+ TRY_MSVC_INVAL
+ {
+ result = _dup2 (fd, desired_fd);
+ }
+ CATCH_MSVC_INVAL
+ {
+ errno = EBADF;
+ result = -1;
+ }
+ DONE_MSVC_INVAL;
+
+ return result;
+}
+# else
+# define dup2_nothrow _dup2
+# endif
+
+static int
+ms_windows_dup2 (int fd, int desired_fd)
+{
+ int result;
+
+ /* If fd is closed, mingw hangs on dup2 (fd, fd). If fd is open,
+ dup2 (fd, fd) returns 0, but all further attempts to use fd in
+ future dup2 calls will hang. */
+ if (fd == desired_fd)
+ {
+ if ((HANDLE) _get_osfhandle (fd) == INVALID_HANDLE_VALUE)
+ {
+ errno = EBADF;
+ return -1;
+ }
+ return fd;
+ }
+
+ /* Wine 1.0.1 return 0 when desired_fd is negative but not -1:
+ https://bugs.winehq.org/show_bug.cgi?id=21289 */
+ if (desired_fd < 0)
+ {
+ errno = EBADF;
+ return -1;
+ }
+
+ result = dup2_nothrow (fd, desired_fd);
+
+ if (result == 0)
+ result = desired_fd;
+
+ return result;
+}
+
+# define dup2 ms_windows_dup2
+
+#elif defined __KLIBC__
+
+# include <InnoTekLIBC/backend.h>
+
+static int
+klibc_dup2dirfd (int fd, int desired_fd)
+{
+ int tempfd;
+ int dupfd;
+
+ tempfd = open ("NUL", O_RDONLY);
+ if (tempfd == -1)
+ return -1;
+
+ if (tempfd == desired_fd)
+ {
+ close (tempfd);
+
+ char path[_MAX_PATH];
+ if (__libc_Back_ioFHToPath (fd, path, sizeof (path)))
+ return -1;
+
+ return open(path, O_RDONLY);
+ }
+
+ dupfd = klibc_dup2dirfd (fd, desired_fd);
+
+ close (tempfd);
+
+ return dupfd;
+}
+
+static int
+klibc_dup2 (int fd, int desired_fd)
+{
+ int dupfd;
+ struct stat sbuf;
+
+ dupfd = dup2 (fd, desired_fd);
+ if (dupfd == -1 && errno == ENOTSUP \
+ && !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode))
+ {
+ close (desired_fd);
+
+ return klibc_dup2dirfd (fd, desired_fd);
+ }
+
+ return dupfd;
+}
+
+# define dup2 klibc_dup2
+#endif
+
+int
+rpl_dup2 (int fd, int desired_fd)
+{
+ int result;
+
+#ifdef F_GETFL
+ /* On Linux kernels 2.6.26-2.6.29, dup2 (fd, fd) returns -EBADF.
+ On Cygwin 1.5.x, dup2 (1, 1) returns 0.
+ On Cygwin 1.7.17, dup2 (1, -1) dumps core.
+ On Cygwin 1.7.25, dup2 (1, 256) can dump core.
+ On Haiku, dup2 (fd, fd) mistakenly clears FD_CLOEXEC. */
+# if HAVE_SETDTABLESIZE
+ setdtablesize (desired_fd + 1);
+# endif
+ if (desired_fd < 0)
+ fd = desired_fd;
+ if (fd == desired_fd)
+ return fcntl (fd, F_GETFL) == -1 ? -1 : fd;
+#endif
+
+ result = dup2 (fd, desired_fd);
+
+ /* Correct an errno value on FreeBSD 6.1 and Cygwin 1.5.x. */
+ if (result == -1 && errno == EMFILE)
+ errno = EBADF;
+#if REPLACE_FCHDIR
+ if (fd != desired_fd && result != -1)
+ result = _gl_register_dup (fd, result);
+#endif
+ return result;
+}
diff --git a/gl/lib/dynarray.h b/gl/lib/dynarray.h
new file mode 100644
index 0000000..ca6439d
--- /dev/null
+++ b/gl/lib/dynarray.h
@@ -0,0 +1,284 @@
+/* Type-safe arrays which grow dynamically.
+ Copyright 2021-2022 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 2.1 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 Paul Eggert and Bruno Haible, 2021. */
+
+#ifndef _GL_DYNARRAY_H
+#define _GL_DYNARRAY_H
+
+/* Before including this file, you need to define:
+
+ DYNARRAY_STRUCT
+ The struct tag of dynamic array to be defined.
+
+ DYNARRAY_ELEMENT
+ The type name of the element type. Elements are copied
+ as if by memcpy, and can change address as the dynamic
+ array grows.
+
+ DYNARRAY_PREFIX
+ The prefix of the functions which are defined.
+
+ The following parameters are optional:
+
+ DYNARRAY_ELEMENT_FREE
+ DYNARRAY_ELEMENT_FREE (E) is evaluated to deallocate the
+ contents of elements. E is of type DYNARRAY_ELEMENT *.
+
+ DYNARRAY_ELEMENT_INIT
+ DYNARRAY_ELEMENT_INIT (E) is evaluated to initialize a new
+ element. E is of type DYNARRAY_ELEMENT *.
+ If DYNARRAY_ELEMENT_FREE but not DYNARRAY_ELEMENT_INIT is
+ defined, new elements are automatically zero-initialized.
+ Otherwise, new elements have undefined contents.
+
+ DYNARRAY_INITIAL_SIZE
+ The size of the statically allocated array (default:
+ at least 2, more elements if they fit into 128 bytes).
+ Must be a preprocessor constant. If DYNARRAY_INITIAL_SIZE is 0,
+ there is no statically allocated array at, and all non-empty
+ arrays are heap-allocated.
+
+ DYNARRAY_FINAL_TYPE
+ The name of the type which holds the final array. If not
+ defined, is PREFIX##finalize not provided. DYNARRAY_FINAL_TYPE
+ must be a struct type, with members of type DYNARRAY_ELEMENT and
+ size_t at the start (in this order).
+
+ These macros are undefined after this header file has been
+ included.
+
+ The following types are provided (their members are private to the
+ dynarray implementation):
+
+ struct DYNARRAY_STRUCT
+
+ The following functions are provided:
+ */
+
+/* Initialize a dynamic array object. This must be called before any
+ use of the object. */
+#if 0
+static void
+ DYNARRAY_PREFIX##init (struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Deallocate the dynamic array and its elements. */
+#if 0
+static void
+ DYNARRAY_PREFIX##free (struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Return true if the dynamic array is in an error state. */
+#if 0
+static bool
+ DYNARRAY_PREFIX##has_failed (const struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Mark the dynamic array as failed. All elements are deallocated as
+ a side effect. */
+#if 0
+static void
+ DYNARRAY_PREFIX##mark_failed (struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Return the number of elements which have been added to the dynamic
+ array. */
+#if 0
+static size_t
+ DYNARRAY_PREFIX##size (const struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Return a pointer to the first array element, if any. For a
+ zero-length array, the pointer can be NULL even though the dynamic
+ array has not entered the failure state. */
+#if 0
+static DYNARRAY_ELEMENT *
+ DYNARRAY_PREFIX##begin (const struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Return a pointer one element past the last array element. For a
+ zero-length array, the pointer can be NULL even though the dynamic
+ array has not entered the failure state. */
+#if 0
+static DYNARRAY_ELEMENT *
+ DYNARRAY_PREFIX##end (const struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Return a pointer to the array element at INDEX. Terminate the
+ process if INDEX is out of bounds. */
+#if 0
+static DYNARRAY_ELEMENT *
+ DYNARRAY_PREFIX##at (struct DYNARRAY_STRUCT *list, size_t index);
+#endif
+
+/* Add ITEM at the end of the array, enlarging it by one element.
+ Mark *LIST as failed if the dynamic array allocation size cannot be
+ increased. */
+#if 0
+static void
+ DYNARRAY_PREFIX##add (struct DYNARRAY_STRUCT *list,
+ DYNARRAY_ELEMENT item);
+#endif
+
+/* Allocate a place for a new element in *LIST and return a pointer to
+ it. The pointer can be NULL if the dynamic array cannot be
+ enlarged due to a memory allocation failure. */
+#if 0
+static DYNARRAY_ELEMENT *
+ DYNARRAY_PREFIX##emplace (struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Change the size of *LIST to SIZE. If SIZE is larger than the
+ existing size, new elements are added (which can be initialized).
+ Otherwise, the list is truncated, and elements are freed. Return
+ false on memory allocation failure (and mark *LIST as failed). */
+#if 0
+static bool
+ DYNARRAY_PREFIX##resize (struct DYNARRAY_STRUCT *list, size_t size);
+#endif
+
+/* Remove the last element of LIST if it is present. */
+#if 0
+static void
+ DYNARRAY_PREFIX##remove_last (struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Remove all elements from the list. The elements are freed, but the
+ list itself is not. */
+#if 0
+static void
+ DYNARRAY_PREFIX##clear (struct DYNARRAY_STRUCT *list);
+#endif
+
+#if defined DYNARRAY_FINAL_TYPE
+/* Transfer the dynamic array to a permanent location at *RESULT.
+ Returns true on success on false on allocation failure. In either
+ case, *LIST is re-initialized and can be reused. A NULL pointer is
+ stored in *RESULT if LIST refers to an empty list. On success, the
+ pointer in *RESULT is heap-allocated and must be deallocated using
+ free. */
+#if 0
+static bool
+ DYNARRAY_PREFIX##finalize (struct DYNARRAY_STRUCT *list,
+ DYNARRAY_FINAL_TYPE *result);
+#endif
+#else /* !defined DYNARRAY_FINAL_TYPE */
+/* Transfer the dynamic array to a heap-allocated array and return a
+ pointer to it. The pointer is NULL if memory allocation fails, or
+ if the array is empty, so this function should be used only for
+ arrays which are known not be empty (usually because they always
+ have a sentinel at the end). If LENGTHP is not NULL, the array
+ length is written to *LENGTHP. *LIST is re-initialized and can be
+ reused. */
+#if 0
+static DYNARRAY_ELEMENT *
+ DYNARRAY_PREFIX##finalize (struct DYNARRAY_STRUCT *list,
+ size_t *lengthp);
+#endif
+#endif
+
+/* A minimal example which provides a growing list of integers can be
+ defined like this:
+
+ struct int_array
+ {
+ // Pointer to result array followed by its length,
+ // as required by DYNARRAY_FINAL_TYPE.
+ int *array;
+ size_t length;
+ };
+
+ #define DYNARRAY_STRUCT dynarray_int
+ #define DYNARRAY_ELEMENT int
+ #define DYNARRAY_PREFIX dynarray_int_
+ #define DYNARRAY_FINAL_TYPE struct int_array
+ #include <malloc/dynarray-skeleton.c>
+
+ To create a three-element array with elements 1, 2, 3, use this
+ code:
+
+ struct dynarray_int dyn;
+ dynarray_int_init (&dyn);
+ for (int i = 1; i <= 3; ++i)
+ {
+ int *place = dynarray_int_emplace (&dyn);
+ assert (place != NULL);
+ *place = i;
+ }
+ struct int_array result;
+ bool ok = dynarray_int_finalize (&dyn, &result);
+ assert (ok);
+ assert (result.length == 3);
+ assert (result.array[0] == 1);
+ assert (result.array[1] == 2);
+ assert (result.array[2] == 3);
+ free (result.array);
+
+ If the elements contain resources which must be freed, define
+ DYNARRAY_ELEMENT_FREE appropriately, like this:
+
+ struct str_array
+ {
+ char **array;
+ size_t length;
+ };
+
+ #define DYNARRAY_STRUCT dynarray_str
+ #define DYNARRAY_ELEMENT char *
+ #define DYNARRAY_ELEMENT_FREE(ptr) free (*ptr)
+ #define DYNARRAY_PREFIX dynarray_str_
+ #define DYNARRAY_FINAL_TYPE struct str_array
+ #include <malloc/dynarray-skeleton.c>
+ */
+
+
+/* The implementation is imported from glibc. */
+
+/* Avoid possible conflicts with symbols exported by the GNU libc. */
+#define __libc_dynarray_at_failure gl_dynarray_at_failure
+#define __libc_dynarray_emplace_enlarge gl_dynarray_emplace_enlarge
+#define __libc_dynarray_finalize gl_dynarray_finalize
+#define __libc_dynarray_resize_clear gl_dynarray_resize_clear
+#define __libc_dynarray_resize gl_dynarray_resize
+
+#if defined DYNARRAY_STRUCT || defined DYNARRAY_ELEMENT || defined DYNARRAY_PREFIX
+
+# ifndef _GL_LIKELY
+/* Rely on __builtin_expect, as provided by the module 'builtin-expect'. */
+# define _GL_LIKELY(cond) __builtin_expect ((cond), 1)
+# define _GL_UNLIKELY(cond) __builtin_expect ((cond), 0)
+# endif
+
+/* Define auxiliary structs and declare auxiliary functions, common to all
+ instantiations of dynarray. */
+# include <malloc/dynarray.gl.h>
+
+/* Define the instantiation, specified through
+ DYNARRAY_STRUCT
+ DYNARRAY_ELEMENT
+ DYNARRAY_PREFIX
+ etc. */
+# include <malloc/dynarray-skeleton.gl.h>
+
+#else
+
+/* This file is being included from one of the malloc/dynarray_*.c files. */
+# include <malloc/dynarray.h>
+
+#endif
+
+#endif /* _GL_DYNARRAY_H */
diff --git a/gl/lib/eloop-threshold.h b/gl/lib/eloop-threshold.h
new file mode 100644
index 0000000..8b31457
--- /dev/null
+++ b/gl/lib/eloop-threshold.h
@@ -0,0 +1,83 @@
+/* Threshold at which to diagnose ELOOP. Generic version.
+ Copyright (C) 2012-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _ELOOP_THRESHOLD_H
+#define _ELOOP_THRESHOLD_H 1
+
+#include <limits.h>
+#ifdef _LIBC
+# include <sys/param.h>
+# define _GL_ATTRIBUTE_CONST __attribute__ ((const))
+#else
+# include <unistd.h>
+# include "minmax.h"
+# define __sysconf sysconf
+# if (!defined SYMLOOP_MAX \
+ && ! (defined _SC_SYMLOOP_MAX && defined _POSIX_SYMLOOP_MAX))
+# define SYMLOOP_MAX 8
+# endif
+#endif
+
+/* POSIX specifies SYMLOOP_MAX as the "Maximum number of symbolic
+ links that can be reliably traversed in the resolution of a
+ pathname in the absence of a loop." This makes it a minimum that
+ we should certainly accept. But it leaves open the possibility
+ that more might sometimes work--just not "reliably".
+
+ For example, Linux implements a complex policy whereby there is a
+ small limit on the number of direct symlink traversals (a symlink
+ to a symlink to a symlink), but larger limit on the total number of
+ symlink traversals overall. Hence the SYMLOOP_MAX number should be
+ the small one, but the limit library functions enforce on users
+ should be the larger one.
+
+ So, we use the larger of the reported SYMLOOP_MAX (if any) and our
+ own constant MIN_ELOOP_THRESHOLD, below. This constant should be
+ large enough that it never rules out a file name and directory tree
+ that the underlying system (i.e. calls to 'open' et al) would
+ resolve successfully. It should be small enough that actual loops
+ are detected without a huge number of iterations. */
+
+#ifndef MIN_ELOOP_THRESHOLD
+# define MIN_ELOOP_THRESHOLD 40
+#endif
+
+/* Return the maximum number of symlink traversals to permit
+ before diagnosing ELOOP. */
+static inline unsigned int _GL_ATTRIBUTE_CONST
+__eloop_threshold (void)
+{
+#ifdef SYMLOOP_MAX
+ const int symloop_max = SYMLOOP_MAX;
+#else
+ /* The function is marked 'const' even though we use memory and
+ call a function, because sysconf is required to return the
+ same value in every call and so it must always be safe to
+ call __eloop_threshold exactly once and reuse the value. */
+ static long int sysconf_symloop_max;
+ if (sysconf_symloop_max == 0)
+ sysconf_symloop_max = __sysconf (_SC_SYMLOOP_MAX);
+ const unsigned int symloop_max = (sysconf_symloop_max <= 0
+ ? _POSIX_SYMLOOP_MAX
+ : sysconf_symloop_max);
+#endif
+
+ return MAX (symloop_max, MIN_ELOOP_THRESHOLD);
+}
+
+#endif /* eloop-threshold.h */
diff --git a/gl/lib/errno.in.h b/gl/lib/errno.in.h
new file mode 100644
index 0000000..3ec1845
--- /dev/null
+++ b/gl/lib/errno.in.h
@@ -0,0 +1,279 @@
+/* A POSIX-like <errno.h>.
+
+ Copyright (C) 2008-2022 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 2.1 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/>. */
+
+#ifndef _@GUARD_PREFIX@_ERRNO_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_ERRNO_H@
+
+#ifndef _@GUARD_PREFIX@_ERRNO_H
+#define _@GUARD_PREFIX@_ERRNO_H
+
+
+/* On native Windows platforms, many macros are not defined. */
+# if defined _WIN32 && ! defined __CYGWIN__
+
+/* These are the same values as defined by MSVC 10, for interoperability. */
+
+# ifndef ENOMSG
+# define ENOMSG 122
+# define GNULIB_defined_ENOMSG 1
+# endif
+
+# ifndef EIDRM
+# define EIDRM 111
+# define GNULIB_defined_EIDRM 1
+# endif
+
+# ifndef ENOLINK
+# define ENOLINK 121
+# define GNULIB_defined_ENOLINK 1
+# endif
+
+# ifndef EPROTO
+# define EPROTO 134
+# define GNULIB_defined_EPROTO 1
+# endif
+
+# ifndef EBADMSG
+# define EBADMSG 104
+# define GNULIB_defined_EBADMSG 1
+# endif
+
+# ifndef EOVERFLOW
+# define EOVERFLOW 132
+# define GNULIB_defined_EOVERFLOW 1
+# endif
+
+# ifndef ENOTSUP
+# define ENOTSUP 129
+# define GNULIB_defined_ENOTSUP 1
+# endif
+
+# ifndef ENETRESET
+# define ENETRESET 117
+# define GNULIB_defined_ENETRESET 1
+# endif
+
+# ifndef ECONNABORTED
+# define ECONNABORTED 106
+# define GNULIB_defined_ECONNABORTED 1
+# endif
+
+# ifndef ECANCELED
+# define ECANCELED 105
+# define GNULIB_defined_ECANCELED 1
+# endif
+
+# ifndef EOWNERDEAD
+# define EOWNERDEAD 133
+# define GNULIB_defined_EOWNERDEAD 1
+# endif
+
+# ifndef ENOTRECOVERABLE
+# define ENOTRECOVERABLE 127
+# define GNULIB_defined_ENOTRECOVERABLE 1
+# endif
+
+# ifndef EINPROGRESS
+# define EINPROGRESS 112
+# define EALREADY 103
+# define ENOTSOCK 128
+# define EDESTADDRREQ 109
+# define EMSGSIZE 115
+# define EPROTOTYPE 136
+# define ENOPROTOOPT 123
+# define EPROTONOSUPPORT 135
+# define EOPNOTSUPP 130
+# define EAFNOSUPPORT 102
+# define EADDRINUSE 100
+# define EADDRNOTAVAIL 101
+# define ENETDOWN 116
+# define ENETUNREACH 118
+# define ECONNRESET 108
+# define ENOBUFS 119
+# define EISCONN 113
+# define ENOTCONN 126
+# define ETIMEDOUT 138
+# define ECONNREFUSED 107
+# define ELOOP 114
+# define EHOSTUNREACH 110
+# define EWOULDBLOCK 140
+# define GNULIB_defined_ESOCK 1
+# endif
+
+# ifndef ETXTBSY
+# define ETXTBSY 139
+# define ENODATA 120 /* not required by POSIX */
+# define ENOSR 124 /* not required by POSIX */
+# define ENOSTR 125 /* not required by POSIX */
+# define ETIME 137 /* not required by POSIX */
+# define EOTHER 131 /* not required by POSIX */
+# define GNULIB_defined_ESTREAMS 1
+# endif
+
+/* These are intentionally the same values as the WSA* error numbers, defined
+ in <winsock2.h>. */
+# define ESOCKTNOSUPPORT 10044 /* not required by POSIX */
+# define EPFNOSUPPORT 10046 /* not required by POSIX */
+# define ESHUTDOWN 10058 /* not required by POSIX */
+# define ETOOMANYREFS 10059 /* not required by POSIX */
+# define EHOSTDOWN 10064 /* not required by POSIX */
+# define EPROCLIM 10067 /* not required by POSIX */
+# define EUSERS 10068 /* not required by POSIX */
+# define EDQUOT 10069
+# define ESTALE 10070
+# define EREMOTE 10071 /* not required by POSIX */
+# define GNULIB_defined_EWINSOCK 1
+
+# endif
+
+
+/* On OSF/1 5.1, when _XOPEN_SOURCE_EXTENDED is not defined, the macros
+ EMULTIHOP, ENOLINK, EOVERFLOW are not defined. */
+# if @EMULTIHOP_HIDDEN@
+# define EMULTIHOP @EMULTIHOP_VALUE@
+# define GNULIB_defined_EMULTIHOP 1
+# endif
+# if @ENOLINK_HIDDEN@
+# define ENOLINK @ENOLINK_VALUE@
+# define GNULIB_defined_ENOLINK 1
+# endif
+# if @EOVERFLOW_HIDDEN@
+# define EOVERFLOW @EOVERFLOW_VALUE@
+# define GNULIB_defined_EOVERFLOW 1
+# endif
+
+
+/* On OpenBSD 4.0 and on native Windows, the macros ENOMSG, EIDRM, ENOLINK,
+ EPROTO, EMULTIHOP, EBADMSG, EOVERFLOW, ENOTSUP, ECANCELED are not defined.
+ Likewise, on NonStop Kernel, EDQUOT is not defined.
+ Define them here. Values >= 2000 seem safe to use: Solaris ESTALE = 151,
+ HP-UX EWOULDBLOCK = 246, IRIX EDQUOT = 1133.
+
+ Note: When one of these systems defines some of these macros some day,
+ binaries will have to be recompiled so that they recognizes the new
+ errno values from the system. */
+
+# ifndef ENOMSG
+# define ENOMSG 2000
+# define GNULIB_defined_ENOMSG 1
+# endif
+
+# ifndef EIDRM
+# define EIDRM 2001
+# define GNULIB_defined_EIDRM 1
+# endif
+
+# ifndef ENOLINK
+# define ENOLINK 2002
+# define GNULIB_defined_ENOLINK 1
+# endif
+
+# ifndef EPROTO
+# define EPROTO 2003
+# define GNULIB_defined_EPROTO 1
+# endif
+
+# ifndef EMULTIHOP
+# define EMULTIHOP 2004
+# define GNULIB_defined_EMULTIHOP 1
+# endif
+
+# ifndef EBADMSG
+# define EBADMSG 2005
+# define GNULIB_defined_EBADMSG 1
+# endif
+
+# ifndef EOVERFLOW
+# define EOVERFLOW 2006
+# define GNULIB_defined_EOVERFLOW 1
+# endif
+
+# ifndef ENOTSUP
+# define ENOTSUP 2007
+# define GNULIB_defined_ENOTSUP 1
+# endif
+
+# ifndef ENETRESET
+# define ENETRESET 2011
+# define GNULIB_defined_ENETRESET 1
+# endif
+
+# ifndef ECONNABORTED
+# define ECONNABORTED 2012
+# define GNULIB_defined_ECONNABORTED 1
+# endif
+
+# ifndef ESTALE
+# define ESTALE 2009
+# define GNULIB_defined_ESTALE 1
+# endif
+
+# ifndef EDQUOT
+# define EDQUOT 2010
+# define GNULIB_defined_EDQUOT 1
+# endif
+
+# ifndef ECANCELED
+# define ECANCELED 2008
+# define GNULIB_defined_ECANCELED 1
+# endif
+
+/* On many platforms, the macros EOWNERDEAD and ENOTRECOVERABLE are not
+ defined. */
+
+# ifndef EOWNERDEAD
+# if defined __sun
+ /* Use the same values as defined for Solaris >= 8, for
+ interoperability. */
+# define EOWNERDEAD 58
+# define ENOTRECOVERABLE 59
+# elif defined _WIN32 && ! defined __CYGWIN__
+ /* We have a conflict here: pthreads-win32 defines these values
+ differently than MSVC 10. It's hairy to decide which one to use. */
+# if defined __MINGW32__ && !defined USE_WINDOWS_THREADS
+ /* Use the same values as defined by pthreads-win32, for
+ interoperability. */
+# define EOWNERDEAD 43
+# define ENOTRECOVERABLE 44
+# else
+ /* Use the same values as defined by MSVC 10, for
+ interoperability. */
+# define EOWNERDEAD 133
+# define ENOTRECOVERABLE 127
+# endif
+# else
+# define EOWNERDEAD 2013
+# define ENOTRECOVERABLE 2014
+# endif
+# define GNULIB_defined_EOWNERDEAD 1
+# define GNULIB_defined_ENOTRECOVERABLE 1
+# endif
+
+# ifndef EILSEQ
+# define EILSEQ 2015
+# define GNULIB_defined_EILSEQ 1
+# endif
+
+#endif /* _@GUARD_PREFIX@_ERRNO_H */
+#endif /* _@GUARD_PREFIX@_ERRNO_H */
diff --git a/gl/lib/error.c b/gl/lib/error.c
new file mode 100644
index 0000000..272d45e
--- /dev/null
+++ b/gl/lib/error.c
@@ -0,0 +1,411 @@
+/* Error handler for noninteractive utilities
+ Copyright (C) 1990-1998, 2000-2007, 2009-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ 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 2.1 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 David MacKenzie <djm@gnu.ai.mit.edu>. */
+
+#if !_LIBC
+# include <config.h>
+#endif
+
+#include "error.h"
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if !_LIBC && ENABLE_NLS
+# include "gettext.h"
+# define _(msgid) gettext (msgid)
+#endif
+
+#ifdef _LIBC
+# include <libintl.h>
+# include <stdbool.h>
+# include <stdint.h>
+# include <wchar.h>
+# define mbsrtowcs __mbsrtowcs
+# define USE_UNLOCKED_IO 0
+# define _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(a, b)
+# define _GL_ARG_NONNULL(a)
+#else
+# include "getprogname.h"
+#endif
+
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
+
+#ifndef _
+# define _(String) String
+#endif
+
+/* If NULL, error will flush stdout, then print on stderr the program
+ name, a colon and a space. Otherwise, error will call this
+ function without parameters instead. */
+void (*error_print_progname) (void);
+
+/* This variable is incremented each time 'error' is called. */
+unsigned int error_message_count;
+
+#ifdef _LIBC
+/* In the GNU C library, there is a predefined variable for this. */
+
+# define program_name program_invocation_name
+# include <errno.h>
+# include <limits.h>
+# include <libio/libioP.h>
+
+/* In GNU libc we want do not want to use the common name 'error' directly.
+ Instead make it a weak alias. */
+extern void __error (int status, int errnum, const char *message, ...)
+ __attribute__ ((__format__ (__printf__, 3, 4)));
+extern void __error_at_line (int status, int errnum, const char *file_name,
+ unsigned int line_number, const char *message,
+ ...)
+ __attribute__ ((__format__ (__printf__, 5, 6)));
+# define error __error
+# define error_at_line __error_at_line
+
+# include <libio/iolibio.h>
+# define fflush(s) _IO_fflush (s)
+# undef putc
+# define putc(c, fp) _IO_putc (c, fp)
+
+# include <bits/libc-lock.h>
+
+#else /* not _LIBC */
+
+# include <fcntl.h>
+# include <unistd.h>
+
+# if defined _WIN32 && ! defined __CYGWIN__
+/* Get declarations of the native Windows API functions. */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+/* Get _get_osfhandle. */
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+# endif
+
+/* The gnulib override of fcntl is not needed in this file. */
+# undef fcntl
+
+# if !(GNULIB_STRERROR_R_POSIX || HAVE_DECL_STRERROR_R)
+# ifndef HAVE_DECL_STRERROR_R
+"this configure-time declaration test was not run"
+# endif
+# if STRERROR_R_CHAR_P
+char *strerror_r (int errnum, char *buf, size_t buflen);
+# else
+int strerror_r (int errnum, char *buf, size_t buflen);
+# endif
+# endif
+
+# define program_name getprogname ()
+
+# if GNULIB_STRERROR_R_POSIX || HAVE_STRERROR_R || defined strerror_r
+# define __strerror_r strerror_r
+# endif /* GNULIB_STRERROR_R_POSIX || HAVE_STRERROR_R || defined strerror_r */
+#endif /* not _LIBC */
+
+#if !_LIBC
+/* Return non-zero if FD is open. */
+static int
+is_open (int fd)
+{
+# if defined _WIN32 && ! defined __CYGWIN__
+ /* On native Windows: The initial state of unassigned standard file
+ descriptors is that they are open but point to an INVALID_HANDLE_VALUE.
+ There is no fcntl, and the gnulib replacement fcntl does not support
+ F_GETFL. */
+ return (HANDLE) _get_osfhandle (fd) != INVALID_HANDLE_VALUE;
+# else
+# ifndef F_GETFL
+# error Please port fcntl to your platform
+# endif
+ return 0 <= fcntl (fd, F_GETFL);
+# endif
+}
+#endif
+
+static void
+flush_stdout (void)
+{
+#if !_LIBC
+ int stdout_fd;
+
+# if GNULIB_FREOPEN_SAFER
+ /* Use of gnulib's freopen-safer module normally ensures that
+ fileno (stdout) == 1
+ whenever stdout is open. */
+ stdout_fd = STDOUT_FILENO;
+# else
+ /* POSIX states that fileno (stdout) after fclose is unspecified. But in
+ practice it is not a problem, because stdout is statically allocated and
+ the fd of a FILE stream is stored as a field in its allocated memory. */
+ stdout_fd = fileno (stdout);
+# endif
+ /* POSIX states that fflush (stdout) after fclose is unspecified; it
+ is safe in glibc, but not on all other platforms. fflush (NULL)
+ is always defined, but too draconian. */
+ if (0 <= stdout_fd && is_open (stdout_fd))
+#endif
+ fflush (stdout);
+}
+
+static void
+print_errno_message (int errnum)
+{
+ char const *s;
+
+#if _LIBC || GNULIB_STRERROR_R_POSIX || defined HAVE_STRERROR_R
+ char errbuf[1024];
+# if _LIBC || (!GNULIB_STRERROR_R_POSIX && STRERROR_R_CHAR_P)
+ s = __strerror_r (errnum, errbuf, sizeof errbuf);
+# else
+ if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0)
+ s = errbuf;
+ else
+ s = 0;
+# endif
+#else
+ s = strerror (errnum);
+#endif
+
+#if !_LIBC
+ if (! s)
+ s = _("Unknown system error");
+#endif
+
+#if _LIBC
+ __fxprintf (NULL, ": %s", s);
+#else
+ fprintf (stderr, ": %s", s);
+#endif
+}
+
+static void _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0) _GL_ARG_NONNULL ((3))
+error_tail (int status, int errnum, const char *message, va_list args)
+{
+#if _LIBC
+ if (_IO_fwide (stderr, 0) > 0)
+ {
+ size_t len = strlen (message) + 1;
+ wchar_t *wmessage = NULL;
+ mbstate_t st;
+ size_t res;
+ const char *tmp;
+ bool use_malloc = false;
+
+ while (1)
+ {
+ if (__libc_use_alloca (len * sizeof (wchar_t)))
+ wmessage = (wchar_t *) alloca (len * sizeof (wchar_t));
+ else
+ {
+ if (!use_malloc)
+ wmessage = NULL;
+
+ wchar_t *p = (wchar_t *) realloc (wmessage,
+ len * sizeof (wchar_t));
+ if (p == NULL)
+ {
+ free (wmessage);
+ fputws_unlocked (L"out of memory\n", stderr);
+ return;
+ }
+ wmessage = p;
+ use_malloc = true;
+ }
+
+ memset (&st, '\0', sizeof (st));
+ tmp = message;
+
+ res = mbsrtowcs (wmessage, &tmp, len, &st);
+ if (res != len)
+ break;
+
+ if (__builtin_expect (len >= SIZE_MAX / sizeof (wchar_t) / 2, 0))
+ {
+ /* This really should not happen if everything is fine. */
+ res = (size_t) -1;
+ break;
+ }
+
+ len *= 2;
+ }
+
+ if (res == (size_t) -1)
+ {
+ /* The string cannot be converted. */
+ if (use_malloc)
+ {
+ free (wmessage);
+ use_malloc = false;
+ }
+ wmessage = (wchar_t *) L"???";
+ }
+
+ __vfwprintf (stderr, wmessage, args);
+
+ if (use_malloc)
+ free (wmessage);
+ }
+ else
+#endif
+ vfprintf (stderr, message, args);
+
+ ++error_message_count;
+ if (errnum)
+ print_errno_message (errnum);
+#if _LIBC
+ __fxprintf (NULL, "\n");
+#else
+ putc ('\n', stderr);
+#endif
+ fflush (stderr);
+ if (status)
+ exit (status);
+}
+
+
+/* Print the program name and error message MESSAGE, which is a printf-style
+ format string with optional args.
+ If ERRNUM is nonzero, print its corresponding system error message.
+ Exit with status STATUS if it is nonzero. */
+void
+error (int status, int errnum, const char *message, ...)
+{
+ va_list args;
+
+#if defined _LIBC && defined __libc_ptf_call
+ /* We do not want this call to be cut short by a thread
+ cancellation. Therefore disable cancellation for now. */
+ int state = PTHREAD_CANCEL_ENABLE;
+ __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
+ 0);
+#endif
+
+ flush_stdout ();
+#ifdef _LIBC
+ _IO_flockfile (stderr);
+#endif
+ if (error_print_progname)
+ (*error_print_progname) ();
+ else
+ {
+#if _LIBC
+ __fxprintf (NULL, "%s: ", program_name);
+#else
+ fprintf (stderr, "%s: ", program_name);
+#endif
+ }
+
+ va_start (args, message);
+ error_tail (status, errnum, message, args);
+ va_end (args);
+
+#ifdef _LIBC
+ _IO_funlockfile (stderr);
+# ifdef __libc_ptf_call
+ __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
+# endif
+#endif
+}
+
+/* Sometimes we want to have at most one error per line. This
+ variable controls whether this mode is selected or not. */
+int error_one_per_line;
+
+void
+error_at_line (int status, int errnum, const char *file_name,
+ unsigned int line_number, const char *message, ...)
+{
+ va_list args;
+
+ if (error_one_per_line)
+ {
+ static const char *old_file_name;
+ static unsigned int old_line_number;
+
+ if (old_line_number == line_number
+ && (file_name == old_file_name
+ || (old_file_name != NULL
+ && file_name != NULL
+ && strcmp (old_file_name, file_name) == 0)))
+
+ /* Simply return and print nothing. */
+ return;
+
+ old_file_name = file_name;
+ old_line_number = line_number;
+ }
+
+#if defined _LIBC && defined __libc_ptf_call
+ /* We do not want this call to be cut short by a thread
+ cancellation. Therefore disable cancellation for now. */
+ int state = PTHREAD_CANCEL_ENABLE;
+ __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
+ 0);
+#endif
+
+ flush_stdout ();
+#ifdef _LIBC
+ _IO_flockfile (stderr);
+#endif
+ if (error_print_progname)
+ (*error_print_progname) ();
+ else
+ {
+#if _LIBC
+ __fxprintf (NULL, "%s:", program_name);
+#else
+ fprintf (stderr, "%s:", program_name);
+#endif
+ }
+
+#if _LIBC
+ __fxprintf (NULL, file_name != NULL ? "%s:%u: " : " ",
+ file_name, line_number);
+#else
+ fprintf (stderr, file_name != NULL ? "%s:%u: " : " ",
+ file_name, line_number);
+#endif
+
+ va_start (args, message);
+ error_tail (status, errnum, message, args);
+ va_end (args);
+
+#ifdef _LIBC
+ _IO_funlockfile (stderr);
+# ifdef __libc_ptf_call
+ __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
+# endif
+#endif
+}
+
+#ifdef _LIBC
+/* Make the weak alias. */
+# undef error
+# undef error_at_line
+weak_alias (__error, error)
+weak_alias (__error_at_line, error_at_line)
+#endif
diff --git a/gl/lib/error.h b/gl/lib/error.h
new file mode 100644
index 0000000..45ec2a5
--- /dev/null
+++ b/gl/lib/error.h
@@ -0,0 +1,66 @@
+/* Declaration for error-reporting function
+ Copyright (C) 1995-1997, 2003, 2006, 2008-2022 Free Software Foundation,
+ Inc.
+ This file is part of the GNU C Library.
+
+ 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 2.1 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/>. */
+
+#ifndef _ERROR_H
+#define _ERROR_H 1
+
+/* Get _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM. */
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Print a message with 'fprintf (stderr, FORMAT, ...)';
+ if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
+ If STATUS is nonzero, terminate the program with 'exit (STATUS)'. */
+
+extern void error (int __status, int __errnum, const char *__format, ...)
+#if GNULIB_VFPRINTF_POSIX
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 4))
+#else
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, 3, 4))
+#endif
+ ;
+
+extern void error_at_line (int __status, int __errnum, const char *__fname,
+ unsigned int __lineno, const char *__format, ...)
+#if GNULIB_VFPRINTF_POSIX
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 5, 6))
+#else
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, 5, 6))
+#endif
+ ;
+
+/* If NULL, error will flush stdout, then print on stderr the program
+ name, a colon and a space. Otherwise, error will call this
+ function without parameters instead. */
+extern void (*error_print_progname) (void);
+
+/* This variable is incremented each time 'error' is called. */
+extern unsigned int error_message_count;
+
+/* Sometimes we want to have at most one error per line. This
+ variable controls whether this mode is selected or not. */
+extern int error_one_per_line;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* error.h */
diff --git a/gl/lib/exitfail.c b/gl/lib/exitfail.c
new file mode 100644
index 0000000..84fb0ef
--- /dev/null
+++ b/gl/lib/exitfail.c
@@ -0,0 +1,24 @@
+/* Failure exit status
+
+ Copyright (C) 2002-2003, 2005-2007, 2009-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+#include "exitfail.h"
+
+#include <stdlib.h>
+
+int volatile exit_failure = EXIT_FAILURE;
diff --git a/gl/lib/exitfail.h b/gl/lib/exitfail.h
new file mode 100644
index 0000000..865f096
--- /dev/null
+++ b/gl/lib/exitfail.h
@@ -0,0 +1,18 @@
+/* Failure exit status
+
+ Copyright (C) 2002, 2009-2022 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 2.1 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/>. */
+
+extern int volatile exit_failure;
diff --git a/gl/lib/fchdir.c b/gl/lib/fchdir.c
new file mode 100644
index 0000000..99e4aa8
--- /dev/null
+++ b/gl/lib/fchdir.c
@@ -0,0 +1,206 @@
+/* fchdir replacement.
+ Copyright (C) 2006-2022 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "assure.h"
+#include "filename.h"
+#include "filenamecat.h"
+
+#ifndef REPLACE_OPEN_DIRECTORY
+# define REPLACE_OPEN_DIRECTORY 0
+#endif
+
+/* This replacement assumes that a directory is not renamed while opened
+ through a file descriptor.
+
+ FIXME: On mingw, this would be possible to enforce if we were to
+ also open a HANDLE to each directory currently visited by a file
+ descriptor, since mingw refuses to rename any in-use file system
+ object. */
+
+/* Array of file descriptors opened. If REPLACE_OPEN_DIRECTORY or if it points
+ to a directory, it stores info about this directory. */
+typedef struct
+{
+ char *name; /* Absolute name of the directory, or NULL. */
+ /* FIXME - add a DIR* member to make dirfd possible on mingw? */
+} dir_info_t;
+static dir_info_t *dirs;
+static size_t dirs_allocated;
+
+/* Try to ensure dirs has enough room for a slot at index fd; free any
+ contents already in that slot. Return false and set errno to
+ ENOMEM on allocation failure. */
+static bool
+ensure_dirs_slot (size_t fd)
+{
+ if (fd < dirs_allocated)
+ free (dirs[fd].name);
+ else
+ {
+ size_t new_allocated;
+ dir_info_t *new_dirs;
+
+ new_allocated = 2 * dirs_allocated + 1;
+ if (new_allocated <= fd)
+ new_allocated = fd + 1;
+ new_dirs =
+ (dirs != NULL
+ ? (dir_info_t *) realloc (dirs, new_allocated * sizeof *dirs)
+ : (dir_info_t *) malloc (new_allocated * sizeof *dirs));
+ if (new_dirs == NULL)
+ return false;
+ memset (new_dirs + dirs_allocated, 0,
+ (new_allocated - dirs_allocated) * sizeof *dirs);
+ dirs = new_dirs;
+ dirs_allocated = new_allocated;
+ }
+ return true;
+}
+
+/* Return an absolute name of DIR in malloc'd storage.
+ Upon failure, return NULL with errno set. */
+static char *
+get_name (char const *dir)
+{
+ char *cwd;
+ char *result;
+
+ if (IS_ABSOLUTE_FILE_NAME (dir))
+ return strdup (dir);
+
+ /* We often encounter "."; treat it as a special case. */
+ cwd = getcwd (NULL, 0);
+ if (!cwd || (dir[0] == '.' && dir[1] == '\0'))
+ return cwd;
+
+ result = mfile_name_concat (cwd, dir, NULL);
+ free (cwd);
+ return result;
+}
+
+/* Hook into the gnulib replacements for open() and close() to keep track
+ of the open file descriptors. */
+
+/* Close FD, cleaning up any fd to name mapping if fd was visiting a
+ directory. */
+void
+_gl_unregister_fd (int fd)
+{
+ if (fd >= 0 && fd < dirs_allocated)
+ {
+ free (dirs[fd].name);
+ dirs[fd].name = NULL;
+ }
+}
+
+/* Mark FD as visiting FILENAME. FD must be non-negative, and refer
+ to an open file descriptor. If REPLACE_OPEN_DIRECTORY is non-zero,
+ this should only be called if FD is visiting a directory. Close FD
+ and return -1 with errno set if there is insufficient memory to track
+ the directory name; otherwise return FD. */
+int
+_gl_register_fd (int fd, const char *filename)
+{
+ struct stat statbuf;
+
+ assure (0 <= fd);
+ if (REPLACE_OPEN_DIRECTORY
+ || (fstat (fd, &statbuf) == 0 && S_ISDIR (statbuf.st_mode)))
+ {
+ if (!ensure_dirs_slot (fd)
+ || (dirs[fd].name = get_name (filename)) == NULL)
+ {
+ int saved_errno = errno;
+ close (fd);
+ errno = saved_errno;
+ return -1;
+ }
+ }
+ return fd;
+}
+
+/* Mark NEWFD as a duplicate of OLDFD; useful from dup, dup2, dup3,
+ and fcntl. Both arguments must be valid and distinct file
+ descriptors. Close NEWFD and return -1 if OLDFD is tracking a
+ directory, but there is insufficient memory to track the same
+ directory in NEWFD; otherwise return NEWFD. */
+int
+_gl_register_dup (int oldfd, int newfd)
+{
+ assure (0 <= oldfd && 0 <= newfd && oldfd != newfd);
+ if (oldfd < dirs_allocated && dirs[oldfd].name)
+ {
+ /* Duplicated a directory; must ensure newfd is allocated. */
+ if (!ensure_dirs_slot (newfd)
+ || (dirs[newfd].name = strdup (dirs[oldfd].name)) == NULL)
+ {
+ int saved_errno = errno;
+ close (newfd);
+ errno = saved_errno;
+ newfd = -1;
+ }
+ }
+ else if (newfd < dirs_allocated)
+ {
+ /* Duplicated a non-directory; ensure newfd is cleared. */
+ free (dirs[newfd].name);
+ dirs[newfd].name = NULL;
+ }
+ return newfd;
+}
+
+/* If FD is currently visiting a directory, then return the name of
+ that directory. Otherwise, return NULL and set errno. */
+const char *
+_gl_directory_name (int fd)
+{
+ if (0 <= fd && fd < dirs_allocated && dirs[fd].name != NULL)
+ return dirs[fd].name;
+ /* At this point, fd is either invalid, or open but not a directory.
+ If dup2 fails, errno is correctly EBADF. */
+ if (0 <= fd)
+ {
+ if (dup2 (fd, fd) == fd)
+ errno = ENOTDIR;
+ }
+ else
+ errno = EBADF;
+ return NULL;
+}
+
+
+/* Implement fchdir() in terms of chdir(). */
+
+int
+fchdir (int fd)
+{
+ const char *name = _gl_directory_name (fd);
+ return name ? chdir (name) : -1;
+}
diff --git a/gl/lib/fchown-stub.c b/gl/lib/fchown-stub.c
new file mode 100644
index 0000000..74df86a
--- /dev/null
+++ b/gl/lib/fchown-stub.c
@@ -0,0 +1,34 @@
+/* Change ownership of a file.
+ Copyright (C) 2004-2022 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 2.1 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 Paul Eggert, 2004. */
+
+#include <config.h>
+
+#include <sys/types.h>
+#include <errno.h>
+
+/* A trivial substitute for 'fchown'.
+
+ DJGPP 2.03 and earlier (and perhaps later) don't have 'fchown',
+ so we pretend no-one has permission for this operation. */
+
+int
+fchown (int fd, uid_t uid, gid_t gid)
+{
+ errno = EPERM;
+ return -1;
+}
diff --git a/gl/lib/fcntl.c b/gl/lib/fcntl.c
new file mode 100644
index 0000000..f9753c4
--- /dev/null
+++ b/gl/lib/fcntl.c
@@ -0,0 +1,629 @@
+/* Provide file descriptor control.
+
+ Copyright (C) 2009-2022 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 2.1 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 Eric Blake <ebb9@byu.net>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <fcntl.h>
+
+#include <errno.h>
+#include <limits.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#ifdef __KLIBC__
+# define INCL_DOS
+# include <os2.h>
+#endif
+
+#if defined _WIN32 && ! defined __CYGWIN__
+/* Get declarations of the native Windows API functions. */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+
+/* Get _get_osfhandle. */
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+
+/* Upper bound on getdtablesize(). See lib/getdtablesize.c. */
+# define OPEN_MAX_MAX 0x10000
+
+/* Duplicate OLDFD into the first available slot of at least NEWFD,
+ which must be positive, with FLAGS determining whether the duplicate
+ will be inheritable. */
+static int
+dupfd (int oldfd, int newfd, int flags)
+{
+ /* Mingw has no way to create an arbitrary fd. Iterate until all
+ file descriptors less than newfd are filled up. */
+ HANDLE curr_process = GetCurrentProcess ();
+ HANDLE old_handle = (HANDLE) _get_osfhandle (oldfd);
+ unsigned char fds_to_close[OPEN_MAX_MAX / CHAR_BIT];
+ unsigned int fds_to_close_bound = 0;
+ int result;
+ BOOL inherit = flags & O_CLOEXEC ? FALSE : TRUE;
+ int mode;
+
+ if (newfd < 0 || getdtablesize () <= newfd)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ if (old_handle == INVALID_HANDLE_VALUE
+ || (mode = _setmode (oldfd, O_BINARY)) == -1)
+ {
+ /* oldfd is not open, or is an unassigned standard file
+ descriptor. */
+ errno = EBADF;
+ return -1;
+ }
+ _setmode (oldfd, mode);
+ flags |= mode;
+
+ for (;;)
+ {
+ HANDLE new_handle;
+ int duplicated_fd;
+ unsigned int index;
+
+ if (!DuplicateHandle (curr_process, /* SourceProcessHandle */
+ old_handle, /* SourceHandle */
+ curr_process, /* TargetProcessHandle */
+ (PHANDLE) &new_handle, /* TargetHandle */
+ (DWORD) 0, /* DesiredAccess */
+ inherit, /* InheritHandle */
+ DUPLICATE_SAME_ACCESS)) /* Options */
+ {
+ switch (GetLastError ())
+ {
+ case ERROR_TOO_MANY_OPEN_FILES:
+ errno = EMFILE;
+ break;
+ case ERROR_INVALID_HANDLE:
+ case ERROR_INVALID_TARGET_HANDLE:
+ case ERROR_DIRECT_ACCESS_HANDLE:
+ errno = EBADF;
+ break;
+ case ERROR_INVALID_PARAMETER:
+ case ERROR_INVALID_FUNCTION:
+ case ERROR_INVALID_ACCESS:
+ errno = EINVAL;
+ break;
+ default:
+ errno = EACCES;
+ break;
+ }
+ result = -1;
+ break;
+ }
+ duplicated_fd = _open_osfhandle ((intptr_t) new_handle, flags);
+ if (duplicated_fd < 0)
+ {
+ CloseHandle (new_handle);
+ result = -1;
+ break;
+ }
+ if (newfd <= duplicated_fd)
+ {
+ result = duplicated_fd;
+ break;
+ }
+
+ /* Set the bit duplicated_fd in fds_to_close[]. */
+ index = (unsigned int) duplicated_fd / CHAR_BIT;
+ if (fds_to_close_bound <= index)
+ {
+ if (sizeof fds_to_close <= index)
+ /* Need to increase OPEN_MAX_MAX. */
+ abort ();
+ memset (fds_to_close + fds_to_close_bound, '\0',
+ index + 1 - fds_to_close_bound);
+ fds_to_close_bound = index + 1;
+ }
+ fds_to_close[index] |= 1 << ((unsigned int) duplicated_fd % CHAR_BIT);
+ }
+
+ /* Close the previous fds that turned out to be too small. */
+ {
+ int saved_errno = errno;
+ unsigned int duplicated_fd;
+
+ for (duplicated_fd = 0;
+ duplicated_fd < fds_to_close_bound * CHAR_BIT;
+ duplicated_fd++)
+ if ((fds_to_close[duplicated_fd / CHAR_BIT]
+ >> (duplicated_fd % CHAR_BIT))
+ & 1)
+ close (duplicated_fd);
+
+ errno = saved_errno;
+ }
+
+# if REPLACE_FCHDIR
+ if (0 <= result)
+ result = _gl_register_dup (oldfd, result);
+# endif
+ return result;
+}
+#endif /* W32 */
+
+/* Forward declarations, because we '#undef fcntl' in the middle of this
+ compilation unit. */
+/* Our implementation of fcntl (fd, F_DUPFD, target). */
+static int rpl_fcntl_DUPFD (int fd, int target);
+/* Our implementation of fcntl (fd, F_DUPFD_CLOEXEC, target). */
+static int rpl_fcntl_DUPFD_CLOEXEC (int fd, int target);
+#ifdef __KLIBC__
+/* Adds support for fcntl on directories. */
+static int klibc_fcntl (int fd, int action, /* arg */...);
+#endif
+
+
+/* Perform the specified ACTION on the file descriptor FD, possibly
+ using the argument ARG further described below. This replacement
+ handles the following actions, and forwards all others on to the
+ native fcntl. An unrecognized ACTION returns -1 with errno set to
+ EINVAL.
+
+ F_DUPFD - duplicate FD, with int ARG being the minimum target fd.
+ If successful, return the duplicate, which will be inheritable;
+ otherwise return -1 and set errno.
+
+ F_DUPFD_CLOEXEC - duplicate FD, with int ARG being the minimum
+ target fd. If successful, return the duplicate, which will not be
+ inheritable; otherwise return -1 and set errno.
+
+ F_GETFD - ARG need not be present. If successful, return a
+ non-negative value containing the descriptor flags of FD (only
+ FD_CLOEXEC is portable, but other flags may be present); otherwise
+ return -1 and set errno. */
+
+int
+fcntl (int fd, int action, /* arg */...)
+#undef fcntl
+#ifdef __KLIBC__
+# define fcntl klibc_fcntl
+#endif
+{
+ va_list arg;
+ int result = -1;
+ va_start (arg, action);
+ switch (action)
+ {
+ case F_DUPFD:
+ {
+ int target = va_arg (arg, int);
+ result = rpl_fcntl_DUPFD (fd, target);
+ break;
+ }
+
+ case F_DUPFD_CLOEXEC:
+ {
+ int target = va_arg (arg, int);
+ result = rpl_fcntl_DUPFD_CLOEXEC (fd, target);
+ break;
+ }
+
+#if !HAVE_FCNTL
+ case F_GETFD:
+ {
+# if defined _WIN32 && ! defined __CYGWIN__
+ HANDLE handle = (HANDLE) _get_osfhandle (fd);
+ DWORD flags;
+ if (handle == INVALID_HANDLE_VALUE
+ || GetHandleInformation (handle, &flags) == 0)
+ errno = EBADF;
+ else
+ result = (flags & HANDLE_FLAG_INHERIT) ? 0 : FD_CLOEXEC;
+# else /* !W32 */
+ /* Use dup2 to reject invalid file descriptors. No way to
+ access this information, so punt. */
+ if (0 <= dup2 (fd, fd))
+ result = 0;
+# endif /* !W32 */
+ break;
+ } /* F_GETFD */
+#endif /* !HAVE_FCNTL */
+
+ /* Implementing F_SETFD on mingw is not trivial - there is no
+ API for changing the O_NOINHERIT bit on an fd, and merely
+ changing the HANDLE_FLAG_INHERIT bit on the underlying handle
+ can lead to odd state. It may be possible by duplicating the
+ handle, using _open_osfhandle with the right flags, then
+ using dup2 to move the duplicate onto the original, but that
+ is not supported for now. */
+
+ default:
+ {
+#if HAVE_FCNTL
+ switch (action)
+ {
+ #ifdef F_BARRIERFSYNC /* macOS */
+ case F_BARRIERFSYNC:
+ #endif
+ #ifdef F_CHKCLEAN /* macOS */
+ case F_CHKCLEAN:
+ #endif
+ #ifdef F_CLOSEM /* NetBSD, HP-UX */
+ case F_CLOSEM:
+ #endif
+ #ifdef F_FLUSH_DATA /* macOS */
+ case F_FLUSH_DATA:
+ #endif
+ #ifdef F_FREEZE_FS /* macOS */
+ case F_FREEZE_FS:
+ #endif
+ #ifdef F_FULLFSYNC /* macOS */
+ case F_FULLFSYNC:
+ #endif
+ #ifdef F_GETCONFINED /* macOS */
+ case F_GETCONFINED:
+ #endif
+ #ifdef F_GETDEFAULTPROTLEVEL /* macOS */
+ case F_GETDEFAULTPROTLEVEL:
+ #endif
+ #ifdef F_GETFD /* POSIX */
+ case F_GETFD:
+ #endif
+ #ifdef F_GETFL /* POSIX */
+ case F_GETFL:
+ #endif
+ #ifdef F_GETLEASE /* Linux */
+ case F_GETLEASE:
+ #endif
+ #ifdef F_GETNOSIGPIPE /* macOS */
+ case F_GETNOSIGPIPE:
+ #endif
+ #ifdef F_GETOWN /* POSIX */
+ case F_GETOWN:
+ #endif
+ #ifdef F_GETPIPE_SZ /* Linux */
+ case F_GETPIPE_SZ:
+ #endif
+ #ifdef F_GETPROTECTIONCLASS /* macOS */
+ case F_GETPROTECTIONCLASS:
+ #endif
+ #ifdef F_GETPROTECTIONLEVEL /* macOS */
+ case F_GETPROTECTIONLEVEL:
+ #endif
+ #ifdef F_GET_SEALS /* Linux */
+ case F_GET_SEALS:
+ #endif
+ #ifdef F_GETSIG /* Linux */
+ case F_GETSIG:
+ #endif
+ #ifdef F_MAXFD /* NetBSD */
+ case F_MAXFD:
+ #endif
+ #ifdef F_RECYCLE /* macOS */
+ case F_RECYCLE:
+ #endif
+ #ifdef F_SETFIFOENH /* HP-UX */
+ case F_SETFIFOENH:
+ #endif
+ #ifdef F_THAW_FS /* macOS */
+ case F_THAW_FS:
+ #endif
+ /* These actions take no argument. */
+ result = fcntl (fd, action);
+ break;
+
+ #ifdef F_ADD_SEALS /* Linux */
+ case F_ADD_SEALS:
+ #endif
+ #ifdef F_BADFD /* Solaris */
+ case F_BADFD:
+ #endif
+ #ifdef F_CHECK_OPENEVT /* macOS */
+ case F_CHECK_OPENEVT:
+ #endif
+ #ifdef F_DUP2FD /* FreeBSD, AIX, Solaris */
+ case F_DUP2FD:
+ #endif
+ #ifdef F_DUP2FD_CLOEXEC /* FreeBSD, Solaris */
+ case F_DUP2FD_CLOEXEC:
+ #endif
+ #ifdef F_DUP2FD_CLOFORK /* Solaris */
+ case F_DUP2FD_CLOFORK:
+ #endif
+ #ifdef F_DUPFD /* POSIX */
+ case F_DUPFD:
+ #endif
+ #ifdef F_DUPFD_CLOEXEC /* POSIX */
+ case F_DUPFD_CLOEXEC:
+ #endif
+ #ifdef F_DUPFD_CLOFORK /* Solaris */
+ case F_DUPFD_CLOFORK:
+ #endif
+ #ifdef F_GETXFL /* Solaris */
+ case F_GETXFL:
+ #endif
+ #ifdef F_GLOBAL_NOCACHE /* macOS */
+ case F_GLOBAL_NOCACHE:
+ #endif
+ #ifdef F_MAKECOMPRESSED /* macOS */
+ case F_MAKECOMPRESSED:
+ #endif
+ #ifdef F_MOVEDATAEXTENTS /* macOS */
+ case F_MOVEDATAEXTENTS:
+ #endif
+ #ifdef F_NOCACHE /* macOS */
+ case F_NOCACHE:
+ #endif
+ #ifdef F_NODIRECT /* macOS */
+ case F_NODIRECT:
+ #endif
+ #ifdef F_NOTIFY /* Linux */
+ case F_NOTIFY:
+ #endif
+ #ifdef F_OPLKACK /* IRIX */
+ case F_OPLKACK:
+ #endif
+ #ifdef F_OPLKREG /* IRIX */
+ case F_OPLKREG:
+ #endif
+ #ifdef F_RDAHEAD /* macOS */
+ case F_RDAHEAD:
+ #endif
+ #ifdef F_SETBACKINGSTORE /* macOS */
+ case F_SETBACKINGSTORE:
+ #endif
+ #ifdef F_SETCONFINED /* macOS */
+ case F_SETCONFINED:
+ #endif
+ #ifdef F_SETFD /* POSIX */
+ case F_SETFD:
+ #endif
+ #ifdef F_SETFL /* POSIX */
+ case F_SETFL:
+ #endif
+ #ifdef F_SETLEASE /* Linux */
+ case F_SETLEASE:
+ #endif
+ #ifdef F_SETNOSIGPIPE /* macOS */
+ case F_SETNOSIGPIPE:
+ #endif
+ #ifdef F_SETOWN /* POSIX */
+ case F_SETOWN:
+ #endif
+ #ifdef F_SETPIPE_SZ /* Linux */
+ case F_SETPIPE_SZ:
+ #endif
+ #ifdef F_SETPROTECTIONCLASS /* macOS */
+ case F_SETPROTECTIONCLASS:
+ #endif
+ #ifdef F_SETSIG /* Linux */
+ case F_SETSIG:
+ #endif
+ #ifdef F_SINGLE_WRITER /* macOS */
+ case F_SINGLE_WRITER:
+ #endif
+ /* These actions take an 'int' argument. */
+ {
+ int x = va_arg (arg, int);
+ result = fcntl (fd, action, x);
+ }
+ break;
+
+ default:
+ /* Other actions take a pointer argument. */
+ {
+ void *p = va_arg (arg, void *);
+ result = fcntl (fd, action, p);
+ }
+ break;
+ }
+#else
+ errno = EINVAL;
+#endif
+ break;
+ }
+ }
+ va_end (arg);
+ return result;
+}
+
+static int
+rpl_fcntl_DUPFD (int fd, int target)
+{
+ int result;
+#if !HAVE_FCNTL
+ result = dupfd (fd, target, 0);
+#elif FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR
+ /* Detect invalid target; needed for cygwin 1.5.x. */
+ if (target < 0 || getdtablesize () <= target)
+ {
+ result = -1;
+ errno = EINVAL;
+ }
+ else
+ {
+ /* Haiku alpha 2 loses fd flags on original. */
+ int flags = fcntl (fd, F_GETFD);
+ if (flags < 0)
+ result = -1;
+ else
+ {
+ result = fcntl (fd, F_DUPFD, target);
+ if (0 <= result && fcntl (fd, F_SETFD, flags) == -1)
+ {
+ int saved_errno = errno;
+ close (result);
+ result = -1;
+ errno = saved_errno;
+ }
+# if REPLACE_FCHDIR
+ if (0 <= result)
+ result = _gl_register_dup (fd, result);
+# endif
+ }
+ }
+#else
+ result = fcntl (fd, F_DUPFD, target);
+#endif
+ return result;
+}
+
+static int
+rpl_fcntl_DUPFD_CLOEXEC (int fd, int target)
+{
+ int result;
+#if !HAVE_FCNTL
+ result = dupfd (fd, target, O_CLOEXEC);
+#else /* HAVE_FCNTL */
+# if defined __NetBSD__ || defined __HAIKU__
+ /* On NetBSD 9.0, the system fcntl (fd, F_DUPFD_CLOEXEC, target)
+ has only the same effect as fcntl (fd, F_DUPFD, target). */
+ /* On Haiku, the system fcntl (fd, F_DUPFD_CLOEXEC, target) sets
+ the FD_CLOEXEC flag on fd, not on target. Therefore avoid the
+ system fcntl in this case. */
+# define have_dupfd_cloexec -1
+# else
+ /* Try the system call first, if the headers claim it exists
+ (that is, if GNULIB_defined_F_DUPFD_CLOEXEC is 0), since we
+ may be running with a glibc that has the macro but with an
+ older kernel that does not support it. Cache the
+ information on whether the system call really works, but
+ avoid caching failure if the corresponding F_DUPFD fails
+ for any reason. 0 = unknown, 1 = yes, -1 = no. */
+ static int have_dupfd_cloexec = GNULIB_defined_F_DUPFD_CLOEXEC ? -1 : 0;
+ if (0 <= have_dupfd_cloexec)
+ {
+ result = fcntl (fd, F_DUPFD_CLOEXEC, target);
+ if (0 <= result || errno != EINVAL)
+ {
+ have_dupfd_cloexec = 1;
+# if REPLACE_FCHDIR
+ if (0 <= result)
+ result = _gl_register_dup (fd, result);
+# endif
+ }
+ else
+ {
+ result = rpl_fcntl_DUPFD (fd, target);
+ if (result >= 0)
+ have_dupfd_cloexec = -1;
+ }
+ }
+ else
+# endif
+ result = rpl_fcntl_DUPFD (fd, target);
+ if (0 <= result && have_dupfd_cloexec == -1)
+ {
+ int flags = fcntl (result, F_GETFD);
+ if (flags < 0 || fcntl (result, F_SETFD, flags | FD_CLOEXEC) == -1)
+ {
+ int saved_errno = errno;
+ close (result);
+ errno = saved_errno;
+ result = -1;
+ }
+ }
+#endif /* HAVE_FCNTL */
+ return result;
+}
+
+#undef fcntl
+
+#ifdef __KLIBC__
+
+static int
+klibc_fcntl (int fd, int action, /* arg */...)
+{
+ va_list arg_ptr;
+ int arg;
+ struct stat sbuf;
+ int result;
+
+ va_start (arg_ptr, action);
+ arg = va_arg (arg_ptr, int);
+ result = fcntl (fd, action, arg);
+ /* EPERM for F_DUPFD, ENOTSUP for others */
+ if (result == -1 && (errno == EPERM || errno == ENOTSUP)
+ && !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode))
+ {
+ ULONG ulMode;
+
+ switch (action)
+ {
+ case F_DUPFD:
+ /* Find available fd */
+ while (fcntl (arg, F_GETFL) != -1 || errno != EBADF)
+ arg++;
+
+ result = dup2 (fd, arg);
+ break;
+
+ /* Using underlying APIs is right ? */
+ case F_GETFD:
+ if (DosQueryFHState (fd, &ulMode))
+ break;
+
+ result = (ulMode & OPEN_FLAGS_NOINHERIT) ? FD_CLOEXEC : 0;
+ break;
+
+ case F_SETFD:
+ if (arg & ~FD_CLOEXEC)
+ break;
+
+ if (DosQueryFHState (fd, &ulMode))
+ break;
+
+ if (arg & FD_CLOEXEC)
+ ulMode |= OPEN_FLAGS_NOINHERIT;
+ else
+ ulMode &= ~OPEN_FLAGS_NOINHERIT;
+
+ /* Filter supported flags. */
+ ulMode &= (OPEN_FLAGS_WRITE_THROUGH | OPEN_FLAGS_FAIL_ON_ERROR
+ | OPEN_FLAGS_NO_CACHE | OPEN_FLAGS_NOINHERIT);
+
+ if (DosSetFHState (fd, ulMode))
+ break;
+
+ result = 0;
+ break;
+
+ case F_GETFL:
+ result = 0;
+ break;
+
+ case F_SETFL:
+ if (arg != 0)
+ break;
+
+ result = 0;
+ break;
+
+ default:
+ errno = EINVAL;
+ break;
+ }
+ }
+
+ va_end (arg_ptr);
+
+ return result;
+}
+
+#endif
diff --git a/gl/lib/fcntl.in.h b/gl/lib/fcntl.in.h
new file mode 100644
index 0000000..9270ced
--- /dev/null
+++ b/gl/lib/fcntl.in.h
@@ -0,0 +1,445 @@
+/* Like <fcntl.h>, but with non-working flags defined to 0.
+
+ Copyright (C) 2006-2022 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 2.1 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 Paul Eggert */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined __need_system_fcntl_h
+/* Special invocation convention. */
+
+/* Needed before <sys/stat.h>.
+ May also define off_t to a 64-bit type on native Windows. */
+#include <sys/types.h>
+/* On some systems other than glibc, <sys/stat.h> is a prerequisite of
+ <fcntl.h>. On glibc systems, we would like to avoid namespace pollution.
+ But on glibc systems, <fcntl.h> includes <sys/stat.h> inside an
+ extern "C" { ... } block, which leads to errors in C++ mode with the
+ overridden <sys/stat.h> from gnulib. These errors are known to be gone
+ with g++ version >= 4.3. */
+#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && (defined __ICC || !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))))
+# include <sys/stat.h>
+#endif
+#@INCLUDE_NEXT@ @NEXT_FCNTL_H@
+
+/* Native Windows platforms declare open(), creat() in <io.h>. */
+#if (@GNULIB_CREAT@ || @GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
+ && (defined _WIN32 && ! defined __CYGWIN__)
+# include <io.h>
+#endif
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_FCNTL_H
+
+/* Needed before <sys/stat.h>.
+ May also define off_t to a 64-bit type on native Windows. */
+#include <sys/types.h>
+/* On some systems other than glibc, <sys/stat.h> is a prerequisite of
+ <fcntl.h>. On glibc systems, we would like to avoid namespace pollution.
+ But on glibc systems, <fcntl.h> includes <sys/stat.h> inside an
+ extern "C" { ... } block, which leads to errors in C++ mode with the
+ overridden <sys/stat.h> from gnulib. These errors are known to be gone
+ with g++ version >= 4.3. */
+#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && (defined __ICC || !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))))
+# include <sys/stat.h>
+#endif
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_FCNTL_H@
+
+/* Native Windows platforms declare open(), creat() in <io.h>. */
+#if (@GNULIB_CREAT@ || @GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
+ && (defined _WIN32 && ! defined __CYGWIN__)
+# include <io.h>
+#endif
+
+#ifndef _@GUARD_PREFIX@_FCNTL_H
+#define _@GUARD_PREFIX@_FCNTL_H
+
+#ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems. */
+# include <unistd.h>
+#endif
+
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+/* Declare overridden functions. */
+
+#if @GNULIB_CREAT@
+# if @REPLACE_CREAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef creat
+# define creat rpl_creat
+# endif
+_GL_FUNCDECL_RPL (creat, int, (const char *filename, mode_t mode)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (creat, int, (const char *filename, mode_t mode));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef creat
+# define creat _creat
+# endif
+_GL_CXXALIAS_MDA (creat, int, (const char *filename, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (creat, int, (const char *filename, mode_t mode));
+# endif
+_GL_CXXALIASWARN (creat);
+#elif defined GNULIB_POSIXCHECK
+# undef creat
+/* Assume creat is always declared. */
+_GL_WARN_ON_USE (creat, "creat is not always POSIX compliant - "
+ "use gnulib module creat for portability");
+#elif @GNULIB_MDA_CREAT@
+/* On native Windows, map 'creat' to '_creat', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::creat always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef creat
+# define creat _creat
+# endif
+/* Need to cast, because in mingw the last argument is 'int mode'. */
+_GL_CXXALIAS_MDA_CAST (creat, int, (const char *filename, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (creat, int, (const char *filename, mode_t mode));
+# endif
+_GL_CXXALIASWARN (creat);
+#endif
+
+#if @GNULIB_FCNTL@
+# if @REPLACE_FCNTL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fcntl
+# define fcntl rpl_fcntl
+# endif
+_GL_FUNCDECL_RPL (fcntl, int, (int fd, int action, ...));
+_GL_CXXALIAS_RPL (fcntl, int, (int fd, int action, ...));
+# if !GNULIB_defined_rpl_fcntl
+# define GNULIB_defined_rpl_fcntl 1
+# endif
+# else
+# if !@HAVE_FCNTL@
+_GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...));
+# if !GNULIB_defined_fcntl
+# define GNULIB_defined_fcntl 1
+# endif
+# endif
+_GL_CXXALIAS_SYS (fcntl, int, (int fd, int action, ...));
+# endif
+_GL_CXXALIASWARN (fcntl);
+#elif defined GNULIB_POSIXCHECK
+# undef fcntl
+# if HAVE_RAW_DECL_FCNTL
+_GL_WARN_ON_USE (fcntl, "fcntl is not always POSIX compliant - "
+ "use gnulib module fcntl for portability");
+# endif
+#endif
+
+#if @GNULIB_OPEN@
+# if @REPLACE_OPEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef open
+# define open rpl_open
+# endif
+_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef open
+# define open _open
+# endif
+_GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...));
+# else
+_GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
+# endif
+/* On HP-UX 11, in C++ mode, open() is defined as an inline function with a
+ default argument. _GL_CXXALIASWARN does not work in this case. */
+# if !defined __hpux
+_GL_CXXALIASWARN (open);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef open
+/* Assume open is always declared. */
+_GL_WARN_ON_USE (open, "open is not always POSIX compliant - "
+ "use gnulib module open for portability");
+#elif @GNULIB_MDA_OPEN@
+/* On native Windows, map 'open' to '_open', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::open always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef open
+# define open _open
+# endif
+_GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...));
+# else
+_GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
+# endif
+# if !defined __hpux
+_GL_CXXALIASWARN (open);
+# endif
+#endif
+
+#if @GNULIB_OPENAT@
+# if @REPLACE_OPENAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef openat
+# define openat rpl_openat
+# endif
+_GL_FUNCDECL_RPL (openat, int,
+ (int fd, char const *file, int flags, /* mode_t mode */ ...)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (openat, int,
+ (int fd, char const *file, int flags, /* mode_t mode */ ...));
+# else
+# if !@HAVE_OPENAT@
+_GL_FUNCDECL_SYS (openat, int,
+ (int fd, char const *file, int flags, /* mode_t mode */ ...)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (openat, int,
+ (int fd, char const *file, int flags, /* mode_t mode */ ...));
+# endif
+_GL_CXXALIASWARN (openat);
+#elif defined GNULIB_POSIXCHECK
+# undef openat
+# if HAVE_RAW_DECL_OPENAT
+_GL_WARN_ON_USE (openat, "openat is not portable - "
+ "use gnulib module openat for portability");
+# endif
+#endif
+
+
+/* Fix up the FD_* macros, only known to be missing on mingw. */
+
+#ifndef FD_CLOEXEC
+# define FD_CLOEXEC 1
+#endif
+
+/* Fix up the supported F_* macros. Intentionally leave other F_*
+ macros undefined. Only known to be missing on mingw. */
+
+#ifndef F_DUPFD_CLOEXEC
+# define F_DUPFD_CLOEXEC 0x40000000
+/* Witness variable: 1 if gnulib defined F_DUPFD_CLOEXEC, 0 otherwise. */
+# define GNULIB_defined_F_DUPFD_CLOEXEC 1
+#else
+# define GNULIB_defined_F_DUPFD_CLOEXEC 0
+#endif
+
+#ifndef F_DUPFD
+# define F_DUPFD 1
+#endif
+
+#ifndef F_GETFD
+# define F_GETFD 2
+#endif
+
+/* Fix up the O_* macros. */
+
+/* AIX 7.1 with XL C 12.1 defines O_CLOEXEC, O_NOFOLLOW, and O_TTY_INIT
+ to values outside 'int' range, so omit these misdefinitions.
+ But avoid namespace pollution on non-AIX systems. */
+#ifdef _AIX
+# include <limits.h>
+# if defined O_CLOEXEC && ! (INT_MIN <= O_CLOEXEC && O_CLOEXEC <= INT_MAX)
+# undef O_CLOEXEC
+# endif
+# if defined O_NOFOLLOW && ! (INT_MIN <= O_NOFOLLOW && O_NOFOLLOW <= INT_MAX)
+# undef O_NOFOLLOW
+# endif
+# if defined O_TTY_INIT && ! (INT_MIN <= O_TTY_INIT && O_TTY_INIT <= INT_MAX)
+# undef O_TTY_INIT
+# endif
+#endif
+
+#if !defined O_DIRECT && defined O_DIRECTIO
+/* Tru64 spells it 'O_DIRECTIO'. */
+# define O_DIRECT O_DIRECTIO
+#endif
+
+#if !defined O_CLOEXEC && defined O_NOINHERIT
+/* Mingw spells it 'O_NOINHERIT'. */
+# define O_CLOEXEC O_NOINHERIT
+#endif
+
+#ifndef O_CLOEXEC
+# define O_CLOEXEC 0x40000000 /* Try to not collide with system O_* flags. */
+# define GNULIB_defined_O_CLOEXEC 1
+#else
+# define GNULIB_defined_O_CLOEXEC 0
+#endif
+
+#ifndef O_DIRECT
+# define O_DIRECT 0
+#endif
+
+#ifndef O_DIRECTORY
+# define O_DIRECTORY 0
+#endif
+
+#ifndef O_DSYNC
+# define O_DSYNC 0
+#endif
+
+#ifndef O_EXEC
+# define O_EXEC O_RDONLY /* This is often close enough in older systems. */
+#endif
+
+#ifndef O_IGNORE_CTTY
+# define O_IGNORE_CTTY 0
+#endif
+
+#ifndef O_NDELAY
+# define O_NDELAY 0
+#endif
+
+#ifndef O_NOATIME
+# define O_NOATIME 0
+#endif
+
+#ifndef O_NONBLOCK
+# define O_NONBLOCK O_NDELAY
+#endif
+
+/* If the gnulib module 'nonblocking' is in use, guarantee a working non-zero
+ value of O_NONBLOCK. Otherwise, O_NONBLOCK is defined (above) to O_NDELAY
+ or to 0 as fallback. */
+#if @GNULIB_NONBLOCKING@
+# if O_NONBLOCK
+# define GNULIB_defined_O_NONBLOCK 0
+# else
+# define GNULIB_defined_O_NONBLOCK 1
+# undef O_NONBLOCK
+# define O_NONBLOCK 0x40000000
+# endif
+#endif
+
+#ifndef O_NOCTTY
+# define O_NOCTTY 0
+#endif
+
+#ifndef O_NOFOLLOW
+# define O_NOFOLLOW 0
+#endif
+
+#ifndef O_NOLINK
+# define O_NOLINK 0
+#endif
+
+#ifndef O_NOLINKS
+# define O_NOLINKS 0
+#endif
+
+#ifndef O_NOTRANS
+# define O_NOTRANS 0
+#endif
+
+#ifndef O_RSYNC
+# define O_RSYNC 0
+#endif
+
+#ifndef O_SEARCH
+# define O_SEARCH O_RDONLY /* This is often close enough in older systems. */
+#endif
+
+#ifndef O_SYNC
+# define O_SYNC 0
+#endif
+
+#ifndef O_TTY_INIT
+# define O_TTY_INIT 0
+#endif
+
+#if ~O_ACCMODE & (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH)
+# undef O_ACCMODE
+# define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH)
+#endif
+
+/* For systems that distinguish between text and binary I/O.
+ O_BINARY is usually declared in fcntl.h */
+#if !defined O_BINARY && defined _O_BINARY
+ /* For MSC-compatible compilers. */
+# define O_BINARY _O_BINARY
+# define O_TEXT _O_TEXT
+#endif
+
+#if defined __BEOS__ || defined __HAIKU__
+ /* BeOS 5 and Haiku have O_BINARY and O_TEXT, but they have no effect. */
+# undef O_BINARY
+# undef O_TEXT
+#endif
+
+#ifndef O_BINARY
+# define O_BINARY 0
+# define O_TEXT 0
+#endif
+
+/* Fix up the AT_* macros. */
+
+/* Work around a bug in Solaris 9 and 10: AT_FDCWD is positive. Its
+ value exceeds INT_MAX, so its use as an int doesn't conform to the
+ C standard, and GCC and Sun C complain in some cases. If the bug
+ is present, undef AT_FDCWD here, so it can be redefined below. */
+#if 0 < AT_FDCWD && AT_FDCWD == 0xffd19553
+# undef AT_FDCWD
+#endif
+
+/* Use the same bit pattern as Solaris 9, but with the proper
+ signedness. The bit pattern is important, in case this actually is
+ Solaris with the above workaround. */
+#ifndef AT_FDCWD
+# define AT_FDCWD (-3041965)
+#endif
+
+/* Use the same values as Solaris 9. This shouldn't matter, but
+ there's no real reason to differ. */
+#ifndef AT_SYMLINK_NOFOLLOW
+# define AT_SYMLINK_NOFOLLOW 4096
+#endif
+
+#ifndef AT_REMOVEDIR
+# define AT_REMOVEDIR 1
+#endif
+
+/* Solaris 9 lacks these two, so just pick unique values. */
+#ifndef AT_SYMLINK_FOLLOW
+# define AT_SYMLINK_FOLLOW 2
+#endif
+
+#ifndef AT_EACCESS
+# define AT_EACCESS 4
+#endif
+
+/* Ignore this flag if not supported. */
+#ifndef AT_NO_AUTOMOUNT
+# define AT_NO_AUTOMOUNT 0
+#endif
+
+#endif /* _@GUARD_PREFIX@_FCNTL_H */
+#endif /* _@GUARD_PREFIX@_FCNTL_H */
+#endif
diff --git a/gl/lib/fd-hook.c b/gl/lib/fd-hook.c
new file mode 100644
index 0000000..64a7a80
--- /dev/null
+++ b/gl/lib/fd-hook.c
@@ -0,0 +1,116 @@
+/* Hook for making file descriptor functions close(), ioctl() extensible.
+ Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2009.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "fd-hook.h"
+
+#include <stdlib.h>
+
+/* Currently, this entire code is only needed for the handling of sockets
+ on native Windows platforms. */
+#if WINDOWS_SOCKETS
+
+/* The first and last link in the doubly linked list.
+ Initially the list is empty. */
+static struct fd_hook anchor = { &anchor, &anchor, NULL, NULL };
+
+int
+execute_close_hooks (const struct fd_hook *remaining_list, gl_close_fn primary,
+ int fd)
+{
+ if (remaining_list == &anchor)
+ /* End of list reached. */
+ return primary (fd);
+ else
+ return remaining_list->private_close_fn (remaining_list->private_next,
+ primary, fd);
+}
+
+int
+execute_all_close_hooks (gl_close_fn primary, int fd)
+{
+ return execute_close_hooks (anchor.private_next, primary, fd);
+}
+
+int
+execute_ioctl_hooks (const struct fd_hook *remaining_list, gl_ioctl_fn primary,
+ int fd, int request, void *arg)
+{
+ if (remaining_list == &anchor)
+ /* End of list reached. */
+ return primary (fd, request, arg);
+ else
+ return remaining_list->private_ioctl_fn (remaining_list->private_next,
+ primary, fd, request, arg);
+}
+
+int
+execute_all_ioctl_hooks (gl_ioctl_fn primary,
+ int fd, int request, void *arg)
+{
+ return execute_ioctl_hooks (anchor.private_next, primary, fd, request, arg);
+}
+
+void
+register_fd_hook (close_hook_fn close_hook, ioctl_hook_fn ioctl_hook, struct fd_hook *link)
+{
+ if (close_hook == NULL)
+ close_hook = execute_close_hooks;
+ if (ioctl_hook == NULL)
+ ioctl_hook = execute_ioctl_hooks;
+
+ if (link->private_next == NULL && link->private_prev == NULL)
+ {
+ /* Add the link to the doubly linked list. */
+ link->private_next = anchor.private_next;
+ link->private_prev = &anchor;
+ link->private_close_fn = close_hook;
+ link->private_ioctl_fn = ioctl_hook;
+ anchor.private_next->private_prev = link;
+ anchor.private_next = link;
+ }
+ else
+ {
+ /* The link is already in use. */
+ if (link->private_close_fn != close_hook
+ || link->private_ioctl_fn != ioctl_hook)
+ abort ();
+ }
+}
+
+void
+unregister_fd_hook (struct fd_hook *link)
+{
+ struct fd_hook *next = link->private_next;
+ struct fd_hook *prev = link->private_prev;
+
+ if (next != NULL && prev != NULL)
+ {
+ /* The link is in use. Remove it from the doubly linked list. */
+ prev->private_next = next;
+ next->private_prev = prev;
+ /* Clear the link, to mark it unused. */
+ link->private_next = NULL;
+ link->private_prev = NULL;
+ link->private_close_fn = NULL;
+ link->private_ioctl_fn = NULL;
+ }
+}
+
+#endif
diff --git a/gl/lib/fd-hook.h b/gl/lib/fd-hook.h
new file mode 100644
index 0000000..d6c4964
--- /dev/null
+++ b/gl/lib/fd-hook.h
@@ -0,0 +1,119 @@
+/* Hook for making file descriptor functions close(), ioctl() extensible.
+ Copyright (C) 2009-2022 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 2.1 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/>. */
+
+
+#ifndef FD_HOOK_H
+#define FD_HOOK_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Currently, this entire code is only needed for the handling of sockets
+ on native Windows platforms. */
+#if WINDOWS_SOCKETS
+
+
+/* Type of function that closes FD. */
+typedef int (*gl_close_fn) (int fd);
+
+/* Type of function that applies a control request to FD. */
+typedef int (*gl_ioctl_fn) (int fd, int request, void *arg);
+
+/* An element of the list of file descriptor hooks.
+ In CLOS (Common Lisp Object System) speak, it consists of an "around"
+ method for the close() function and an "around" method for the ioctl()
+ function.
+ The fields of this structure are considered private. */
+struct fd_hook
+{
+ /* Doubly linked list. */
+ struct fd_hook *private_next;
+ struct fd_hook *private_prev;
+ /* Function that treats the types of FD that it knows about and calls
+ execute_close_hooks (REMAINING_LIST, PRIMARY, FD) as a fallback. */
+ int (*private_close_fn) (const struct fd_hook *remaining_list,
+ gl_close_fn primary,
+ int fd);
+ /* Function that treats the types of FD that it knows about and calls
+ execute_ioctl_hooks (REMAINING_LIST, PRIMARY, FD, REQUEST, ARG) as a
+ fallback. */
+ int (*private_ioctl_fn) (const struct fd_hook *remaining_list,
+ gl_ioctl_fn primary,
+ int fd, int request, void *arg);
+};
+
+/* This type of function closes FD, applying special knowledge for the FD
+ types it knows about, and calls
+ execute_close_hooks (REMAINING_LIST, PRIMARY, FD)
+ for the other FD types.
+ In CLOS speak, REMAINING_LIST is the remaining list of "around" methods,
+ and PRIMARY is the "primary" method for close(). */
+typedef int (*close_hook_fn) (const struct fd_hook *remaining_list,
+ gl_close_fn primary,
+ int fd);
+
+/* Execute the close hooks in REMAINING_LIST, with PRIMARY as "primary" method.
+ Return 0 or -1, like close() would do. */
+extern int execute_close_hooks (const struct fd_hook *remaining_list,
+ gl_close_fn primary,
+ int fd);
+
+/* Execute all close hooks, with PRIMARY as "primary" method.
+ Return 0 or -1, like close() would do. */
+extern int execute_all_close_hooks (gl_close_fn primary, int fd);
+
+/* This type of function applies a control request to FD, applying special
+ knowledge for the FD types it knows about, and calls
+ execute_ioctl_hooks (REMAINING_LIST, PRIMARY, FD, REQUEST, ARG)
+ for the other FD types.
+ In CLOS speak, REMAINING_LIST is the remaining list of "around" methods,
+ and PRIMARY is the "primary" method for ioctl(). */
+typedef int (*ioctl_hook_fn) (const struct fd_hook *remaining_list,
+ gl_ioctl_fn primary,
+ int fd, int request, void *arg);
+
+/* Execute the ioctl hooks in REMAINING_LIST, with PRIMARY as "primary" method.
+ Return 0 or -1, like ioctl() would do. */
+extern int execute_ioctl_hooks (const struct fd_hook *remaining_list,
+ gl_ioctl_fn primary,
+ int fd, int request, void *arg);
+
+/* Execute all ioctl hooks, with PRIMARY as "primary" method.
+ Return 0 or -1, like ioctl() would do. */
+extern int execute_all_ioctl_hooks (gl_ioctl_fn primary,
+ int fd, int request, void *arg);
+
+/* Add a function pair to the list of file descriptor hooks.
+ CLOSE_HOOK and IOCTL_HOOK may be NULL, indicating no change.
+ The LINK variable points to a piece of memory which is guaranteed to be
+ accessible until the corresponding call to unregister_fd_hook. */
+extern void register_fd_hook (close_hook_fn close_hook, ioctl_hook_fn ioctl_hook,
+ struct fd_hook *link);
+
+/* Removes a hook from the list of file descriptor hooks. */
+extern void unregister_fd_hook (struct fd_hook *link);
+
+
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* FD_HOOK_H */
diff --git a/gl/lib/fd-safer-flag.c b/gl/lib/fd-safer-flag.c
new file mode 100644
index 0000000..2e07cb9
--- /dev/null
+++ b/gl/lib/fd-safer-flag.c
@@ -0,0 +1,52 @@
+/* Adjust a file descriptor result so that it avoids clobbering
+ STD{IN,OUT,ERR}_FILENO, with specific flags.
+
+ Copyright (C) 2005-2006, 2009-2022 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 and Eric Blake. */
+
+#include <config.h>
+
+/* Specification. */
+#include "unistd-safer.h"
+
+#include <errno.h>
+#include <unistd.h>
+
+/* Return FD, unless FD would be a copy of standard input, output, or
+ error; in that case, return a duplicate of FD, closing FD. If FLAG
+ contains O_CLOEXEC, the returned FD will have close-on-exec
+ semantics. On failure to duplicate, close FD, set errno, and
+ return -1. Preserve errno if FD is negative, so that the caller
+ can always inspect errno when the returned value is negative.
+
+ This function is usefully wrapped around functions that return file
+ descriptors, e.g., fd_safer_flag (open ("file", O_RDONLY | flag), flag). */
+
+int
+fd_safer_flag (int fd, int flag)
+{
+ if (STDIN_FILENO <= fd && fd <= STDERR_FILENO)
+ {
+ int f = dup_safer_flag (fd, flag);
+ int e = errno;
+ close (fd);
+ errno = e;
+ fd = f;
+ }
+
+ return fd;
+}
diff --git a/gl/lib/fd-safer.c b/gl/lib/fd-safer.c
new file mode 100644
index 0000000..e37b7b3
--- /dev/null
+++ b/gl/lib/fd-safer.c
@@ -0,0 +1,49 @@
+/* Return a safer copy of a file descriptor.
+
+ Copyright (C) 2005-2006, 2009-2022 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 "unistd-safer.h"
+
+#include <errno.h>
+#include <unistd.h>
+
+/* Return FD, unless FD would be a copy of standard input, output, or
+ error; in that case, return a duplicate of FD, closing FD. On
+ failure to duplicate, close FD, set errno, and return -1. Preserve
+ errno if FD is negative, so that the caller can always inspect
+ errno when the returned value is negative.
+
+ This function is usefully wrapped around functions that return file
+ descriptors, e.g., fd_safer (open ("file", O_RDONLY)). */
+
+int
+fd_safer (int fd)
+{
+ if (STDIN_FILENO <= fd && fd <= STDERR_FILENO)
+ {
+ int f = dup_safer (fd);
+ int e = errno;
+ close (fd);
+ errno = e;
+ fd = f;
+ }
+
+ return fd;
+}
diff --git a/gl/lib/fdopendir.c b/gl/lib/fdopendir.c
new file mode 100644
index 0000000..c2b0e1e
--- /dev/null
+++ b/gl/lib/fdopendir.c
@@ -0,0 +1,249 @@
+/* provide a replacement fdopendir function
+ Copyright (C) 2004-2022 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 <dirent.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+
+#if !HAVE_FDOPENDIR
+
+# include "openat.h"
+# include "openat-priv.h"
+# include "save-cwd.h"
+
+# if GNULIB_DIRENT_SAFER
+# include "dirent--.h"
+# endif
+
+# ifndef REPLACE_FCHDIR
+# define REPLACE_FCHDIR 0
+# endif
+
+static DIR *fdopendir_with_dup (int, int, struct saved_cwd const *);
+static DIR *fd_clone_opendir (int, struct saved_cwd const *);
+
+/* Replacement for POSIX fdopendir.
+
+ First, try to simulate it via opendir ("/proc/self/fd/..."). Failing
+ that, simulate it by using fchdir metadata, or by doing
+ save_cwd/fchdir/opendir(".")/restore_cwd.
+ If either the save_cwd or the restore_cwd fails (relatively unlikely),
+ then give a diagnostic and exit nonzero.
+
+ If successful, the resulting stream is based on FD in
+ implementations where streams are based on file descriptors and in
+ applications where no other thread or signal handler allocates or
+ frees file descriptors. In other cases, consult dirfd on the result
+ to find out whether FD is still being used.
+
+ Otherwise, this function works just like POSIX fdopendir.
+
+ W A R N I N G:
+
+ Unlike other fd-related functions, this one places constraints on FD.
+ If this function returns successfully, FD is under control of the
+ dirent.h system, and the caller should not close or modify the state of
+ FD other than by the dirent.h functions. */
+# ifdef __KLIBC__
+# include <InnoTekLIBC/backend.h>
+
+DIR *
+fdopendir (int fd)
+{
+ char path[_MAX_PATH];
+ DIR *dirp;
+
+ /* Get a path from fd */
+ if (__libc_Back_ioFHToPath (fd, path, sizeof (path)))
+ return NULL;
+
+ dirp = opendir (path);
+ if (!dirp)
+ return NULL;
+
+ /* Unregister fd registered by opendir() */
+ _gl_unregister_dirp_fd (dirfd (dirp));
+
+ /* Register our fd */
+ if (_gl_register_dirp_fd (fd, dirp))
+ {
+ int saved_errno = errno;
+
+ closedir (dirp);
+
+ errno = saved_errno;
+
+ dirp = NULL;
+ }
+
+ return dirp;
+}
+# else
+DIR *
+fdopendir (int fd)
+{
+ DIR *dir = fdopendir_with_dup (fd, -1, NULL);
+
+ if (! REPLACE_FCHDIR && ! dir)
+ {
+ int saved_errno = errno;
+ if (EXPECTED_ERRNO (saved_errno))
+ {
+ struct saved_cwd cwd;
+ if (save_cwd (&cwd) != 0)
+ openat_save_fail (errno);
+ dir = fdopendir_with_dup (fd, -1, &cwd);
+ saved_errno = errno;
+ free_cwd (&cwd);
+ errno = saved_errno;
+ }
+ }
+
+ return dir;
+}
+# endif
+
+/* Like fdopendir, except that if OLDER_DUPFD is not -1, it is known
+ to be a dup of FD which is less than FD - 1 and which will be
+ closed by the caller and not otherwise used by the caller. This
+ function makes sure that FD is closed and all file descriptors less
+ than FD are open, and then calls fd_clone_opendir on a dup of FD.
+ That way, barring race conditions, fd_clone_opendir returns a
+ stream whose file descriptor is FD.
+
+ If REPLACE_FCHDIR or CWD is null, use opendir ("/proc/self/fd/...",
+ falling back on fchdir metadata. Otherwise, CWD is a saved version
+ of the working directory; use fchdir/opendir(".")/restore_cwd(CWD). */
+static DIR *
+fdopendir_with_dup (int fd, int older_dupfd, struct saved_cwd const *cwd)
+{
+ int dupfd = dup (fd);
+ if (dupfd < 0 && errno == EMFILE)
+ dupfd = older_dupfd;
+ if (dupfd < 0)
+ return NULL;
+ else
+ {
+ DIR *dir;
+ int saved_errno;
+ if (dupfd < fd - 1 && dupfd != older_dupfd)
+ {
+ dir = fdopendir_with_dup (fd, dupfd, cwd);
+ saved_errno = errno;
+ }
+ else
+ {
+ close (fd);
+ dir = fd_clone_opendir (dupfd, cwd);
+ saved_errno = errno;
+ if (! dir)
+ {
+ int fd1 = dup (dupfd);
+ if (fd1 != fd)
+ openat_save_fail (fd1 < 0 ? errno : EBADF);
+ }
+ }
+
+ if (dupfd != older_dupfd)
+ close (dupfd);
+ errno = saved_errno;
+ return dir;
+ }
+}
+
+/* Like fdopendir, except the result controls a clone of FD. It is
+ the caller's responsibility both to close FD and (if the result is
+ not null) to closedir the result. */
+static DIR *
+fd_clone_opendir (int fd, struct saved_cwd const *cwd)
+{
+ if (REPLACE_FCHDIR || ! cwd)
+ {
+ DIR *dir = NULL;
+ int saved_errno = EOPNOTSUPP;
+ char buf[OPENAT_BUFFER_SIZE];
+ char *proc_file = openat_proc_name (buf, fd, ".");
+ if (proc_file)
+ {
+ dir = opendir (proc_file);
+ saved_errno = errno;
+ if (proc_file != buf)
+ free (proc_file);
+ }
+# if REPLACE_FCHDIR
+ if (! dir && EXPECTED_ERRNO (saved_errno))
+ {
+ char const *name = _gl_directory_name (fd);
+ DIR *dp = name ? opendir (name) : NULL;
+
+ /* The caller has done an elaborate dance to arrange for opendir to
+ consume just the right file descriptor. If dirfd returns -1,
+ though, we're on a system like mingw where opendir does not
+ consume a file descriptor. Consume it via 'dup' instead. */
+ if (dp && dirfd (dp) < 0)
+ dup (fd);
+
+ return dp;
+ }
+# endif
+ errno = saved_errno;
+ return dir;
+ }
+ else
+ {
+ if (fchdir (fd) != 0)
+ return NULL;
+ else
+ {
+ DIR *dir = opendir (".");
+ int saved_errno = errno;
+ if (restore_cwd (cwd) != 0)
+ openat_restore_fail (errno);
+ errno = saved_errno;
+ return dir;
+ }
+ }
+}
+
+#else /* HAVE_FDOPENDIR */
+
+# include <errno.h>
+# include <sys/stat.h>
+
+# undef fdopendir
+
+/* Like fdopendir, but work around GNU/Hurd bug by validating FD. */
+
+DIR *
+rpl_fdopendir (int fd)
+{
+ struct stat st;
+ if (fstat (fd, &st))
+ return NULL;
+ if (!S_ISDIR (st.st_mode))
+ {
+ errno = ENOTDIR;
+ return NULL;
+ }
+ return fdopendir (fd);
+}
+
+#endif /* HAVE_FDOPENDIR */
diff --git a/gl/lib/file-set.c b/gl/lib/file-set.c
new file mode 100644
index 0000000..3270551
--- /dev/null
+++ b/gl/lib/file-set.c
@@ -0,0 +1,74 @@
+/* Specialized functions to manipulate a set of files.
+ Copyright (C) 2007, 2009-2022 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 "file-set.h"
+
+#include "hash-triple.h"
+#include "xalloc.h"
+
+/* Record file, FILE, and dev/ino from *STATS, in the hash table, HT.
+ If HT is NULL, return immediately.
+ If memory allocation fails, exit immediately. */
+void
+record_file (Hash_table *ht, char const *file, struct stat const *stats)
+{
+ struct F_triple *ent;
+
+ if (ht == NULL)
+ return;
+
+ ent = xmalloc (sizeof *ent);
+ ent->name = xstrdup (file);
+ ent->st_ino = stats->st_ino;
+ ent->st_dev = stats->st_dev;
+
+ {
+ struct F_triple *ent_from_table = hash_insert (ht, ent);
+ if (ent_from_table == NULL)
+ {
+ /* Insertion failed due to lack of memory. */
+ xalloc_die ();
+ }
+
+ if (ent_from_table != ent)
+ {
+ /* There was already a matching entry in the table, so ENT was
+ not inserted. Free it. */
+ triple_free (ent);
+ }
+ }
+}
+
+/* Return true if there is an entry in hash table, HT,
+ for the file described by FILE and STATS. */
+bool
+seen_file (Hash_table const *ht, char const *file,
+ struct stat const *stats)
+{
+ struct F_triple new_ent;
+
+ if (ht == NULL)
+ return false;
+
+ new_ent.name = (char *) file;
+ new_ent.st_ino = stats->st_ino;
+ new_ent.st_dev = stats->st_dev;
+
+ return !!hash_lookup (ht, &new_ent);
+}
diff --git a/gl/lib/file-set.h b/gl/lib/file-set.h
new file mode 100644
index 0000000..dc9d0ae
--- /dev/null
+++ b/gl/lib/file-set.h
@@ -0,0 +1,33 @@
+/* Very specialized set-of-files code.
+ Copyright (C) 2007-2022 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, 2007. */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdbool.h>
+
+#include "hash.h"
+
+extern void record_file (Hash_table *ht, char const *file,
+ struct stat const *stats)
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__
+ __attribute__ ((__nonnull__ (2, 3)))
+#endif
+;
+
+extern bool seen_file (Hash_table const *ht, char const *file,
+ struct stat const *stats);
diff --git a/gl/lib/filename.h b/gl/lib/filename.h
new file mode 100644
index 0000000..ab77ca2
--- /dev/null
+++ b/gl/lib/filename.h
@@ -0,0 +1,112 @@
+/* Basic filename support macros.
+ Copyright (C) 2001-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+/* From Paul Eggert and Jim Meyering. */
+
+#ifndef _FILENAME_H
+#define _FILENAME_H
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Filename support.
+ ISSLASH(C) tests whether C is a directory separator
+ character.
+ HAS_DEVICE(Filename) tests whether Filename contains a device
+ specification.
+ FILE_SYSTEM_PREFIX_LEN(Filename) length of the device specification
+ at the beginning of Filename,
+ index of the part consisting of
+ alternating components and slashes.
+ FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+ 1 when a non-empty device specification
+ can be followed by an empty or relative
+ part,
+ 0 when a non-empty device specification
+ must be followed by a slash,
+ 0 when device specification don't exist.
+ IS_ABSOLUTE_FILE_NAME(Filename)
+ tests whether Filename is independent of
+ any notion of "current directory".
+ IS_RELATIVE_FILE_NAME(Filename)
+ tests whether Filename may be concatenated
+ to a directory filename.
+ Note: On native Windows, OS/2, DOS, "c:" is neither an absolute nor a
+ relative file name!
+ IS_FILE_NAME_WITH_DIR(Filename) tests whether Filename contains a device
+ or directory specification.
+ */
+#if defined _WIN32 || defined __CYGWIN__ \
+ || defined __EMX__ || defined __MSDOS__ || defined __DJGPP__
+ /* Native Windows, Cygwin, OS/2, DOS */
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+ /* Internal macro: Tests whether a character is a drive letter. */
+# define _IS_DRIVE_LETTER(C) \
+ (((C) >= 'A' && (C) <= 'Z') || ((C) >= 'a' && (C) <= 'z'))
+ /* Help the compiler optimizing it. This assumes ASCII. */
+# undef _IS_DRIVE_LETTER
+# define _IS_DRIVE_LETTER(C) \
+ (((unsigned int) (C) | ('a' - 'A')) - 'a' <= 'z' - 'a')
+# define HAS_DEVICE(Filename) \
+ (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':')
+# define FILE_SYSTEM_PREFIX_LEN(Filename) (HAS_DEVICE (Filename) ? 2 : 0)
+# ifdef __CYGWIN__
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
+# else
+ /* On native Windows, OS/2, DOS, the system has the notion of a
+ "current directory" on each drive. */
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1
+# endif
+# if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+# define IS_ABSOLUTE_FILE_NAME(Filename) \
+ ISSLASH ((Filename)[FILE_SYSTEM_PREFIX_LEN (Filename)])
+# else
+# define IS_ABSOLUTE_FILE_NAME(Filename) \
+ (ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename))
+# endif
+# define IS_RELATIVE_FILE_NAME(Filename) \
+ (! (ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename)))
+# define IS_FILE_NAME_WITH_DIR(Filename) \
+ (strchr ((Filename), '/') != NULL || strchr ((Filename), '\\') != NULL \
+ || HAS_DEVICE (Filename))
+#else
+ /* Unix */
+# define ISSLASH(C) ((C) == '/')
+# define HAS_DEVICE(Filename) ((void) (Filename), 0)
+# define FILE_SYSTEM_PREFIX_LEN(Filename) ((void) (Filename), 0)
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
+# define IS_ABSOLUTE_FILE_NAME(Filename) ISSLASH ((Filename)[0])
+# define IS_RELATIVE_FILE_NAME(Filename) (! ISSLASH ((Filename)[0]))
+# define IS_FILE_NAME_WITH_DIR(Filename) (strchr ((Filename), '/') != NULL)
+#endif
+
+/* Deprecated macros. For backward compatibility with old users of the
+ 'filename' module. */
+#define IS_ABSOLUTE_PATH IS_ABSOLUTE_FILE_NAME
+#define IS_PATH_WITH_DIR IS_FILE_NAME_WITH_DIR
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _FILENAME_H */
diff --git a/gl/lib/filenamecat-lgpl.c b/gl/lib/filenamecat-lgpl.c
new file mode 100644
index 0000000..56981aa
--- /dev/null
+++ b/gl/lib/filenamecat-lgpl.c
@@ -0,0 +1,90 @@
+/* Concatenate two arbitrary file names.
+
+ Copyright (C) 1996-2007, 2009-2022 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 2.1 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 Jim Meyering. */
+
+#include <config.h>
+
+/* Specification. */
+#include "filenamecat.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "basename-lgpl.h"
+#include "filename.h"
+
+#if ! HAVE_MEMPCPY && ! defined mempcpy
+# define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N)))
+#endif
+
+/* Concatenate two file name components, DIR and BASE, in
+ newly-allocated storage and return the result.
+ The resulting file name F is such that the commands "ls F" and "(cd
+ DIR; ls ./BASE)" refer to the same file. If necessary, put
+ a separator between DIR and BASE in the result. Typically this
+ separator is "/", but in rare cases it might be ".".
+ In any case, if BASE_IN_RESULT is non-NULL, set
+ *BASE_IN_RESULT to point to the copy of BASE at the end of the
+ returned concatenation.
+
+ If malloc fails, return NULL with errno set. */
+
+char *
+mfile_name_concat (char const *dir, char const *base, char **base_in_result)
+{
+ char const *dirbase = last_component (dir);
+ size_t dirbaselen = base_len (dirbase);
+ size_t dirlen = dirbase - dir + dirbaselen;
+ size_t baselen = strlen (base);
+ char sep = '\0';
+ if (dirbaselen)
+ {
+ /* DIR is not a file system root, so separate with / if needed. */
+ if (! ISSLASH (dir[dirlen - 1]) && ! ISSLASH (*base))
+ sep = '/';
+ }
+ else if (ISSLASH (*base))
+ {
+ /* DIR is a file system root and BASE begins with a slash, so
+ separate with ".". For example, if DIR is "/" and BASE is
+ "/foo" then return "/./foo", as "//foo" would be wrong on
+ some POSIX systems. A fancier algorithm could omit "." in
+ some cases but is not worth the trouble. */
+ sep = '.';
+ }
+
+ char *p_concat = malloc (dirlen + (sep != '\0') + baselen + 1);
+ if (p_concat == NULL)
+ return NULL;
+
+ {
+ char *p;
+
+ p = mempcpy (p_concat, dir, dirlen);
+ *p = sep;
+ p += sep != '\0';
+
+ if (base_in_result)
+ *base_in_result = p;
+
+ p = mempcpy (p, base, baselen);
+ *p = '\0';
+ }
+
+ return p_concat;
+}
diff --git a/gl/lib/filenamecat.h b/gl/lib/filenamecat.h
new file mode 100644
index 0000000..f11bd28
--- /dev/null
+++ b/gl/lib/filenamecat.h
@@ -0,0 +1,32 @@
+/* Concatenate two arbitrary file names.
+
+ Copyright (C) 1996-1997, 2003, 2005, 2007, 2009-2022 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 2.1 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 Jim Meyering. */
+
+#include <stdlib.h>
+
+#if GNULIB_FILENAMECAT
+char *file_name_concat (char const *dir, char const *base,
+ char **base_in_result)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+#endif
+
+char *mfile_name_concat (char const *dir, char const *base,
+ char **base_in_result)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
diff --git a/gl/lib/flexmember.h b/gl/lib/flexmember.h
new file mode 100644
index 0000000..1545639
--- /dev/null
+++ b/gl/lib/flexmember.h
@@ -0,0 +1,60 @@
+/* Sizes of structs with flexible array members.
+
+ Copyright 2016-2022 Free Software Foundation, Inc.
+
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>.
+
+ Written by Paul Eggert. */
+
+#include <stddef.h>
+
+/* Nonzero multiple of alignment of TYPE, suitable for FLEXSIZEOF below.
+ On older platforms without _Alignof, use a pessimistic bound that is
+ safe in practice even if FLEXIBLE_ARRAY_MEMBER is 1.
+ On newer platforms, use _Alignof to get a tighter bound. */
+
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
+# define FLEXALIGNOF(type) (sizeof (type) & ~ (sizeof (type) - 1))
+#else
+# define FLEXALIGNOF(type) _Alignof (type)
+#endif
+
+/* Yield a properly aligned upper bound on the size of a struct of
+ type TYPE with a flexible array member named MEMBER that is
+ followed by N bytes of other data. The result is suitable as an
+ argument to malloc. For example:
+
+ struct s { int n; char d[FLEXIBLE_ARRAY_MEMBER]; };
+ struct s *p = malloc (FLEXSIZEOF (struct s, d, n * sizeof (char)));
+
+ FLEXSIZEOF (TYPE, MEMBER, N) is not simply (sizeof (TYPE) + N),
+ since FLEXIBLE_ARRAY_MEMBER may be 1 on pre-C11 platforms. Nor is
+ it simply (offsetof (TYPE, MEMBER) + N), as that might yield a size
+ that causes malloc to yield a pointer that is not properly aligned
+ for TYPE; for example, if sizeof (int) == alignof (int) == 4,
+ malloc (offsetof (struct s, d) + 3 * sizeof (char)) is equivalent
+ to malloc (7) and might yield a pointer that is not a multiple of 4
+ (which means the pointer is not properly aligned for struct s),
+ whereas malloc (FLEXSIZEOF (struct s, d, 3 * sizeof (char))) is
+ equivalent to malloc (8) and must yield a pointer that is a
+ multiple of 4.
+
+ Yield a value less than N if and only if arithmetic overflow occurs. */
+
+#define FLEXSIZEOF(type, member, n) \
+ ((offsetof (type, member) + FLEXALIGNOF (type) - 1 + (n)) \
+ & ~ (FLEXALIGNOF (type) - 1))
diff --git a/gl/lib/float+.h b/gl/lib/float+.h
new file mode 100644
index 0000000..9ab4520
--- /dev/null
+++ b/gl/lib/float+.h
@@ -0,0 +1,147 @@
+/* Supplemental information about the floating-point formats.
+ Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2007.
+
+ 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 2.1 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/>. */
+
+#ifndef _FLOATPLUS_H
+#define _FLOATPLUS_H
+
+#include <float.h>
+#include <limits.h>
+
+/* Number of bits in the mantissa of a floating-point number, including the
+ "hidden bit". */
+#if FLT_RADIX == 2
+# define FLT_MANT_BIT FLT_MANT_DIG
+# define DBL_MANT_BIT DBL_MANT_DIG
+# define LDBL_MANT_BIT LDBL_MANT_DIG
+#elif FLT_RADIX == 4
+# define FLT_MANT_BIT (FLT_MANT_DIG * 2)
+# define DBL_MANT_BIT (DBL_MANT_DIG * 2)
+# define LDBL_MANT_BIT (LDBL_MANT_DIG * 2)
+#elif FLT_RADIX == 16
+# define FLT_MANT_BIT (FLT_MANT_DIG * 4)
+# define DBL_MANT_BIT (DBL_MANT_DIG * 4)
+# define LDBL_MANT_BIT (LDBL_MANT_DIG * 4)
+#endif
+
+/* Bit mask that can be used to mask the exponent, as an unsigned number. */
+#define FLT_EXP_MASK ((FLT_MAX_EXP - FLT_MIN_EXP) | 7)
+#define DBL_EXP_MASK ((DBL_MAX_EXP - DBL_MIN_EXP) | 7)
+#define LDBL_EXP_MASK ((LDBL_MAX_EXP - LDBL_MIN_EXP) | 7)
+
+/* Number of bits used for the exponent of a floating-point number, including
+ the exponent's sign. */
+#define FLT_EXP_BIT \
+ (FLT_EXP_MASK < 0x100 ? 8 : \
+ FLT_EXP_MASK < 0x200 ? 9 : \
+ FLT_EXP_MASK < 0x400 ? 10 : \
+ FLT_EXP_MASK < 0x800 ? 11 : \
+ FLT_EXP_MASK < 0x1000 ? 12 : \
+ FLT_EXP_MASK < 0x2000 ? 13 : \
+ FLT_EXP_MASK < 0x4000 ? 14 : \
+ FLT_EXP_MASK < 0x8000 ? 15 : \
+ FLT_EXP_MASK < 0x10000 ? 16 : \
+ FLT_EXP_MASK < 0x20000 ? 17 : \
+ FLT_EXP_MASK < 0x40000 ? 18 : \
+ FLT_EXP_MASK < 0x80000 ? 19 : \
+ FLT_EXP_MASK < 0x100000 ? 20 : \
+ FLT_EXP_MASK < 0x200000 ? 21 : \
+ FLT_EXP_MASK < 0x400000 ? 22 : \
+ FLT_EXP_MASK < 0x800000 ? 23 : \
+ FLT_EXP_MASK < 0x1000000 ? 24 : \
+ FLT_EXP_MASK < 0x2000000 ? 25 : \
+ FLT_EXP_MASK < 0x4000000 ? 26 : \
+ FLT_EXP_MASK < 0x8000000 ? 27 : \
+ FLT_EXP_MASK < 0x10000000 ? 28 : \
+ FLT_EXP_MASK < 0x20000000 ? 29 : \
+ FLT_EXP_MASK < 0x40000000 ? 30 : \
+ FLT_EXP_MASK <= 0x7fffffff ? 31 : \
+ 32)
+#define DBL_EXP_BIT \
+ (DBL_EXP_MASK < 0x100 ? 8 : \
+ DBL_EXP_MASK < 0x200 ? 9 : \
+ DBL_EXP_MASK < 0x400 ? 10 : \
+ DBL_EXP_MASK < 0x800 ? 11 : \
+ DBL_EXP_MASK < 0x1000 ? 12 : \
+ DBL_EXP_MASK < 0x2000 ? 13 : \
+ DBL_EXP_MASK < 0x4000 ? 14 : \
+ DBL_EXP_MASK < 0x8000 ? 15 : \
+ DBL_EXP_MASK < 0x10000 ? 16 : \
+ DBL_EXP_MASK < 0x20000 ? 17 : \
+ DBL_EXP_MASK < 0x40000 ? 18 : \
+ DBL_EXP_MASK < 0x80000 ? 19 : \
+ DBL_EXP_MASK < 0x100000 ? 20 : \
+ DBL_EXP_MASK < 0x200000 ? 21 : \
+ DBL_EXP_MASK < 0x400000 ? 22 : \
+ DBL_EXP_MASK < 0x800000 ? 23 : \
+ DBL_EXP_MASK < 0x1000000 ? 24 : \
+ DBL_EXP_MASK < 0x2000000 ? 25 : \
+ DBL_EXP_MASK < 0x4000000 ? 26 : \
+ DBL_EXP_MASK < 0x8000000 ? 27 : \
+ DBL_EXP_MASK < 0x10000000 ? 28 : \
+ DBL_EXP_MASK < 0x20000000 ? 29 : \
+ DBL_EXP_MASK < 0x40000000 ? 30 : \
+ DBL_EXP_MASK <= 0x7fffffff ? 31 : \
+ 32)
+#define LDBL_EXP_BIT \
+ (LDBL_EXP_MASK < 0x100 ? 8 : \
+ LDBL_EXP_MASK < 0x200 ? 9 : \
+ LDBL_EXP_MASK < 0x400 ? 10 : \
+ LDBL_EXP_MASK < 0x800 ? 11 : \
+ LDBL_EXP_MASK < 0x1000 ? 12 : \
+ LDBL_EXP_MASK < 0x2000 ? 13 : \
+ LDBL_EXP_MASK < 0x4000 ? 14 : \
+ LDBL_EXP_MASK < 0x8000 ? 15 : \
+ LDBL_EXP_MASK < 0x10000 ? 16 : \
+ LDBL_EXP_MASK < 0x20000 ? 17 : \
+ LDBL_EXP_MASK < 0x40000 ? 18 : \
+ LDBL_EXP_MASK < 0x80000 ? 19 : \
+ LDBL_EXP_MASK < 0x100000 ? 20 : \
+ LDBL_EXP_MASK < 0x200000 ? 21 : \
+ LDBL_EXP_MASK < 0x400000 ? 22 : \
+ LDBL_EXP_MASK < 0x800000 ? 23 : \
+ LDBL_EXP_MASK < 0x1000000 ? 24 : \
+ LDBL_EXP_MASK < 0x2000000 ? 25 : \
+ LDBL_EXP_MASK < 0x4000000 ? 26 : \
+ LDBL_EXP_MASK < 0x8000000 ? 27 : \
+ LDBL_EXP_MASK < 0x10000000 ? 28 : \
+ LDBL_EXP_MASK < 0x20000000 ? 29 : \
+ LDBL_EXP_MASK < 0x40000000 ? 30 : \
+ LDBL_EXP_MASK <= 0x7fffffff ? 31 : \
+ 32)
+
+/* Number of bits used for a floating-point number: the mantissa (not
+ counting the "hidden bit", since it may or may not be explicit), the
+ exponent, and the sign. */
+#define FLT_TOTAL_BIT ((FLT_MANT_BIT - 1) + FLT_EXP_BIT + 1)
+#define DBL_TOTAL_BIT ((DBL_MANT_BIT - 1) + DBL_EXP_BIT + 1)
+#define LDBL_TOTAL_BIT ((LDBL_MANT_BIT - 1) + LDBL_EXP_BIT + 1)
+
+/* Number of bytes used for a floating-point number.
+ This can be smaller than the 'sizeof'. For example, on i386 systems,
+ 'long double' most often have LDBL_MANT_BIT = 64, LDBL_EXP_BIT = 16, hence
+ LDBL_TOTAL_BIT = 80 bits, i.e. 10 bytes of consecutive memory, but
+ sizeof (long double) = 12 or = 16. */
+#define SIZEOF_FLT ((FLT_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
+#define SIZEOF_DBL ((DBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
+#define SIZEOF_LDBL ((LDBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
+
+/* Verify that SIZEOF_FLT <= sizeof (float) etc. */
+typedef int verify_sizeof_flt[SIZEOF_FLT <= sizeof (float) ? 1 : -1];
+typedef int verify_sizeof_dbl[SIZEOF_DBL <= sizeof (double) ? 1 : - 1];
+typedef int verify_sizeof_ldbl[SIZEOF_LDBL <= sizeof (long double) ? 1 : - 1];
+
+#endif /* _FLOATPLUS_H */
diff --git a/gl/lib/float.c b/gl/lib/float.c
new file mode 100644
index 0000000..de85064
--- /dev/null
+++ b/gl/lib/float.c
@@ -0,0 +1,33 @@
+/* Auxiliary definitions for <float.h>.
+ Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <float.h>
+
+#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
+const union gl_long_double_union gl_LDBL_MAX =
+ { { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL } };
+#elif defined __i386__
+const union gl_long_double_union gl_LDBL_MAX =
+ { { 0xFFFFFFFF, 0xFFFFFFFF, 32766 } };
+#else
+/* This declaration is solely to ensure that after preprocessing
+ this file is never empty. */
+typedef int dummy;
+#endif
diff --git a/gl/lib/float.in.h b/gl/lib/float.in.h
new file mode 100644
index 0000000..a418376
--- /dev/null
+++ b/gl/lib/float.in.h
@@ -0,0 +1,194 @@
+/* A correct <float.h>.
+
+ Copyright (C) 2007-2022 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 2.1 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/>. */
+
+#ifndef _@GUARD_PREFIX@_FLOAT_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_FLOAT_H@
+
+#ifndef _@GUARD_PREFIX@_FLOAT_H
+#define _@GUARD_PREFIX@_FLOAT_H
+
+/* 'long double' properties. */
+
+#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
+/* Number of mantissa units, in base FLT_RADIX. */
+# undef LDBL_MANT_DIG
+# define LDBL_MANT_DIG 64
+/* Number of decimal digits that is sufficient for representing a number. */
+# undef LDBL_DIG
+# define LDBL_DIG 18
+/* x-1 where x is the smallest representable number > 1. */
+# undef LDBL_EPSILON
+# define LDBL_EPSILON 1.0842021724855044340E-19L
+/* Minimum e such that FLT_RADIX^(e-1) is a normalized number. */
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP (-16381)
+/* Maximum e such that FLT_RADIX^(e-1) is a representable finite number. */
+# undef LDBL_MAX_EXP
+# define LDBL_MAX_EXP 16384
+/* Minimum positive normalized number. */
+# undef LDBL_MIN
+# define LDBL_MIN 3.3621031431120935063E-4932L
+/* Maximum representable finite number. */
+# undef LDBL_MAX
+# define LDBL_MAX 1.1897314953572317650E+4932L
+/* Minimum e such that 10^e is in the range of normalized numbers. */
+# undef LDBL_MIN_10_EXP
+# define LDBL_MIN_10_EXP (-4931)
+/* Maximum e such that 10^e is in the range of representable finite numbers. */
+# undef LDBL_MAX_10_EXP
+# define LDBL_MAX_10_EXP 4932
+#endif
+
+/* On FreeBSD/x86 6.4, the 'long double' type really has only 53 bits of
+ precision in the compiler but 64 bits of precision at runtime. See
+ <https://lists.gnu.org/r/bug-gnulib/2008-07/msg00063.html>. */
+#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
+/* Number of mantissa units, in base FLT_RADIX. */
+# undef LDBL_MANT_DIG
+# define LDBL_MANT_DIG 64
+/* Number of decimal digits that is sufficient for representing a number. */
+# undef LDBL_DIG
+# define LDBL_DIG 18
+/* x-1 where x is the smallest representable number > 1. */
+# undef LDBL_EPSILON
+# define LDBL_EPSILON 1.084202172485504434007452800869941711426e-19L /* 2^-63 */
+/* Minimum e such that FLT_RADIX^(e-1) is a normalized number. */
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP (-16381)
+/* Maximum e such that FLT_RADIX^(e-1) is a representable finite number. */
+# undef LDBL_MAX_EXP
+# define LDBL_MAX_EXP 16384
+/* Minimum positive normalized number. */
+# undef LDBL_MIN
+# define LDBL_MIN 3.362103143112093506262677817321752E-4932L /* = 0x1p-16382L */
+/* Maximum representable finite number. */
+# undef LDBL_MAX
+/* LDBL_MAX is represented as { 0xFFFFFFFF, 0xFFFFFFFF, 32766 }.
+ But the largest literal that GCC allows us to write is
+ 0x0.fffffffffffff8p16384L = { 0xFFFFF800, 0xFFFFFFFF, 32766 }.
+ So, define it like this through a reference to an external variable
+
+ const unsigned int LDBL_MAX[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 32766 };
+ extern const long double LDBL_MAX;
+
+ Unfortunately, this is not a constant expression. */
+# if !GNULIB_defined_long_double_union
+union gl_long_double_union
+ {
+ struct { unsigned int lo; unsigned int hi; unsigned int exponent; } xd;
+ long double ld;
+ };
+# define GNULIB_defined_long_double_union 1
+# endif
+extern const union gl_long_double_union gl_LDBL_MAX;
+# define LDBL_MAX (gl_LDBL_MAX.ld)
+/* Minimum e such that 10^e is in the range of normalized numbers. */
+# undef LDBL_MIN_10_EXP
+# define LDBL_MIN_10_EXP (-4931)
+/* Maximum e such that 10^e is in the range of representable finite numbers. */
+# undef LDBL_MAX_10_EXP
+# define LDBL_MAX_10_EXP 4932
+#endif
+
+/* On AIX 7.1 with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_MAX are
+ wrong.
+ On Linux/PowerPC with gcc 4.4, the value of LDBL_MAX is wrong. */
+#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP DBL_MIN_EXP
+# undef LDBL_MIN_10_EXP
+# define LDBL_MIN_10_EXP DBL_MIN_10_EXP
+# undef LDBL_MIN
+# define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */
+#endif
+#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
+# undef LDBL_MAX
+/* LDBL_MAX is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xFFFFFFFF }.
+ It is not easy to define:
+ #define LDBL_MAX 1.79769313486231580793728971405302307166e308L
+ is too small, whereas
+ #define LDBL_MAX 1.79769313486231580793728971405302307167e308L
+ is too large. Apparently a bug in GCC decimal-to-binary conversion.
+ Also, I can't get values larger than
+ #define LDBL63 ((long double) (1ULL << 63))
+ #define LDBL882 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
+ #define LDBL945 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
+ #define LDBL1008 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
+ #define LDBL_MAX (LDBL1008 * 65535.0L + LDBL945 * (long double) 9223372036821221375ULL + LDBL882 * (long double) 4611686018427387904ULL)
+ which is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xF8000000 }.
+ So, define it like this through a reference to an external variable
+
+ const double LDBL_MAX[2] = { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL };
+ extern const long double LDBL_MAX;
+
+ or through a pointer cast
+
+ #define LDBL_MAX \
+ (*(const long double *) (double[]) { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL })
+
+ Unfortunately, this is not a constant expression, and the latter expression
+ does not work well when GCC is optimizing.. */
+# if !GNULIB_defined_long_double_union
+union gl_long_double_union
+ {
+ struct { double hi; double lo; } dd;
+ long double ld;
+ };
+# define GNULIB_defined_long_double_union 1
+# endif
+extern const union gl_long_double_union gl_LDBL_MAX;
+# define LDBL_MAX (gl_LDBL_MAX.ld)
+#endif
+
+/* On IRIX 6.5, with cc, the value of LDBL_MANT_DIG is wrong.
+ On IRIX 6.5, with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_EPSILON
+ are wrong. */
+#if defined __sgi && (LDBL_MANT_DIG >= 106)
+# undef LDBL_MANT_DIG
+# define LDBL_MANT_DIG 106
+# if defined __GNUC__
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP DBL_MIN_EXP
+# undef LDBL_MIN_10_EXP
+# define LDBL_MIN_10_EXP DBL_MIN_10_EXP
+# undef LDBL_MIN
+# define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */
+# undef LDBL_EPSILON
+# define LDBL_EPSILON 2.46519032881566189191165176650870696773e-32L /* 2^-105 */
+# endif
+#endif
+
+#if @REPLACE_ITOLD@
+/* Pull in a function that fixes the 'int' to 'long double' conversion
+ of glibc 2.7. */
+extern
+# ifdef __cplusplus
+"C"
+# endif
+void _Qp_itoq (long double *, int);
+static void (*_gl_float_fix_itold) (long double *, int) = _Qp_itoq;
+#endif
+
+#endif /* _@GUARD_PREFIX@_FLOAT_H */
+#endif /* _@GUARD_PREFIX@_FLOAT_H */
diff --git a/gl/lib/flock.c b/gl/lib/flock.c
new file mode 100644
index 0000000..28773d5
--- /dev/null
+++ b/gl/lib/flock.c
@@ -0,0 +1,224 @@
+/* Emulate flock on platforms that lack it, primarily Windows and MinGW.
+
+ This is derived from sqlite3 sources.
+ https://www.sqlite.org/src/finfo?name=src/os_win.c
+ https://www.sqlite.org/copyright.html
+
+ Written by Richard W.M. Jones <rjones.at.redhat.com>
+
+ Copyright (C) 2008-2022 Free Software Foundation, Inc.
+
+ This library 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 2.1 of the License, or (at your option) any later version.
+
+ This library 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/>. */
+
+#include <config.h>
+#include <sys/file.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+
+/* LockFileEx */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+
+# include <errno.h>
+
+/* _get_osfhandle */
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+
+/* Determine the current size of a file. Because the other braindead
+ * APIs we'll call need lower/upper 32 bit pairs, keep the file size
+ * like that too.
+ */
+static BOOL
+file_size (HANDLE h, DWORD * lower, DWORD * upper)
+{
+ *lower = GetFileSize (h, upper);
+ return 1;
+}
+
+/* LOCKFILE_FAIL_IMMEDIATELY is undefined on some Windows systems. */
+# ifndef LOCKFILE_FAIL_IMMEDIATELY
+# define LOCKFILE_FAIL_IMMEDIATELY 1
+# endif
+
+/* Acquire a lock. */
+static BOOL
+do_lock (HANDLE h, int non_blocking, int exclusive)
+{
+ BOOL res;
+ DWORD size_lower, size_upper;
+ OVERLAPPED ovlp;
+ int flags = 0;
+
+ /* We're going to lock the whole file, so get the file size. */
+ res = file_size (h, &size_lower, &size_upper);
+ if (!res)
+ return 0;
+
+ /* Start offset is 0, and also zero the remaining members of this struct. */
+ memset (&ovlp, 0, sizeof ovlp);
+
+ if (non_blocking)
+ flags |= LOCKFILE_FAIL_IMMEDIATELY;
+ if (exclusive)
+ flags |= LOCKFILE_EXCLUSIVE_LOCK;
+
+ return LockFileEx (h, flags, 0, size_lower, size_upper, &ovlp);
+}
+
+/* Unlock reader or exclusive lock. */
+static BOOL
+do_unlock (HANDLE h)
+{
+ int res;
+ DWORD size_lower, size_upper;
+
+ res = file_size (h, &size_lower, &size_upper);
+ if (!res)
+ return 0;
+
+ return UnlockFile (h, 0, 0, size_lower, size_upper);
+}
+
+/* Now our BSD-like flock operation. */
+int
+flock (int fd, int operation)
+{
+ HANDLE h = (HANDLE) _get_osfhandle (fd);
+ DWORD res;
+ int non_blocking;
+
+ if (h == INVALID_HANDLE_VALUE)
+ {
+ errno = EBADF;
+ return -1;
+ }
+
+ non_blocking = operation & LOCK_NB;
+ operation &= ~LOCK_NB;
+
+ switch (operation)
+ {
+ case LOCK_SH:
+ res = do_lock (h, non_blocking, 0);
+ break;
+ case LOCK_EX:
+ res = do_lock (h, non_blocking, 1);
+ break;
+ case LOCK_UN:
+ res = do_unlock (h);
+ break;
+ default:
+ errno = EINVAL;
+ return -1;
+ }
+
+ /* Map Windows errors into Unix errnos. As usual MSDN fails to
+ * document the permissible error codes.
+ */
+ if (!res)
+ {
+ DWORD err = GetLastError ();
+ switch (err)
+ {
+ /* This means someone else is holding a lock. */
+ case ERROR_LOCK_VIOLATION:
+ errno = EAGAIN;
+ break;
+
+ /* Out of memory. */
+ case ERROR_NOT_ENOUGH_MEMORY:
+ errno = ENOMEM;
+ break;
+
+ case ERROR_BAD_COMMAND:
+ errno = EINVAL;
+ break;
+
+ /* Unlikely to be other errors, but at least don't lose the
+ * error code.
+ */
+ default:
+ errno = err;
+ }
+
+ return -1;
+ }
+
+ return 0;
+}
+
+#else /* !Windows */
+
+# ifdef HAVE_STRUCT_FLOCK_L_TYPE
+/* We know how to implement flock in terms of fcntl. */
+
+# include <fcntl.h>
+
+# ifdef HAVE_UNISTD_H
+# include <unistd.h>
+# endif
+
+# include <errno.h>
+# include <string.h>
+
+int
+flock (int fd, int operation)
+{
+ int cmd, r;
+ struct flock fl;
+
+ if (operation & LOCK_NB)
+ cmd = F_SETLK;
+ else
+ cmd = F_SETLKW;
+ operation &= ~LOCK_NB;
+
+ memset (&fl, 0, sizeof fl);
+ fl.l_whence = SEEK_SET;
+ /* l_start & l_len are 0, which as a special case means "whole file". */
+
+ switch (operation)
+ {
+ case LOCK_SH:
+ fl.l_type = F_RDLCK;
+ break;
+ case LOCK_EX:
+ fl.l_type = F_WRLCK;
+ break;
+ case LOCK_UN:
+ fl.l_type = F_UNLCK;
+ break;
+ default:
+ errno = EINVAL;
+ return -1;
+ }
+
+ r = fcntl (fd, cmd, &fl);
+ if (r == -1 && errno == EACCES)
+ errno = EAGAIN;
+
+ return r;
+}
+
+# else /* !HAVE_STRUCT_FLOCK_L_TYPE */
+
+# error "This platform lacks flock function, and Gnulib doesn't provide a replacement. This is a bug in Gnulib."
+
+# endif /* !HAVE_STRUCT_FLOCK_L_TYPE */
+
+#endif /* !Windows */
diff --git a/gl/lib/fnmatch.c b/gl/lib/fnmatch.c
new file mode 100644
index 0000000..b33a127
--- /dev/null
+++ b/gl/lib/fnmatch.c
@@ -0,0 +1,361 @@
+/* Copyright (C) 1991-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+/* Enable GNU extensions in fnmatch.h. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#include <fnmatch.h>
+
+#include <assert.h>
+#include <errno.h>
+#include <ctype.h>
+#include <string.h>
+#include <stdlib.h>
+#if defined _LIBC || HAVE_ALLOCA
+# include <alloca.h>
+#endif
+#include <wchar.h>
+#include <wctype.h>
+#include <stddef.h>
+#include <stdbool.h>
+
+/* We need some of the locale data (the collation sequence information)
+ but there is no interface to get this information in general. Therefore
+ we support a correct implementation only in glibc. */
+#ifdef _LIBC
+# include "../locale/localeinfo.h"
+# include "../locale/coll-lookup.h"
+# include <shlib-compat.h>
+
+# define CONCAT(a,b) __CONCAT(a,b)
+# define btowc __btowc
+# define iswctype __iswctype
+# define mbsrtowcs __mbsrtowcs
+# define mempcpy __mempcpy
+# define strnlen __strnlen
+# define towlower __towlower
+# define wcscat __wcscat
+# define wcslen __wcslen
+# define wctype __wctype
+# define wmemchr __wmemchr
+# define wmempcpy __wmempcpy
+# define fnmatch __fnmatch
+extern int fnmatch (const char *pattern, const char *string, int flags);
+#endif
+
+#ifdef _LIBC
+# if __GNUC__ >= 7
+# define FALLTHROUGH __attribute__ ((__fallthrough__))
+# else
+# define FALLTHROUGH ((void) 0)
+# endif
+#else
+# include "attribute.h"
+#endif
+
+#include <intprops.h>
+#include <flexmember.h>
+
+#ifdef _LIBC
+typedef ptrdiff_t idx_t;
+#else
+# include "idx.h"
+#endif
+
+/* We often have to test for FNM_FILE_NAME and FNM_PERIOD being both set. */
+#define NO_LEADING_PERIOD(flags) \
+ ((flags & (FNM_FILE_NAME | FNM_PERIOD)) == (FNM_FILE_NAME | FNM_PERIOD))
+
+#ifndef _LIBC
+# if HAVE_ALLOCA
+/* The OS usually guarantees only one guard page at the bottom of the stack,
+ and a page size can be as small as 4096 bytes. So we cannot safely
+ allocate anything larger than 4096 bytes. Also care for the possibility
+ of a few compiler-allocated temporary stack slots. */
+# define __libc_use_alloca(n) ((n) < 4032)
+# else
+/* Just use malloc. */
+# define __libc_use_alloca(n) false
+# undef alloca
+# define alloca(n) malloc (n)
+# endif
+# define alloca_account(size, avar) ((avar) += (size), alloca (size))
+#endif
+
+/* Provide support for user-defined character classes, based on the functions
+ from ISO C 90 amendment 1. */
+#ifdef CHARCLASS_NAME_MAX
+# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
+#else
+/* This shouldn't happen but some implementation might still have this
+ problem. Use a reasonable default value. */
+# define CHAR_CLASS_MAX_LENGTH 256
+#endif
+
+#define IS_CHAR_CLASS(string) wctype (string)
+
+/* Avoid depending on library functions or files
+ whose names are inconsistent. */
+
+/* Global variable. */
+static int posixly_correct;
+
+/* Note that this evaluates C many times. */
+#define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c))
+#define CHAR char
+#define UCHAR unsigned char
+#define INT int
+#define FCT internal_fnmatch
+#define EXT ext_match
+#define END end_pattern
+#define STRUCT fnmatch_struct
+#define L_(CS) CS
+#define BTOWC(C) btowc (C)
+#define STRLEN(S) strlen (S)
+#define STRCAT(D, S) strcat (D, S)
+#define MEMPCPY(D, S, N) mempcpy (D, S, N)
+#define MEMCHR(S, C, N) memchr (S, C, N)
+#define WIDE_CHAR_VERSION 0
+#ifdef _LIBC
+# include <locale/weight.h>
+# define FINDIDX findidx
+#endif
+#include "fnmatch_loop.c"
+
+
+#define FOLD(c) ((flags & FNM_CASEFOLD) ? towlower (c) : (c))
+#define CHAR wchar_t
+#define UCHAR wint_t
+#define INT wint_t
+#define FCT internal_fnwmatch
+#define EXT ext_wmatch
+#define END end_wpattern
+#define L_(CS) L##CS
+#define BTOWC(C) (C)
+#define STRLEN(S) wcslen (S)
+#define STRCAT(D, S) wcscat (D, S)
+#define MEMPCPY(D, S, N) wmempcpy (D, S, N)
+#define MEMCHR(S, C, N) wmemchr (S, C, N)
+#define WIDE_CHAR_VERSION 1
+#ifdef _LIBC
+/* Change the name the header defines so it doesn't conflict with
+ the <locale/weight.h> version included above. */
+# define findidx findidxwc
+# include <locale/weightwc.h>
+# undef findidx
+# define FINDIDX findidxwc
+#endif
+
+#undef IS_CHAR_CLASS
+/* We have to convert the wide character string in a multibyte string. But
+ we know that the character class names consist of alphanumeric characters
+ from the portable character set, and since the wide character encoding
+ for a member of the portable character set is the same code point as
+ its single-byte encoding, we can use a simplified method to convert the
+ string to a multibyte character string. */
+static wctype_t
+is_char_class (const wchar_t *wcs)
+{
+ char s[CHAR_CLASS_MAX_LENGTH + 1];
+ char *cp = s;
+
+ do
+ {
+ /* Test for a printable character from the portable character set. */
+#ifdef _LIBC
+ if (*wcs < 0x20 || *wcs > 0x7e
+ || *wcs == 0x24 || *wcs == 0x40 || *wcs == 0x60)
+ return (wctype_t) 0;
+#else
+ switch (*wcs)
+ {
+ case L' ': case L'!': case L'"': case L'#': case L'%':
+ case L'&': case L'\'': case L'(': case L')': case L'*':
+ case L'+': case L',': case L'-': case L'.': case L'/':
+ case L'0': case L'1': case L'2': case L'3': case L'4':
+ case L'5': case L'6': case L'7': case L'8': case L'9':
+ case L':': case L';': case L'<': case L'=': case L'>':
+ case L'?':
+ case L'A': case L'B': case L'C': case L'D': case L'E':
+ case L'F': case L'G': case L'H': case L'I': case L'J':
+ case L'K': case L'L': case L'M': case L'N': case L'O':
+ case L'P': case L'Q': case L'R': case L'S': case L'T':
+ case L'U': case L'V': case L'W': case L'X': case L'Y':
+ case L'Z':
+ case L'[': case L'\\': case L']': case L'^': case L'_':
+ case L'a': case L'b': case L'c': case L'd': case L'e':
+ case L'f': case L'g': case L'h': case L'i': case L'j':
+ case L'k': case L'l': case L'm': case L'n': case L'o':
+ case L'p': case L'q': case L'r': case L's': case L't':
+ case L'u': case L'v': case L'w': case L'x': case L'y':
+ case L'z': case L'{': case L'|': case L'}': case L'~':
+ break;
+ default:
+ return (wctype_t) 0;
+ }
+#endif
+
+ /* Avoid overrunning the buffer. */
+ if (cp == s + CHAR_CLASS_MAX_LENGTH)
+ return (wctype_t) 0;
+
+ *cp++ = (char) *wcs++;
+ }
+ while (*wcs != L'\0');
+
+ *cp = '\0';
+
+ return wctype (s);
+}
+#define IS_CHAR_CLASS(string) is_char_class (string)
+
+#include "fnmatch_loop.c"
+
+
+int
+fnmatch (const char *pattern, const char *string, int flags)
+{
+ if (__glibc_unlikely (MB_CUR_MAX != 1))
+ {
+ mbstate_t ps;
+ size_t n;
+ const char *p;
+ wchar_t *wpattern_malloc = NULL;
+ wchar_t *wpattern;
+ wchar_t *wstring_malloc = NULL;
+ wchar_t *wstring;
+ size_t alloca_used = 0;
+
+ /* Convert the strings into wide characters. */
+ memset (&ps, '\0', sizeof (ps));
+ p = pattern;
+ n = strnlen (pattern, 1024);
+ if (__glibc_likely (n < 1024))
+ {
+ wpattern = (wchar_t *) alloca_account ((n + 1) * sizeof (wchar_t),
+ alloca_used);
+ n = mbsrtowcs (wpattern, &p, n + 1, &ps);
+ if (__glibc_unlikely (n == (size_t) -1))
+ /* Something wrong.
+ XXX Do we have to set 'errno' to something which mbsrtows hasn't
+ already done? */
+ return -1;
+ if (p)
+ {
+ memset (&ps, '\0', sizeof (ps));
+ goto prepare_wpattern;
+ }
+ }
+ else
+ {
+ prepare_wpattern:
+ n = mbsrtowcs (NULL, &pattern, 0, &ps);
+ if (__glibc_unlikely (n == (size_t) -1))
+ /* Something wrong.
+ XXX Do we have to set 'errno' to something which mbsrtows hasn't
+ already done? */
+ return -1;
+ if (__glibc_unlikely (n >= (size_t) -1 / sizeof (wchar_t)))
+ {
+ __set_errno (ENOMEM);
+ return -2;
+ }
+ wpattern_malloc = wpattern
+ = (wchar_t *) malloc ((n + 1) * sizeof (wchar_t));
+ assert (mbsinit (&ps));
+ if (wpattern == NULL)
+ return -2;
+ (void) mbsrtowcs (wpattern, &pattern, n + 1, &ps);
+ }
+
+ assert (mbsinit (&ps));
+ n = strnlen (string, 1024);
+ p = string;
+ if (__glibc_likely (n < 1024))
+ {
+ wstring = (wchar_t *) alloca_account ((n + 1) * sizeof (wchar_t),
+ alloca_used);
+ n = mbsrtowcs (wstring, &p, n + 1, &ps);
+ if (__glibc_unlikely (n == (size_t) -1))
+ {
+ /* Something wrong.
+ XXX Do we have to set 'errno' to something which
+ mbsrtows hasn't already done? */
+ free_return:
+ free (wpattern_malloc);
+ return -1;
+ }
+ if (p)
+ {
+ memset (&ps, '\0', sizeof (ps));
+ goto prepare_wstring;
+ }
+ }
+ else
+ {
+ prepare_wstring:
+ n = mbsrtowcs (NULL, &string, 0, &ps);
+ if (__glibc_unlikely (n == (size_t) -1))
+ /* Something wrong.
+ XXX Do we have to set 'errno' to something which mbsrtows hasn't
+ already done? */
+ goto free_return;
+ if (__glibc_unlikely (n >= (size_t) -1 / sizeof (wchar_t)))
+ {
+ free (wpattern_malloc);
+ __set_errno (ENOMEM);
+ return -2;
+ }
+
+ wstring_malloc = wstring
+ = (wchar_t *) malloc ((n + 1) * sizeof (wchar_t));
+ if (wstring == NULL)
+ {
+ free (wpattern_malloc);
+ return -2;
+ }
+ assert (mbsinit (&ps));
+ (void) mbsrtowcs (wstring, &string, n + 1, &ps);
+ }
+
+ int res = internal_fnwmatch (wpattern, wstring, wstring + n,
+ flags & FNM_PERIOD, flags, NULL,
+ alloca_used);
+
+ free (wstring_malloc);
+ free (wpattern_malloc);
+
+ return res;
+ }
+
+ return internal_fnmatch (pattern, string, string + strlen (string),
+ flags & FNM_PERIOD, flags, NULL, 0);
+}
+
+#undef fnmatch
+versioned_symbol (libc, __fnmatch, fnmatch, GLIBC_2_2_3);
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_3)
+strong_alias (__fnmatch, __fnmatch_old)
+compat_symbol (libc, __fnmatch_old, fnmatch, GLIBC_2_0);
+#endif
+libc_hidden_ver (__fnmatch, fnmatch)
diff --git a/gl/lib/fnmatch.in.h b/gl/lib/fnmatch.in.h
new file mode 100644
index 0000000..a282c09
--- /dev/null
+++ b/gl/lib/fnmatch.in.h
@@ -0,0 +1,110 @@
+/* Substitute for and wrapper around <fnmatch.h>.
+ Copyright (C) 1991-1993, 1996-1999, 2001-2003, 2005, 2007, 2009-2022 Free
+ Software Foundation, Inc.
+
+ This file is part of the GNU C Library.
+
+ 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 2.1 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/>. */
+
+#ifndef _@GUARD_PREFIX@_FNMATCH_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_FNMATCH_H@ && !@REPLACE_FNMATCH@
+# @INCLUDE_NEXT@ @NEXT_FNMATCH_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_FNMATCH_H
+#define _@GUARD_PREFIX@_FNMATCH_H
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+#if !@HAVE_FNMATCH_H@ || @REPLACE_FNMATCH@
+
+/* We #undef these before defining them because some losing systems
+ (HP-UX A.08.07 for example) define these in <unistd.h>. */
+#undef FNM_PATHNAME
+#undef FNM_NOESCAPE
+#undef FNM_PERIOD
+
+/* Bits set in the FLAGS argument to 'fnmatch'. */
+#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match '/'. */
+#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
+#define FNM_PERIOD (1 << 2) /* Leading '.' is matched only explicitly. */
+
+#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
+# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
+# define FNM_LEADING_DIR (1 << 3) /* Ignore '/...' after a match. */
+# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
+# define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching. */
+#endif
+
+/* Value returned by 'fnmatch' if STRING does not match PATTERN. */
+#define FNM_NOMATCH 1
+
+/* This value is returned if the implementation does not support
+ 'fnmatch'. Since this is not the case here it will never be
+ returned but the conformance test suites still require the symbol
+ to be defined. */
+#ifdef _XOPEN_SOURCE
+# define FNM_NOSYS (-1)
+#endif
+
+#endif
+
+
+#if @GNULIB_FNMATCH@
+/* Match NAME against the file name pattern PATTERN,
+ returning zero if it matches, FNM_NOMATCH if not. */
+# if @REPLACE_FNMATCH@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define fnmatch rpl_fnmatch
+# endif
+_GL_FUNCDECL_RPL (fnmatch, int,
+ (const char *pattern, const char *name, int flags)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (fnmatch, int,
+ (const char *pattern, const char *name, int flags));
+# else
+# if !@HAVE_FNMATCH@
+_GL_FUNCDECL_SYS (fnmatch, int,
+ (const char *pattern, const char *name, int flags)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (fnmatch, int,
+ (const char *pattern, const char *name, int flags));
+# endif
+# if !GNULIB_FNMATCH_GNU && __GLIBC__ >= 2
+_GL_CXXALIASWARN (fnmatch);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef fnmatch
+# if HAVE_RAW_DECL_FNMATCH
+_GL_WARN_ON_USE (fnmatch,
+ "fnmatch does not portably work - "
+ "use gnulib module fnmatch for portability or gnulib module fnmatch-gnu for a glibc compatible implementation");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_FNMATCH_H */
+#endif /* _@GUARD_PREFIX@_FNMATCH_H */
diff --git a/gl/lib/fnmatch_loop.c b/gl/lib/fnmatch_loop.c
new file mode 100644
index 0000000..e635953
--- /dev/null
+++ b/gl/lib/fnmatch_loop.c
@@ -0,0 +1,1211 @@
+/* Copyright (C) 1991-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifdef _LIBC
+# include <stdint.h>
+#endif
+
+struct STRUCT
+{
+ const CHAR *pattern;
+ const CHAR *string;
+ bool no_leading_period;
+};
+
+/* Match STRING against the file name pattern PATTERN, returning zero if
+ it matches, nonzero if not. */
+static int FCT (const CHAR *pattern, const CHAR *string,
+ const CHAR *string_end, bool no_leading_period, int flags,
+ struct STRUCT *ends, size_t alloca_used);
+static int EXT (INT opt, const CHAR *pattern, const CHAR *string,
+ const CHAR *string_end, bool no_leading_period, int flags,
+ size_t alloca_used);
+static const CHAR *END (const CHAR *patternp);
+
+static int
+FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
+ bool no_leading_period, int flags, struct STRUCT *ends, size_t alloca_used)
+{
+ const CHAR *p = pattern, *n = string;
+ UCHAR c;
+#ifdef _LIBC
+# if WIDE_CHAR_VERSION
+ const char *collseq = (const char *)
+ _NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQWC);
+# else
+ const UCHAR *collseq = (const UCHAR *)
+ _NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQMB);
+# endif
+#endif
+
+ while ((c = *p++) != L_('\0'))
+ {
+ bool new_no_leading_period = false;
+ c = FOLD (c);
+
+ switch (c)
+ {
+ case L_('?'):
+ if (__glibc_unlikely (flags & FNM_EXTMATCH) && *p == '(')
+ {
+ int res = EXT (c, p, n, string_end, no_leading_period,
+ flags, alloca_used);
+ if (res != -1)
+ return res;
+ }
+
+ if (n == string_end)
+ return FNM_NOMATCH;
+ else if (*n == L_('/') && (flags & FNM_FILE_NAME))
+ return FNM_NOMATCH;
+ else if (*n == L_('.') && no_leading_period)
+ return FNM_NOMATCH;
+ break;
+
+ case L_('\\'):
+ if (!(flags & FNM_NOESCAPE))
+ {
+ c = *p++;
+ if (c == L_('\0'))
+ /* Trailing \ loses. */
+ return FNM_NOMATCH;
+ c = FOLD (c);
+ }
+ if (n == string_end || FOLD ((UCHAR) *n) != c)
+ return FNM_NOMATCH;
+ break;
+
+ case L_('*'):
+ if (__glibc_unlikely (flags & FNM_EXTMATCH) && *p == '(')
+ {
+ int res = EXT (c, p, n, string_end, no_leading_period,
+ flags, alloca_used);
+ if (res != -1)
+ return res;
+ }
+ else if (ends != NULL)
+ {
+ ends->pattern = p - 1;
+ ends->string = n;
+ ends->no_leading_period = no_leading_period;
+ return 0;
+ }
+
+ if (n != string_end && *n == L_('.') && no_leading_period)
+ return FNM_NOMATCH;
+
+ for (c = *p++; c == L_('?') || c == L_('*'); c = *p++)
+ {
+ if (*p == L_('(') && (flags & FNM_EXTMATCH) != 0)
+ {
+ const CHAR *endp = END (p);
+ if (endp != p)
+ {
+ /* This is a pattern. Skip over it. */
+ p = endp;
+ continue;
+ }
+ }
+
+ if (c == L_('?'))
+ {
+ /* A ? needs to match one character. */
+ if (n == string_end)
+ /* There isn't another character; no match. */
+ return FNM_NOMATCH;
+ else if (*n == L_('/')
+ && __glibc_unlikely (flags & FNM_FILE_NAME))
+ /* A slash does not match a wildcard under
+ FNM_FILE_NAME. */
+ return FNM_NOMATCH;
+ else
+ /* One character of the string is consumed in matching
+ this ? wildcard, so *??? won't match if there are
+ less than three characters. */
+ ++n;
+ }
+ }
+
+ if (c == L_('\0'))
+ /* The wildcard(s) is/are the last element of the pattern.
+ If the name is a file name and contains another slash
+ this means it cannot match, unless the FNM_LEADING_DIR
+ flag is set. */
+ {
+ int result = (flags & FNM_FILE_NAME) == 0 ? 0 : FNM_NOMATCH;
+
+ if (flags & FNM_FILE_NAME)
+ {
+ if (flags & FNM_LEADING_DIR)
+ result = 0;
+ else
+ {
+ if (MEMCHR (n, L_('/'), string_end - n) == NULL)
+ result = 0;
+ }
+ }
+
+ return result;
+ }
+ else
+ {
+ const CHAR *endp;
+ struct STRUCT end;
+
+ end.pattern = NULL;
+ endp = MEMCHR (n, (flags & FNM_FILE_NAME) ? L_('/') : L_('\0'),
+ string_end - n);
+ if (endp == NULL)
+ endp = string_end;
+
+ if (c == L_('[')
+ || (__glibc_unlikely (flags & FNM_EXTMATCH)
+ && (c == L_('@') || c == L_('+') || c == L_('!'))
+ && *p == L_('(')))
+ {
+ int flags2 = ((flags & FNM_FILE_NAME)
+ ? flags : (flags & ~FNM_PERIOD));
+
+ for (--p; n < endp; ++n, no_leading_period = false)
+ if (FCT (p, n, string_end, no_leading_period, flags2,
+ &end, alloca_used) == 0)
+ goto found;
+ }
+ else if (c == L_('/') && (flags & FNM_FILE_NAME))
+ {
+ while (n < string_end && *n != L_('/'))
+ ++n;
+ if (n < string_end && *n == L_('/')
+ && (FCT (p, n + 1, string_end, flags & FNM_PERIOD, flags,
+ NULL, alloca_used) == 0))
+ return 0;
+ }
+ else
+ {
+ int flags2 = ((flags & FNM_FILE_NAME)
+ ? flags : (flags & ~FNM_PERIOD));
+
+ if (c == L_('\\') && !(flags & FNM_NOESCAPE))
+ c = *p;
+ c = FOLD (c);
+ for (--p; n < endp; ++n, no_leading_period = false)
+ if (FOLD ((UCHAR) *n) == c
+ && (FCT (p, n, string_end, no_leading_period, flags2,
+ &end, alloca_used) == 0))
+ {
+ found:
+ if (end.pattern == NULL)
+ return 0;
+ break;
+ }
+ if (end.pattern != NULL)
+ {
+ p = end.pattern;
+ n = end.string;
+ no_leading_period = end.no_leading_period;
+ continue;
+ }
+ }
+ }
+
+ /* If we come here no match is possible with the wildcard. */
+ return FNM_NOMATCH;
+
+ case L_('['):
+ {
+ /* Nonzero if the sense of the character class is inverted. */
+ const CHAR *p_init = p;
+ const CHAR *n_init = n;
+ bool not;
+ CHAR cold;
+ UCHAR fn;
+
+ if (posixly_correct == 0)
+ posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
+
+ if (n == string_end)
+ return FNM_NOMATCH;
+
+ if (*n == L_('.') && no_leading_period)
+ return FNM_NOMATCH;
+
+ if (*n == L_('/') && (flags & FNM_FILE_NAME))
+ /* '/' cannot be matched. */
+ return FNM_NOMATCH;
+
+ not = (*p == L_('!') || (posixly_correct < 0 && *p == L_('^')));
+ if (not)
+ ++p;
+
+ fn = FOLD ((UCHAR) *n);
+
+ c = *p++;
+ for (;;)
+ {
+ if (!(flags & FNM_NOESCAPE) && c == L_('\\'))
+ {
+ if (*p == L_('\0'))
+ return FNM_NOMATCH;
+ c = FOLD ((UCHAR) *p);
+ ++p;
+
+ goto normal_bracket;
+ }
+ else if (c == L_('[') && *p == L_(':'))
+ {
+ /* Leave room for the null. */
+ CHAR str[CHAR_CLASS_MAX_LENGTH + 1];
+ size_t c1 = 0;
+ wctype_t wt;
+ const CHAR *startp = p;
+
+ for (;;)
+ {
+ if (c1 == CHAR_CLASS_MAX_LENGTH)
+ /* The name is too long and therefore the pattern
+ is ill-formed. */
+ return FNM_NOMATCH;
+
+ c = *++p;
+ if (c == L_(':') && p[1] == L_(']'))
+ {
+ p += 2;
+ break;
+ }
+ if (c < L_('a') || c >= L_('z'))
+ {
+ /* This cannot possibly be a character class name.
+ Match it as a normal range. */
+ p = startp;
+ c = L_('[');
+ goto normal_bracket;
+ }
+ str[c1++] = c;
+ }
+ str[c1] = L_('\0');
+
+ wt = IS_CHAR_CLASS (str);
+ if (wt == 0)
+ /* Invalid character class name. */
+ return FNM_NOMATCH;
+
+#if defined _LIBC && ! WIDE_CHAR_VERSION
+ /* The following code is glibc specific but does
+ there a good job in speeding up the code since
+ we can avoid the btowc() call. */
+ if (_ISCTYPE ((UCHAR) *n, wt))
+ goto matched;
+#else
+ if (iswctype (BTOWC ((UCHAR) *n), wt))
+ goto matched;
+#endif
+ c = *p++;
+ }
+#ifdef _LIBC
+ else if (c == L_('[') && *p == L_('='))
+ {
+ /* It's important that STR be a scalar variable rather
+ than a one-element array, because GCC (at least 4.9.2
+ -O2 on x86-64) can be confused by the array and
+ diagnose a "used initialized" in a dead branch in the
+ findidx function. */
+ UCHAR str;
+ uint32_t nrules =
+ _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+ const CHAR *startp = p;
+
+ c = *++p;
+ if (c == L_('\0'))
+ {
+ p = startp;
+ c = L_('[');
+ goto normal_bracket;
+ }
+ str = c;
+
+ c = *++p;
+ if (c != L_('=') || p[1] != L_(']'))
+ {
+ p = startp;
+ c = L_('[');
+ goto normal_bracket;
+ }
+ p += 2;
+
+ if (nrules == 0)
+ {
+ if ((UCHAR) *n == str)
+ goto matched;
+ }
+ else
+ {
+ const int32_t *table;
+# if WIDE_CHAR_VERSION
+ const int32_t *weights;
+ const wint_t *extra;
+# else
+ const unsigned char *weights;
+ const unsigned char *extra;
+# endif
+ const int32_t *indirect;
+ int32_t idx;
+ const UCHAR *cp = (const UCHAR *) &str;
+
+# if WIDE_CHAR_VERSION
+ table = (const int32_t *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEWC);
+ weights = (const int32_t *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTWC);
+ extra = (const wint_t *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAWC);
+ indirect = (const int32_t *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTWC);
+# else
+ table = (const int32_t *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
+ weights = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTMB);
+ extra = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB);
+ indirect = (const int32_t *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB);
+# endif
+
+ idx = FINDIDX (table, indirect, extra, &cp, 1);
+ if (idx != 0)
+ {
+ /* We found a table entry. Now see whether the
+ character we are currently at has the same
+ equivalence class value. */
+ int len = weights[idx & 0xffffff];
+ int32_t idx2;
+ const UCHAR *np = (const UCHAR *) n;
+
+ idx2 = FINDIDX (table, indirect, extra,
+ &np, string_end - n);
+ if (idx2 != 0
+ && (idx >> 24) == (idx2 >> 24)
+ && len == weights[idx2 & 0xffffff])
+ {
+ int cnt = 0;
+
+ idx &= 0xffffff;
+ idx2 &= 0xffffff;
+
+ while (cnt < len
+ && (weights[idx + 1 + cnt]
+ == weights[idx2 + 1 + cnt]))
+ ++cnt;
+
+ if (cnt == len)
+ goto matched;
+ }
+ }
+ }
+
+ c = *p++;
+ }
+#endif
+ else if (c == L_('\0'))
+ {
+ /* [ unterminated, treat as normal character. */
+ p = p_init;
+ n = n_init;
+ c = L_('[');
+ goto normal_match;
+ }
+ else
+ {
+ bool is_range = false;
+
+#ifdef _LIBC
+ bool is_seqval = false;
+
+ if (c == L_('[') && *p == L_('.'))
+ {
+ uint32_t nrules =
+ _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+ const CHAR *startp = p;
+ size_t c1 = 0;
+
+ while (1)
+ {
+ c = *++p;
+ if (c == L_('.') && p[1] == L_(']'))
+ {
+ p += 2;
+ break;
+ }
+ if (c == '\0')
+ return FNM_NOMATCH;
+ ++c1;
+ }
+
+ /* We have to handling the symbols differently in
+ ranges since then the collation sequence is
+ important. */
+ is_range = *p == L_('-') && p[1] != L_('\0');
+
+ if (nrules == 0)
+ {
+ /* There are no names defined in the collation
+ data. Therefore we only accept the trivial
+ names consisting of the character itself. */
+ if (c1 != 1)
+ return FNM_NOMATCH;
+
+ if (!is_range && *n == startp[1])
+ goto matched;
+
+ cold = startp[1];
+ c = *p++;
+ }
+ else
+ {
+ int32_t table_size;
+ const int32_t *symb_table;
+ const unsigned char *extra;
+ int32_t idx;
+ int32_t elem;
+# if WIDE_CHAR_VERSION
+ CHAR *wextra;
+# endif
+
+ table_size =
+ _NL_CURRENT_WORD (LC_COLLATE,
+ _NL_COLLATE_SYMB_HASH_SIZEMB);
+ symb_table = (const int32_t *)
+ _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_SYMB_TABLEMB);
+ extra = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_SYMB_EXTRAMB);
+
+ for (elem = 0; elem < table_size; elem++)
+ if (symb_table[2 * elem] != 0)
+ {
+ idx = symb_table[2 * elem + 1];
+ /* Skip the name of collating element. */
+ idx += 1 + extra[idx];
+# if WIDE_CHAR_VERSION
+ /* Skip the byte sequence of the
+ collating element. */
+ idx += 1 + extra[idx];
+ /* Adjust for the alignment. */
+ idx = (idx + 3) & ~3;
+
+ wextra = (CHAR *) &extra[idx + 4];
+
+ if (/* Compare the length of the sequence. */
+ c1 == wextra[0]
+ /* Compare the wide char sequence. */
+ && (__wmemcmp (startp + 1, &wextra[1],
+ c1)
+ == 0))
+ /* Yep, this is the entry. */
+ break;
+# else
+ if (/* Compare the length of the sequence. */
+ c1 == extra[idx]
+ /* Compare the byte sequence. */
+ && memcmp (startp + 1,
+ &extra[idx + 1], c1) == 0)
+ /* Yep, this is the entry. */
+ break;
+# endif
+ }
+
+ if (elem < table_size)
+ {
+ /* Compare the byte sequence but only if
+ this is not part of a range. */
+ if (! is_range
+
+# if WIDE_CHAR_VERSION
+ && __wmemcmp (n, &wextra[1], c1) == 0
+# else
+ && memcmp (n, &extra[idx + 1], c1) == 0
+# endif
+ )
+ {
+ n += c1 - 1;
+ goto matched;
+ }
+
+ /* Get the collation sequence value. */
+ is_seqval = true;
+# if WIDE_CHAR_VERSION
+ cold = wextra[1 + wextra[0]];
+# else
+ idx += 1 + extra[idx];
+ /* Adjust for the alignment. */
+ idx = (idx + 3) & ~3;
+ cold = *((int32_t *) &extra[idx]);
+# endif
+
+ c = *p++;
+ }
+ else if (c1 == 1)
+ {
+ /* No valid character. Match it as a
+ single byte. */
+ if (!is_range && *n == startp[1])
+ goto matched;
+
+ cold = startp[1];
+ c = *p++;
+ }
+ else
+ return FNM_NOMATCH;
+ }
+ }
+ else
+#endif
+ {
+ c = FOLD (c);
+ normal_bracket:
+
+ /* We have to handling the symbols differently in
+ ranges since then the collation sequence is
+ important. */
+ is_range = (*p == L_('-') && p[1] != L_('\0')
+ && p[1] != L_(']'));
+
+ if (!is_range && c == fn)
+ goto matched;
+
+#if _LIBC
+ /* This is needed if we goto normal_bracket; from
+ outside of is_seqval's scope. */
+ is_seqval = false;
+#endif
+ cold = c;
+ c = *p++;
+ }
+
+ if (c == L_('-') && *p != L_(']'))
+ {
+#if _LIBC
+ /* We have to find the collation sequence
+ value for C. Collation sequence is nothing
+ we can regularly access. The sequence
+ value is defined by the order in which the
+ definitions of the collation values for the
+ various characters appear in the source
+ file. A strange concept, nowhere
+ documented. */
+ uint32_t fcollseq;
+ uint32_t lcollseq;
+ UCHAR cend = *p++;
+
+# if WIDE_CHAR_VERSION
+ /* Search in the 'names' array for the characters. */
+ fcollseq = __collseq_table_lookup (collseq, fn);
+ if (fcollseq == ~((uint32_t) 0))
+ /* XXX We don't know anything about the character
+ we are supposed to match. This means we are
+ failing. */
+ goto range_not_matched;
+
+ if (is_seqval)
+ lcollseq = cold;
+ else
+ lcollseq = __collseq_table_lookup (collseq, cold);
+# else
+ fcollseq = collseq[fn];
+ lcollseq = is_seqval ? cold : collseq[(UCHAR) cold];
+# endif
+
+ is_seqval = false;
+ if (cend == L_('[') && *p == L_('.'))
+ {
+ uint32_t nrules =
+ _NL_CURRENT_WORD (LC_COLLATE,
+ _NL_COLLATE_NRULES);
+ const CHAR *startp = p;
+ size_t c1 = 0;
+
+ while (1)
+ {
+ c = *++p;
+ if (c == L_('.') && p[1] == L_(']'))
+ {
+ p += 2;
+ break;
+ }
+ if (c == '\0')
+ return FNM_NOMATCH;
+ ++c1;
+ }
+
+ if (nrules == 0)
+ {
+ /* There are no names defined in the
+ collation data. Therefore we only
+ accept the trivial names consisting
+ of the character itself. */
+ if (c1 != 1)
+ return FNM_NOMATCH;
+
+ cend = startp[1];
+ }
+ else
+ {
+ int32_t table_size;
+ const int32_t *symb_table;
+ const unsigned char *extra;
+ int32_t idx;
+ int32_t elem;
+# if WIDE_CHAR_VERSION
+ CHAR *wextra;
+# endif
+
+ table_size =
+ _NL_CURRENT_WORD (LC_COLLATE,
+ _NL_COLLATE_SYMB_HASH_SIZEMB);
+ symb_table = (const int32_t *)
+ _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_SYMB_TABLEMB);
+ extra = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_SYMB_EXTRAMB);
+
+ for (elem = 0; elem < table_size; elem++)
+ if (symb_table[2 * elem] != 0)
+ {
+ idx = symb_table[2 * elem + 1];
+ /* Skip the name of collating
+ element. */
+ idx += 1 + extra[idx];
+# if WIDE_CHAR_VERSION
+ /* Skip the byte sequence of the
+ collating element. */
+ idx += 1 + extra[idx];
+ /* Adjust for the alignment. */
+ idx = (idx + 3) & ~3;
+
+ wextra = (CHAR *) &extra[idx + 4];
+
+ if (/* Compare the length of the
+ sequence. */
+ c1 == wextra[0]
+ /* Compare the wide char sequence. */
+ && (__wmemcmp (startp + 1,
+ &wextra[1], c1)
+ == 0))
+ /* Yep, this is the entry. */
+ break;
+# else
+ if (/* Compare the length of the
+ sequence. */
+ c1 == extra[idx]
+ /* Compare the byte sequence. */
+ && memcmp (startp + 1,
+ &extra[idx + 1], c1) == 0)
+ /* Yep, this is the entry. */
+ break;
+# endif
+ }
+
+ if (elem < table_size)
+ {
+ /* Get the collation sequence value. */
+ is_seqval = true;
+# if WIDE_CHAR_VERSION
+ cend = wextra[1 + wextra[0]];
+# else
+ idx += 1 + extra[idx];
+ /* Adjust for the alignment. */
+ idx = (idx + 3) & ~3;
+ cend = *((int32_t *) &extra[idx]);
+# endif
+ }
+ else if (c1 == 1)
+ {
+ cend = startp[1];
+ c = *p++;
+ }
+ else
+ return FNM_NOMATCH;
+ }
+ }
+ else
+ {
+ if (!(flags & FNM_NOESCAPE) && cend == L_('\\'))
+ cend = *p++;
+ if (cend == L_('\0'))
+ return FNM_NOMATCH;
+ cend = FOLD (cend);
+ }
+
+ /* XXX It is not entirely clear to me how to handle
+ characters which are not mentioned in the
+ collation specification. */
+ if (
+# if WIDE_CHAR_VERSION
+ lcollseq == 0xffffffff ||
+# endif
+ lcollseq <= fcollseq)
+ {
+ /* We have to look at the upper bound. */
+ uint32_t hcollseq;
+
+ if (is_seqval)
+ hcollseq = cend;
+ else
+ {
+# if WIDE_CHAR_VERSION
+ hcollseq =
+ __collseq_table_lookup (collseq, cend);
+ if (hcollseq == ~((uint32_t) 0))
+ {
+ /* Hum, no information about the upper
+ bound. The matching succeeds if the
+ lower bound is matched exactly. */
+ if (lcollseq != fcollseq)
+ goto range_not_matched;
+
+ goto matched;
+ }
+# else
+ hcollseq = collseq[cend];
+# endif
+ }
+
+ if (lcollseq <= hcollseq && fcollseq <= hcollseq)
+ goto matched;
+ }
+# if WIDE_CHAR_VERSION
+ range_not_matched:
+# endif
+#else
+ /* We use a boring value comparison of the character
+ values. This is better than comparing using
+ 'strcoll' since the latter would have surprising
+ and sometimes fatal consequences. */
+ UCHAR cend = *p++;
+
+ if (!(flags & FNM_NOESCAPE) && cend == L_('\\'))
+ cend = *p++;
+ if (cend == L_('\0'))
+ return FNM_NOMATCH;
+
+ /* It is a range. */
+ if ((UCHAR) cold <= fn && fn <= cend)
+ goto matched;
+#endif
+
+ c = *p++;
+ }
+ }
+
+ if (c == L_(']'))
+ break;
+ }
+
+ if (!not)
+ return FNM_NOMATCH;
+ break;
+
+ matched:
+ /* Skip the rest of the [...] that already matched. */
+ while ((c = *p++) != L_(']'))
+ {
+ if (c == L_('\0'))
+ /* [... (unterminated) loses. */
+ return FNM_NOMATCH;
+
+ if (!(flags & FNM_NOESCAPE) && c == L_('\\'))
+ {
+ if (*p == L_('\0'))
+ return FNM_NOMATCH;
+ /* XXX 1003.2d11 is unclear if this is right. */
+ ++p;
+ }
+ else if (c == L_('[') && *p == L_(':'))
+ {
+ int c1 = 0;
+ const CHAR *startp = p;
+
+ while (1)
+ {
+ c = *++p;
+ if (++c1 == CHAR_CLASS_MAX_LENGTH)
+ return FNM_NOMATCH;
+
+ if (*p == L_(':') && p[1] == L_(']'))
+ break;
+
+ if (c < L_('a') || c >= L_('z'))
+ {
+ p = startp - 2;
+ break;
+ }
+ }
+ p += 2;
+ }
+ else if (c == L_('[') && *p == L_('='))
+ {
+ c = *++p;
+ if (c == L_('\0'))
+ return FNM_NOMATCH;
+ c = *++p;
+ if (c != L_('=') || p[1] != L_(']'))
+ return FNM_NOMATCH;
+ p += 2;
+ }
+ else if (c == L_('[') && *p == L_('.'))
+ {
+ while (1)
+ {
+ c = *++p;
+ if (c == L_('\0'))
+ return FNM_NOMATCH;
+
+ if (c == L_('.') && p[1] == L_(']'))
+ break;
+ }
+ p += 2;
+ }
+ }
+ if (not)
+ return FNM_NOMATCH;
+ }
+ break;
+
+ case L_('+'):
+ case L_('@'):
+ case L_('!'):
+ if (__glibc_unlikely (flags & FNM_EXTMATCH) && *p == '(')
+ {
+ int res = EXT (c, p, n, string_end, no_leading_period, flags,
+ alloca_used);
+ if (res != -1)
+ return res;
+ }
+ goto normal_match;
+
+ case L_('/'):
+ if (NO_LEADING_PERIOD (flags))
+ {
+ if (n == string_end || c != (UCHAR) *n)
+ return FNM_NOMATCH;
+
+ new_no_leading_period = true;
+ break;
+ }
+ FALLTHROUGH;
+ default:
+ normal_match:
+ if (n == string_end || c != FOLD ((UCHAR) *n))
+ return FNM_NOMATCH;
+ }
+
+ no_leading_period = new_no_leading_period;
+ ++n;
+ }
+
+ if (n == string_end)
+ return 0;
+
+ if ((flags & FNM_LEADING_DIR) && n != string_end && *n == L_('/'))
+ /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */
+ return 0;
+
+ return FNM_NOMATCH;
+}
+
+
+static const CHAR *
+END (const CHAR *pattern)
+{
+ const CHAR *p = pattern;
+
+ while (1)
+ if (*++p == L_('\0'))
+ /* This is an invalid pattern. */
+ return pattern;
+ else if (*p == L_('['))
+ {
+ /* Handle brackets special. */
+ if (posixly_correct == 0)
+ posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
+
+ /* Skip the not sign. We have to recognize it because of a possibly
+ following ']'. */
+ if (*++p == L_('!') || (posixly_correct < 0 && *p == L_('^')))
+ ++p;
+ /* A leading ']' is recognized as such. */
+ if (*p == L_(']'))
+ ++p;
+ /* Skip over all characters of the list. */
+ while (*p != L_(']'))
+ if (*p++ == L_('\0'))
+ /* This is no valid pattern. */
+ return pattern;
+ }
+ else if ((*p == L_('?') || *p == L_('*') || *p == L_('+') || *p == L_('@')
+ || *p == L_('!')) && p[1] == L_('('))
+ {
+ p = END (p + 1);
+ if (*p == L_('\0'))
+ /* This is an invalid pattern. */
+ return pattern;
+ }
+ else if (*p == L_(')'))
+ break;
+
+ return p + 1;
+}
+
+
+static int
+EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
+ bool no_leading_period, int flags, size_t alloca_used)
+{
+ const CHAR *startp;
+ ptrdiff_t level;
+ struct patternlist
+ {
+ struct patternlist *next;
+ CHAR malloced;
+ CHAR str __flexarr;
+ } *list = NULL;
+ struct patternlist **lastp = &list;
+ size_t pattern_len = STRLEN (pattern);
+ bool any_malloced = false;
+ const CHAR *p;
+ const CHAR *rs;
+ int retval = 0;
+
+ /* Parse the pattern. Store the individual parts in the list. */
+ level = 0;
+ for (startp = p = pattern + 1; level >= 0; ++p)
+ if (*p == L_('\0'))
+ {
+ /* This is an invalid pattern. */
+ retval = -1;
+ goto out;
+ }
+ else if (*p == L_('['))
+ {
+ /* Handle brackets special. */
+ if (posixly_correct == 0)
+ posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
+
+ /* Skip the not sign. We have to recognize it because of a possibly
+ following ']'. */
+ if (*++p == L_('!') || (posixly_correct < 0 && *p == L_('^')))
+ ++p;
+ /* A leading ']' is recognized as such. */
+ if (*p == L_(']'))
+ ++p;
+ /* Skip over all characters of the list. */
+ while (*p != L_(']'))
+ if (*p++ == L_('\0'))
+ {
+ /* This is no valid pattern. */
+ retval = -1;
+ goto out;
+ }
+ }
+ else if ((*p == L_('?') || *p == L_('*') || *p == L_('+') || *p == L_('@')
+ || *p == L_('!')) && p[1] == L_('('))
+ /* Remember the nesting level. */
+ ++level;
+ else if (*p == L_(')'))
+ {
+ if (level-- == 0)
+ {
+ /* This means we found the end of the pattern. */
+#define NEW_PATTERN \
+ struct patternlist *newp; \
+ size_t plen = (opt == L_('?') || opt == L_('@') \
+ ? pattern_len : (p - startp + 1UL)); \
+ idx_t slen = FLEXSIZEOF (struct patternlist, str, 0); \
+ idx_t new_used = alloca_used + slen; \
+ idx_t plensize; \
+ if (INT_MULTIPLY_WRAPV (plen, sizeof (CHAR), &plensize) \
+ || INT_ADD_WRAPV (new_used, plensize, &new_used)) \
+ { \
+ retval = -2; \
+ goto out; \
+ } \
+ slen += plensize; \
+ bool malloced = ! __libc_use_alloca (new_used); \
+ if (__glibc_unlikely (malloced)) \
+ { \
+ newp = malloc (slen); \
+ if (newp == NULL) \
+ { \
+ retval = -2; \
+ goto out; \
+ } \
+ any_malloced = true; \
+ } \
+ else \
+ newp = alloca_account (slen, alloca_used); \
+ newp->next = NULL; \
+ newp->malloced = malloced; \
+ *((CHAR *) MEMPCPY (newp->str, startp, p - startp)) = L_('\0'); \
+ *lastp = newp; \
+ lastp = &newp->next
+ NEW_PATTERN;
+ }
+ }
+ else if (*p == L_('|'))
+ {
+ if (level == 0)
+ {
+ NEW_PATTERN;
+ startp = p + 1;
+ }
+ }
+ assert (list != NULL);
+ assert (p[-1] == L_(')'));
+#undef NEW_PATTERN
+
+ switch (opt)
+ {
+ case L_('*'):
+ if (FCT (p, string, string_end, no_leading_period, flags, NULL,
+ alloca_used) == 0)
+ goto success;
+ FALLTHROUGH;
+ case L_('+'):
+ do
+ {
+ for (rs = string; rs <= string_end; ++rs)
+ /* First match the prefix with the current pattern with the
+ current pattern. */
+ if (FCT (list->str, string, rs, no_leading_period,
+ flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
+ NULL, alloca_used) == 0
+ /* This was successful. Now match the rest with the rest
+ of the pattern. */
+ && (FCT (p, rs, string_end,
+ rs == string
+ ? no_leading_period
+ : rs[-1] == '/' && NO_LEADING_PERIOD (flags),
+ flags & FNM_FILE_NAME
+ ? flags : flags & ~FNM_PERIOD, NULL, alloca_used) == 0
+ /* This didn't work. Try the whole pattern. */
+ || (rs != string
+ && FCT (pattern - 1, rs, string_end,
+ rs == string
+ ? no_leading_period
+ : rs[-1] == '/' && NO_LEADING_PERIOD (flags),
+ flags & FNM_FILE_NAME
+ ? flags : flags & ~FNM_PERIOD, NULL,
+ alloca_used) == 0)))
+ /* It worked. Signal success. */
+ goto success;
+ }
+ while ((list = list->next) != NULL);
+
+ /* None of the patterns lead to a match. */
+ retval = FNM_NOMATCH;
+ break;
+
+ case L_('?'):
+ if (FCT (p, string, string_end, no_leading_period, flags, NULL,
+ alloca_used) == 0)
+ goto success;
+ FALLTHROUGH;
+ case L_('@'):
+ do
+ /* I cannot believe it but 'strcat' is actually acceptable
+ here. Match the entire string with the prefix from the
+ pattern list and the rest of the pattern following the
+ pattern list. */
+ if (FCT (STRCAT (list->str, p), string, string_end,
+ no_leading_period,
+ flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
+ NULL, alloca_used) == 0)
+ /* It worked. Signal success. */
+ goto success;
+ while ((list = list->next) != NULL);
+
+ /* None of the patterns lead to a match. */
+ retval = FNM_NOMATCH;
+ break;
+
+ case L_('!'):
+ for (rs = string; rs <= string_end; ++rs)
+ {
+ struct patternlist *runp;
+
+ for (runp = list; runp != NULL; runp = runp->next)
+ if (FCT (runp->str, string, rs, no_leading_period,
+ flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
+ NULL, alloca_used) == 0)
+ break;
+
+ /* If none of the patterns matched see whether the rest does. */
+ if (runp == NULL
+ && (FCT (p, rs, string_end,
+ rs == string
+ ? no_leading_period
+ : rs[-1] == '/' && NO_LEADING_PERIOD (flags),
+ flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
+ NULL, alloca_used) == 0))
+ /* This is successful. */
+ goto success;
+ }
+
+ /* None of the patterns together with the rest of the pattern
+ lead to a match. */
+ retval = FNM_NOMATCH;
+ break;
+
+ default:
+ assert (! "Invalid extended matching operator");
+ retval = -1;
+ break;
+ }
+
+ success:
+ out:
+ if (any_malloced)
+ while (list != NULL)
+ {
+ struct patternlist *old = list;
+ list = list->next;
+ if (old->malloced)
+ free (old);
+ }
+
+ return retval;
+}
+
+
+#undef FOLD
+#undef CHAR
+#undef UCHAR
+#undef INT
+#undef FCT
+#undef EXT
+#undef END
+#undef STRUCT
+#undef MEMPCPY
+#undef MEMCHR
+#undef STRLEN
+#undef STRCAT
+#undef L_
+#undef BTOWC
+#undef WIDE_CHAR_VERSION
+#undef FINDIDX
diff --git a/gl/lib/free.c b/gl/lib/free.c
new file mode 100644
index 0000000..86ebe6c
--- /dev/null
+++ b/gl/lib/free.c
@@ -0,0 +1,53 @@
+/* Make free() preserve errno.
+
+ Copyright (C) 2003, 2006, 2009-2022 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 2.1 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 Paul Eggert */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdlib.h>
+
+/* A function definition is only needed if HAVE_FREE_POSIX is not defined. */
+#if !HAVE_FREE_POSIX
+
+# include <errno.h>
+
+void
+rpl_free (void *p)
+# undef free
+{
+# if defined __GNUC__ && !defined __clang__
+ /* An invalid GCC optimization
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98396>
+ would optimize away the assignments in the code below, when link-time
+ optimization (LTO) is enabled. Make the code more complicated, so that
+ GCC does not grok how to optimize it. */
+ int err[2];
+ err[0] = errno;
+ err[1] = errno;
+ errno = 0;
+ free (p);
+ errno = err[errno == 0];
+# else
+ int err = errno;
+ free (p);
+ errno = err;
+# endif
+}
+
+#endif
diff --git a/gl/lib/fstat.c b/gl/lib/fstat.c
new file mode 100644
index 0000000..3928c86
--- /dev/null
+++ b/gl/lib/fstat.c
@@ -0,0 +1,94 @@
+/* fstat() replacement.
+ Copyright (C) 2011-2022 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 2.1 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 the user's config.h happens to include <sys/stat.h>, let it include only
+ the system's <sys/stat.h> here, so that orig_fstat doesn't recurse to
+ rpl_fstat. */
+#define __need_system_sys_stat_h
+#include <config.h>
+
+/* Get the original definition of fstat. It might be defined as a macro. */
+#include <sys/types.h>
+#include <sys/stat.h>
+#undef __need_system_sys_stat_h
+
+#if defined _WIN32 && ! defined __CYGWIN__
+# define WINDOWS_NATIVE
+#endif
+
+#if !defined WINDOWS_NATIVE
+
+static int
+orig_fstat (int fd, struct stat *buf)
+{
+ return fstat (fd, buf);
+}
+
+#endif
+
+/* Specification. */
+#ifdef __osf__
+/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc
+ eliminates this include because of the preliminary #include <sys/stat.h>
+ above. */
+# include "sys/stat.h"
+#else
+# include <sys/stat.h>
+#endif
+
+#include "stat-time.h"
+
+#include <errno.h>
+#include <unistd.h>
+#ifdef WINDOWS_NATIVE
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+# include "stat-w32.h"
+#endif
+
+int
+rpl_fstat (int fd, struct stat *buf)
+{
+#if REPLACE_FCHDIR && REPLACE_OPEN_DIRECTORY
+ /* Handle the case when rpl_open() used a dummy file descriptor to work
+ around an open() that can't normally visit directories. */
+ const char *name = _gl_directory_name (fd);
+ if (name != NULL)
+ return stat (name, buf);
+#endif
+
+#ifdef WINDOWS_NATIVE
+ /* Fill the fields ourselves, because the original fstat function returns
+ values for st_atime, st_mtime, st_ctime that depend on the current time
+ zone. See
+ <https://lists.gnu.org/r/bug-gnulib/2017-04/msg00134.html> */
+ HANDLE h = (HANDLE) _get_osfhandle (fd);
+
+ if (h == INVALID_HANDLE_VALUE)
+ {
+ errno = EBADF;
+ return -1;
+ }
+ return _gl_fstat_by_handle (h, NULL, buf);
+#else
+ return stat_time_normalize (orig_fstat (fd, buf), buf);
+#endif
+}
diff --git a/gl/lib/fstatat.c b/gl/lib/fstatat.c
new file mode 100644
index 0000000..6e83449
--- /dev/null
+++ b/gl/lib/fstatat.c
@@ -0,0 +1,148 @@
+/* Work around an fstatat bug on Solaris 9.
+
+ Copyright (C) 2006, 2009-2022 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 and Jim Meyering. */
+
+/* If the user's config.h happens to include <sys/stat.h>, let it include only
+ the system's <sys/stat.h> here, so that orig_fstatat doesn't recurse to
+ rpl_fstatat. */
+#define __need_system_sys_stat_h
+#include <config.h>
+
+/* Get the original definition of fstatat. It might be defined as a macro. */
+#include <sys/types.h>
+#include <sys/stat.h>
+#undef __need_system_sys_stat_h
+
+#if HAVE_FSTATAT && HAVE_WORKING_FSTATAT_ZERO_FLAG
+static int
+orig_fstatat (int fd, char const *filename, struct stat *buf, int flags)
+{
+ return fstatat (fd, filename, buf, flags);
+}
+#endif
+
+#ifdef __osf__
+/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc
+ eliminates this include because of the preliminary #include <sys/stat.h>
+ above. */
+# include "sys/stat.h"
+#else
+# include <sys/stat.h>
+#endif
+
+#include "stat-time.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if HAVE_FSTATAT && HAVE_WORKING_FSTATAT_ZERO_FLAG
+
+# ifndef LSTAT_FOLLOWS_SLASHED_SYMLINK
+# define LSTAT_FOLLOWS_SLASHED_SYMLINK 0
+# endif
+
+static int
+normal_fstatat (int fd, char const *file, struct stat *st, int flag)
+{
+ return stat_time_normalize (orig_fstatat (fd, file, st, flag), st);
+}
+
+/* fstatat should always follow symbolic links that end in /, but on
+ Solaris 9 it doesn't if AT_SYMLINK_NOFOLLOW is specified.
+ Likewise, trailing slash on a non-directory should be an error.
+ These are the same problems that lstat.c and stat.c address, so
+ solve it in a similar way.
+
+ AIX 7.1 fstatat (AT_FDCWD, ..., 0) always fails, which is a bug.
+ Work around this bug if FSTATAT_AT_FDCWD_0_BROKEN is nonzero. */
+
+int
+rpl_fstatat (int fd, char const *file, struct stat *st, int flag)
+{
+ int result = normal_fstatat (fd, file, st, flag);
+ size_t len;
+
+ if (LSTAT_FOLLOWS_SLASHED_SYMLINK || result != 0)
+ return result;
+ len = strlen (file);
+ if (flag & AT_SYMLINK_NOFOLLOW)
+ {
+ /* Fix lstat behavior. */
+ if (file[len - 1] != '/' || S_ISDIR (st->st_mode))
+ return 0;
+ if (!S_ISLNK (st->st_mode))
+ {
+ errno = ENOTDIR;
+ return -1;
+ }
+ result = normal_fstatat (fd, file, st, flag & ~AT_SYMLINK_NOFOLLOW);
+ }
+ /* Fix stat behavior. */
+ if (result == 0 && !S_ISDIR (st->st_mode) && file[len - 1] == '/')
+ {
+ errno = ENOTDIR;
+ return -1;
+ }
+ return result;
+}
+
+#else /* ! (HAVE_FSTATAT && HAVE_WORKING_FSTATAT_ZERO_FLAG) */
+
+/* On mingw, the gnulib <sys/stat.h> defines 'stat' as a function-like
+ macro; but using it in AT_FUNC_F2 causes compilation failure
+ because the preprocessor sees a use of a macro that requires two
+ arguments but is only given one. Hence, we need an inline
+ forwarder to get past the preprocessor. */
+static int
+stat_func (char const *name, struct stat *st)
+{
+ return stat (name, st);
+}
+
+/* Likewise, if there is no native 'lstat', then the gnulib
+ <sys/stat.h> defined it as stat, which also needs adjustment. */
+# if !HAVE_LSTAT
+# undef lstat
+# define lstat stat_func
+# endif
+
+/* Replacement for Solaris' function by the same name.
+ <https://www.google.com/search?q=fstatat+site:docs.oracle.com>
+ First, try to simulate it via l?stat ("/proc/self/fd/FD/FILE").
+ Failing that, simulate it via save_cwd/fchdir/(stat|lstat)/restore_cwd.
+ If either the save_cwd or the restore_cwd fails (relatively unlikely),
+ then give a diagnostic and exit nonzero.
+ Otherwise, this function works just like Solaris' fstatat. */
+
+# define AT_FUNC_NAME fstatat
+# define AT_FUNC_F1 lstat
+# define AT_FUNC_F2 stat_func
+# define AT_FUNC_USE_F1_COND AT_SYMLINK_NOFOLLOW
+# define AT_FUNC_POST_FILE_PARAM_DECLS , struct stat *st, int flag
+# define AT_FUNC_POST_FILE_ARGS , st
+# include "at-func.c"
+# undef AT_FUNC_NAME
+# undef AT_FUNC_F1
+# undef AT_FUNC_F2
+# undef AT_FUNC_USE_F1_COND
+# undef AT_FUNC_POST_FILE_PARAM_DECLS
+# undef AT_FUNC_POST_FILE_ARGS
+
+#endif /* !HAVE_FSTATAT */
diff --git a/gl/lib/getcwd-lgpl.c b/gl/lib/getcwd-lgpl.c
new file mode 100644
index 0000000..f449ac8
--- /dev/null
+++ b/gl/lib/getcwd-lgpl.c
@@ -0,0 +1,127 @@
+/* Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ This file is part of gnulib.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification */
+#include <unistd.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if GNULIB_GETCWD
+/* Favor GPL getcwd.c if both getcwd and getcwd-lgpl modules are in use. */
+typedef int dummy;
+#else
+
+/* Get the name of the current working directory, and put it in SIZE
+ bytes of BUF. Returns NULL if the directory couldn't be determined
+ (perhaps because the absolute name was longer than PATH_MAX, or
+ because of missing read/search permissions on parent directories)
+ or SIZE was too small. If successful, returns BUF. If BUF is
+ NULL, an array is allocated with 'malloc'; the array is SIZE bytes
+ long, unless SIZE == 0, in which case it is as big as
+ necessary. */
+
+# undef getcwd
+# if defined _WIN32 && !defined __CYGWIN__
+# define getcwd _getcwd
+# endif
+
+char *
+rpl_getcwd (char *buf, size_t size)
+{
+ char *ptr;
+ char *result;
+
+ /* Handle single size operations. */
+ if (buf)
+ {
+ if (!size)
+ {
+ errno = EINVAL;
+ return NULL;
+ }
+ return getcwd (buf, size);
+ }
+
+ if (size)
+ {
+ buf = malloc (size);
+ if (!buf)
+ {
+ errno = ENOMEM;
+ return NULL;
+ }
+ result = getcwd (buf, size);
+ if (!result)
+ free (buf);
+ return result;
+ }
+
+ /* Flexible sizing requested. Avoid over-allocation for the common
+ case of a name that fits within a 4k page, minus some space for
+ local variables, to be sure we don't skip over a guard page. */
+ {
+ char tmp[4032];
+ size = sizeof tmp;
+ ptr = getcwd (tmp, size);
+ if (ptr)
+ {
+ result = strdup (ptr);
+ if (!result)
+ errno = ENOMEM;
+ return result;
+ }
+ if (errno != ERANGE)
+ return NULL;
+ }
+
+ /* My what a large directory name we have. */
+ do
+ {
+ size <<= 1;
+ ptr = realloc (buf, size);
+ if (ptr == NULL)
+ {
+ free (buf);
+ errno = ENOMEM;
+ return NULL;
+ }
+ buf = ptr;
+ result = getcwd (buf, size);
+ }
+ while (!result && errno == ERANGE);
+
+ if (!result)
+ free (buf);
+ else
+ {
+ /* Here result == buf. */
+ /* Shrink result before returning it. */
+ size_t actual_size = strlen (result) + 1;
+ if (actual_size < size)
+ {
+ char *shrinked_result = realloc (result, actual_size);
+ if (shrinked_result != NULL)
+ result = shrinked_result;
+ }
+ }
+ return result;
+}
+
+#endif
diff --git a/gl/lib/getcwd.c b/gl/lib/getcwd.c
new file mode 100644
index 0000000..113332f
--- /dev/null
+++ b/gl/lib/getcwd.c
@@ -0,0 +1,495 @@
+/* Copyright (C) 1991-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ 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/>. */
+
+#if !_LIBC
+# include <config.h>
+# include <unistd.h>
+# include "pathmax.h"
+#else
+# define HAVE_OPENAT 1
+# define D_INO_IN_DIRENT 1
+# define HAVE_MSVC_INVALID_PARAMETER_HANDLER 0
+# define HAVE_MINIMALLY_WORKING_GETCWD 0
+#endif
+
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdbool.h>
+#include <stddef.h>
+
+#include <fcntl.h> /* For AT_FDCWD on Solaris 9. */
+
+/* If this host provides the openat function or if we're using the
+ gnulib replacement function with a native fdopendir, then enable
+ code below to make getcwd more efficient and robust. */
+#if defined HAVE_OPENAT || (defined GNULIB_OPENAT && defined HAVE_FDOPENDIR)
+# define HAVE_OPENAT_SUPPORT 1
+#else
+# define HAVE_OPENAT_SUPPORT 0
+#endif
+
+#ifndef __set_errno
+# define __set_errno(val) (errno = (val))
+#endif
+
+#include <dirent.h>
+#ifndef _D_EXACT_NAMLEN
+# define _D_EXACT_NAMLEN(d) strlen ((d)->d_name)
+#endif
+#ifndef _D_ALLOC_NAMLEN
+# define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1)
+#endif
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if _LIBC
+# ifndef mempcpy
+# define mempcpy __mempcpy
+# endif
+#endif
+
+#ifndef MAX
+# define MAX(a, b) ((a) < (b) ? (b) : (a))
+#endif
+#ifndef MIN
+# define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
+/* In this file, PATH_MAX only serves as a threshold for choosing among two
+ algorithms. */
+#ifndef PATH_MAX
+# define PATH_MAX 8192
+#endif
+
+#if D_INO_IN_DIRENT
+# define MATCHING_INO(dp, ino) ((dp)->d_ino == (ino))
+#else
+# define MATCHING_INO(dp, ino) true
+#endif
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+#endif
+
+#if !_LIBC
+# define GETCWD_RETURN_TYPE char *
+# define __close_nocancel_nostatus close
+# define __getcwd_generic rpl_getcwd
+# undef stat64
+# define stat64 stat
+# define __fstat64 fstat
+# define __fstatat64 fstatat
+# define __lstat64 lstat
+# define __closedir closedir
+# define __opendir opendir
+# define __readdir64 readdir
+# define __fdopendir fdopendir
+# define __openat openat
+# define __rewinddir rewinddir
+# define __openat64 openat
+# define dirent64 dirent
+#else
+# include <not-cancel.h>
+#endif
+
+/* The results of opendir() in this file are not used with dirfd and fchdir,
+ and we do not leak fds to any single-threaded code that could use stdio,
+ therefore save some unnecessary recursion in fchdir.c.
+ FIXME - if the kernel ever adds support for multi-thread safety for
+ avoiding standard fds, then we should use opendir_safer and
+ openat_safer. */
+#ifdef GNULIB_defined_opendir
+# undef opendir
+#endif
+#ifdef GNULIB_defined_closedir
+# undef closedir
+#endif
+
+#if defined _WIN32 && !defined __CYGWIN__
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static char *
+getcwd_nothrow (char *buf, size_t size)
+{
+ char *result;
+
+ TRY_MSVC_INVAL
+ {
+ result = _getcwd (buf, size);
+ }
+ CATCH_MSVC_INVAL
+ {
+ result = NULL;
+ errno = ERANGE;
+ }
+ DONE_MSVC_INVAL;
+
+ return result;
+}
+# else
+# define getcwd_nothrow _getcwd
+# endif
+# define getcwd_system getcwd_nothrow
+#else
+# define getcwd_system getcwd
+#endif
+
+/* Get the name of the current working directory, and put it in SIZE
+ bytes of BUF. Returns NULL with errno set if the directory couldn't be
+ determined or SIZE was too small. If successful, returns BUF. In GNU,
+ if BUF is NULL, an array is allocated with 'malloc'; the array is SIZE
+ bytes long, unless SIZE == 0, in which case it is as big as necessary. */
+
+GETCWD_RETURN_TYPE
+__getcwd_generic (char *buf, size_t size)
+{
+ /* Lengths of big file name components and entire file names, and a
+ deep level of file name nesting. These numbers are not upper
+ bounds; they are merely large values suitable for initial
+ allocations, designed to be large enough for most real-world
+ uses. */
+ enum
+ {
+ BIG_FILE_NAME_COMPONENT_LENGTH = 255,
+ BIG_FILE_NAME_LENGTH = MIN (4095, PATH_MAX - 1),
+ DEEP_NESTING = 100
+ };
+
+#if HAVE_OPENAT_SUPPORT
+ int fd = AT_FDCWD;
+ bool fd_needs_closing = false;
+#else
+ char dots[DEEP_NESTING * sizeof ".." + BIG_FILE_NAME_COMPONENT_LENGTH + 1];
+ char *dotlist = dots;
+ size_t dotsize = sizeof dots;
+ size_t dotlen = 0;
+#endif
+ DIR *dirstream = NULL;
+ dev_t rootdev, thisdev;
+ ino_t rootino, thisino;
+ char *dir;
+ register char *dirp;
+ struct stat64 st;
+ size_t allocated = size;
+ size_t used;
+
+#if HAVE_MINIMALLY_WORKING_GETCWD
+ /* If AT_FDCWD is not defined, the algorithm below is O(N**2) and
+ this is much slower than the system getcwd (at least on
+ GNU/Linux). So trust the system getcwd's results unless they
+ look suspicious.
+
+ Use the system getcwd even if we have openat support, since the
+ system getcwd works even when a parent is unreadable, while the
+ openat-based approach does not.
+
+ But on AIX 5.1..7.1, the system getcwd is not even minimally
+ working: If the current directory name is slightly longer than
+ PATH_MAX, it omits the first directory component and returns
+ this wrong result with errno = 0. */
+
+# undef getcwd
+ dir = getcwd_system (buf, size);
+ if (dir || (size && errno == ERANGE))
+ return dir;
+
+ /* Solaris getcwd (NULL, 0) fails with errno == EINVAL, but it has
+ internal magic that lets it work even if an ancestor directory is
+ inaccessible, which is better in many cases. So in this case try
+ again with a buffer that's almost always big enough. */
+ if (errno == EINVAL && buf == NULL && size == 0)
+ {
+ char big_buffer[BIG_FILE_NAME_LENGTH + 1];
+ dir = getcwd_system (big_buffer, sizeof big_buffer);
+ if (dir)
+ return strdup (dir);
+ }
+
+# if HAVE_PARTLY_WORKING_GETCWD
+ /* The system getcwd works, except it sometimes fails when it
+ shouldn't, setting errno to ERANGE, ENAMETOOLONG, or ENOENT. */
+ if (errno != ERANGE && errno != ENAMETOOLONG && errno != ENOENT)
+ return NULL;
+# endif
+#endif
+ if (size == 0)
+ {
+ if (buf != NULL)
+ {
+ __set_errno (EINVAL);
+ return NULL;
+ }
+
+ allocated = BIG_FILE_NAME_LENGTH + 1;
+ }
+
+ if (buf == NULL)
+ {
+ dir = malloc (allocated);
+ if (dir == NULL)
+ return NULL;
+ }
+ else
+ dir = buf;
+
+ dirp = dir + allocated;
+ *--dirp = '\0';
+
+ if (__lstat64 (".", &st) < 0)
+ goto lose;
+ thisdev = st.st_dev;
+ thisino = st.st_ino;
+
+ if (__lstat64 ("/", &st) < 0)
+ goto lose;
+ rootdev = st.st_dev;
+ rootino = st.st_ino;
+
+ while (!(thisdev == rootdev && thisino == rootino))
+ {
+ struct dirent64 *d;
+ dev_t dotdev;
+ ino_t dotino;
+ bool mount_point;
+ int parent_status;
+ size_t dirroom;
+ size_t namlen;
+ bool use_d_ino = true;
+
+ /* Look at the parent directory. */
+#if HAVE_OPENAT_SUPPORT
+ fd = __openat64 (fd, "..", O_RDONLY);
+ if (fd < 0)
+ goto lose;
+ fd_needs_closing = true;
+ parent_status = __fstat64 (fd, &st);
+#else
+ dotlist[dotlen++] = '.';
+ dotlist[dotlen++] = '.';
+ dotlist[dotlen] = '\0';
+ parent_status = __lstat64 (dotlist, &st);
+#endif
+ if (parent_status != 0)
+ goto lose;
+
+ if (dirstream && __closedir (dirstream) != 0)
+ {
+ dirstream = NULL;
+ goto lose;
+ }
+
+ /* Figure out if this directory is a mount point. */
+ dotdev = st.st_dev;
+ dotino = st.st_ino;
+ mount_point = dotdev != thisdev;
+
+ /* Search for the last directory. */
+#if HAVE_OPENAT_SUPPORT
+ dirstream = __fdopendir (fd);
+ if (dirstream == NULL)
+ goto lose;
+ fd_needs_closing = false;
+#else
+ dirstream = __opendir (dotlist);
+ if (dirstream == NULL)
+ goto lose;
+ dotlist[dotlen++] = '/';
+#endif
+ for (;;)
+ {
+ /* Clear errno to distinguish EOF from error if readdir returns
+ NULL. */
+ __set_errno (0);
+ d = __readdir64 (dirstream);
+
+ /* When we've iterated through all directory entries without finding
+ one with a matching d_ino, rewind the stream and consider each
+ name again, but this time, using lstat. This is necessary in a
+ chroot on at least one system (glibc-2.3.6 + linux 2.6.12), where
+ .., ../.., ../../.., etc. all had the same device number, yet the
+ d_ino values for entries in / did not match those obtained
+ via lstat. */
+ if (d == NULL && errno == 0 && use_d_ino)
+ {
+ use_d_ino = false;
+ __rewinddir (dirstream);
+ d = __readdir64 (dirstream);
+ }
+
+ if (d == NULL)
+ {
+ if (errno == 0)
+ /* EOF on dirstream, which can mean e.g., that the current
+ directory has been removed. */
+ __set_errno (ENOENT);
+ goto lose;
+ }
+ if (d->d_name[0] == '.' &&
+ (d->d_name[1] == '\0' ||
+ (d->d_name[1] == '.' && d->d_name[2] == '\0')))
+ continue;
+
+ if (use_d_ino)
+ {
+ bool match = (MATCHING_INO (d, thisino) || mount_point);
+ if (! match)
+ continue;
+ }
+
+ {
+ int entry_status;
+#if HAVE_OPENAT_SUPPORT
+ entry_status = __fstatat64 (fd, d->d_name, &st, AT_SYMLINK_NOFOLLOW);
+#else
+ /* Compute size needed for this file name, or for the file
+ name ".." in the same directory, whichever is larger.
+ Room for ".." might be needed the next time through
+ the outer loop. */
+ size_t name_alloc = _D_ALLOC_NAMLEN (d);
+ size_t filesize = dotlen + MAX (sizeof "..", name_alloc);
+
+ if (filesize < dotlen)
+ goto memory_exhausted;
+
+ if (dotsize < filesize)
+ {
+ /* My, what a deep directory tree you have, Grandma. */
+ size_t newsize = MAX (filesize, dotsize * 2);
+ size_t i;
+ if (newsize < dotsize)
+ goto memory_exhausted;
+ if (dotlist != dots)
+ free (dotlist);
+ dotlist = malloc (newsize);
+ if (dotlist == NULL)
+ goto lose;
+ dotsize = newsize;
+
+ i = 0;
+ do
+ {
+ dotlist[i++] = '.';
+ dotlist[i++] = '.';
+ dotlist[i++] = '/';
+ }
+ while (i < dotlen);
+ }
+
+ memcpy (dotlist + dotlen, d->d_name, _D_ALLOC_NAMLEN (d));
+ entry_status = __lstat64 (dotlist, &st);
+#endif
+ /* We don't fail here if we cannot stat() a directory entry.
+ This can happen when (network) file systems fail. If this
+ entry is in fact the one we are looking for we will find
+ out soon as we reach the end of the directory without
+ having found anything. */
+ if (entry_status == 0 && S_ISDIR (st.st_mode)
+ && st.st_dev == thisdev && st.st_ino == thisino)
+ break;
+ }
+ }
+
+ dirroom = dirp - dir;
+ namlen = _D_EXACT_NAMLEN (d);
+
+ if (dirroom <= namlen)
+ {
+ if (size != 0)
+ {
+ __set_errno (ERANGE);
+ goto lose;
+ }
+ else
+ {
+ char *tmp;
+ size_t oldsize = allocated;
+
+ allocated += MAX (allocated, namlen);
+ if (allocated < oldsize
+ || ! (tmp = realloc (dir, allocated)))
+ goto memory_exhausted;
+
+ /* Move current contents up to the end of the buffer.
+ This is guaranteed to be non-overlapping. */
+ dirp = memcpy (tmp + allocated - (oldsize - dirroom),
+ tmp + dirroom,
+ oldsize - dirroom);
+ dir = tmp;
+ }
+ }
+ dirp -= namlen;
+ memcpy (dirp, d->d_name, namlen);
+ *--dirp = '/';
+
+ thisdev = dotdev;
+ thisino = dotino;
+ }
+
+ if (dirstream && __closedir (dirstream) != 0)
+ {
+ dirstream = NULL;
+ goto lose;
+ }
+
+ if (dirp == &dir[allocated - 1])
+ *--dirp = '/';
+
+#if ! HAVE_OPENAT_SUPPORT
+ if (dotlist != dots)
+ free (dotlist);
+#endif
+
+ used = dir + allocated - dirp;
+ memmove (dir, dirp, used);
+
+ if (size == 0)
+ /* Ensure that the buffer is only as large as necessary. */
+ buf = (used < allocated ? realloc (dir, used) : dir);
+
+ if (buf == NULL)
+ /* Either buf was NULL all along, or 'realloc' failed but
+ we still have the original string. */
+ buf = dir;
+
+ return buf;
+
+ memory_exhausted:
+ __set_errno (ENOMEM);
+ lose:
+ {
+ int save = errno;
+ if (dirstream)
+ __closedir (dirstream);
+#if HAVE_OPENAT_SUPPORT
+ if (fd_needs_closing)
+ __close_nocancel_nostatus (fd);
+#else
+ if (dotlist != dots)
+ free (dotlist);
+#endif
+ if (buf == NULL)
+ free (dir);
+ __set_errno (save);
+ }
+ return NULL;
+}
+
+#if defined _LIBC && !defined GETCWD_RETURN_TYPE
+libc_hidden_def (__getcwd)
+weak_alias (__getcwd, getcwd)
+#endif
diff --git a/gl/lib/getdelim.c b/gl/lib/getdelim.c
new file mode 100644
index 0000000..9eb0483
--- /dev/null
+++ b/gl/lib/getdelim.c
@@ -0,0 +1,147 @@
+/* getdelim.c --- Implementation of replacement getdelim function.
+ Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2022 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 2.1 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/>. */
+
+/* Ported from glibc by Simon Josefsson. */
+
+/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
+ optimizes away the lineptr == NULL || n == NULL || fp == NULL tests below. */
+#define _GL_ARG_NONNULL(params)
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include <limits.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#ifndef SSIZE_MAX
+# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
+#endif
+
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+# define getc_maybe_unlocked(fp) getc(fp)
+#elif !HAVE_FLOCKFILE || !HAVE_FUNLOCKFILE || !HAVE_DECL_GETC_UNLOCKED
+# undef flockfile
+# undef funlockfile
+# define flockfile(x) ((void) 0)
+# define funlockfile(x) ((void) 0)
+# define getc_maybe_unlocked(fp) getc(fp)
+#else
+# define getc_maybe_unlocked(fp) getc_unlocked(fp)
+#endif
+
+static void
+alloc_failed (void)
+{
+#if defined _WIN32 && ! defined __CYGWIN__
+ /* Avoid errno problem without using the realloc module; see:
+ https://lists.gnu.org/r/bug-gnulib/2016-08/msg00025.html */
+ errno = ENOMEM;
+#endif
+}
+
+/* Read up to (and including) a DELIMITER from FP into *LINEPTR (and
+ NUL-terminate it). *LINEPTR is a pointer returned from malloc (or
+ NULL), pointing to *N characters of space. It is realloc'ed as
+ necessary. Returns the number of characters read (not including
+ the null terminator), or -1 on error or EOF. */
+
+ssize_t
+getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp)
+{
+ ssize_t result;
+ size_t cur_len = 0;
+
+ if (lineptr == NULL || n == NULL || fp == NULL)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
+ flockfile (fp);
+
+ if (*lineptr == NULL || *n == 0)
+ {
+ char *new_lineptr;
+ *n = 120;
+ new_lineptr = (char *) realloc (*lineptr, *n);
+ if (new_lineptr == NULL)
+ {
+ alloc_failed ();
+ result = -1;
+ goto unlock_return;
+ }
+ *lineptr = new_lineptr;
+ }
+
+ for (;;)
+ {
+ int i;
+
+ i = getc_maybe_unlocked (fp);
+ if (i == EOF)
+ {
+ result = -1;
+ break;
+ }
+
+ /* Make enough space for len+1 (for final NUL) bytes. */
+ if (cur_len + 1 >= *n)
+ {
+ size_t needed_max =
+ SSIZE_MAX < SIZE_MAX ? (size_t) SSIZE_MAX + 1 : SIZE_MAX;
+ size_t needed = 2 * *n + 1; /* Be generous. */
+ char *new_lineptr;
+
+ if (needed_max < needed)
+ needed = needed_max;
+ if (cur_len + 1 >= needed)
+ {
+ result = -1;
+ errno = EOVERFLOW;
+ goto unlock_return;
+ }
+
+ new_lineptr = (char *) realloc (*lineptr, needed);
+ if (new_lineptr == NULL)
+ {
+ alloc_failed ();
+ result = -1;
+ goto unlock_return;
+ }
+
+ *lineptr = new_lineptr;
+ *n = needed;
+ }
+
+ (*lineptr)[cur_len] = i;
+ cur_len++;
+
+ if (i == delimiter)
+ break;
+ }
+ (*lineptr)[cur_len] = '\0';
+ result = cur_len ? cur_len : result;
+
+ unlock_return:
+ funlockfile (fp); /* doesn't set errno */
+
+ return result;
+}
diff --git a/gl/lib/getdtablesize.c b/gl/lib/getdtablesize.c
new file mode 100644
index 0000000..793e0f8
--- /dev/null
+++ b/gl/lib/getdtablesize.c
@@ -0,0 +1,124 @@
+/* getdtablesize() function: Return maximum possible file descriptor value + 1.
+ Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+
+# include <stdio.h>
+
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+# endif
+
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static int
+_setmaxstdio_nothrow (int newmax)
+{
+ int result;
+
+ TRY_MSVC_INVAL
+ {
+ result = _setmaxstdio (newmax);
+ }
+ CATCH_MSVC_INVAL
+ {
+ result = -1;
+ }
+ DONE_MSVC_INVAL;
+
+ return result;
+}
+# else
+# define _setmaxstdio_nothrow _setmaxstdio
+# endif
+
+/* Cache for the previous getdtablesize () result. Safe to cache because
+ Windows also lacks setrlimit. */
+static int dtablesize;
+
+int
+getdtablesize (void)
+{
+ if (dtablesize == 0)
+ {
+ /* We are looking for the number N such that the valid file descriptors
+ are 0..N-1. It can be obtained through a loop as follows:
+ {
+ int fd;
+ for (fd = 3; fd < 65536; fd++)
+ if (dup2 (0, fd) == -1)
+ break;
+ return fd;
+ }
+ On Windows XP, the result is 2048.
+ The drawback of this loop is that it allocates memory for a libc
+ internal array that is never freed.
+
+ The number N can also be obtained as the upper bound for
+ _getmaxstdio (). _getmaxstdio () returns the maximum number of open
+ FILE objects. The sanity check in _setmaxstdio reveals the maximum
+ number of file descriptors. This too allocates memory, but it is
+ freed when we call _setmaxstdio with the original value. */
+ int orig_max_stdio = _getmaxstdio ();
+ unsigned int bound;
+ for (bound = 0x10000; _setmaxstdio_nothrow (bound) < 0; bound = bound / 2)
+ ;
+ _setmaxstdio_nothrow (orig_max_stdio);
+ dtablesize = bound;
+ }
+ return dtablesize;
+}
+
+#else
+
+# include <limits.h>
+# include <sys/resource.h>
+
+# ifndef RLIM_SAVED_CUR
+# define RLIM_SAVED_CUR RLIM_INFINITY
+# endif
+# ifndef RLIM_SAVED_MAX
+# define RLIM_SAVED_MAX RLIM_INFINITY
+# endif
+
+# ifdef __CYGWIN__
+ /* Cygwin 1.7.25 auto-increases the RLIMIT_NOFILE soft limit until it
+ hits the compile-time constant hard limit of 3200. We might as
+ well just report the hard limit. */
+# define rlim_cur rlim_max
+# endif
+
+int
+getdtablesize (void)
+{
+ struct rlimit lim;
+
+ if (getrlimit (RLIMIT_NOFILE, &lim) == 0
+ && 0 <= lim.rlim_cur && lim.rlim_cur <= INT_MAX
+ && lim.rlim_cur != RLIM_INFINITY
+ && lim.rlim_cur != RLIM_SAVED_CUR
+ && lim.rlim_cur != RLIM_SAVED_MAX)
+ return lim.rlim_cur;
+
+ return INT_MAX;
+}
+
+#endif
diff --git a/gl/lib/getline.c b/gl/lib/getline.c
new file mode 100644
index 0000000..34b9117
--- /dev/null
+++ b/gl/lib/getline.c
@@ -0,0 +1,27 @@
+/* getline.c --- Implementation of replacement getline function.
+ Copyright (C) 2005-2007, 2009-2022 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 2.1 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 Simon Josefsson. */
+
+#include <config.h>
+
+#include <stdio.h>
+
+ssize_t
+getline (char **lineptr, size_t *n, FILE *stream)
+{
+ return getdelim (lineptr, n, '\n', stream);
+}
diff --git a/gl/lib/getlogin_r.c b/gl/lib/getlogin_r.c
new file mode 100644
index 0000000..6bdf058
--- /dev/null
+++ b/gl/lib/getlogin_r.c
@@ -0,0 +1,110 @@
+/* Provide a working getlogin_r for systems which lack it.
+
+ Copyright (C) 2005-2007, 2010-2022 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 2.1 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 Paul Eggert, Derek Price, and Bruno Haible. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#include <errno.h>
+#include <string.h>
+
+#include "malloca.h"
+
+#if defined _WIN32 && ! defined __CYGWIN__
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+/* Don't assume that UNICODE is not defined. */
+# undef GetUserName
+# define GetUserName GetUserNameA
+#else
+# if !HAVE_DECL_GETLOGIN
+extern char *getlogin (void);
+# endif
+#endif
+
+/* See unistd.in.h for documentation. */
+int
+getlogin_r (char *name, size_t size)
+{
+#undef getlogin_r
+#if defined _WIN32 && ! defined __CYGWIN__
+ /* Native Windows platform. */
+ DWORD sz;
+
+ /* When size > 0x7fff, the doc says that GetUserName will fail.
+ Actually, on Windows XP SP3, it succeeds. But let's be safe,
+ for the sake of older Windows versions. */
+ if (size > 0x7fff)
+ size = 0x7fff;
+ sz = size;
+ if (!GetUserName (name, &sz))
+ {
+ if (GetLastError () == ERROR_INSUFFICIENT_BUFFER)
+ /* In this case, the doc says that sz contains the required size, but
+ actually, on Windows XP SP3, it contains 2 * the required size. */
+ return ERANGE;
+ else
+ return ENOENT;
+ }
+ return 0;
+#elif HAVE_GETLOGIN_R
+ /* Platform with a getlogin_r() function. */
+ int ret = getlogin_r (name, size);
+
+ if (ret == 0)
+ {
+ const char *nul = memchr (name, '\0', size);
+ if (nul == NULL)
+ /* name contains a truncated result. */
+ return ERANGE;
+ if (size > 0 && nul == name + size - 1)
+ {
+ /* strlen(name) == size-1. Determine whether the untruncated result
+ would have had length size-1 or size. */
+ char *room = (char *) malloca (size + 1);
+ if (room == NULL)
+ return ENOMEM;
+ ret = getlogin_r (room, size + 1);
+ /* The untruncated result should be the same as in the first call. */
+ if (ret == 0 && memcmp (name, room, size) != 0)
+ /* The untruncated result would have been different. */
+ ret = ERANGE;
+ freea (room);
+ }
+ }
+ return ret;
+#else
+ /* Platform with a getlogin() function. */
+ char *n;
+ size_t nlen;
+
+ errno = 0;
+ n = getlogin ();
+ if (!n)
+ /* ENOENT is a reasonable errno value if getlogin returns NULL. */
+ return (errno != 0 ? errno : ENOENT);
+
+ nlen = strlen (n);
+ if (size <= nlen)
+ return ERANGE;
+ memcpy (name, n, nlen + 1);
+ return 0;
+#endif
+}
diff --git a/gl/lib/getopt-cdefs.in.h b/gl/lib/getopt-cdefs.in.h
new file mode 100644
index 0000000..b6dd913
--- /dev/null
+++ b/gl/lib/getopt-cdefs.in.h
@@ -0,0 +1,66 @@
+/* getopt-on-non-glibc compatibility macros.
+ Copyright (C) 1989-2022 Free Software Foundation, Inc.
+ This file is part of gnulib.
+ Unlike most of the getopt implementation, it is NOT shared
+ with the GNU C Library.
+
+ 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 2.1 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/>. */
+
+#ifndef _GETOPT_CDEFS_H
+#define _GETOPT_CDEFS_H 1
+
+/* This header should not be used directly; include getopt.h or
+ unistd.h instead. It does not have a protective #error, because
+ the guard macro for getopt.h in gnulib is not fixed. */
+
+/* getopt-core.h and getopt-ext.h are shared with GNU libc, and expect
+ a number of the internal macros supplied to GNU libc's headers by
+ sys/cdefs.h. Provide fallback definitions for all of them. */
+#if @HAVE_SYS_CDEFS_H@
+# include <sys/cdefs.h>
+#endif
+
+#ifndef __BEGIN_DECLS
+# ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# else
+# define __BEGIN_DECLS /* nothing */
+# endif
+#endif
+#ifndef __END_DECLS
+# ifdef __cplusplus
+# define __END_DECLS }
+# else
+# define __END_DECLS /* nothing */
+# endif
+#endif
+
+#ifndef __GNUC_PREREQ
+# if defined __GNUC__ && defined __GNUC_VERSION__
+# define __GNUC_PREREQ(maj, min) \
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+# else
+# define __GNUC_PREREQ(maj, min) 0
+# endif
+#endif
+
+#ifndef __THROW
+# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major__ >= 4)
+# define __THROW throw ()
+# else
+# define __THROW
+# endif
+#endif
+
+#endif /* _GETOPT_CDEFS_H */
diff --git a/gl/lib/getopt-core.h b/gl/lib/getopt-core.h
new file mode 100644
index 0000000..1c40ecc
--- /dev/null
+++ b/gl/lib/getopt-core.h
@@ -0,0 +1,96 @@
+/* Declarations for getopt (basic, portable features only).
+ Copyright (C) 1989-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library and is also part of gnulib.
+ Patches to this file should be submitted to both projects.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _GETOPT_CORE_H
+#define _GETOPT_CORE_H 1
+
+/* This header should not be used directly; include getopt.h or
+ unistd.h instead. Unlike most bits headers, it does not have
+ a protective #error, because the guard macro for getopt.h in
+ gnulib is not fixed. */
+
+__BEGIN_DECLS
+
+/* For communication from 'getopt' to the caller.
+ When 'getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when 'ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+extern char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to 'getopt'.
+
+ On entry to 'getopt', zero means this is the first call; initialize.
+
+ When 'getopt' returns -1, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, 'optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+extern int optind;
+
+/* Callers store zero here to inhibit the error message 'getopt' prints
+ for unrecognized options. */
+
+extern int opterr;
+
+/* Set to an option character which was unrecognized. */
+
+extern int optopt;
+
+/* Get definitions and prototypes for functions to process the
+ arguments in ARGV (ARGC of them, minus the program name) for
+ options given in OPTS.
+
+ Return the option character from OPTS just read. Return -1 when
+ there are no more options. For unrecognized options, or options
+ missing arguments, 'optopt' is set to the option letter, and '?' is
+ returned.
+
+ The OPTS string is a list of characters which are recognized option
+ letters, optionally followed by colons, specifying that that letter
+ takes an argument, to be placed in 'optarg'.
+
+ If a letter in OPTS is followed by two colons, its argument is
+ optional. This behavior is specific to the GNU 'getopt'.
+
+ The argument '--' causes premature termination of argument
+ scanning, explicitly telling 'getopt' that there are no more
+ options.
+
+ If OPTS begins with '-', then non-option arguments are treated as
+ arguments to the option '\1'. This behavior is specific to the GNU
+ 'getopt'. If OPTS begins with '+', or POSIXLY_CORRECT is set in
+ the environment, then do not permute arguments.
+
+ For standards compliance, the 'argv' argument has the type
+ char *const *, but this is inaccurate; if argument permutation is
+ enabled, the argv array (not the strings it points to) must be
+ writable. */
+
+extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
+ __THROW _GL_ARG_NONNULL ((2, 3));
+
+__END_DECLS
+
+#endif /* _GETOPT_CORE_H */
diff --git a/gl/lib/getopt-ext.h b/gl/lib/getopt-ext.h
new file mode 100644
index 0000000..d661fcc
--- /dev/null
+++ b/gl/lib/getopt-ext.h
@@ -0,0 +1,77 @@
+/* Declarations for getopt (GNU extensions).
+ Copyright (C) 1989-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library and is also part of gnulib.
+ Patches to this file should be submitted to both projects.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _GETOPT_EXT_H
+#define _GETOPT_EXT_H 1
+
+/* This header should not be used directly; include getopt.h instead.
+ Unlike most bits headers, it does not have a protective #error,
+ because the guard macro for getopt.h in gnulib is not fixed. */
+
+__BEGIN_DECLS
+
+/* Describe the long-named options requested by the application.
+ The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+ of 'struct option' terminated by an element containing a name which is
+ zero.
+
+ The field 'has_arg' is:
+ no_argument (or 0) if the option does not take an argument,
+ required_argument (or 1) if the option requires an argument,
+ optional_argument (or 2) if the option takes an optional argument.
+
+ If the field 'flag' is not NULL, it points to a variable that is set
+ to the value given in the field 'val' when the option is found, but
+ left unchanged if the option is not found.
+
+ To have a long-named option do something other than set an 'int' to
+ a compiled-in constant, such as set a value from 'optarg', set the
+ option's 'flag' field to zero and its 'val' field to a nonzero
+ value (the equivalent single-letter option character, if there is
+ one). For long options that have a zero 'flag' field, 'getopt'
+ returns the contents of the 'val' field. */
+
+struct option
+{
+ const char *name;
+ /* has_arg can't be an enum because some compilers complain about
+ type mismatches in all the code that assumes it is an int. */
+ int has_arg;
+ int *flag;
+ int val;
+};
+
+/* Names for the values of the 'has_arg' field of 'struct option'. */
+
+#define no_argument 0
+#define required_argument 1
+#define optional_argument 2
+
+extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind)
+ __THROW _GL_ARG_NONNULL ((2, 3));
+extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind)
+ __THROW _GL_ARG_NONNULL ((2, 3));
+
+__END_DECLS
+
+#endif /* _GETOPT_EXT_H */
diff --git a/gl/lib/getopt-pfx-core.h b/gl/lib/getopt-pfx-core.h
new file mode 100644
index 0000000..3eead0e
--- /dev/null
+++ b/gl/lib/getopt-pfx-core.h
@@ -0,0 +1,66 @@
+/* getopt (basic, portable features) gnulib wrapper header.
+ Copyright (C) 1989-2022 Free Software Foundation, Inc.
+ This file is part of gnulib.
+ Unlike most of the getopt implementation, it is NOT shared
+ with the GNU C Library.
+
+ 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 2.1 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/>. */
+
+#ifndef _GETOPT_PFX_CORE_H
+#define _GETOPT_PFX_CORE_H 1
+
+/* This header should not be used directly; include getopt.h or
+ unistd.h instead. It does not have a protective #error, because
+ the guard macro for getopt.h in gnulib is not fixed. */
+
+/* Standalone applications should #define __GETOPT_PREFIX to an
+ identifier that prefixes the external functions and variables
+ defined in getopt-core.h and getopt-ext.h. Systematically
+ rename identifiers so that they do not collide with the system
+ functions and variables. Renaming avoids problems with some
+ compilers and linkers. */
+#ifdef __GETOPT_PREFIX
+# ifndef __GETOPT_ID
+# define __GETOPT_CONCAT(x, y) x ## y
+# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
+# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
+# endif
+# undef getopt
+# undef optarg
+# undef opterr
+# undef optind
+# undef optopt
+# define getopt __GETOPT_ID (getopt)
+# define optarg __GETOPT_ID (optarg)
+# define opterr __GETOPT_ID (opterr)
+# define optind __GETOPT_ID (optind)
+# define optopt __GETOPT_ID (optopt)
+
+/* Work around a a problem on macOS, which declares getopt with a
+ trailing __DARWIN_ALIAS(getopt) that would expand to something like
+ __asm("_" "rpl_getopt" "$UNIX2003") were it not for the following
+ hack to suppress the macOS declaration <https://bugs.gnu.org/40205>. */
+# ifdef __APPLE__
+# define _GETOPT
+# endif
+
+/* The system's getopt.h may have already included getopt-core.h to
+ declare the unprefixed identifiers. Undef _GETOPT_CORE_H so that
+ getopt-core.h declares them with prefixes. */
+# undef _GETOPT_CORE_H
+#endif
+
+#include <getopt-core.h>
+
+#endif /* _GETOPT_PFX_CORE_H */
diff --git a/gl/lib/getopt-pfx-ext.h b/gl/lib/getopt-pfx-ext.h
new file mode 100644
index 0000000..85a6cb5
--- /dev/null
+++ b/gl/lib/getopt-pfx-ext.h
@@ -0,0 +1,70 @@
+/* getopt (GNU extensions) gnulib wrapper header.
+ Copyright (C) 1989-2022 Free Software Foundation, Inc.
+ This file is part of gnulib.
+ Unlike most of the getopt implementation, it is NOT shared
+ with the GNU C Library.
+
+ 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 2.1 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/>. */
+
+#ifndef _GETOPT_PFX_EXT_H
+#define _GETOPT_PFX_EXT_H 1
+
+/* This header should not be used directly; include getopt.h instead.
+ It does not have a protective #error, because the guard macro for
+ getopt.h in gnulib is not fixed. */
+
+/* Standalone applications should #define __GETOPT_PREFIX to an
+ identifier that prefixes the external functions and variables
+ defined in getopt-core.h and getopt-ext.h. Systematically
+ rename identifiers so that they do not collide with the system
+ functions and variables. Renaming avoids problems with some
+ compilers and linkers. */
+#ifdef __GETOPT_PREFIX
+# ifndef __GETOPT_ID
+# define __GETOPT_CONCAT(x, y) x ## y
+# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
+# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
+# endif
+# undef getopt_long
+# undef getopt_long_only
+# undef option
+# undef _getopt_internal
+# define getopt_long __GETOPT_ID (getopt_long)
+# define getopt_long_only __GETOPT_ID (getopt_long_only)
+# define option __GETOPT_ID (option)
+# define _getopt_internal __GETOPT_ID (getopt_internal)
+
+/* The system's getopt.h may have already included getopt-ext.h to
+ declare the unprefixed identifiers. Undef _GETOPT_EXT_H so that
+ getopt-ext.h declares them with prefixes. */
+# undef _GETOPT_EXT_H
+#endif
+
+/* Standalone applications get correct prototypes for getopt_long and
+ getopt_long_only; they declare "char **argv". For backward
+ compatibility with old applications, if __GETOPT_PREFIX is not
+ defined, we supply GNU-libc-compatible, but incorrect, prototypes
+ using "char *const *argv". (GNU libc is stuck with the incorrect
+ prototypes, as they are baked into older versions of LSB.) */
+#ifndef __getopt_argv_const
+# if defined __GETOPT_PREFIX
+# define __getopt_argv_const /* empty */
+# else
+# define __getopt_argv_const const
+# endif
+#endif
+
+#include <getopt-ext.h>
+
+#endif /* _GETOPT_PFX_EXT_H */
diff --git a/gl/lib/getopt.c b/gl/lib/getopt.c
new file mode 100644
index 0000000..128dc7f
--- /dev/null
+++ b/gl/lib/getopt.c
@@ -0,0 +1,811 @@
+/* Getopt for GNU.
+ Copyright (C) 1987-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library and is also part of gnulib.
+ Patches to this file should be submitted to both projects.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+#include "getopt.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#ifdef _LIBC
+/* When used as part of glibc, error printing must be done differently
+ for standards compliance. getopt is not a cancellation point, so
+ it must not call functions that are, and it is specified by an
+ older standard than stdio locking, so it must not refer to
+ functions in the "user namespace" related to stdio locking.
+ Finally, it must use glibc's internal message translation so that
+ the messages are looked up in the proper text domain. */
+# include <libintl.h>
+# define fprintf __fxprintf_nocancel
+# define flockfile(fp) _IO_flockfile (fp)
+# define funlockfile(fp) _IO_funlockfile (fp)
+#else
+# include "gettext.h"
+# define _(msgid) gettext (msgid)
+/* When used standalone, flockfile and funlockfile might not be
+ available. */
+# if (!defined _POSIX_THREAD_SAFE_FUNCTIONS \
+ || (defined _WIN32 && ! defined __CYGWIN__))
+# define flockfile(fp) /* nop */
+# define funlockfile(fp) /* nop */
+# endif
+/* When used standalone, do not attempt to use alloca. */
+# define __libc_use_alloca(size) 0
+# undef alloca
+# define alloca(size) (abort (), (void *)0)
+#endif
+
+/* This implementation of 'getopt' has three modes for handling
+ options interspersed with non-option arguments. It can stop
+ scanning for options at the first non-option argument encountered,
+ as POSIX specifies. It can continue scanning for options after the
+ first non-option argument, but permute 'argv' as it goes so that,
+ after 'getopt' is done, all the options precede all the non-option
+ arguments and 'optind' points to the first non-option argument.
+ Or, it can report non-option arguments as if they were arguments to
+ the option character '\x01'.
+
+ The default behavior of 'getopt_long' is to permute the argument list.
+ When this implementation is used standalone, the default behavior of
+ 'getopt' is to stop at the first non-option argument, but when it is
+ used as part of GNU libc it also permutes the argument list. In both
+ cases, setting the environment variable POSIXLY_CORRECT to any value
+ disables permutation.
+
+ If the first character of the OPTSTRING argument to 'getopt' or
+ 'getopt_long' is '+', both functions will stop at the first
+ non-option argument. If it is '-', both functions will report
+ non-option arguments as arguments to the option character '\x01'. */
+
+#include "getopt_int.h"
+
+/* For communication from 'getopt' to the caller.
+ When 'getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when 'ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to 'getopt'.
+
+ On entry to 'getopt', zero means this is the first call; initialize.
+
+ When 'getopt' returns -1, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, 'optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+/* 1003.2 says this must be 1 before any call. */
+int optind = 1;
+
+/* Callers store zero here to inhibit the error message
+ for unrecognized options. */
+
+int opterr = 1;
+
+/* Set to an option character which was unrecognized.
+ This must be initialized on some systems to avoid linking in the
+ system's own getopt implementation. */
+
+int optopt = '?';
+
+/* Keep a global copy of all internal members of getopt_data. */
+
+static struct _getopt_data getopt_data;
+
+/* Exchange two adjacent subsequences of ARGV.
+ One subsequence is elements [first_nonopt,last_nonopt)
+ which contains all the non-options that have been skipped so far.
+ The other is elements [last_nonopt,optind), which contains all
+ the options processed since those non-options were skipped.
+
+ 'first_nonopt' and 'last_nonopt' are relocated so that they describe
+ the new indices of the non-options in ARGV after they are moved. */
+
+static void
+exchange (char **argv, struct _getopt_data *d)
+{
+ int bottom = d->__first_nonopt;
+ int middle = d->__last_nonopt;
+ int top = d->optind;
+ char *tem;
+
+ /* Exchange the shorter segment with the far end of the longer segment.
+ That puts the shorter segment into the right place.
+ It leaves the longer segment in the right place overall,
+ but it consists of two parts that need to be swapped next. */
+
+ while (top > middle && middle > bottom)
+ {
+ if (top - middle > middle - bottom)
+ {
+ /* Bottom segment is the short one. */
+ int len = middle - bottom;
+ int i;
+
+ /* Swap it with the top part of the top segment. */
+ for (i = 0; i < len; i++)
+ {
+ tem = argv[bottom + i];
+ argv[bottom + i] = argv[top - (middle - bottom) + i];
+ argv[top - (middle - bottom) + i] = tem;
+ }
+ /* Exclude the moved bottom segment from further swapping. */
+ top -= len;
+ }
+ else
+ {
+ /* Top segment is the short one. */
+ int len = top - middle;
+ int i;
+
+ /* Swap it with the bottom part of the bottom segment. */
+ for (i = 0; i < len; i++)
+ {
+ tem = argv[bottom + i];
+ argv[bottom + i] = argv[middle + i];
+ argv[middle + i] = tem;
+ }
+ /* Exclude the moved top segment from further swapping. */
+ bottom += len;
+ }
+ }
+
+ /* Update records for the slots the non-options now occupy. */
+
+ d->__first_nonopt += (d->optind - d->__last_nonopt);
+ d->__last_nonopt = d->optind;
+}
+
+/* Process the argument starting with d->__nextchar as a long option.
+ d->optind should *not* have been advanced over this argument.
+
+ If the value returned is -1, it was not actually a long option, the
+ state is unchanged, and the argument should be processed as a set
+ of short options (this can only happen when long_only is true).
+ Otherwise, the option (and its argument, if any) have been consumed
+ and the return value is the value to return from _getopt_internal_r. */
+static int
+process_long_option (int argc, char **argv, const char *optstring,
+ const struct option *longopts, int *longind,
+ int long_only, struct _getopt_data *d,
+ int print_errors, const char *prefix)
+{
+ char *nameend;
+ size_t namelen;
+ const struct option *p;
+ const struct option *pfound = NULL;
+ int n_options;
+ int option_index;
+
+ for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++)
+ /* Do nothing. */ ;
+ namelen = nameend - d->__nextchar;
+
+ /* First look for an exact match, counting the options as a side
+ effect. */
+ for (p = longopts, n_options = 0; p->name; p++, n_options++)
+ if (!strncmp (p->name, d->__nextchar, namelen)
+ && namelen == strlen (p->name))
+ {
+ /* Exact match found. */
+ pfound = p;
+ option_index = n_options;
+ break;
+ }
+
+ if (pfound == NULL)
+ {
+ /* Didn't find an exact match, so look for abbreviations. */
+ unsigned char *ambig_set = NULL;
+ int ambig_malloced = 0;
+ int ambig_fallback = 0;
+ int indfound = -1;
+
+ for (p = longopts, option_index = 0; p->name; p++, option_index++)
+ if (!strncmp (p->name, d->__nextchar, namelen))
+ {
+ if (pfound == NULL)
+ {
+ /* First nonexact match found. */
+ pfound = p;
+ indfound = option_index;
+ }
+ else if (long_only
+ || pfound->has_arg != p->has_arg
+ || pfound->flag != p->flag
+ || pfound->val != p->val)
+ {
+ /* Second or later nonexact match found. */
+ if (!ambig_fallback)
+ {
+ if (!print_errors)
+ /* Don't waste effort tracking the ambig set if
+ we're not going to print it anyway. */
+ ambig_fallback = 1;
+ else if (!ambig_set)
+ {
+ if (__libc_use_alloca (n_options))
+ ambig_set = alloca (n_options);
+ else if ((ambig_set = malloc (n_options)) == NULL)
+ /* Fall back to simpler error message. */
+ ambig_fallback = 1;
+ else
+ ambig_malloced = 1;
+
+ if (ambig_set)
+ {
+ memset (ambig_set, 0, n_options);
+ ambig_set[indfound] = 1;
+ }
+ }
+ if (ambig_set)
+ ambig_set[option_index] = 1;
+ }
+ }
+ }
+
+ if (ambig_set || ambig_fallback)
+ {
+ if (print_errors)
+ {
+ if (ambig_fallback)
+ fprintf (stderr, _("%s: option '%s%s' is ambiguous\n"),
+ argv[0], prefix, d->__nextchar);
+ else
+ {
+ flockfile (stderr);
+ fprintf (stderr,
+ _("%s: option '%s%s' is ambiguous; possibilities:"),
+ argv[0], prefix, d->__nextchar);
+
+ for (option_index = 0; option_index < n_options; option_index++)
+ if (ambig_set[option_index])
+ fprintf (stderr, " '%s%s'",
+ prefix, longopts[option_index].name);
+
+ /* This must use 'fprintf' even though it's only
+ printing a single character, so that it goes through
+ __fxprintf_nocancel when compiled as part of glibc. */
+ fprintf (stderr, "\n");
+ funlockfile (stderr);
+ }
+ }
+ if (ambig_malloced)
+ free (ambig_set);
+ d->__nextchar += strlen (d->__nextchar);
+ d->optind++;
+ d->optopt = 0;
+ return '?';
+ }
+
+ option_index = indfound;
+ }
+
+ if (pfound == NULL)
+ {
+ /* Can't find it as a long option. If this is not getopt_long_only,
+ or the option starts with '--' or is not a valid short option,
+ then it's an error. */
+ if (!long_only || argv[d->optind][1] == '-'
+ || strchr (optstring, *d->__nextchar) == NULL)
+ {
+ if (print_errors)
+ fprintf (stderr, _("%s: unrecognized option '%s%s'\n"),
+ argv[0], prefix, d->__nextchar);
+
+ d->__nextchar = NULL;
+ d->optind++;
+ d->optopt = 0;
+ return '?';
+ }
+
+ /* Otherwise interpret it as a short option. */
+ return -1;
+ }
+
+ /* We have found a matching long option. Consume it. */
+ d->optind++;
+ d->__nextchar = NULL;
+ if (*nameend)
+ {
+ /* Don't test has_arg with >, because some C compilers don't
+ allow it to be used on enums. */
+ if (pfound->has_arg)
+ d->optarg = nameend + 1;
+ else
+ {
+ if (print_errors)
+ fprintf (stderr,
+ _("%s: option '%s%s' doesn't allow an argument\n"),
+ argv[0], prefix, pfound->name);
+
+ d->optopt = pfound->val;
+ return '?';
+ }
+ }
+ else if (pfound->has_arg == 1)
+ {
+ if (d->optind < argc)
+ d->optarg = argv[d->optind++];
+ else
+ {
+ if (print_errors)
+ fprintf (stderr,
+ _("%s: option '%s%s' requires an argument\n"),
+ argv[0], prefix, pfound->name);
+
+ d->optopt = pfound->val;
+ return optstring[0] == ':' ? ':' : '?';
+ }
+ }
+
+ if (longind != NULL)
+ *longind = option_index;
+ if (pfound->flag)
+ {
+ *(pfound->flag) = pfound->val;
+ return 0;
+ }
+ return pfound->val;
+}
+
+/* Initialize internal data upon the first call to getopt. */
+
+static const char *
+_getopt_initialize (_GL_UNUSED int argc,
+ _GL_UNUSED char **argv, const char *optstring,
+ struct _getopt_data *d, int posixly_correct)
+{
+ /* Start processing options with ARGV-element 1 (since ARGV-element 0
+ is the program name); the sequence of previously skipped
+ non-option ARGV-elements is empty. */
+ if (d->optind == 0)
+ d->optind = 1;
+
+ d->__first_nonopt = d->__last_nonopt = d->optind;
+ d->__nextchar = NULL;
+
+ /* Determine how to handle the ordering of options and nonoptions. */
+ if (optstring[0] == '-')
+ {
+ d->__ordering = RETURN_IN_ORDER;
+ ++optstring;
+ }
+ else if (optstring[0] == '+')
+ {
+ d->__ordering = REQUIRE_ORDER;
+ ++optstring;
+ }
+ else if (posixly_correct || !!getenv ("POSIXLY_CORRECT"))
+ d->__ordering = REQUIRE_ORDER;
+ else
+ d->__ordering = PERMUTE;
+
+ d->__initialized = 1;
+ return optstring;
+}
+
+/* Scan elements of ARGV (whose length is ARGC) for option characters
+ given in OPTSTRING.
+
+ If an element of ARGV starts with '-', and is not exactly "-" or "--",
+ then it is an option element. The characters of this element
+ (aside from the initial '-') are option characters. If 'getopt'
+ is called repeatedly, it returns successively each of the option characters
+ from each of the option elements.
+
+ If 'getopt' finds another option character, it returns that character,
+ updating 'optind' and 'nextchar' so that the next call to 'getopt' can
+ resume the scan with the following option character or ARGV-element.
+
+ If there are no more option characters, 'getopt' returns -1.
+ Then 'optind' is the index in ARGV of the first ARGV-element
+ that is not an option. (The ARGV-elements have been permuted
+ so that those that are not options now come last.)
+
+ OPTSTRING is a string containing the legitimate option characters.
+ If an option character is seen that is not listed in OPTSTRING,
+ return '?' after printing an error message. If you set 'opterr' to
+ zero, the error message is suppressed but we still return '?'.
+
+ If a char in OPTSTRING is followed by a colon, that means it wants an arg,
+ so the following text in the same ARGV-element, or the text of the following
+ ARGV-element, is returned in 'optarg'. Two colons mean an option that
+ wants an optional arg; if there is text in the current ARGV-element,
+ it is returned in 'optarg', otherwise 'optarg' is set to zero.
+
+ If OPTSTRING starts with '-' or '+', it requests different methods of
+ handling the non-option ARGV-elements.
+ See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
+
+ Long-named options begin with '--' instead of '-'.
+ Their names may be abbreviated as long as the abbreviation is unique
+ or is an exact match for some defined option. If they have an
+ argument, it follows the option name in the same ARGV-element, separated
+ from the option name by a '=', or else the in next ARGV-element.
+ When 'getopt' finds a long-named option, it returns 0 if that option's
+ 'flag' field is nonzero, the value of the option's 'val' field
+ if the 'flag' field is zero.
+
+ The elements of ARGV aren't really const, because we permute them.
+ But we pretend they're const in the prototype to be compatible
+ with other systems.
+
+ LONGOPTS is a vector of 'struct option' terminated by an
+ element containing a name which is zero.
+
+ LONGIND returns the index in LONGOPT of the long-named option found.
+ It is only valid when a long-named option has been found by the most
+ recent call.
+
+ If LONG_ONLY is nonzero, '-' as well as '--' can introduce
+ long-named options. */
+
+int
+_getopt_internal_r (int argc, char **argv, const char *optstring,
+ const struct option *longopts, int *longind,
+ int long_only, struct _getopt_data *d, int posixly_correct)
+{
+ int print_errors = d->opterr;
+
+ if (argc < 1)
+ return -1;
+
+ d->optarg = NULL;
+
+ if (d->optind == 0 || !d->__initialized)
+ optstring = _getopt_initialize (argc, argv, optstring, d, posixly_correct);
+ else if (optstring[0] == '-' || optstring[0] == '+')
+ optstring++;
+
+ if (optstring[0] == ':')
+ print_errors = 0;
+
+ /* Test whether ARGV[optind] points to a non-option argument. */
+#define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0')
+
+ if (d->__nextchar == NULL || *d->__nextchar == '\0')
+ {
+ /* Advance to the next ARGV-element. */
+
+ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
+ moved back by the user (who may also have changed the arguments). */
+ if (d->__last_nonopt > d->optind)
+ d->__last_nonopt = d->optind;
+ if (d->__first_nonopt > d->optind)
+ d->__first_nonopt = d->optind;
+
+ if (d->__ordering == PERMUTE)
+ {
+ /* If we have just processed some options following some non-options,
+ exchange them so that the options come first. */
+
+ if (d->__first_nonopt != d->__last_nonopt
+ && d->__last_nonopt != d->optind)
+ exchange (argv, d);
+ else if (d->__last_nonopt != d->optind)
+ d->__first_nonopt = d->optind;
+
+ /* Skip any additional non-options
+ and extend the range of non-options previously skipped. */
+
+ while (d->optind < argc && NONOPTION_P)
+ d->optind++;
+ d->__last_nonopt = d->optind;
+ }
+
+ /* The special ARGV-element '--' means premature end of options.
+ Skip it like a null option,
+ then exchange with previous non-options as if it were an option,
+ then skip everything else like a non-option. */
+
+ if (d->optind != argc && !strcmp (argv[d->optind], "--"))
+ {
+ d->optind++;
+
+ if (d->__first_nonopt != d->__last_nonopt
+ && d->__last_nonopt != d->optind)
+ exchange (argv, d);
+ else if (d->__first_nonopt == d->__last_nonopt)
+ d->__first_nonopt = d->optind;
+ d->__last_nonopt = argc;
+
+ d->optind = argc;
+ }
+
+ /* If we have done all the ARGV-elements, stop the scan
+ and back over any non-options that we skipped and permuted. */
+
+ if (d->optind == argc)
+ {
+ /* Set the next-arg-index to point at the non-options
+ that we previously skipped, so the caller will digest them. */
+ if (d->__first_nonopt != d->__last_nonopt)
+ d->optind = d->__first_nonopt;
+ return -1;
+ }
+
+ /* If we have come to a non-option and did not permute it,
+ either stop the scan or describe it to the caller and pass it by. */
+
+ if (NONOPTION_P)
+ {
+ if (d->__ordering == REQUIRE_ORDER)
+ return -1;
+ d->optarg = argv[d->optind++];
+ return 1;
+ }
+
+ /* We have found another option-ARGV-element.
+ Check whether it might be a long option. */
+ if (longopts)
+ {
+ if (argv[d->optind][1] == '-')
+ {
+ /* "--foo" is always a long option. The special option
+ "--" was handled above. */
+ d->__nextchar = argv[d->optind] + 2;
+ return process_long_option (argc, argv, optstring, longopts,
+ longind, long_only, d,
+ print_errors, "--");
+ }
+
+ /* If long_only and the ARGV-element has the form "-f",
+ where f is a valid short option, don't consider it an
+ abbreviated form of a long option that starts with f.
+ Otherwise there would be no way to give the -f short
+ option.
+
+ On the other hand, if there's a long option "fubar" and
+ the ARGV-element is "-fu", do consider that an
+ abbreviation of the long option, just like "--fu", and
+ not "-f" with arg "u".
+
+ This distinction seems to be the most useful approach. */
+ if (long_only && (argv[d->optind][2]
+ || !strchr (optstring, argv[d->optind][1])))
+ {
+ int code;
+ d->__nextchar = argv[d->optind] + 1;
+ code = process_long_option (argc, argv, optstring, longopts,
+ longind, long_only, d,
+ print_errors, "-");
+ if (code != -1)
+ return code;
+ }
+ }
+
+ /* It is not a long option. Skip the initial punctuation. */
+ d->__nextchar = argv[d->optind] + 1;
+ }
+
+ /* Look at and handle the next short option-character. */
+
+ {
+ char c = *d->__nextchar++;
+ const char *temp = strchr (optstring, c);
+
+ /* Increment 'optind' when we start to process its last character. */
+ if (*d->__nextchar == '\0')
+ ++d->optind;
+
+ if (temp == NULL || c == ':' || c == ';')
+ {
+ if (print_errors)
+ fprintf (stderr, _("%s: invalid option -- '%c'\n"), argv[0], c);
+ d->optopt = c;
+ return '?';
+ }
+
+ /* Convenience. Treat POSIX -W foo same as long option --foo */
+ if (temp[0] == 'W' && temp[1] == ';' && longopts != NULL)
+ {
+ /* This is an option that requires an argument. */
+ if (*d->__nextchar != '\0')
+ d->optarg = d->__nextchar;
+ else if (d->optind == argc)
+ {
+ if (print_errors)
+ fprintf (stderr,
+ _("%s: option requires an argument -- '%c'\n"),
+ argv[0], c);
+
+ d->optopt = c;
+ if (optstring[0] == ':')
+ c = ':';
+ else
+ c = '?';
+ return c;
+ }
+ else
+ d->optarg = argv[d->optind];
+
+ d->__nextchar = d->optarg;
+ d->optarg = NULL;
+ return process_long_option (argc, argv, optstring, longopts, longind,
+ 0 /* long_only */, d, print_errors, "-W ");
+ }
+ if (temp[1] == ':')
+ {
+ if (temp[2] == ':')
+ {
+ /* This is an option that accepts an argument optionally. */
+ if (*d->__nextchar != '\0')
+ {
+ d->optarg = d->__nextchar;
+ d->optind++;
+ }
+ else
+ d->optarg = NULL;
+ d->__nextchar = NULL;
+ }
+ else
+ {
+ /* This is an option that requires an argument. */
+ if (*d->__nextchar != '\0')
+ {
+ d->optarg = d->__nextchar;
+ /* If we end this ARGV-element by taking the rest as an arg,
+ we must advance to the next element now. */
+ d->optind++;
+ }
+ else if (d->optind == argc)
+ {
+ if (print_errors)
+ fprintf (stderr,
+ _("%s: option requires an argument -- '%c'\n"),
+ argv[0], c);
+
+ d->optopt = c;
+ if (optstring[0] == ':')
+ c = ':';
+ else
+ c = '?';
+ }
+ else
+ /* We already incremented 'optind' once;
+ increment it again when taking next ARGV-elt as argument. */
+ d->optarg = argv[d->optind++];
+ d->__nextchar = NULL;
+ }
+ }
+ return c;
+ }
+}
+
+int
+_getopt_internal (int argc, char **argv, const char *optstring,
+ const struct option *longopts, int *longind, int long_only,
+ int posixly_correct)
+{
+ int result;
+
+ getopt_data.optind = optind;
+ getopt_data.opterr = opterr;
+
+ result = _getopt_internal_r (argc, argv, optstring, longopts,
+ longind, long_only, &getopt_data,
+ posixly_correct);
+
+ optind = getopt_data.optind;
+ optarg = getopt_data.optarg;
+ optopt = getopt_data.optopt;
+
+ return result;
+}
+
+/* glibc gets a LSB-compliant getopt and a POSIX-complaint __posix_getopt.
+ Standalone applications just get a POSIX-compliant getopt.
+ POSIX and LSB both require these functions to take 'char *const *argv'
+ even though this is incorrect (because of the permutation). */
+#define GETOPT_ENTRY(NAME, POSIXLY_CORRECT) \
+ int \
+ NAME (int argc, char *const *argv, const char *optstring) \
+ { \
+ return _getopt_internal (argc, (char **)argv, optstring, \
+ 0, 0, 0, POSIXLY_CORRECT); \
+ }
+
+#ifdef _LIBC
+GETOPT_ENTRY(getopt, 0)
+GETOPT_ENTRY(__posix_getopt, 1)
+#else
+GETOPT_ENTRY(getopt, 1)
+#endif
+
+
+#ifdef TEST
+
+/* Compile with -DTEST to make an executable for use in testing
+ the above definition of 'getopt'. */
+
+int
+main (int argc, char **argv)
+{
+ int c;
+ int digit_optind = 0;
+
+ while (1)
+ {
+ int this_option_optind = optind ? optind : 1;
+
+ c = getopt (argc, argv, "abc:d:0123456789");
+ if (c == -1)
+ break;
+
+ switch (c)
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ if (digit_optind != 0 && digit_optind != this_option_optind)
+ printf ("digits occur in two different argv-elements.\n");
+ digit_optind = this_option_optind;
+ printf ("option %c\n", c);
+ break;
+
+ case 'a':
+ printf ("option a\n");
+ break;
+
+ case 'b':
+ printf ("option b\n");
+ break;
+
+ case 'c':
+ printf ("option c with value '%s'\n", optarg);
+ break;
+
+ case '?':
+ break;
+
+ default:
+ printf ("?? getopt returned character code 0%o ??\n", c);
+ }
+ }
+
+ if (optind < argc)
+ {
+ printf ("non-option ARGV-elements: ");
+ while (optind < argc)
+ printf ("%s ", argv[optind++]);
+ printf ("\n");
+ }
+
+ exit (0);
+}
+
+#endif /* TEST */
diff --git a/gl/lib/getopt.in.h b/gl/lib/getopt.in.h
new file mode 100644
index 0000000..9bc50ee
--- /dev/null
+++ b/gl/lib/getopt.in.h
@@ -0,0 +1,61 @@
+/* Declarations for getopt.
+ Copyright (C) 1989-2022 Free Software Foundation, Inc.
+ This file is part of gnulib.
+ Unlike most of the getopt implementation, it is NOT shared
+ with the GNU C Library, which supplies a different version of
+ this file.
+
+ 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 2.1 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/>. */
+
+#ifndef _@GUARD_PREFIX@_GETOPT_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. We must
+ also inform the replacement unistd.h to not recursively use
+ <getopt.h>; our definitions will be present soon enough. */
+#if @HAVE_GETOPT_H@
+# define _GL_SYSTEM_GETOPT
+# @INCLUDE_NEXT@ @NEXT_GETOPT_H@
+# undef _GL_SYSTEM_GETOPT
+#endif
+
+#define _@GUARD_PREFIX@_GETOPT_H 1
+
+/* Standalone applications should #define __GETOPT_PREFIX to an
+ identifier that prefixes the external functions and variables
+ defined in getopt-core.h and getopt-ext.h. When this happens,
+ include the headers that might declare getopt so that they will not
+ cause confusion if included after this file (if the system had
+ <getopt.h>, we have already included it). */
+#if defined __GETOPT_PREFIX
+# if !@HAVE_GETOPT_H@
+# define __need_system_stdlib_h
+# include <stdlib.h>
+# undef __need_system_stdlib_h
+# include <stdio.h>
+# include <unistd.h>
+# endif
+#endif
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+#include <getopt-cdefs.h>
+#include <getopt-pfx-core.h>
+#include <getopt-pfx-ext.h>
+
+#endif /* _@GUARD_PREFIX@_GETOPT_H */
diff --git a/gl/lib/getopt1.c b/gl/lib/getopt1.c
new file mode 100644
index 0000000..990eee1
--- /dev/null
+++ b/gl/lib/getopt1.c
@@ -0,0 +1,159 @@
+/* getopt_long and getopt_long_only entry points for GNU getopt.
+ Copyright (C) 1987-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library and is also part of gnulib.
+ Patches to this file should be submitted to both projects.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+#include "getopt.h"
+#include "getopt_int.h"
+
+int
+getopt_long (int argc, char *__getopt_argv_const *argv, const char *options,
+ const struct option *long_options, int *opt_index)
+{
+ return _getopt_internal (argc, (char **) argv, options, long_options,
+ opt_index, 0, 0);
+}
+
+int
+_getopt_long_r (int argc, char **argv, const char *options,
+ const struct option *long_options, int *opt_index,
+ struct _getopt_data *d)
+{
+ return _getopt_internal_r (argc, argv, options, long_options, opt_index,
+ 0, d, 0);
+}
+
+/* Like getopt_long, but '-' as well as '--' can indicate a long option.
+ If an option that starts with '-' (not '--') doesn't match a long option,
+ but does match a short option, it is parsed as a short option
+ instead. */
+
+int
+getopt_long_only (int argc, char *__getopt_argv_const *argv,
+ const char *options,
+ const struct option *long_options, int *opt_index)
+{
+ return _getopt_internal (argc, (char **) argv, options, long_options,
+ opt_index, 1, 0);
+}
+
+int
+_getopt_long_only_r (int argc, char **argv, const char *options,
+ const struct option *long_options, int *opt_index,
+ struct _getopt_data *d)
+{
+ return _getopt_internal_r (argc, argv, options, long_options, opt_index,
+ 1, d, 0);
+}
+
+
+#ifdef TEST
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main (int argc, char **argv)
+{
+ int c;
+ int digit_optind = 0;
+
+ while (1)
+ {
+ int this_option_optind = optind ? optind : 1;
+ int option_index = 0;
+ static const struct option long_options[] =
+ {
+ {"add", 1, 0, 0},
+ {"append", 0, 0, 0},
+ {"delete", 1, 0, 0},
+ {"verbose", 0, 0, 0},
+ {"create", 0, 0, 0},
+ {"file", 1, 0, 0},
+ {0, 0, 0, 0}
+ };
+
+ c = getopt_long (argc, argv, "abc:d:0123456789",
+ long_options, &option_index);
+ if (c == -1)
+ break;
+
+ switch (c)
+ {
+ case 0:
+ printf ("option %s", long_options[option_index].name);
+ if (optarg)
+ printf (" with arg %s", optarg);
+ printf ("\n");
+ break;
+
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ if (digit_optind != 0 && digit_optind != this_option_optind)
+ printf ("digits occur in two different argv-elements.\n");
+ digit_optind = this_option_optind;
+ printf ("option %c\n", c);
+ break;
+
+ case 'a':
+ printf ("option a\n");
+ break;
+
+ case 'b':
+ printf ("option b\n");
+ break;
+
+ case 'c':
+ printf ("option c with value '%s'\n", optarg);
+ break;
+
+ case 'd':
+ printf ("option d with value '%s'\n", optarg);
+ break;
+
+ case '?':
+ break;
+
+ default:
+ printf ("?? getopt returned character code 0%o ??\n", c);
+ }
+ }
+
+ if (optind < argc)
+ {
+ printf ("non-option ARGV-elements: ");
+ while (optind < argc)
+ printf ("%s ", argv[optind++]);
+ printf ("\n");
+ }
+
+ exit (0);
+}
+
+#endif /* TEST */
diff --git a/gl/lib/getopt_int.h b/gl/lib/getopt_int.h
new file mode 100644
index 0000000..ccdbb97
--- /dev/null
+++ b/gl/lib/getopt_int.h
@@ -0,0 +1,118 @@
+/* Internal declarations for getopt.
+ Copyright (C) 1989-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library and is also part of gnulib.
+ Patches to this file should be submitted to both projects.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _GETOPT_INT_H
+#define _GETOPT_INT_H 1
+
+#include <getopt.h>
+
+extern int _getopt_internal (int ___argc, char **___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind,
+ int __long_only, int __posixly_correct);
+
+
+/* Reentrant versions which can handle parsing multiple argument
+ vectors at the same time. */
+
+/* Describe how to deal with options that follow non-option ARGV-elements.
+
+ REQUIRE_ORDER means don't recognize them as options; stop option
+ processing when the first non-option is seen. This is what POSIX
+ specifies should happen.
+
+ PERMUTE means permute the contents of ARGV as we scan, so that
+ eventually all the non-options are at the end. This allows options
+ to be given in any order, even with programs that were not written
+ to expect this.
+
+ RETURN_IN_ORDER is an option available to programs that were
+ written to expect options and other ARGV-elements in any order
+ and that care about the ordering of the two. We describe each
+ non-option ARGV-element as if it were the argument of an option
+ with character code 1.
+
+ The special argument '--' forces an end of option-scanning regardless
+ of the value of 'ordering'. In the case of RETURN_IN_ORDER, only
+ '--' can cause 'getopt' to return -1 with 'optind' != ARGC. */
+
+enum __ord
+ {
+ REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
+ };
+
+/* Data type for reentrant functions. */
+struct _getopt_data
+{
+ /* These have exactly the same meaning as the corresponding global
+ variables, except that they are used for the reentrant
+ versions of getopt. */
+ int optind;
+ int opterr;
+ int optopt;
+ char *optarg;
+
+ /* Internal members. */
+
+ /* True if the internal members have been initialized. */
+ int __initialized;
+
+ /* The next char to be scanned in the option-element
+ in which the last option character we returned was found.
+ This allows us to pick up the scan where we left off.
+
+ If this is zero, or a null string, it means resume the scan
+ by advancing to the next ARGV-element. */
+ char *__nextchar;
+
+ /* See __ord above. */
+ enum __ord __ordering;
+
+ /* Handle permutation of arguments. */
+
+ /* Describe the part of ARGV that contains non-options that have
+ been skipped. 'first_nonopt' is the index in ARGV of the first
+ of them; 'last_nonopt' is the index after the last of them. */
+
+ int __first_nonopt;
+ int __last_nonopt;
+};
+
+/* The initializer is necessary to set OPTIND and OPTERR to their
+ default values and to clear the initialization flag. */
+#define _GETOPT_DATA_INITIALIZER { 1, 1 }
+
+extern int _getopt_internal_r (int ___argc, char **___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind,
+ int __long_only, struct _getopt_data *__data,
+ int __posixly_correct);
+
+extern int _getopt_long_r (int ___argc, char **___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind,
+ struct _getopt_data *__data);
+
+extern int _getopt_long_only_r (int ___argc, char **___argv,
+ const char *__shortopts,
+ const struct option *__longopts,
+ int *__longind,
+ struct _getopt_data *__data);
+
+#endif /* getopt_int.h */
diff --git a/gl/lib/getprogname.c b/gl/lib/getprogname.c
new file mode 100644
index 0000000..62a4800
--- /dev/null
+++ b/gl/lib/getprogname.c
@@ -0,0 +1,302 @@
+/* Program name management.
+ Copyright (C) 2016-2022 Free Software Foundation, Inc.
+
+ This program 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 2.1 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "getprogname.h"
+
+#include <errno.h> /* get program_invocation_name declaration */
+#include <stdlib.h> /* get __argv declaration */
+
+#ifdef _AIX
+# include <unistd.h>
+# include <procinfo.h>
+# include <string.h>
+#endif
+
+#ifdef __MVS__
+# ifndef _OPEN_SYS
+# define _OPEN_SYS
+# endif
+# include <string.h>
+# include <sys/ps.h>
+#endif
+
+#ifdef __hpux
+# include <unistd.h>
+# include <sys/param.h>
+# include <sys/pstat.h>
+# include <string.h>
+#endif
+
+#if defined __sgi || defined __osf__
+# include <string.h>
+# include <unistd.h>
+# include <stdio.h>
+# include <fcntl.h>
+# include <sys/procfs.h>
+#endif
+
+#if defined __SCO_VERSION__ || defined __sysv5__
+# include <fcntl.h>
+# include <stdlib.h>
+# include <string.h>
+#endif
+
+#include "basename-lgpl.h"
+
+#ifndef HAVE_GETPROGNAME /* not Mac OS X, FreeBSD, NetBSD, OpenBSD >= 5.4, Cygwin */
+char const *
+getprogname (void)
+{
+# if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME /* glibc, BeOS */
+ /* https://www.gnu.org/software/libc/manual/html_node/Error-Messages.html */
+ return program_invocation_short_name;
+# elif HAVE_DECL_PROGRAM_INVOCATION_NAME /* glibc, BeOS */
+ /* https://www.gnu.org/software/libc/manual/html_node/Error-Messages.html */
+ return last_component (program_invocation_name);
+# elif HAVE_GETEXECNAME /* Solaris */
+ /* https://docs.oracle.com/cd/E19253-01/816-5168/6mbb3hrb1/index.html */
+ const char *p = getexecname ();
+ if (!p)
+ p = "?";
+ return last_component (p);
+# elif HAVE_DECL___ARGV /* mingw, MSVC */
+ /* https://docs.microsoft.com/en-us/cpp/c-runtime-library/argc-argv-wargv */
+ const char *p = __argv && __argv[0] ? __argv[0] : "?";
+ return last_component (p);
+# elif HAVE_VAR___PROGNAME /* OpenBSD, Android, QNX */
+ /* https://man.openbsd.org/style.9 */
+ /* http://www.qnx.de/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.neutrino_lib_ref%2Fp%2F__progname.html */
+ /* Be careful to declare this only when we absolutely need it
+ (OpenBSD 5.1), rather than when it's available. Otherwise,
+ its mere declaration makes program_invocation_short_name
+ malfunction (have zero length) with Fedora 25's glibc. */
+ extern char *__progname;
+ const char *p = __progname;
+# if defined __ANDROID__
+ return last_component (p);
+# else
+ return p && p[0] ? p : "?";
+# endif
+# elif _AIX /* AIX */
+ /* Idea by Bastien ROUCARIÈS,
+ https://lists.gnu.org/r/bug-gnulib/2010-12/msg00095.html
+ Reference: https://www.ibm.com/support/knowledgecenter/en/ssw_aix_61/com.ibm.aix.basetrf1/getprocs.htm
+ */
+ static char *p;
+ static int first = 1;
+ if (first)
+ {
+ first = 0;
+ pid_t pid = getpid ();
+ struct procentry64 procs;
+ p = (0 < getprocs64 (&procs, sizeof procs, NULL, 0, &pid, 1)
+ ? strdup (procs.pi_comm)
+ : NULL);
+ if (!p)
+ p = "?";
+ }
+ return p;
+# elif defined __hpux
+ static char *p;
+ static int first = 1;
+ if (first)
+ {
+ first = 0;
+ pid_t pid = getpid ();
+ struct pst_status status;
+ if (pstat_getproc (&status, sizeof status, 0, pid) > 0)
+ {
+ char *ucomm = status.pst_ucomm;
+ char *cmd = status.pst_cmd;
+ if (strlen (ucomm) < PST_UCOMMLEN - 1)
+ p = ucomm;
+ else
+ {
+ /* ucomm is truncated to length PST_UCOMMLEN - 1.
+ Look at cmd instead. */
+ char *space = strchr (cmd, ' ');
+ if (space != NULL)
+ *space = '\0';
+ p = strrchr (cmd, '/');
+ if (p != NULL)
+ p++;
+ else
+ p = cmd;
+ if (strlen (p) > PST_UCOMMLEN - 1
+ && memcmp (p, ucomm, PST_UCOMMLEN - 1) == 0)
+ /* p is less truncated than ucomm. */
+ ;
+ else
+ p = ucomm;
+ }
+ p = strdup (p);
+ }
+ else
+ {
+# if !defined __LP64__
+ /* Support for 32-bit programs running in 64-bit HP-UX.
+ The documented way to do this is to use the same source code
+ as above, but in a compilation unit where '#define _PSTAT64 1'
+ is in effect. I prefer a single compilation unit; the struct
+ size and the offsets are not going to change. */
+ char status64[1216];
+ if (__pstat_getproc64 (status64, sizeof status64, 0, pid) > 0)
+ {
+ char *ucomm = status64 + 288;
+ char *cmd = status64 + 168;
+ if (strlen (ucomm) < PST_UCOMMLEN - 1)
+ p = ucomm;
+ else
+ {
+ /* ucomm is truncated to length PST_UCOMMLEN - 1.
+ Look at cmd instead. */
+ char *space = strchr (cmd, ' ');
+ if (space != NULL)
+ *space = '\0';
+ p = strrchr (cmd, '/');
+ if (p != NULL)
+ p++;
+ else
+ p = cmd;
+ if (strlen (p) > PST_UCOMMLEN - 1
+ && memcmp (p, ucomm, PST_UCOMMLEN - 1) == 0)
+ /* p is less truncated than ucomm. */
+ ;
+ else
+ p = ucomm;
+ }
+ p = strdup (p);
+ }
+ else
+# endif
+ p = NULL;
+ }
+ if (!p)
+ p = "?";
+ }
+ return p;
+# elif __MVS__ /* z/OS */
+ /* https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxbd00/rtwgetp.htm */
+ static char *p = "?";
+ static int first = 1;
+ if (first)
+ {
+ pid_t pid = getpid ();
+ int token;
+ W_PSPROC buf;
+ first = 0;
+ memset (&buf, 0, sizeof(buf));
+ buf.ps_cmdptr = (char *) malloc (buf.ps_cmdlen = PS_CMDBLEN_LONG);
+ buf.ps_conttyptr = (char *) malloc (buf.ps_conttylen = PS_CONTTYBLEN);
+ buf.ps_pathptr = (char *) malloc (buf.ps_pathlen = PS_PATHBLEN);
+ if (buf.ps_cmdptr && buf.ps_conttyptr && buf.ps_pathptr)
+ {
+ for (token = 0; token >= 0;
+ token = w_getpsent (token, &buf, sizeof(buf)))
+ {
+ if (token > 0 && buf.ps_pid == pid)
+ {
+ char *s = strdup (last_component (buf.ps_pathptr));
+ if (s)
+ p = s;
+ break;
+ }
+ }
+ }
+ free (buf.ps_cmdptr);
+ free (buf.ps_conttyptr);
+ free (buf.ps_pathptr);
+ }
+ return p;
+# elif defined __sgi || defined __osf__ /* IRIX or Tru64 */
+ char filename[50];
+ int fd;
+
+ # if defined __sgi
+ sprintf (filename, "/proc/pinfo/%d", (int) getpid ());
+ # else
+ sprintf (filename, "/proc/%d", (int) getpid ());
+ # endif
+ fd = open (filename, O_RDONLY | O_CLOEXEC);
+ if (0 <= fd)
+ {
+ prpsinfo_t buf;
+ int ioctl_ok = 0 <= ioctl (fd, PIOCPSINFO, &buf);
+ close (fd);
+ if (ioctl_ok)
+ {
+ char *name = buf.pr_fname;
+ size_t namesize = sizeof buf.pr_fname;
+ /* It may not be NUL-terminated. */
+ char *namenul = memchr (name, '\0', namesize);
+ size_t namelen = namenul ? namenul - name : namesize;
+ char *namecopy = malloc (namelen + 1);
+ if (namecopy)
+ {
+ namecopy[namelen] = '\0';
+ return memcpy (namecopy, name, namelen);
+ }
+ }
+ }
+ return NULL;
+# elif defined __SCO_VERSION__ || defined __sysv5__ /* SCO OpenServer6/UnixWare */
+ char buf[80];
+ int fd;
+ sprintf (buf, "/proc/%d/cmdline", getpid());
+ fd = open (buf, O_RDONLY);
+ if (0 <= fd)
+ {
+ size_t n = read (fd, buf, 79);
+ if (n > 0)
+ {
+ buf[n] = '\0'; /* Guarantee null-termination */
+ char *progname;
+ progname = strrchr (buf, '/');
+ if (progname)
+ {
+ progname = progname + 1; /* Skip the '/' */
+ }
+ else
+ {
+ progname = buf;
+ }
+ char *ret;
+ ret = malloc (strlen (progname) + 1);
+ if (ret)
+ {
+ strcpy (ret, progname);
+ return ret;
+ }
+ }
+ close (fd);
+ }
+ return "?";
+# else
+# error "getprogname module not ported to this OS"
+# endif
+}
+
+#endif
+
+/*
+ * Hey Emacs!
+ * Local Variables:
+ * coding: utf-8
+ * End:
+ */
diff --git a/gl/lib/getprogname.h b/gl/lib/getprogname.h
new file mode 100644
index 0000000..9a35e58
--- /dev/null
+++ b/gl/lib/getprogname.h
@@ -0,0 +1,40 @@
+/* Program name management.
+ Copyright (C) 2016-2022 Free Software Foundation, Inc.
+
+ This program 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 2.1 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU 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/>. */
+
+#ifndef _GL_GETPROGNAME_H
+#define _GL_GETPROGNAME_H
+
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Return the base name of the executing program.
+ On native Windows this will usually end in ".exe" or ".EXE". */
+#ifndef HAVE_GETPROGNAME
+extern char const *getprogname (void)
+# ifdef HAVE_DECL_PROGRAM_INVOCATION_NAME
+ _GL_ATTRIBUTE_PURE
+# endif
+ ;
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/gl/lib/getrandom.c b/gl/lib/getrandom.c
new file mode 100644
index 0000000..e146873
--- /dev/null
+++ b/gl/lib/getrandom.c
@@ -0,0 +1,191 @@
+/* Obtain a series of random bytes.
+
+ Copyright 2020-2022 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 2.1 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 Paul Eggert. */
+
+#include <config.h>
+
+#include <sys/random.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <unistd.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# if HAVE_BCRYPT_H
+# include <bcrypt.h>
+# else
+# define NTSTATUS LONG
+typedef void * BCRYPT_ALG_HANDLE;
+# define BCRYPT_USE_SYSTEM_PREFERRED_RNG 0x00000002
+# if HAVE_LIB_BCRYPT
+extern NTSTATUS WINAPI BCryptGenRandom (BCRYPT_ALG_HANDLE, UCHAR *, ULONG, ULONG);
+# endif
+# endif
+# if !HAVE_LIB_BCRYPT
+# include <wincrypt.h>
+# ifndef CRYPT_VERIFY_CONTEXT
+# define CRYPT_VERIFY_CONTEXT 0xF0000000
+# endif
+# endif
+#endif
+
+#include "minmax.h"
+
+#if defined _WIN32 && ! defined __CYGWIN__
+
+/* Don't assume that UNICODE is not defined. */
+# undef LoadLibrary
+# define LoadLibrary LoadLibraryA
+# undef CryptAcquireContext
+# define CryptAcquireContext CryptAcquireContextA
+
+# if !HAVE_LIB_BCRYPT
+
+/* Avoid warnings from gcc -Wcast-function-type. */
+# define GetProcAddress \
+ (void *) GetProcAddress
+
+/* BCryptGenRandom with the BCRYPT_USE_SYSTEM_PREFERRED_RNG flag works only
+ starting with Windows 7. */
+typedef NTSTATUS (WINAPI * BCryptGenRandomFuncType) (BCRYPT_ALG_HANDLE, UCHAR *, ULONG, ULONG);
+static BCryptGenRandomFuncType BCryptGenRandomFunc = NULL;
+static BOOL initialized = FALSE;
+
+static void
+initialize (void)
+{
+ HMODULE bcrypt = LoadLibrary ("bcrypt.dll");
+ if (bcrypt != NULL)
+ {
+ BCryptGenRandomFunc =
+ (BCryptGenRandomFuncType) GetProcAddress (bcrypt, "BCryptGenRandom");
+ }
+ initialized = TRUE;
+}
+
+# else
+
+# define BCryptGenRandomFunc BCryptGenRandom
+
+# endif
+
+#else
+/* These devices exist on all platforms except native Windows. */
+
+/* Name of a device through which the kernel returns high quality random
+ numbers, from an entropy pool. When the pool is empty, the call blocks
+ until entropy sources have added enough bits of entropy. */
+# ifndef NAME_OF_RANDOM_DEVICE
+# define NAME_OF_RANDOM_DEVICE "/dev/random"
+# endif
+
+/* Name of a device through which the kernel returns random or pseudo-random
+ numbers. It uses an entropy pool, but, in order to avoid blocking, adds
+ bits generated by a pseudo-random number generator, as needed. */
+# ifndef NAME_OF_NONCE_DEVICE
+# define NAME_OF_NONCE_DEVICE "/dev/urandom"
+# endif
+
+#endif
+
+/* Set BUFFER (of size LENGTH) to random bytes under the control of FLAGS.
+ Return the number of bytes written (> 0).
+ Upon error, return -1 and set errno. */
+ssize_t
+getrandom (void *buffer, size_t length, unsigned int flags)
+#undef getrandom
+{
+#if defined _WIN32 && ! defined __CYGWIN__
+ /* BCryptGenRandom, defined in <bcrypt.h>
+ <https://docs.microsoft.com/en-us/windows/win32/api/bcrypt/nf-bcrypt-bcryptgenrandom>
+ with the BCRYPT_USE_SYSTEM_PREFERRED_RNG flag
+ works in Windows 7 and newer. */
+ static int bcrypt_not_working /* = 0 */;
+ if (!bcrypt_not_working)
+ {
+# if !HAVE_LIB_BCRYPT
+ if (!initialized)
+ initialize ();
+# endif
+ if (BCryptGenRandomFunc != NULL
+ && BCryptGenRandomFunc (NULL, buffer, length,
+ BCRYPT_USE_SYSTEM_PREFERRED_RNG)
+ == 0 /*STATUS_SUCCESS*/)
+ return length;
+ bcrypt_not_working = 1;
+ }
+# if !HAVE_LIB_BCRYPT
+ /* CryptGenRandom, defined in <wincrypt.h>
+ <https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cryptgenrandom>
+ works in older releases as well, but is now deprecated.
+ CryptAcquireContext, defined in <wincrypt.h>
+ <https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cryptacquirecontexta> */
+ {
+ static int crypt_initialized /* = 0 */;
+ static HCRYPTPROV provider;
+ if (!crypt_initialized)
+ {
+ if (CryptAcquireContext (&provider, NULL, NULL, PROV_RSA_FULL,
+ CRYPT_VERIFY_CONTEXT))
+ crypt_initialized = 1;
+ else
+ crypt_initialized = -1;
+ }
+ if (crypt_initialized >= 0)
+ {
+ if (!CryptGenRandom (provider, length, buffer))
+ {
+ errno = EIO;
+ return -1;
+ }
+ return length;
+ }
+ }
+# endif
+ errno = ENOSYS;
+ return -1;
+#elif HAVE_GETRANDOM
+ return getrandom (buffer, length, flags);
+#else
+ static int randfd[2] = { -1, -1 };
+ bool devrandom = (flags & GRND_RANDOM) != 0;
+ int fd = randfd[devrandom];
+
+ if (fd < 0)
+ {
+ static char const randdevice[][MAX (sizeof NAME_OF_NONCE_DEVICE,
+ sizeof NAME_OF_RANDOM_DEVICE)]
+ = { NAME_OF_NONCE_DEVICE, NAME_OF_RANDOM_DEVICE };
+ int oflags = (O_RDONLY + O_CLOEXEC
+ + (flags & GRND_NONBLOCK ? O_NONBLOCK : 0));
+ fd = open (randdevice[devrandom], oflags);
+ if (fd < 0)
+ {
+ if (errno == ENOENT || errno == ENOTDIR)
+ errno = ENOSYS;
+ return -1;
+ }
+ randfd[devrandom] = fd;
+ }
+
+ return read (fd, buffer, length);
+#endif
+}
diff --git a/gl/lib/gettext.h b/gl/lib/gettext.h
new file mode 100644
index 0000000..b3577a0
--- /dev/null
+++ b/gl/lib/gettext.h
@@ -0,0 +1,300 @@
+/* Convenience header for conditional use of GNU <libintl.h>.
+ Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2022 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 2.1 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/>. */
+
+#ifndef _LIBGETTEXT_H
+#define _LIBGETTEXT_H 1
+
+/* NLS can be disabled through the configure --disable-nls option
+ or through "#define ENABLE NLS 0" before including this file. */
+#if defined ENABLE_NLS && ENABLE_NLS
+
+/* Get declarations of GNU message catalog functions. */
+# include <libintl.h>
+
+/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by
+ the gettext() and ngettext() macros. This is an alternative to calling
+ textdomain(), and is useful for libraries. */
+# ifdef DEFAULT_TEXT_DOMAIN
+# undef gettext
+# define gettext(Msgid) \
+ dgettext (DEFAULT_TEXT_DOMAIN, Msgid)
+# undef ngettext
+# define ngettext(Msgid1, Msgid2, N) \
+ dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N)
+# endif
+
+#else
+
+/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
+ chokes if dcgettext is defined as a macro. So include it now, to make
+ later inclusions of <locale.h> a NOP. We don't include <libintl.h>
+ as well because people using "gettext.h" will not include <libintl.h>,
+ and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
+ is OK. */
+#if defined(__sun)
+# include <locale.h>
+#endif
+
+/* Many header files from the libstdc++ coming with g++ 3.3 or newer include
+ <libintl.h>, which chokes if dcgettext is defined as a macro. So include
+ it now, to make later inclusions of <libintl.h> a NOP. */
+#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
+# include <cstdlib>
+# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || _GLIBCXX_HAVE_LIBINTL_H
+# include <libintl.h>
+# endif
+#endif
+
+/* Disabled NLS.
+ The casts to 'const char *' serve the purpose of producing warnings
+ for invalid uses of the value returned from these functions.
+ On pre-ANSI systems without 'const', the config.h file is supposed to
+ contain "#define const". */
+# undef gettext
+# define gettext(Msgid) ((const char *) (Msgid))
+# undef dgettext
+# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid))
+# undef dcgettext
+# define dcgettext(Domainname, Msgid, Category) \
+ ((void) (Category), dgettext (Domainname, Msgid))
+# undef ngettext
+# define ngettext(Msgid1, Msgid2, N) \
+ ((N) == 1 \
+ ? ((void) (Msgid2), (const char *) (Msgid1)) \
+ : ((void) (Msgid1), (const char *) (Msgid2)))
+# undef dngettext
+# define dngettext(Domainname, Msgid1, Msgid2, N) \
+ ((void) (Domainname), ngettext (Msgid1, Msgid2, N))
+# undef dcngettext
+# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
+ ((void) (Category), dngettext (Domainname, Msgid1, Msgid2, N))
+# undef textdomain
+# define textdomain(Domainname) ((const char *) (Domainname))
+# undef bindtextdomain
+# define bindtextdomain(Domainname, Dirname) \
+ ((void) (Domainname), (const char *) (Dirname))
+# undef bind_textdomain_codeset
+# define bind_textdomain_codeset(Domainname, Codeset) \
+ ((void) (Domainname), (const char *) (Codeset))
+
+#endif
+
+/* Prefer gnulib's setlocale override over libintl's setlocale override. */
+#ifdef GNULIB_defined_setlocale
+# undef setlocale
+# define setlocale rpl_setlocale
+#endif
+
+/* A pseudo function call that serves as a marker for the automated
+ extraction of messages, but does not call gettext(). The run-time
+ translation is done at a different place in the code.
+ The argument, String, should be a literal string. Concatenated strings
+ and other string expressions won't work.
+ The macro's expansion is not parenthesized, so that it is suitable as
+ initializer for static 'char[]' or 'const char[]' variables. */
+#define gettext_noop(String) String
+
+/* The separator between msgctxt and msgid in a .mo file. */
+#define GETTEXT_CONTEXT_GLUE "\004"
+
+/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
+ MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be
+ short and rarely need to change.
+ The letter 'p' stands for 'particular' or 'special'. */
+#ifdef DEFAULT_TEXT_DOMAIN
+# define pgettext(Msgctxt, Msgid) \
+ pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#else
+# define pgettext(Msgctxt, Msgid) \
+ pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#endif
+#define dpgettext(Domainname, Msgctxt, Msgid) \
+ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
+ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category)
+#ifdef DEFAULT_TEXT_DOMAIN
+# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+ npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#else
+# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+ npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#endif
+#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
+ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
+ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category)
+
+#if defined __GNUC__ || defined __clang__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+pgettext_aux (const char *domain,
+ const char *msg_ctxt_id, const char *msgid,
+ int category)
+{
+ const char *translation = dcgettext (domain, msg_ctxt_id, category);
+ if (translation == msg_ctxt_id)
+ return msgid;
+ else
+ return translation;
+}
+
+#if defined __GNUC__ || defined __clang__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+npgettext_aux (const char *domain,
+ const char *msg_ctxt_id, const char *msgid,
+ const char *msgid_plural, unsigned long int n,
+ int category)
+{
+ const char *translation =
+ dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
+ if (translation == msg_ctxt_id || translation == msgid_plural)
+ return (n == 1 ? msgid : msgid_plural);
+ else
+ return translation;
+}
+
+/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID
+ can be arbitrary expressions. But for string literals these macros are
+ less efficient than those above. */
+
+#include <string.h>
+
+/* GNULIB_NO_VLA can be defined to disable use of VLAs even if supported.
+ This relates to the -Wvla and -Wvla-larger-than warnings, enabled in
+ the default GCC many warnings set. This allows programs to disable use
+ of VLAs, which may be unintended, or may be awkward to support portably,
+ or may have security implications due to non-deterministic stack usage. */
+
+#if (!defined GNULIB_NO_VLA \
+ && defined __STDC_VERSION__ && 199901L <= __STDC_VERSION__ \
+ && !defined __STDC_NO_VLA__)
+# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1
+#else
+# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0
+#endif
+
+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+#include <stdlib.h>
+#endif
+
+#define pgettext_expr(Msgctxt, Msgid) \
+ dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES)
+#define dpgettext_expr(Domainname, Msgctxt, Msgid) \
+ dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES)
+
+#if defined __GNUC__ || defined __clang__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+dcpgettext_expr (const char *domain,
+ const char *msgctxt, const char *msgid,
+ int category)
+{
+ size_t msgctxt_len = strlen (msgctxt) + 1;
+ size_t msgid_len = strlen (msgid) + 1;
+ const char *translation;
+#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ char msg_ctxt_id[msgctxt_len + msgid_len];
+#else
+ char buf[1024];
+ char *msg_ctxt_id =
+ (msgctxt_len + msgid_len <= sizeof (buf)
+ ? buf
+ : (char *) malloc (msgctxt_len + msgid_len));
+ if (msg_ctxt_id != NULL)
+#endif
+ {
+ int found_translation;
+ memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
+ msg_ctxt_id[msgctxt_len - 1] = '\004';
+ memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
+ translation = dcgettext (domain, msg_ctxt_id, category);
+ found_translation = (translation != msg_ctxt_id);
+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ if (msg_ctxt_id != buf)
+ free (msg_ctxt_id);
+#endif
+ if (found_translation)
+ return translation;
+ }
+ return msgid;
+}
+
+#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \
+ dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
+#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
+ dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
+
+#if defined __GNUC__ || defined __clang__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+dcnpgettext_expr (const char *domain,
+ const char *msgctxt, const char *msgid,
+ const char *msgid_plural, unsigned long int n,
+ int category)
+{
+ size_t msgctxt_len = strlen (msgctxt) + 1;
+ size_t msgid_len = strlen (msgid) + 1;
+ const char *translation;
+#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ char msg_ctxt_id[msgctxt_len + msgid_len];
+#else
+ char buf[1024];
+ char *msg_ctxt_id =
+ (msgctxt_len + msgid_len <= sizeof (buf)
+ ? buf
+ : (char *) malloc (msgctxt_len + msgid_len));
+ if (msg_ctxt_id != NULL)
+#endif
+ {
+ int found_translation;
+ memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
+ msg_ctxt_id[msgctxt_len - 1] = '\004';
+ memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
+ translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
+ found_translation = !(translation == msg_ctxt_id || translation == msgid_plural);
+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ if (msg_ctxt_id != buf)
+ free (msg_ctxt_id);
+#endif
+ if (found_translation)
+ return translation;
+ }
+ return (n == 1 ? msgid : msgid_plural);
+}
+
+#endif /* _LIBGETTEXT_H */
diff --git a/gl/lib/gettime.c b/gl/lib/gettime.c
new file mode 100644
index 0000000..541af18
--- /dev/null
+++ b/gl/lib/gettime.c
@@ -0,0 +1,51 @@
+/* gettime -- get the system clock
+
+ Copyright (C) 2002, 2004-2007, 2009-2022 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 Paul Eggert. */
+
+#include <config.h>
+
+#include "timespec.h"
+
+#include <sys/time.h>
+
+/* Get the system time into *TS. */
+
+void
+gettime (struct timespec *ts)
+{
+#if defined CLOCK_REALTIME && HAVE_CLOCK_GETTIME
+ clock_gettime (CLOCK_REALTIME, ts);
+#elif defined HAVE_TIMESPEC_GET
+ timespec_get (ts, TIME_UTC);
+#else
+ struct timeval tv;
+ gettimeofday (&tv, NULL);
+ ts->tv_sec = tv.tv_sec;
+ ts->tv_nsec = tv.tv_usec * 1000;
+#endif
+}
+
+/* Return the current system time as a struct timespec. */
+
+struct timespec
+current_timespec (void)
+{
+ struct timespec ts;
+ gettime (&ts);
+ return ts;
+}
diff --git a/gl/lib/gettimeofday.c b/gl/lib/gettimeofday.c
new file mode 100644
index 0000000..36c7920
--- /dev/null
+++ b/gl/lib/gettimeofday.c
@@ -0,0 +1,153 @@
+/* Provide gettimeofday for systems that don't have it or for which it's broken.
+
+ Copyright (C) 2001-2003, 2005-2007, 2009-2022 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 2.1 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 Jim Meyering */
+
+#include <config.h>
+
+/* Specification. */
+#include <sys/time.h>
+
+#include <time.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+# define WINDOWS_NATIVE
+# include <windows.h>
+#endif
+
+#ifdef WINDOWS_NATIVE
+
+/* Don't assume that UNICODE is not defined. */
+# undef LoadLibrary
+# define LoadLibrary LoadLibraryA
+
+# if !(_WIN32_WINNT >= _WIN32_WINNT_WIN8)
+
+/* Avoid warnings from gcc -Wcast-function-type. */
+# define GetProcAddress \
+ (void *) GetProcAddress
+
+/* GetSystemTimePreciseAsFileTime was introduced only in Windows 8. */
+typedef void (WINAPI * GetSystemTimePreciseAsFileTimeFuncType) (FILETIME *lpTime);
+static GetSystemTimePreciseAsFileTimeFuncType GetSystemTimePreciseAsFileTimeFunc = NULL;
+static BOOL initialized = FALSE;
+
+static void
+initialize (void)
+{
+ HMODULE kernel32 = LoadLibrary ("kernel32.dll");
+ if (kernel32 != NULL)
+ {
+ GetSystemTimePreciseAsFileTimeFunc =
+ (GetSystemTimePreciseAsFileTimeFuncType) GetProcAddress (kernel32, "GetSystemTimePreciseAsFileTime");
+ }
+ initialized = TRUE;
+}
+
+# else
+
+# define GetSystemTimePreciseAsFileTimeFunc GetSystemTimePreciseAsFileTime
+
+# endif
+
+#endif
+
+/* This is a wrapper for gettimeofday. It is used only on systems
+ that lack this function, or whose implementation of this function
+ causes problems.
+ Work around the bug in some systems whereby gettimeofday clobbers
+ the static buffer that localtime uses for its return value. The
+ gettimeofday function from Mac OS X 10.0.4 (i.e., Darwin 1.3.7) has
+ this problem. */
+
+int
+gettimeofday (struct timeval *restrict tv, void *restrict tz)
+{
+#undef gettimeofday
+#ifdef WINDOWS_NATIVE
+
+ /* On native Windows, there are two ways to get the current time:
+ GetSystemTimeAsFileTime
+ <https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimeasfiletime>
+ or
+ GetSystemTimePreciseAsFileTime
+ <https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimepreciseasfiletime>.
+ GetSystemTimeAsFileTime produces values that jump by increments of
+ 15.627 milliseconds (!) on average.
+ Whereas GetSystemTimePreciseAsFileTime values usually jump by 1 or 2
+ microseconds.
+ More discussion on this topic:
+ <http://www.windowstimestamp.com/description>. */
+ FILETIME current_time;
+
+# if !(_WIN32_WINNT >= _WIN32_WINNT_WIN8)
+ if (!initialized)
+ initialize ();
+# endif
+ if (GetSystemTimePreciseAsFileTimeFunc != NULL)
+ GetSystemTimePreciseAsFileTimeFunc (&current_time);
+ else
+ GetSystemTimeAsFileTime (&current_time);
+
+ /* Convert from FILETIME to 'struct timeval'. */
+ /* FILETIME: <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-filetime> */
+ ULONGLONG since_1601 =
+ ((ULONGLONG) current_time.dwHighDateTime << 32)
+ | (ULONGLONG) current_time.dwLowDateTime;
+ /* Between 1601-01-01 and 1970-01-01 there were 280 normal years and 89 leap
+ years, in total 134774 days. */
+ ULONGLONG since_1970 =
+ since_1601 - (ULONGLONG) 134774 * (ULONGLONG) 86400 * (ULONGLONG) 10000000;
+ ULONGLONG microseconds_since_1970 = since_1970 / (ULONGLONG) 10;
+ tv->tv_sec = microseconds_since_1970 / (ULONGLONG) 1000000;
+ tv->tv_usec = microseconds_since_1970 % (ULONGLONG) 1000000;
+
+ return 0;
+
+#else
+
+# if HAVE_GETTIMEOFDAY
+
+# if defined timeval /* 'struct timeval' overridden by gnulib? */
+# undef timeval
+ struct timeval otv;
+ int result = gettimeofday (&otv, (struct timezone *) tz);
+ if (result == 0)
+ {
+ tv->tv_sec = otv.tv_sec;
+ tv->tv_usec = otv.tv_usec;
+ }
+# else
+ int result = gettimeofday (tv, (struct timezone *) tz);
+# endif
+
+ return result;
+
+# else
+
+# if !defined OK_TO_USE_1S_CLOCK
+# error "Only 1-second nominal clock resolution found. Is that intended?" \
+ "If so, compile with the -DOK_TO_USE_1S_CLOCK option."
+# endif
+ tv->tv_sec = time (NULL);
+ tv->tv_usec = 0;
+
+ return 0;
+
+# endif
+#endif
+}
diff --git a/gl/lib/gl_anyhash1.h b/gl/lib/gl_anyhash1.h
new file mode 100644
index 0000000..c6c046e
--- /dev/null
+++ b/gl/lib/gl_anyhash1.h
@@ -0,0 +1,31 @@
+/* Hash table for sequential list, set, and map data type.
+ Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+ 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 2.1 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/>. */
+
+/* Common code of
+ gl_linkedhash_list.c, gl_avltreehash_list.c, gl_rbtreehash_list.c,
+ gl_linkedhash_set.c, gl_hash_set.c,
+ gl_linkedhash_map.c, gl_hash_map.c. */
+
+/* Hash table entry. */
+struct gl_hash_entry
+{
+ struct gl_hash_entry *hash_next; /* chain of entries in same bucket */
+ size_t hashcode; /* cache of the hash code of
+ - the key (for map data type) or
+ - the value (for list, set data types) */
+};
+typedef struct gl_hash_entry * gl_hash_entry_t;
diff --git a/gl/lib/gl_anyhash2.h b/gl/lib/gl_anyhash2.h
new file mode 100644
index 0000000..5ceba98
--- /dev/null
+++ b/gl/lib/gl_anyhash2.h
@@ -0,0 +1,82 @@
+/* Hash table for sequential list, set, and map data type.
+ Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+ 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 2.1 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/>. */
+
+/* Common code of
+ gl_linkedhash_list.c, gl_avltreehash_list.c, gl_rbtreehash_list.c,
+ gl_linkedhash_set.c, gl_hash_set.c,
+ gl_linkedhash_map.c, gl_hash_map.c. */
+
+#include "gl_anyhash_primes.h"
+
+/* Resizes the hash table with a new estimated size. */
+static void
+hash_resize (CONTAINER_T container, size_t estimate)
+{
+ size_t new_size = next_prime (estimate);
+
+ if (new_size > container->table_size)
+ {
+ gl_hash_entry_t *old_table = container->table;
+ /* Allocate the new table. */
+ gl_hash_entry_t *new_table;
+ size_t i;
+
+ if (size_overflow_p (xtimes (new_size, sizeof (gl_hash_entry_t))))
+ goto fail;
+ new_table =
+ (gl_hash_entry_t *) calloc (new_size, sizeof (gl_hash_entry_t));
+ if (new_table == NULL)
+ goto fail;
+
+ /* Iterate through the entries of the old table. */
+ for (i = container->table_size; i > 0; )
+ {
+ gl_hash_entry_t node = old_table[--i];
+
+ while (node != NULL)
+ {
+ gl_hash_entry_t next = node->hash_next;
+ /* Add the entry to the new table. */
+ size_t bucket = node->hashcode % new_size;
+ node->hash_next = new_table[bucket];
+ new_table[bucket] = node;
+
+ node = next;
+ }
+ }
+
+ container->table = new_table;
+ container->table_size = new_size;
+ free (old_table);
+ }
+ return;
+
+ fail:
+ /* Just continue without resizing the table. */
+ return;
+}
+
+/* Resizes the hash table if needed, after CONTAINER_COUNT (container) was
+ incremented. */
+static void
+hash_resize_after_add (CONTAINER_T container)
+{
+ size_t count = CONTAINER_COUNT (container);
+ size_t estimate = xsum (count, count / 2); /* 1.5 * count */
+ if (estimate > container->table_size)
+ hash_resize (container, estimate);
+}
diff --git a/gl/lib/gl_anyhash_primes.h b/gl/lib/gl_anyhash_primes.h
new file mode 100644
index 0000000..b00a606
--- /dev/null
+++ b/gl/lib/gl_anyhash_primes.h
@@ -0,0 +1,87 @@
+/* Table of primes, for use by hash tables.
+ Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+ 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 2.1 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/>. */
+
+/* Array of primes, approximately in steps of factor 1.2.
+ This table was computed by executing the Common Lisp expression
+ (dotimes (i 244) (format t "nextprime(~D)~%" (ceiling (expt 1.2d0 i))))
+ and feeding the result to PARI/gp. */
+static const size_t primes[] =
+ {
+ 11, 13, 17, 19, 23, 29, 37, 41, 47, 59, 67, 83, 97, 127, 139, 167, 199,
+ 239, 293, 347, 419, 499, 593, 709, 853, 1021, 1229, 1471, 1777, 2129, 2543,
+ 3049, 3659, 4391, 5273, 6323, 7589, 9103, 10937, 13109, 15727, 18899,
+ 22651, 27179, 32609, 39133, 46957, 56359, 67619, 81157, 97369, 116849,
+ 140221, 168253, 201907, 242309, 290761, 348889, 418667, 502409, 602887,
+ 723467, 868151, 1041779, 1250141, 1500181, 1800191, 2160233, 2592277,
+ 3110741, 3732887, 4479463, 5375371, 6450413, 7740517, 9288589, 11146307,
+ 13375573, 16050689, 19260817, 23112977, 27735583, 33282701, 39939233,
+ 47927081, 57512503, 69014987, 82818011, 99381577, 119257891, 143109469,
+ 171731387, 206077643, 247293161, 296751781, 356102141, 427322587,
+ 512787097, 615344489, 738413383, 886096061, 1063315271, 1275978331,
+ 1531174013, 1837408799, 2204890543UL, 2645868653UL, 3175042391UL,
+ 3810050851UL,
+#if SIZE_MAX > 4294967295UL
+ 4572061027UL, 5486473229UL, 6583767889UL, 7900521449UL, 9480625733UL,
+ 11376750877UL, 13652101063UL, 16382521261UL, 19659025513UL, 23590830631UL,
+ 28308996763UL, 33970796089UL, 40764955463UL, 48917946377UL, 58701535657UL,
+ 70441842749UL, 84530211301UL, 101436253561UL, 121723504277UL,
+ 146068205131UL, 175281846149UL, 210338215379UL, 252405858521UL,
+ 302887030151UL, 363464436191UL, 436157323417UL, 523388788231UL,
+ 628066545713UL, 753679854847UL, 904415825857UL, 1085298991109UL,
+ 1302358789181UL, 1562830547009UL, 1875396656429UL, 2250475987709UL,
+ 2700571185239UL, 3240685422287UL, 3888822506759UL, 4666587008147UL,
+ 5599904409713UL, 6719885291641UL, 8063862349969UL, 9676634819959UL,
+ 11611961783951UL, 13934354140769UL, 16721224968907UL, 20065469962669UL,
+ 24078563955191UL, 28894276746229UL, 34673132095507UL, 41607758514593UL,
+ 49929310217531UL, 59915172260971UL, 71898206713183UL, 86277848055823UL,
+ 103533417666967UL, 124240101200359UL, 149088121440451UL, 178905745728529UL,
+ 214686894874223UL, 257624273849081UL, 309149128618903UL, 370978954342639UL,
+ 445174745211143UL, 534209694253381UL, 641051633104063UL, 769261959724877UL,
+ 923114351670013UL, 1107737222003791UL, 1329284666404567UL,
+ 1595141599685509UL, 1914169919622551UL, 2297003903547091UL,
+ 2756404684256459UL, 3307685621107757UL, 3969222745329323UL,
+ 4763067294395177UL, 5715680753274209UL, 6858816903929113UL,
+ 8230580284714831UL, 9876696341657791UL, 11852035609989371UL,
+ 14222442731987227UL, 17066931278384657UL, 20480317534061597UL,
+ 24576381040873903UL, 29491657249048679UL, 35389988698858471UL,
+ 42467986438630267UL, 50961583726356109UL, 61153900471627387UL,
+ 73384680565952851UL, 88061616679143347UL, 105673940014972061UL,
+ 126808728017966413UL, 152170473621559703UL, 182604568345871671UL,
+ 219125482015045997UL, 262950578418055169UL, 315540694101666193UL,
+ 378648832921999397UL, 454378599506399233UL, 545254319407679131UL,
+ 654305183289214771UL, 785166219947057701UL, 942199463936469157UL,
+ 1130639356723763129UL, 1356767228068515623UL, 1628120673682218619UL,
+ 1953744808418662409UL, 2344493770102394881UL, 2813392524122873857UL,
+ 3376071028947448339UL, 4051285234736937517UL, 4861542281684325481UL,
+ 5833850738021191727UL, 7000620885625427969UL, 8400745062750513217UL,
+ 10080894075300616261UL, 12097072890360739951UL, 14516487468432885797UL,
+ 17419784962119465179UL,
+#endif
+ SIZE_MAX /* sentinel, to ensure the search terminates */
+ };
+
+/* Returns a suitable prime >= ESTIMATE. */
+static size_t
+next_prime (size_t estimate)
+{
+ size_t i;
+
+ for (i = 0; i < sizeof (primes) / sizeof (primes[0]); i++)
+ if (primes[i] >= estimate)
+ return primes[i];
+ return SIZE_MAX; /* not a prime, but better than nothing */
+}
diff --git a/gl/lib/gl_anylinked_list1.h b/gl/lib/gl_anylinked_list1.h
new file mode 100644
index 0000000..709106a
--- /dev/null
+++ b/gl/lib/gl_anylinked_list1.h
@@ -0,0 +1,48 @@
+/* Sequential list data type implemented by a linked list.
+ Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+ 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 2.1 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/>. */
+
+/* Common code of gl_linked_list.c and gl_linkedhash_list.c. */
+
+/* -------------------------- gl_list_t Data Type -------------------------- */
+
+/* Concrete list node implementation, valid for this file only. */
+struct gl_list_node_impl
+{
+#if WITH_HASHTABLE
+ struct gl_hash_entry h; /* hash table entry fields; must be first */
+#endif
+ struct gl_list_node_impl *next;
+ struct gl_list_node_impl *prev;
+ const void *value;
+};
+
+/* Concrete gl_list_impl type, valid for this file only. */
+struct gl_list_impl
+{
+ struct gl_list_impl_base base;
+#if WITH_HASHTABLE
+ /* A hash table: managed as an array of collision lists. */
+ struct gl_hash_entry **table;
+ size_t table_size;
+#endif
+ /* A circular list anchored at root.
+ The first node is = root.next, the last node is = root.prev.
+ The root's value is unused. */
+ struct gl_list_node_impl root;
+ /* Number of list nodes, excluding the root. */
+ size_t count;
+};
diff --git a/gl/lib/gl_anylinked_list2.h b/gl/lib/gl_anylinked_list2.h
new file mode 100644
index 0000000..af83f0d
--- /dev/null
+++ b/gl/lib/gl_anylinked_list2.h
@@ -0,0 +1,1215 @@
+/* Sequential list data type implemented by a linked list.
+ Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+ 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 2.1 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/>. */
+
+/* Common code of gl_linked_list.c and gl_linkedhash_list.c. */
+
+/* If the symbol SIGNAL_SAFE_LIST is defined, the code is compiled in such
+ a way that a gl_list_t data structure may be used from within a signal
+ handler. The operations allowed in the signal handler are:
+ gl_list_iterator, gl_list_iterator_next, gl_list_iterator_free.
+ The list and node fields that are therefore accessed from the signal handler
+ are:
+ list->root, node->next, node->value.
+ We are careful to make modifications to these fields only in an order
+ that maintains the consistency of the list data structure at any moment,
+ and we use 'volatile' assignments to prevent the compiler from reordering
+ such assignments. */
+#ifdef SIGNAL_SAFE_LIST
+# define ASYNCSAFE(type) *(type volatile *)&
+#else
+# define ASYNCSAFE(type)
+#endif
+
+/* -------------------------- gl_list_t Data Type -------------------------- */
+
+static gl_list_t
+gl_linked_nx_create_empty (gl_list_implementation_t implementation,
+ gl_listelement_equals_fn equals_fn,
+ gl_listelement_hashcode_fn hashcode_fn,
+ gl_listelement_dispose_fn dispose_fn,
+ bool allow_duplicates)
+{
+ struct gl_list_impl *list =
+ (struct gl_list_impl *) malloc (sizeof (struct gl_list_impl));
+
+ if (list == NULL)
+ return NULL;
+
+ list->base.vtable = implementation;
+ list->base.equals_fn = equals_fn;
+ list->base.hashcode_fn = hashcode_fn;
+ list->base.dispose_fn = dispose_fn;
+ list->base.allow_duplicates = allow_duplicates;
+#if WITH_HASHTABLE
+ list->table_size = 11;
+ list->table =
+ (gl_hash_entry_t *) calloc (list->table_size, sizeof (gl_hash_entry_t));
+ if (list->table == NULL)
+ goto fail;
+#endif
+ list->root.next = &list->root;
+ list->root.prev = &list->root;
+ list->count = 0;
+
+ return list;
+
+#if WITH_HASHTABLE
+ fail:
+ free (list);
+ return NULL;
+#endif
+}
+
+static gl_list_t
+gl_linked_nx_create (gl_list_implementation_t implementation,
+ gl_listelement_equals_fn equals_fn,
+ gl_listelement_hashcode_fn hashcode_fn,
+ gl_listelement_dispose_fn dispose_fn,
+ bool allow_duplicates,
+ size_t count, const void **contents)
+{
+ struct gl_list_impl *list =
+ (struct gl_list_impl *) malloc (sizeof (struct gl_list_impl));
+ gl_list_node_t tail;
+
+ if (list == NULL)
+ return NULL;
+
+ list->base.vtable = implementation;
+ list->base.equals_fn = equals_fn;
+ list->base.hashcode_fn = hashcode_fn;
+ list->base.dispose_fn = dispose_fn;
+ list->base.allow_duplicates = allow_duplicates;
+#if WITH_HASHTABLE
+ {
+ size_t estimate = xsum (count, count / 2); /* 1.5 * count */
+ if (estimate < 10)
+ estimate = 10;
+ list->table_size = next_prime (estimate);
+ if (size_overflow_p (xtimes (list->table_size, sizeof (gl_hash_entry_t))))
+ goto fail1;
+ list->table =
+ (gl_hash_entry_t *) calloc (list->table_size, sizeof (gl_hash_entry_t));
+ if (list->table == NULL)
+ goto fail1;
+ }
+#endif
+ list->count = count;
+ tail = &list->root;
+ for (; count > 0; contents++, count--)
+ {
+ gl_list_node_t node =
+ (struct gl_list_node_impl *) malloc (sizeof (struct gl_list_node_impl));
+
+ if (node == NULL)
+ goto fail2;
+
+ node->value = *contents;
+#if WITH_HASHTABLE
+ node->h.hashcode =
+ (list->base.hashcode_fn != NULL
+ ? list->base.hashcode_fn (node->value)
+ : (size_t)(uintptr_t) node->value);
+
+ /* Add node to the hash table. */
+ if (add_to_bucket (list, node) < 0)
+ {
+ free (node);
+ goto fail2;
+ }
+#endif
+
+ /* Add node to the list. */
+ node->prev = tail;
+ tail->next = node;
+ tail = node;
+ }
+ tail->next = &list->root;
+ list->root.prev = tail;
+
+ return list;
+
+ fail2:
+ {
+ gl_list_node_t node;
+
+ for (node = tail; node != &list->root; )
+ {
+ gl_list_node_t prev = node->prev;
+
+ free (node);
+ node = prev;
+ }
+ }
+#if WITH_HASHTABLE
+ free (list->table);
+ fail1:
+#endif
+ free (list);
+ return NULL;
+}
+
+static size_t _GL_ATTRIBUTE_PURE
+gl_linked_size (gl_list_t list)
+{
+ return list->count;
+}
+
+static const void * _GL_ATTRIBUTE_PURE
+gl_linked_node_value (_GL_ATTRIBUTE_MAYBE_UNUSED gl_list_t list,
+ gl_list_node_t node)
+{
+ return node->value;
+}
+
+static int
+gl_linked_node_nx_set_value (_GL_ATTRIBUTE_MAYBE_UNUSED gl_list_t list,
+ gl_list_node_t node,
+ const void *elt)
+{
+#if WITH_HASHTABLE
+ if (elt != node->value)
+ {
+ size_t new_hashcode =
+ (list->base.hashcode_fn != NULL
+ ? list->base.hashcode_fn (elt)
+ : (size_t)(uintptr_t) elt);
+
+ if (new_hashcode != node->h.hashcode)
+ {
+ remove_from_bucket (list, node);
+ node->value = elt;
+ node->h.hashcode = new_hashcode;
+ if (add_to_bucket (list, node) < 0)
+ {
+ /* Out of memory. We removed node from a bucket but cannot add
+ it to another bucket. In order to avoid inconsistencies, we
+ must remove node entirely from the list. */
+ gl_list_node_t before_removed = node->prev;
+ gl_list_node_t after_removed = node->next;
+ ASYNCSAFE(gl_list_node_t) before_removed->next = after_removed;
+ after_removed->prev = before_removed;
+ list->count--;
+ free (node);
+ return -1;
+ }
+ }
+ else
+ node->value = elt;
+ }
+#else
+ node->value = elt;
+#endif
+ return 0;
+}
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_linked_next_node (gl_list_t list, gl_list_node_t node)
+{
+ return (node->next != &list->root ? node->next : NULL);
+}
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_linked_previous_node (gl_list_t list, gl_list_node_t node)
+{
+ return (node->prev != &list->root ? node->prev : NULL);
+}
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_linked_first_node (gl_list_t list)
+{
+ if (list->count > 0)
+ return list->root.next;
+ else
+ return NULL;
+}
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_linked_last_node (gl_list_t list)
+{
+ if (list->count > 0)
+ return list->root.prev;
+ else
+ return NULL;
+}
+
+static const void * _GL_ATTRIBUTE_PURE
+gl_linked_get_at (gl_list_t list, size_t position)
+{
+ size_t count = list->count;
+ gl_list_node_t node;
+
+ if (!(position < count))
+ /* Invalid argument. */
+ abort ();
+ /* Here we know count > 0. */
+ if (position <= ((count - 1) / 2))
+ {
+ node = list->root.next;
+ for (; position > 0; position--)
+ node = node->next;
+ }
+ else
+ {
+ position = count - 1 - position;
+ node = list->root.prev;
+ for (; position > 0; position--)
+ node = node->prev;
+ }
+ return node->value;
+}
+
+static gl_list_node_t
+gl_linked_nx_set_at (gl_list_t list, size_t position, const void *elt)
+{
+ size_t count = list->count;
+ gl_list_node_t node;
+
+ if (!(position < count))
+ /* Invalid argument. */
+ abort ();
+ /* Here we know count > 0. */
+ if (position <= ((count - 1) / 2))
+ {
+ node = list->root.next;
+ for (; position > 0; position--)
+ node = node->next;
+ }
+ else
+ {
+ position = count - 1 - position;
+ node = list->root.prev;
+ for (; position > 0; position--)
+ node = node->prev;
+ }
+#if WITH_HASHTABLE
+ if (elt != node->value)
+ {
+ size_t new_hashcode =
+ (list->base.hashcode_fn != NULL
+ ? list->base.hashcode_fn (elt)
+ : (size_t)(uintptr_t) elt);
+
+ if (new_hashcode != node->h.hashcode)
+ {
+ remove_from_bucket (list, node);
+ node->value = elt;
+ node->h.hashcode = new_hashcode;
+ if (add_to_bucket (list, node) < 0)
+ {
+ /* Out of memory. We removed node from a bucket but cannot add
+ it to another bucket. In order to avoid inconsistencies, we
+ must remove node entirely from the list. */
+ gl_list_node_t before_removed = node->prev;
+ gl_list_node_t after_removed = node->next;
+ ASYNCSAFE(gl_list_node_t) before_removed->next = after_removed;
+ after_removed->prev = before_removed;
+ list->count--;
+ free (node);
+ return NULL;
+ }
+ }
+ else
+ node->value = elt;
+ }
+#else
+ node->value = elt;
+#endif
+ return node;
+}
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_linked_search_from_to (gl_list_t list, size_t start_index, size_t end_index,
+ const void *elt)
+{
+ size_t count = list->count;
+
+ if (!(start_index <= end_index && end_index <= count))
+ /* Invalid arguments. */
+ abort ();
+ {
+#if WITH_HASHTABLE
+ size_t hashcode =
+ (list->base.hashcode_fn != NULL
+ ? list->base.hashcode_fn (elt)
+ : (size_t)(uintptr_t) elt);
+ size_t bucket = hashcode % list->table_size;
+ gl_listelement_equals_fn equals = list->base.equals_fn;
+
+ if (!list->base.allow_duplicates)
+ {
+ /* Look for the first match in the hash bucket. */
+ gl_list_node_t found = NULL;
+ gl_list_node_t node;
+
+ for (node = (gl_list_node_t) list->table[bucket];
+ node != NULL;
+ node = (gl_list_node_t) node->h.hash_next)
+ if (node->h.hashcode == hashcode
+ && (equals != NULL
+ ? equals (elt, node->value)
+ : elt == node->value))
+ {
+ found = node;
+ break;
+ }
+ if (start_index > 0)
+ /* Look whether found's index is < start_index. */
+ for (node = list->root.next; ; node = node->next)
+ {
+ if (node == found)
+ return NULL;
+ if (--start_index == 0)
+ break;
+ }
+ if (end_index < count)
+ /* Look whether found's index is >= end_index. */
+ {
+ end_index = count - end_index;
+ for (node = list->root.prev; ; node = node->prev)
+ {
+ if (node == found)
+ return NULL;
+ if (--end_index == 0)
+ break;
+ }
+ }
+ return found;
+ }
+ else
+ {
+ /* Look whether there is more than one match in the hash bucket. */
+ bool multiple_matches = false;
+ gl_list_node_t first_match = NULL;
+ gl_list_node_t node;
+
+ for (node = (gl_list_node_t) list->table[bucket];
+ node != NULL;
+ node = (gl_list_node_t) node->h.hash_next)
+ if (node->h.hashcode == hashcode
+ && (equals != NULL
+ ? equals (elt, node->value)
+ : elt == node->value))
+ {
+ if (first_match == NULL)
+ first_match = node;
+ else
+ {
+ multiple_matches = true;
+ break;
+ }
+ }
+ if (multiple_matches)
+ {
+ /* We need the match with the smallest index. But we don't have
+ a fast mapping node -> index. So we have to walk the list. */
+ end_index -= start_index;
+ node = list->root.next;
+ for (; start_index > 0; start_index--)
+ node = node->next;
+
+ for (;
+ end_index > 0;
+ node = node->next, end_index--)
+ if (node->h.hashcode == hashcode
+ && (equals != NULL
+ ? equals (elt, node->value)
+ : elt == node->value))
+ return node;
+ /* The matches must have all been at indices < start_index or
+ >= end_index. */
+ return NULL;
+ }
+ else
+ {
+ if (start_index > 0)
+ /* Look whether first_match's index is < start_index. */
+ for (node = list->root.next; node != &list->root; node = node->next)
+ {
+ if (node == first_match)
+ return NULL;
+ if (--start_index == 0)
+ break;
+ }
+ if (end_index < list->count)
+ /* Look whether first_match's index is >= end_index. */
+ {
+ end_index = list->count - end_index;
+ for (node = list->root.prev; ; node = node->prev)
+ {
+ if (node == first_match)
+ return NULL;
+ if (--end_index == 0)
+ break;
+ }
+ }
+ return first_match;
+ }
+ }
+#else
+ gl_listelement_equals_fn equals = list->base.equals_fn;
+ gl_list_node_t node = list->root.next;
+
+ end_index -= start_index;
+ for (; start_index > 0; start_index--)
+ node = node->next;
+
+ if (equals != NULL)
+ {
+ for (; end_index > 0; node = node->next, end_index--)
+ if (equals (elt, node->value))
+ return node;
+ }
+ else
+ {
+ for (; end_index > 0; node = node->next, end_index--)
+ if (elt == node->value)
+ return node;
+ }
+ return NULL;
+#endif
+ }
+}
+
+static size_t _GL_ATTRIBUTE_PURE
+gl_linked_indexof_from_to (gl_list_t list, size_t start_index, size_t end_index,
+ const void *elt)
+{
+ size_t count = list->count;
+
+ if (!(start_index <= end_index && end_index <= count))
+ /* Invalid arguments. */
+ abort ();
+ {
+#if WITH_HASHTABLE
+ /* Here the hash table doesn't help much. It only allows us to minimize
+ the number of equals() calls, by looking up first the node and then
+ its index. */
+ size_t hashcode =
+ (list->base.hashcode_fn != NULL
+ ? list->base.hashcode_fn (elt)
+ : (size_t)(uintptr_t) elt);
+ size_t bucket = hashcode % list->table_size;
+ gl_listelement_equals_fn equals = list->base.equals_fn;
+ gl_list_node_t node;
+
+ /* First step: Look up the node. */
+ if (!list->base.allow_duplicates)
+ {
+ /* Look for the first match in the hash bucket. */
+ for (node = (gl_list_node_t) list->table[bucket];
+ node != NULL;
+ node = (gl_list_node_t) node->h.hash_next)
+ if (node->h.hashcode == hashcode
+ && (equals != NULL
+ ? equals (elt, node->value)
+ : elt == node->value))
+ break;
+ }
+ else
+ {
+ /* Look whether there is more than one match in the hash bucket. */
+ bool multiple_matches = false;
+ gl_list_node_t first_match = NULL;
+
+ for (node = (gl_list_node_t) list->table[bucket];
+ node != NULL;
+ node = (gl_list_node_t) node->h.hash_next)
+ if (node->h.hashcode == hashcode
+ && (equals != NULL
+ ? equals (elt, node->value)
+ : elt == node->value))
+ {
+ if (first_match == NULL)
+ first_match = node;
+ else
+ {
+ multiple_matches = true;
+ break;
+ }
+ }
+ if (multiple_matches)
+ {
+ /* We need the match with the smallest index. But we don't have
+ a fast mapping node -> index. So we have to walk the list. */
+ size_t index;
+
+ index = start_index;
+ node = list->root.next;
+ for (; start_index > 0; start_index--)
+ node = node->next;
+
+ for (;
+ index < end_index;
+ node = node->next, index++)
+ if (node->h.hashcode == hashcode
+ && (equals != NULL
+ ? equals (elt, node->value)
+ : elt == node->value))
+ return index;
+ /* The matches must have all been at indices < start_index or
+ >= end_index. */
+ return (size_t)(-1);
+ }
+ node = first_match;
+ }
+
+ /* Second step: Look up the index of the node. */
+ if (node == NULL)
+ return (size_t)(-1);
+ else
+ {
+ size_t index = 0;
+
+ for (; node->prev != &list->root; node = node->prev)
+ index++;
+
+ if (index >= start_index && index < end_index)
+ return index;
+ else
+ return (size_t)(-1);
+ }
+#else
+ gl_listelement_equals_fn equals = list->base.equals_fn;
+ size_t index = start_index;
+ gl_list_node_t node = list->root.next;
+
+ for (; start_index > 0; start_index--)
+ node = node->next;
+
+ if (equals != NULL)
+ {
+ for (;
+ index < end_index;
+ node = node->next, index++)
+ if (equals (elt, node->value))
+ return index;
+ }
+ else
+ {
+ for (;
+ index < end_index;
+ node = node->next, index++)
+ if (elt == node->value)
+ return index;
+ }
+ return (size_t)(-1);
+#endif
+ }
+}
+
+static gl_list_node_t
+gl_linked_nx_add_first (gl_list_t list, const void *elt)
+{
+ gl_list_node_t node =
+ (struct gl_list_node_impl *) malloc (sizeof (struct gl_list_node_impl));
+
+ if (node == NULL)
+ return NULL;
+
+ ASYNCSAFE(const void *) node->value = elt;
+#if WITH_HASHTABLE
+ node->h.hashcode =
+ (list->base.hashcode_fn != NULL
+ ? list->base.hashcode_fn (node->value)
+ : (size_t)(uintptr_t) node->value);
+
+ /* Add node to the hash table. */
+ if (add_to_bucket (list, node) < 0)
+ {
+ free (node);
+ return NULL;
+ }
+#endif
+
+ /* Add node to the list. */
+ node->prev = &list->root;
+ ASYNCSAFE(gl_list_node_t) node->next = list->root.next;
+ node->next->prev = node;
+ ASYNCSAFE(gl_list_node_t) list->root.next = node;
+ list->count++;
+
+#if WITH_HASHTABLE
+ hash_resize_after_add (list);
+#endif
+
+ return node;
+}
+
+static gl_list_node_t
+gl_linked_nx_add_last (gl_list_t list, const void *elt)
+{
+ gl_list_node_t node =
+ (struct gl_list_node_impl *) malloc (sizeof (struct gl_list_node_impl));
+
+ if (node == NULL)
+ return NULL;
+
+ ASYNCSAFE(const void *) node->value = elt;
+#if WITH_HASHTABLE
+ node->h.hashcode =
+ (list->base.hashcode_fn != NULL
+ ? list->base.hashcode_fn (node->value)
+ : (size_t)(uintptr_t) node->value);
+
+ /* Add node to the hash table. */
+ if (add_to_bucket (list, node) < 0)
+ {
+ free (node);
+ return NULL;
+ }
+#endif
+
+ /* Add node to the list. */
+ ASYNCSAFE(gl_list_node_t) node->next = &list->root;
+ node->prev = list->root.prev;
+ ASYNCSAFE(gl_list_node_t) node->prev->next = node;
+ list->root.prev = node;
+ list->count++;
+
+#if WITH_HASHTABLE
+ hash_resize_after_add (list);
+#endif
+
+ return node;
+}
+
+static gl_list_node_t
+gl_linked_nx_add_before (gl_list_t list, gl_list_node_t node, const void *elt)
+{
+ gl_list_node_t new_node =
+ (struct gl_list_node_impl *) malloc (sizeof (struct gl_list_node_impl));
+
+ if (new_node == NULL)
+ return NULL;
+
+ ASYNCSAFE(const void *) new_node->value = elt;
+#if WITH_HASHTABLE
+ new_node->h.hashcode =
+ (list->base.hashcode_fn != NULL
+ ? list->base.hashcode_fn (new_node->value)
+ : (size_t)(uintptr_t) new_node->value);
+
+ /* Add new_node to the hash table. */
+ if (add_to_bucket (list, new_node) < 0)
+ {
+ free (new_node);
+ return NULL;
+ }
+#endif
+
+ /* Add new_node to the list. */
+ ASYNCSAFE(gl_list_node_t) new_node->next = node;
+ new_node->prev = node->prev;
+ ASYNCSAFE(gl_list_node_t) new_node->prev->next = new_node;
+ node->prev = new_node;
+ list->count++;
+
+#if WITH_HASHTABLE
+ hash_resize_after_add (list);
+#endif
+
+ return new_node;
+}
+
+static gl_list_node_t
+gl_linked_nx_add_after (gl_list_t list, gl_list_node_t node, const void *elt)
+{
+ gl_list_node_t new_node =
+ (struct gl_list_node_impl *) malloc (sizeof (struct gl_list_node_impl));
+
+ if (new_node == NULL)
+ return NULL;
+
+ ASYNCSAFE(const void *) new_node->value = elt;
+#if WITH_HASHTABLE
+ new_node->h.hashcode =
+ (list->base.hashcode_fn != NULL
+ ? list->base.hashcode_fn (new_node->value)
+ : (size_t)(uintptr_t) new_node->value);
+
+ /* Add new_node to the hash table. */
+ if (add_to_bucket (list, new_node) < 0)
+ {
+ free (new_node);
+ return NULL;
+ }
+#endif
+
+ /* Add new_node to the list. */
+ new_node->prev = node;
+ ASYNCSAFE(gl_list_node_t) new_node->next = node->next;
+ new_node->next->prev = new_node;
+ ASYNCSAFE(gl_list_node_t) node->next = new_node;
+ list->count++;
+
+#if WITH_HASHTABLE
+ hash_resize_after_add (list);
+#endif
+
+ return new_node;
+}
+
+static gl_list_node_t
+gl_linked_nx_add_at (gl_list_t list, size_t position, const void *elt)
+{
+ size_t count = list->count;
+ gl_list_node_t new_node;
+
+ if (!(position <= count))
+ /* Invalid argument. */
+ abort ();
+
+ new_node = (struct gl_list_node_impl *) malloc (sizeof (struct gl_list_node_impl));
+ if (new_node == NULL)
+ return NULL;
+
+ ASYNCSAFE(const void *) new_node->value = elt;
+#if WITH_HASHTABLE
+ new_node->h.hashcode =
+ (list->base.hashcode_fn != NULL
+ ? list->base.hashcode_fn (new_node->value)
+ : (size_t)(uintptr_t) new_node->value);
+
+ /* Add new_node to the hash table. */
+ if (add_to_bucket (list, new_node) < 0)
+ {
+ free (new_node);
+ return NULL;
+ }
+#endif
+
+ /* Add new_node to the list. */
+ if (position <= (count / 2))
+ {
+ gl_list_node_t node;
+
+ node = &list->root;
+ for (; position > 0; position--)
+ node = node->next;
+ new_node->prev = node;
+ ASYNCSAFE(gl_list_node_t) new_node->next = node->next;
+ new_node->next->prev = new_node;
+ ASYNCSAFE(gl_list_node_t) node->next = new_node;
+ }
+ else
+ {
+ gl_list_node_t node;
+
+ position = count - position;
+ node = &list->root;
+ for (; position > 0; position--)
+ node = node->prev;
+ ASYNCSAFE(gl_list_node_t) new_node->next = node;
+ new_node->prev = node->prev;
+ ASYNCSAFE(gl_list_node_t) new_node->prev->next = new_node;
+ node->prev = new_node;
+ }
+ list->count++;
+
+#if WITH_HASHTABLE
+ hash_resize_after_add (list);
+#endif
+
+ return new_node;
+}
+
+static bool
+gl_linked_remove_node (gl_list_t list, gl_list_node_t node)
+{
+ gl_list_node_t prev;
+ gl_list_node_t next;
+
+#if WITH_HASHTABLE
+ /* Remove node from the hash table. */
+ remove_from_bucket (list, node);
+#endif
+
+ /* Remove node from the list. */
+ prev = node->prev;
+ next = node->next;
+
+ ASYNCSAFE(gl_list_node_t) prev->next = next;
+ next->prev = prev;
+ list->count--;
+
+ if (list->base.dispose_fn != NULL)
+ list->base.dispose_fn (node->value);
+ free (node);
+ return true;
+}
+
+static bool
+gl_linked_remove_at (gl_list_t list, size_t position)
+{
+ size_t count = list->count;
+ gl_list_node_t removed_node;
+
+ if (!(position < count))
+ /* Invalid argument. */
+ abort ();
+ /* Here we know count > 0. */
+ if (position <= ((count - 1) / 2))
+ {
+ gl_list_node_t node;
+ gl_list_node_t after_removed;
+
+ node = &list->root;
+ for (; position > 0; position--)
+ node = node->next;
+ removed_node = node->next;
+ after_removed = node->next->next;
+ ASYNCSAFE(gl_list_node_t) node->next = after_removed;
+ after_removed->prev = node;
+ }
+ else
+ {
+ gl_list_node_t node;
+ gl_list_node_t before_removed;
+
+ position = count - 1 - position;
+ node = &list->root;
+ for (; position > 0; position--)
+ node = node->prev;
+ removed_node = node->prev;
+ before_removed = node->prev->prev;
+ node->prev = before_removed;
+ ASYNCSAFE(gl_list_node_t) before_removed->next = node;
+ }
+#if WITH_HASHTABLE
+ remove_from_bucket (list, removed_node);
+#endif
+ list->count--;
+
+ if (list->base.dispose_fn != NULL)
+ list->base.dispose_fn (removed_node->value);
+ free (removed_node);
+ return true;
+}
+
+static bool
+gl_linked_remove (gl_list_t list, const void *elt)
+{
+ gl_list_node_t node = gl_linked_search_from_to (list, 0, list->count, elt);
+
+ if (node != NULL)
+ return gl_linked_remove_node (list, node);
+ else
+ return false;
+}
+
+static void
+gl_linked_list_free (gl_list_t list)
+{
+ gl_listelement_dispose_fn dispose = list->base.dispose_fn;
+ gl_list_node_t node;
+
+ for (node = list->root.next; node != &list->root; )
+ {
+ gl_list_node_t next = node->next;
+ if (dispose != NULL)
+ dispose (node->value);
+ free (node);
+ node = next;
+ }
+#if WITH_HASHTABLE
+ free (list->table);
+#endif
+ free (list);
+}
+
+/* --------------------- gl_list_iterator_t Data Type --------------------- */
+
+static gl_list_iterator_t _GL_ATTRIBUTE_PURE
+gl_linked_iterator (gl_list_t list)
+{
+ gl_list_iterator_t result;
+
+ result.vtable = list->base.vtable;
+ result.list = list;
+ result.p = list->root.next;
+ result.q = &list->root;
+#if defined GCC_LINT || defined lint
+ result.i = 0;
+ result.j = 0;
+ result.count = 0;
+#endif
+
+ return result;
+}
+
+static gl_list_iterator_t _GL_ATTRIBUTE_PURE
+gl_linked_iterator_from_to (gl_list_t list,
+ size_t start_index, size_t end_index)
+{
+ gl_list_iterator_t result;
+ size_t n1, n2, n3;
+
+ if (!(start_index <= end_index && end_index <= list->count))
+ /* Invalid arguments. */
+ abort ();
+ result.vtable = list->base.vtable;
+ result.list = list;
+ n1 = start_index;
+ n2 = end_index - start_index;
+ n3 = list->count - end_index;
+ /* Find the maximum among n1, n2, n3, so as to reduce the number of
+ loop iterations to n1 + n2 + n3 - max(n1,n2,n3). */
+ if (n1 > n2 && n1 > n3)
+ {
+ /* n1 is the maximum, use n2 and n3. */
+ gl_list_node_t node;
+ size_t i;
+
+ node = &list->root;
+ for (i = n3; i > 0; i--)
+ node = node->prev;
+ result.q = node;
+ for (i = n2; i > 0; i--)
+ node = node->prev;
+ result.p = node;
+ }
+ else if (n2 > n3)
+ {
+ /* n2 is the maximum, use n1 and n3. */
+ gl_list_node_t node;
+ size_t i;
+
+ node = list->root.next;
+ for (i = n1; i > 0; i--)
+ node = node->next;
+ result.p = node;
+
+ node = &list->root;
+ for (i = n3; i > 0; i--)
+ node = node->prev;
+ result.q = node;
+ }
+ else
+ {
+ /* n3 is the maximum, use n1 and n2. */
+ gl_list_node_t node;
+ size_t i;
+
+ node = list->root.next;
+ for (i = n1; i > 0; i--)
+ node = node->next;
+ result.p = node;
+ for (i = n2; i > 0; i--)
+ node = node->next;
+ result.q = node;
+ }
+
+#if defined GCC_LINT || defined lint
+ result.i = 0;
+ result.j = 0;
+ result.count = 0;
+#endif
+
+ return result;
+}
+
+static bool
+gl_linked_iterator_next (gl_list_iterator_t *iterator,
+ const void **eltp, gl_list_node_t *nodep)
+{
+ if (iterator->p != iterator->q)
+ {
+ gl_list_node_t node = (gl_list_node_t) iterator->p;
+ *eltp = node->value;
+ if (nodep != NULL)
+ *nodep = node;
+ iterator->p = node->next;
+ return true;
+ }
+ else
+ return false;
+}
+
+static void
+gl_linked_iterator_free (_GL_ATTRIBUTE_MAYBE_UNUSED gl_list_iterator_t *iterator)
+{
+}
+
+/* ---------------------- Sorted gl_list_t Data Type ---------------------- */
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_linked_sortedlist_search (gl_list_t list, gl_listelement_compar_fn compar,
+ const void *elt)
+{
+ gl_list_node_t node;
+
+ for (node = list->root.next; node != &list->root; node = node->next)
+ {
+ int cmp = compar (node->value, elt);
+
+ if (cmp > 0)
+ break;
+ if (cmp == 0)
+ return node;
+ }
+ return NULL;
+}
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_linked_sortedlist_search_from_to (gl_list_t list,
+ gl_listelement_compar_fn compar,
+ size_t low, size_t high,
+ const void *elt)
+{
+ size_t count = list->count;
+
+ if (!(low <= high && high <= list->count))
+ /* Invalid arguments. */
+ abort ();
+
+ high -= low;
+ if (high > 0)
+ {
+ /* Here we know low < count. */
+ size_t position = low;
+ gl_list_node_t node;
+
+ if (position <= ((count - 1) / 2))
+ {
+ node = list->root.next;
+ for (; position > 0; position--)
+ node = node->next;
+ }
+ else
+ {
+ position = count - 1 - position;
+ node = list->root.prev;
+ for (; position > 0; position--)
+ node = node->prev;
+ }
+
+ do
+ {
+ int cmp = compar (node->value, elt);
+
+ if (cmp > 0)
+ break;
+ if (cmp == 0)
+ return node;
+ node = node->next;
+ }
+ while (--high > 0);
+ }
+ return NULL;
+}
+
+static size_t _GL_ATTRIBUTE_PURE
+gl_linked_sortedlist_indexof (gl_list_t list, gl_listelement_compar_fn compar,
+ const void *elt)
+{
+ gl_list_node_t node;
+ size_t index;
+
+ for (node = list->root.next, index = 0;
+ node != &list->root;
+ node = node->next, index++)
+ {
+ int cmp = compar (node->value, elt);
+
+ if (cmp > 0)
+ break;
+ if (cmp == 0)
+ return index;
+ }
+ return (size_t)(-1);
+}
+
+static size_t _GL_ATTRIBUTE_PURE
+gl_linked_sortedlist_indexof_from_to (gl_list_t list,
+ gl_listelement_compar_fn compar,
+ size_t low, size_t high,
+ const void *elt)
+{
+ size_t count = list->count;
+
+ if (!(low <= high && high <= list->count))
+ /* Invalid arguments. */
+ abort ();
+
+ high -= low;
+ if (high > 0)
+ {
+ /* Here we know low < count. */
+ size_t index = low;
+ size_t position = low;
+ gl_list_node_t node;
+
+ if (position <= ((count - 1) / 2))
+ {
+ node = list->root.next;
+ for (; position > 0; position--)
+ node = node->next;
+ }
+ else
+ {
+ position = count - 1 - position;
+ node = list->root.prev;
+ for (; position > 0; position--)
+ node = node->prev;
+ }
+
+ do
+ {
+ int cmp = compar (node->value, elt);
+
+ if (cmp > 0)
+ break;
+ if (cmp == 0)
+ return index;
+ node = node->next;
+ index++;
+ }
+ while (--high > 0);
+ }
+ return (size_t)(-1);
+}
+
+static gl_list_node_t
+gl_linked_sortedlist_nx_add (gl_list_t list, gl_listelement_compar_fn compar,
+ const void *elt)
+{
+ gl_list_node_t node;
+
+ for (node = list->root.next; node != &list->root; node = node->next)
+ if (compar (node->value, elt) >= 0)
+ return gl_linked_nx_add_before (list, node, elt);
+ return gl_linked_nx_add_last (list, elt);
+}
+
+static bool
+gl_linked_sortedlist_remove (gl_list_t list, gl_listelement_compar_fn compar,
+ const void *elt)
+{
+ gl_list_node_t node;
+
+ for (node = list->root.next; node != &list->root; node = node->next)
+ {
+ int cmp = compar (node->value, elt);
+
+ if (cmp > 0)
+ break;
+ if (cmp == 0)
+ return gl_linked_remove_node (list, node);
+ }
+ return false;
+}
diff --git a/gl/lib/gl_anyrbtree_list1.h b/gl/lib/gl_anyrbtree_list1.h
new file mode 100644
index 0000000..750fd36
--- /dev/null
+++ b/gl/lib/gl_anyrbtree_list1.h
@@ -0,0 +1,76 @@
+/* Sequential list data type implemented by a binary tree.
+ Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+ 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 2.1 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/>. */
+
+/* Common code of gl_rbtree_list.c and gl_rbtreehash_list.c. */
+
+/* A red-black tree is a binary tree where every node is colored black or
+ red such that
+ 1. The root is black.
+ 2. No red node has a red parent.
+ Or equivalently: No red node has a red child.
+ 3. All paths from the root down to any NULL endpoint contain the same
+ number of black nodes.
+ Let's call this the "black-height" bh of the tree. It follows that every
+ such path contains exactly bh black and between 0 and bh red nodes. (The
+ extreme cases are a path containing only black nodes, and a path colored
+ alternately black-red-black-red-...-black-red.) The height of the tree
+ therefore is >= bh, <= 2*bh.
+ */
+
+/* -------------------------- gl_list_t Data Type -------------------------- */
+
+/* Color of a node. */
+typedef enum color { BLACK, RED } color_t;
+
+/* Concrete list node implementation, valid for this file only. */
+struct gl_list_node_impl
+{
+#if WITH_HASHTABLE
+ struct gl_hash_entry h; /* hash table entry fields; must be first */
+#endif
+ struct gl_list_node_impl *left; /* left branch, or NULL */
+ struct gl_list_node_impl *right; /* right branch, or NULL */
+ /* Parent pointer, or NULL. The parent pointer is not needed for most
+ operations. It is needed so that a gl_list_node_t can be returned
+ without memory allocation, on which the functions gl_list_remove_node,
+ gl_list_add_before, gl_list_add_after can be implemented. */
+ struct gl_list_node_impl *parent;
+ color_t color; /* node's color */
+ size_t branch_size; /* number of nodes in this branch,
+ = branchsize(left)+branchsize(right)+1 */
+ const void *value;
+};
+
+/* Concrete gl_list_impl type, valid for this file only. */
+struct gl_list_impl
+{
+ struct gl_list_impl_base base;
+#if WITH_HASHTABLE
+ /* A hash table: managed as an array of collision lists. */
+ struct gl_hash_entry **table;
+ size_t table_size;
+#endif
+ struct gl_list_node_impl *root; /* root node or NULL */
+};
+
+/* A red-black tree of height h has a black-height bh >= ceil(h/2) and
+ therefore at least 2^ceil(h/2) - 1 elements. So, h <= 116 (because a tree
+ of height h >= 117 would have at least 2^59 - 1 elements, and because even
+ on 64-bit machines,
+ sizeof (gl_list_node_impl) * (2^59 - 1) > 2^64
+ this would exceed the address space of the machine. */
+#define MAXHEIGHT 116
diff --git a/gl/lib/gl_anyrbtree_list2.h b/gl/lib/gl_anyrbtree_list2.h
new file mode 100644
index 0000000..95d193c
--- /dev/null
+++ b/gl/lib/gl_anyrbtree_list2.h
@@ -0,0 +1,1028 @@
+/* Sequential list data type implemented by a binary tree.
+ Copyright (C) 2006-2007, 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+ 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 2.1 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/>. */
+
+/* Common code of gl_rbtree_list.c and gl_rbtreehash_list.c. */
+
+/* -------------------------- gl_list_t Data Type -------------------------- */
+
+/* Creates a subtree for count >= 1 elements.
+ Its black-height bh is passed as argument, with
+ 2^bh - 1 <= count <= 2^(bh+1) - 1. bh == 0 implies count == 1.
+ Its height is h where 2^(h-1) <= count <= 2^h - 1.
+ Return NULL upon out-of-memory. */
+static gl_list_node_t
+create_subtree_with_contents (unsigned int bh,
+ size_t count, const void **contents)
+{
+ size_t half1 = (count - 1) / 2;
+ size_t half2 = count / 2;
+ /* Note: half1 + half2 = count - 1. */
+ gl_list_node_t node =
+ (struct gl_list_node_impl *) malloc (sizeof (struct gl_list_node_impl));
+ if (node == NULL)
+ return NULL;
+
+ if (half1 > 0)
+ {
+ /* half1 > 0 implies count > 1, implies bh >= 1, implies
+ 2^(bh-1) - 1 <= half1 <= 2^bh - 1. */
+ node->left =
+ create_subtree_with_contents (bh - 1, half1, contents);
+ if (node->left == NULL)
+ goto fail1;
+ node->left->parent = node;
+ }
+ else
+ node->left = NULL;
+
+ node->value = contents[half1];
+
+ if (half2 > 0)
+ {
+ /* half2 > 0 implies count > 1, implies bh >= 1, implies
+ 2^(bh-1) - 1 <= half2 <= 2^bh - 1. */
+ node->right =
+ create_subtree_with_contents (bh - 1, half2, contents + half1 + 1);
+ if (node->right == NULL)
+ goto fail2;
+ node->right->parent = node;
+ }
+ else
+ node->right = NULL;
+
+ node->color = (bh == 0 ? RED : BLACK);
+
+ node->branch_size = count;
+
+ return node;
+
+ fail2:
+ if (node->left != NULL)
+ free_subtree (node->left);
+ fail1:
+ free (node);
+ return NULL;
+}
+
+static gl_list_t
+gl_tree_nx_create (gl_list_implementation_t implementation,
+ gl_listelement_equals_fn equals_fn,
+ gl_listelement_hashcode_fn hashcode_fn,
+ gl_listelement_dispose_fn dispose_fn,
+ bool allow_duplicates,
+ size_t count, const void **contents)
+{
+ struct gl_list_impl *list =
+ (struct gl_list_impl *) malloc (sizeof (struct gl_list_impl));
+
+ if (list == NULL)
+ return NULL;
+
+ list->base.vtable = implementation;
+ list->base.equals_fn = equals_fn;
+ list->base.hashcode_fn = hashcode_fn;
+ list->base.dispose_fn = dispose_fn;
+ list->base.allow_duplicates = allow_duplicates;
+#if WITH_HASHTABLE
+ {
+ size_t estimate = xsum (count, count / 2); /* 1.5 * count */
+ if (estimate < 10)
+ estimate = 10;
+ list->table_size = next_prime (estimate);
+ if (size_overflow_p (xtimes (list->table_size, sizeof (gl_hash_entry_t))))
+ goto fail1;
+ list->table =
+ (gl_hash_entry_t *) calloc (list->table_size, sizeof (gl_hash_entry_t));
+ if (list->table == NULL)
+ goto fail1;
+ }
+#endif
+ if (count > 0)
+ {
+ /* Assuming 2^bh - 1 <= count <= 2^(bh+1) - 2, we create a tree whose
+ upper bh levels are black, and only the partially present lowest
+ level is red. */
+ unsigned int bh;
+ {
+ size_t n;
+ for (n = count + 1, bh = 0; n > 1; n = n >> 1)
+ bh++;
+ }
+
+ list->root = create_subtree_with_contents (bh, count, contents);
+ if (list->root == NULL)
+ goto fail2;
+ list->root->parent = NULL;
+
+#if WITH_HASHTABLE
+ /* Now that the tree is built, node_position() works. Now we can
+ add the nodes to the hash table. */
+ if (add_nodes_to_buckets (list) < 0)
+ goto fail3;
+#endif
+ }
+ else
+ list->root = NULL;
+
+ return list;
+
+#if WITH_HASHTABLE
+ fail3:
+ free_subtree (list->root);
+#endif
+ fail2:
+#if WITH_HASHTABLE
+ free (list->table);
+ fail1:
+#endif
+ free (list);
+ return NULL;
+}
+
+/* Rotates left a subtree.
+
+ B D
+ / \ / \
+ A D --> B E
+ / \ / \
+ C E A C
+
+ Changes the tree structure, updates the branch sizes.
+ The caller must update the colors and register D as child of its parent. */
+static gl_list_node_t
+rotate_left (gl_list_node_t b_node, gl_list_node_t d_node)
+{
+ gl_list_node_t a_node = b_node->left;
+ gl_list_node_t c_node = d_node->left;
+ gl_list_node_t e_node = d_node->right;
+
+ b_node->right = c_node;
+ d_node->left = b_node;
+
+ d_node->parent = b_node->parent;
+ b_node->parent = d_node;
+ if (c_node != NULL)
+ c_node->parent = b_node;
+
+ b_node->branch_size =
+ (a_node != NULL ? a_node->branch_size : 0)
+ + 1 + (c_node != NULL ? c_node->branch_size : 0);
+ d_node->branch_size =
+ b_node->branch_size + 1 + (e_node != NULL ? e_node->branch_size : 0);
+
+ return d_node;
+}
+
+/* Rotates right a subtree.
+
+ D B
+ / \ / \
+ B E --> A D
+ / \ / \
+ A C C E
+
+ Changes the tree structure, updates the branch sizes.
+ The caller must update the colors and register B as child of its parent. */
+static gl_list_node_t
+rotate_right (gl_list_node_t b_node, gl_list_node_t d_node)
+{
+ gl_list_node_t a_node = b_node->left;
+ gl_list_node_t c_node = b_node->right;
+ gl_list_node_t e_node = d_node->right;
+
+ d_node->left = c_node;
+ b_node->right = d_node;
+
+ b_node->parent = d_node->parent;
+ d_node->parent = b_node;
+ if (c_node != NULL)
+ c_node->parent = d_node;
+
+ d_node->branch_size =
+ (c_node != NULL ? c_node->branch_size : 0)
+ + 1 + (e_node != NULL ? e_node->branch_size : 0);
+ b_node->branch_size =
+ (a_node != NULL ? a_node->branch_size : 0) + 1 + d_node->branch_size;
+
+ return b_node;
+}
+
+/* Ensures the tree is balanced, after an insertion operation.
+ Also assigns node->color.
+ parent is the given node's parent, known to be non-NULL. */
+static void
+rebalance_after_add (gl_list_t list, gl_list_node_t node, gl_list_node_t parent)
+{
+ for (;;)
+ {
+ /* At this point, parent = node->parent != NULL.
+ Think of node->color being RED (although node->color is not yet
+ assigned.) */
+ gl_list_node_t grandparent;
+ gl_list_node_t uncle;
+
+ if (parent->color == BLACK)
+ {
+ /* A RED color for node is acceptable. */
+ node->color = RED;
+ return;
+ }
+
+ grandparent = parent->parent;
+ /* Since parent is RED, we know that
+ grandparent is != NULL and colored BLACK. */
+
+ if (grandparent->left == parent)
+ uncle = grandparent->right;
+ else if (grandparent->right == parent)
+ uncle = grandparent->left;
+ else
+ abort ();
+
+ if (uncle != NULL && uncle->color == RED)
+ {
+ /* Change grandparent from BLACK to RED, and
+ change parent and uncle from RED to BLACK.
+ This makes it acceptable for node to be RED. */
+ node->color = RED;
+ parent->color = uncle->color = BLACK;
+ node = grandparent;
+ }
+ else
+ {
+ /* grandparent and uncle are BLACK. parent is RED. node wants
+ to be RED too.
+ In this case, recoloring is not sufficient. Need to perform
+ one or two rotations. */
+ gl_list_node_t *grandparentp;
+
+ if (grandparent->parent == NULL)
+ grandparentp = &list->root;
+ else if (grandparent->parent->left == grandparent)
+ grandparentp = &grandparent->parent->left;
+ else if (grandparent->parent->right == grandparent)
+ grandparentp = &grandparent->parent->right;
+ else
+ abort ();
+
+ if (grandparent->left == parent)
+ {
+ if (parent->right == node)
+ {
+ /* Rotation between node and parent. */
+ grandparent->left = rotate_left (parent, node);
+ node = parent;
+ parent = grandparent->left;
+ }
+ /* grandparent and uncle are BLACK. parent and node want to be
+ RED. parent = grandparent->left. node = parent->left.
+
+ grandparent parent
+ bh+1 bh+1
+ / \ / \
+ parent uncle --> node grandparent
+ bh bh bh bh
+ / \ / \
+ node C C uncle
+ bh bh bh bh
+ */
+ *grandparentp = rotate_right (parent, grandparent);
+ parent->color = BLACK;
+ node->color = grandparent->color = RED;
+ }
+ else /* grandparent->right == parent */
+ {
+ if (parent->left == node)
+ {
+ /* Rotation between node and parent. */
+ grandparent->right = rotate_right (node, parent);
+ node = parent;
+ parent = grandparent->right;
+ }
+ /* grandparent and uncle are BLACK. parent and node want to be
+ RED. parent = grandparent->right. node = parent->right.
+
+ grandparent parent
+ bh+1 bh+1
+ / \ / \
+ uncle parent --> grandparent node
+ bh bh bh bh
+ / \ / \
+ C node uncle C
+ bh bh bh bh
+ */
+ *grandparentp = rotate_left (grandparent, parent);
+ parent->color = BLACK;
+ node->color = grandparent->color = RED;
+ }
+ return;
+ }
+
+ /* Start again with a new (node, parent) pair. */
+ parent = node->parent;
+
+ if (parent == NULL)
+ {
+ /* Change node's color from RED to BLACK. This increases the
+ tree's black-height. */
+ node->color = BLACK;
+ return;
+ }
+ }
+}
+
+/* Ensures the tree is balanced, after a deletion operation.
+ CHILD was a grandchild of PARENT and is now its child. Between them,
+ a black node was removed. CHILD is also black, or NULL.
+ (CHILD can also be NULL. But PARENT is non-NULL.) */
+static void
+rebalance_after_remove (gl_list_t list, gl_list_node_t child, gl_list_node_t parent)
+{
+ for (;;)
+ {
+ /* At this point, we reduced the black-height of the CHILD subtree by 1.
+ To make up, either look for a possibility to turn a RED to a BLACK
+ node, or try to reduce the black-height tree of CHILD's sibling
+ subtree as well. */
+ gl_list_node_t *parentp;
+
+ if (parent->parent == NULL)
+ parentp = &list->root;
+ else if (parent->parent->left == parent)
+ parentp = &parent->parent->left;
+ else if (parent->parent->right == parent)
+ parentp = &parent->parent->right;
+ else
+ abort ();
+
+ if (parent->left == child)
+ {
+ gl_list_node_t sibling = parent->right;
+ /* sibling's black-height is >= 1. In particular,
+ sibling != NULL.
+
+ parent
+ / \
+ child sibling
+ bh bh+1
+ */
+
+ if (sibling->color == RED)
+ {
+ /* sibling is RED, hence parent is BLACK and sibling's children
+ are non-NULL and BLACK.
+
+ parent sibling
+ bh+2 bh+2
+ / \ / \
+ child sibling --> parent SR
+ bh bh+1 bh+1 bh+1
+ / \ / \
+ SL SR child SL
+ bh+1 bh+1 bh bh+1
+ */
+ *parentp = rotate_left (parent, sibling);
+ parent->color = RED;
+ sibling->color = BLACK;
+
+ /* Concentrate on the subtree of parent. The new sibling is
+ one of the old sibling's children, and known to be BLACK. */
+ parentp = &sibling->left;
+ sibling = parent->right;
+ }
+ /* Now we know that sibling is BLACK.
+
+ parent
+ / \
+ child sibling
+ bh bh+1
+ */
+ if (sibling->right != NULL && sibling->right->color == RED)
+ {
+ /*
+ parent sibling
+ bh+1|bh+2 bh+1|bh+2
+ / \ / \
+ child sibling --> parent SR
+ bh bh+1 bh+1 bh+1
+ / \ / \
+ SL SR child SL
+ bh bh bh bh
+ */
+ *parentp = rotate_left (parent, sibling);
+ sibling->color = parent->color;
+ parent->color = BLACK;
+ sibling->right->color = BLACK;
+ return;
+ }
+ else if (sibling->left != NULL && sibling->left->color == RED)
+ {
+ /*
+ parent parent
+ bh+1|bh+2 bh+1|bh+2
+ / \ / \
+ child sibling --> child SL
+ bh bh+1 bh bh+1
+ / \ / \
+ SL SR SLL sibling
+ bh bh bh bh
+ / \ / \
+ SLL SLR SLR SR
+ bh bh bh bh
+
+ where SLL, SLR, SR are all black.
+ */
+ parent->right = rotate_right (sibling->left, sibling);
+ /* Change sibling from BLACK to RED and SL from RED to BLACK. */
+ sibling->color = RED;
+ sibling = parent->right;
+ sibling->color = BLACK;
+
+ /* Now do as in the previous case. */
+ *parentp = rotate_left (parent, sibling);
+ sibling->color = parent->color;
+ parent->color = BLACK;
+ sibling->right->color = BLACK;
+ return;
+ }
+ else
+ {
+ if (parent->color == BLACK)
+ {
+ /* Change sibling from BLACK to RED. Then the entire
+ subtree at parent has decreased its black-height.
+ parent parent
+ bh+2 bh+1
+ / \ / \
+ child sibling --> child sibling
+ bh bh+1 bh bh
+ */
+ sibling->color = RED;
+
+ child = parent;
+ }
+ else
+ {
+ /* Change parent from RED to BLACK, but compensate by
+ changing sibling from BLACK to RED.
+ parent parent
+ bh+1 bh+1
+ / \ / \
+ child sibling --> child sibling
+ bh bh+1 bh bh
+ */
+ parent->color = BLACK;
+ sibling->color = RED;
+ return;
+ }
+ }
+ }
+ else if (parent->right == child)
+ {
+ gl_list_node_t sibling = parent->left;
+ /* sibling's black-height is >= 1. In particular,
+ sibling != NULL.
+
+ parent
+ / \
+ sibling child
+ bh+1 bh
+ */
+
+ if (sibling->color == RED)
+ {
+ /* sibling is RED, hence parent is BLACK and sibling's children
+ are non-NULL and BLACK.
+
+ parent sibling
+ bh+2 bh+2
+ / \ / \
+ sibling child --> SR parent
+ bh+1 ch bh+1 bh+1
+ / \ / \
+ SL SR SL child
+ bh+1 bh+1 bh+1 bh
+ */
+ *parentp = rotate_right (sibling, parent);
+ parent->color = RED;
+ sibling->color = BLACK;
+
+ /* Concentrate on the subtree of parent. The new sibling is
+ one of the old sibling's children, and known to be BLACK. */
+ parentp = &sibling->right;
+ sibling = parent->left;
+ }
+ /* Now we know that sibling is BLACK.
+
+ parent
+ / \
+ sibling child
+ bh+1 bh
+ */
+ if (sibling->left != NULL && sibling->left->color == RED)
+ {
+ /*
+ parent sibling
+ bh+1|bh+2 bh+1|bh+2
+ / \ / \
+ sibling child --> SL parent
+ bh+1 bh bh+1 bh+1
+ / \ / \
+ SL SR SR child
+ bh bh bh bh
+ */
+ *parentp = rotate_right (sibling, parent);
+ sibling->color = parent->color;
+ parent->color = BLACK;
+ sibling->left->color = BLACK;
+ return;
+ }
+ else if (sibling->right != NULL && sibling->right->color == RED)
+ {
+ /*
+ parent parent
+ bh+1|bh+2 bh+1|bh+2
+ / \ / \
+ sibling child --> SR child
+ bh+1 bh bh+1 bh
+ / \ / \
+ SL SR sibling SRR
+ bh bh bh bh
+ / \ / \
+ SRL SRR SL SRL
+ bh bh bh bh
+
+ where SL, SRL, SRR are all black.
+ */
+ parent->left = rotate_left (sibling, sibling->right);
+ /* Change sibling from BLACK to RED and SL from RED to BLACK. */
+ sibling->color = RED;
+ sibling = parent->left;
+ sibling->color = BLACK;
+
+ /* Now do as in the previous case. */
+ *parentp = rotate_right (sibling, parent);
+ sibling->color = parent->color;
+ parent->color = BLACK;
+ sibling->left->color = BLACK;
+ return;
+ }
+ else
+ {
+ if (parent->color == BLACK)
+ {
+ /* Change sibling from BLACK to RED. Then the entire
+ subtree at parent has decreased its black-height.
+ parent parent
+ bh+2 bh+1
+ / \ / \
+ sibling child --> sibling child
+ bh+1 bh bh bh
+ */
+ sibling->color = RED;
+
+ child = parent;
+ }
+ else
+ {
+ /* Change parent from RED to BLACK, but compensate by
+ changing sibling from BLACK to RED.
+ parent parent
+ bh+1 bh+1
+ / \ / \
+ sibling child --> sibling child
+ bh+1 bh bh bh
+ */
+ parent->color = BLACK;
+ sibling->color = RED;
+ return;
+ }
+ }
+ }
+ else
+ abort ();
+
+ /* Start again with a new (child, parent) pair. */
+ parent = child->parent;
+
+#if 0 /* Already handled. */
+ if (child != NULL && child->color == RED)
+ {
+ child->color = BLACK;
+ return;
+ }
+#endif
+
+ if (parent == NULL)
+ return;
+ }
+}
+
+static void
+gl_tree_remove_node_from_tree (gl_list_t list, gl_list_node_t node)
+{
+ gl_list_node_t parent = node->parent;
+
+ if (node->left == NULL)
+ {
+ /* Replace node with node->right. */
+ gl_list_node_t child = node->right;
+
+ if (child != NULL)
+ {
+ child->parent = parent;
+ /* Since node->left == NULL, child must be RED and of height 1,
+ hence node must have been BLACK. Recolor the child. */
+ child->color = BLACK;
+ }
+ if (parent == NULL)
+ list->root = child;
+ else
+ {
+ if (parent->left == node)
+ parent->left = child;
+ else /* parent->right == node */
+ parent->right = child;
+
+ /* Update branch_size fields of the parent nodes. */
+ {
+ gl_list_node_t p;
+
+ for (p = parent; p != NULL; p = p->parent)
+ p->branch_size--;
+ }
+
+ if (child == NULL && node->color == BLACK)
+ rebalance_after_remove (list, child, parent);
+ }
+ }
+ else if (node->right == NULL)
+ {
+ /* It is not absolutely necessary to treat this case. But the more
+ general case below is more complicated, hence slower. */
+ /* Replace node with node->left. */
+ gl_list_node_t child = node->left;
+
+ child->parent = parent;
+ /* Since node->right == NULL, child must be RED and of height 1,
+ hence node must have been BLACK. Recolor the child. */
+ child->color = BLACK;
+ if (parent == NULL)
+ list->root = child;
+ else
+ {
+ if (parent->left == node)
+ parent->left = child;
+ else /* parent->right == node */
+ parent->right = child;
+
+ /* Update branch_size fields of the parent nodes. */
+ {
+ gl_list_node_t p;
+
+ for (p = parent; p != NULL; p = p->parent)
+ p->branch_size--;
+ }
+ }
+ }
+ else
+ {
+ /* Replace node with the rightmost element of the node->left subtree. */
+ gl_list_node_t subst;
+ gl_list_node_t subst_parent;
+ gl_list_node_t child;
+ color_t removed_color;
+
+ for (subst = node->left; subst->right != NULL; )
+ subst = subst->right;
+
+ subst_parent = subst->parent;
+
+ child = subst->left;
+
+ removed_color = subst->color;
+
+ /* The case subst_parent == node is special: If we do nothing special,
+ we get confusion about node->left, subst->left and child->parent.
+ subst_parent == node
+ <==> The 'for' loop above terminated immediately.
+ <==> subst == subst_parent->left
+ [otherwise subst == subst_parent->right]
+ In this case, we would need to first set
+ child->parent = node; node->left = child;
+ and later - when we copy subst into node's position - again
+ child->parent = subst; subst->left = child;
+ Altogether a no-op. */
+ if (subst_parent != node)
+ {
+ if (child != NULL)
+ child->parent = subst_parent;
+ subst_parent->right = child;
+ }
+
+ /* Update branch_size fields of the parent nodes. */
+ {
+ gl_list_node_t p;
+
+ for (p = subst_parent; p != NULL; p = p->parent)
+ p->branch_size--;
+ }
+
+ /* Copy subst into node's position.
+ (This is safer than to copy subst's value into node, keep node in
+ place, and free subst.) */
+ if (subst_parent != node)
+ {
+ subst->left = node->left;
+ subst->left->parent = subst;
+ }
+ subst->right = node->right;
+ subst->right->parent = subst;
+ subst->color = node->color;
+ subst->branch_size = node->branch_size;
+ subst->parent = parent;
+ if (parent == NULL)
+ list->root = subst;
+ else if (parent->left == node)
+ parent->left = subst;
+ else /* parent->right == node */
+ parent->right = subst;
+
+ if (removed_color == BLACK)
+ {
+ if (child != NULL && child->color == RED)
+ /* Recolor the child. */
+ child->color = BLACK;
+ else
+ /* Rebalancing starts at child's parent, that is subst_parent -
+ except when subst_parent == node. In this case, we need to use
+ its replacement, subst. */
+ rebalance_after_remove (list, child,
+ subst_parent != node ? subst_parent : subst);
+ }
+ }
+}
+
+static gl_list_node_t
+gl_tree_nx_add_first (gl_list_t list, const void *elt)
+{
+ /* Create new node. */
+ gl_list_node_t new_node =
+ (struct gl_list_node_impl *) malloc (sizeof (struct gl_list_node_impl));
+
+ if (new_node == NULL)
+ return NULL;
+
+ new_node->left = NULL;
+ new_node->right = NULL;
+ new_node->branch_size = 1;
+ new_node->value = elt;
+#if WITH_HASHTABLE
+ new_node->h.hashcode =
+ (list->base.hashcode_fn != NULL
+ ? list->base.hashcode_fn (new_node->value)
+ : (size_t)(uintptr_t) new_node->value);
+#endif
+
+ /* Add it to the tree. */
+ if (list->root == NULL)
+ {
+ new_node->color = BLACK;
+ list->root = new_node;
+ new_node->parent = NULL;
+ }
+ else
+ {
+ gl_list_node_t node;
+
+ for (node = list->root; node->left != NULL; )
+ node = node->left;
+
+ node->left = new_node;
+ new_node->parent = node;
+
+ /* Update branch_size fields of the parent nodes. */
+ {
+ gl_list_node_t p;
+
+ for (p = node; p != NULL; p = p->parent)
+ p->branch_size++;
+ }
+
+ /* Color and rebalance. */
+ rebalance_after_add (list, new_node, node);
+ }
+
+#if WITH_HASHTABLE
+ /* Add node to the hash table.
+ Note that this is only possible _after_ the node has been added to the
+ tree structure, because add_to_bucket() uses node_position(). */
+ if (add_to_bucket (list, new_node) < 0)
+ {
+ gl_tree_remove_node_from_tree (list, new_node);
+ free (new_node);
+ return NULL;
+ }
+ hash_resize_after_add (list);
+#endif
+
+ return new_node;
+}
+
+static gl_list_node_t
+gl_tree_nx_add_last (gl_list_t list, const void *elt)
+{
+ /* Create new node. */
+ gl_list_node_t new_node =
+ (struct gl_list_node_impl *) malloc (sizeof (struct gl_list_node_impl));
+
+ if (new_node == NULL)
+ return NULL;
+
+ new_node->left = NULL;
+ new_node->right = NULL;
+ new_node->branch_size = 1;
+ new_node->value = elt;
+#if WITH_HASHTABLE
+ new_node->h.hashcode =
+ (list->base.hashcode_fn != NULL
+ ? list->base.hashcode_fn (new_node->value)
+ : (size_t)(uintptr_t) new_node->value);
+#endif
+
+ /* Add it to the tree. */
+ if (list->root == NULL)
+ {
+ new_node->color = BLACK;
+ list->root = new_node;
+ new_node->parent = NULL;
+ }
+ else
+ {
+ gl_list_node_t node;
+
+ for (node = list->root; node->right != NULL; )
+ node = node->right;
+
+ node->right = new_node;
+ new_node->parent = node;
+
+ /* Update branch_size fields of the parent nodes. */
+ {
+ gl_list_node_t p;
+
+ for (p = node; p != NULL; p = p->parent)
+ p->branch_size++;
+ }
+
+ /* Color and rebalance. */
+ rebalance_after_add (list, new_node, node);
+ }
+
+#if WITH_HASHTABLE
+ /* Add node to the hash table.
+ Note that this is only possible _after_ the node has been added to the
+ tree structure, because add_to_bucket() uses node_position(). */
+ if (add_to_bucket (list, new_node) < 0)
+ {
+ gl_tree_remove_node_from_tree (list, new_node);
+ free (new_node);
+ return NULL;
+ }
+ hash_resize_after_add (list);
+#endif
+
+ return new_node;
+}
+
+static gl_list_node_t
+gl_tree_nx_add_before (gl_list_t list, gl_list_node_t node, const void *elt)
+{
+ /* Create new node. */
+ gl_list_node_t new_node =
+ (struct gl_list_node_impl *) malloc (sizeof (struct gl_list_node_impl));
+
+ if (new_node == NULL)
+ return NULL;
+
+ new_node->left = NULL;
+ new_node->right = NULL;
+ new_node->branch_size = 1;
+ new_node->value = elt;
+#if WITH_HASHTABLE
+ new_node->h.hashcode =
+ (list->base.hashcode_fn != NULL
+ ? list->base.hashcode_fn (new_node->value)
+ : (size_t)(uintptr_t) new_node->value);
+#endif
+
+ /* Add it to the tree. */
+ if (node->left == NULL)
+ node->left = new_node;
+ else
+ {
+ for (node = node->left; node->right != NULL; )
+ node = node->right;
+ node->right = new_node;
+ }
+ new_node->parent = node;
+
+ /* Update branch_size fields of the parent nodes. */
+ {
+ gl_list_node_t p;
+
+ for (p = node; p != NULL; p = p->parent)
+ p->branch_size++;
+ }
+
+ /* Color and rebalance. */
+ rebalance_after_add (list, new_node, node);
+
+#if WITH_HASHTABLE
+ /* Add node to the hash table.
+ Note that this is only possible _after_ the node has been added to the
+ tree structure, because add_to_bucket() uses node_position(). */
+ if (add_to_bucket (list, new_node) < 0)
+ {
+ gl_tree_remove_node_from_tree (list, new_node);
+ free (new_node);
+ return NULL;
+ }
+ hash_resize_after_add (list);
+#endif
+
+ return new_node;
+}
+
+static gl_list_node_t
+gl_tree_nx_add_after (gl_list_t list, gl_list_node_t node, const void *elt)
+{
+ /* Create new node. */
+ gl_list_node_t new_node =
+ (struct gl_list_node_impl *) malloc (sizeof (struct gl_list_node_impl));
+
+ if (new_node == NULL)
+ return NULL;
+
+ new_node->left = NULL;
+ new_node->right = NULL;
+ new_node->branch_size = 1;
+ new_node->value = elt;
+#if WITH_HASHTABLE
+ new_node->h.hashcode =
+ (list->base.hashcode_fn != NULL
+ ? list->base.hashcode_fn (new_node->value)
+ : (size_t)(uintptr_t) new_node->value);
+#endif
+
+ /* Add it to the tree. */
+ if (node->right == NULL)
+ node->right = new_node;
+ else
+ {
+ for (node = node->right; node->left != NULL; )
+ node = node->left;
+ node->left = new_node;
+ }
+ new_node->parent = node;
+
+ /* Update branch_size fields of the parent nodes. */
+ {
+ gl_list_node_t p;
+
+ for (p = node; p != NULL; p = p->parent)
+ p->branch_size++;
+ }
+
+ /* Color and rebalance. */
+ rebalance_after_add (list, new_node, node);
+
+#if WITH_HASHTABLE
+ /* Add node to the hash table.
+ Note that this is only possible _after_ the node has been added to the
+ tree structure, because add_to_bucket() uses node_position(). */
+ if (add_to_bucket (list, new_node) < 0)
+ {
+ gl_tree_remove_node_from_tree (list, new_node);
+ free (new_node);
+ return NULL;
+ }
+ hash_resize_after_add (list);
+#endif
+
+ return new_node;
+}
diff --git a/gl/lib/gl_anytree_list1.h b/gl/lib/gl_anytree_list1.h
new file mode 100644
index 0000000..1f05430
--- /dev/null
+++ b/gl/lib/gl_anytree_list1.h
@@ -0,0 +1,41 @@
+/* Sequential list data type implemented by a binary tree.
+ Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+ 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 2.1 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/>. */
+
+/* Common code of gl_avltree_list.c, gl_rbtree_list.c,
+ gl_avltreehash_list.c, gl_rbtreehash_list.c. */
+
+/* An item on the stack used for iterating across the elements. */
+typedef struct
+{
+ gl_list_node_t node;
+ size_t rightp;
+} iterstack_item_t;
+
+/* A stack used for iterating across the elements. */
+typedef iterstack_item_t iterstack_t[MAXHEIGHT];
+
+/* Frees a non-empty subtree recursively.
+ This function is recursive and therefore not very fast. */
+static void
+free_subtree (gl_list_node_t node)
+{
+ if (node->left != NULL)
+ free_subtree (node->left);
+ if (node->right != NULL)
+ free_subtree (node->right);
+ free (node);
+}
diff --git a/gl/lib/gl_anytree_list2.h b/gl/lib/gl_anytree_list2.h
new file mode 100644
index 0000000..165b715
--- /dev/null
+++ b/gl/lib/gl_anytree_list2.h
@@ -0,0 +1,970 @@
+/* Sequential list data type implemented by a binary tree.
+ Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+ 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 2.1 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/>. */
+
+/* Common code of gl_avltree_list.c, gl_rbtree_list.c,
+ gl_avltreehash_list.c, gl_rbtreehash_list.c. */
+
+static gl_list_t
+gl_tree_nx_create_empty (gl_list_implementation_t implementation,
+ gl_listelement_equals_fn equals_fn,
+ gl_listelement_hashcode_fn hashcode_fn,
+ gl_listelement_dispose_fn dispose_fn,
+ bool allow_duplicates)
+{
+ struct gl_list_impl *list = (struct gl_list_impl *) malloc (sizeof (struct gl_list_impl));
+
+ if (list == NULL)
+ return NULL;
+
+ list->base.vtable = implementation;
+ list->base.equals_fn = equals_fn;
+ list->base.hashcode_fn = hashcode_fn;
+ list->base.dispose_fn = dispose_fn;
+ list->base.allow_duplicates = allow_duplicates;
+#if WITH_HASHTABLE
+ list->table_size = 11;
+ list->table =
+ (gl_hash_entry_t *) calloc (list->table_size, sizeof (gl_hash_entry_t));
+ if (list->table == NULL)
+ goto fail;
+#endif
+ list->root = NULL;
+
+ return list;
+
+#if WITH_HASHTABLE
+ fail:
+ free (list);
+ return NULL;
+#endif
+}
+
+static size_t _GL_ATTRIBUTE_PURE
+gl_tree_size (gl_list_t list)
+{
+ return (list->root != NULL ? list->root->branch_size : 0);
+}
+
+static const void * _GL_ATTRIBUTE_PURE
+gl_tree_node_value (_GL_ATTRIBUTE_MAYBE_UNUSED gl_list_t list,
+ gl_list_node_t node)
+{
+ return node->value;
+}
+
+static int
+gl_tree_node_nx_set_value (_GL_ATTRIBUTE_MAYBE_UNUSED gl_list_t list,
+ gl_list_node_t node, const void *elt)
+{
+#if WITH_HASHTABLE
+ if (elt != node->value)
+ {
+ size_t new_hashcode =
+ (list->base.hashcode_fn != NULL
+ ? list->base.hashcode_fn (elt)
+ : (size_t)(uintptr_t) elt);
+
+ if (new_hashcode != node->h.hashcode)
+ {
+ remove_from_bucket (list, node);
+ node->value = elt;
+ node->h.hashcode = new_hashcode;
+ if (add_to_bucket (list, node) < 0)
+ {
+ /* Out of memory. We removed node from a bucket but cannot add
+ it to another bucket. In order to avoid inconsistencies, we
+ must remove node entirely from the list. */
+ gl_tree_remove_node_from_tree (list, node);
+ free (node);
+ return -1;
+ }
+ }
+ else
+ node->value = elt;
+ }
+#else
+ node->value = elt;
+#endif
+ return 0;
+}
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_tree_next_node (_GL_ATTRIBUTE_MAYBE_UNUSED gl_list_t list,
+ gl_list_node_t node)
+{
+ if (node->right != NULL)
+ {
+ node = node->right;
+ while (node->left != NULL)
+ node = node->left;
+ }
+ else
+ {
+ while (node->parent != NULL && node->parent->right == node)
+ node = node->parent;
+ node = node->parent;
+ }
+ return node;
+}
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_tree_previous_node (_GL_ATTRIBUTE_MAYBE_UNUSED gl_list_t list,
+ gl_list_node_t node)
+{
+ if (node->left != NULL)
+ {
+ node = node->left;
+ while (node->right != NULL)
+ node = node->right;
+ }
+ else
+ {
+ while (node->parent != NULL && node->parent->left == node)
+ node = node->parent;
+ node = node->parent;
+ }
+ return node;
+}
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_tree_first_node (_GL_ATTRIBUTE_MAYBE_UNUSED gl_list_t list)
+{
+ gl_list_node_t node = list->root;
+
+ if (node != NULL)
+ {
+ while (node->left != NULL)
+ node = node->left;
+ }
+ return node;
+}
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_tree_last_node (_GL_ATTRIBUTE_MAYBE_UNUSED gl_list_t list)
+{
+ gl_list_node_t node = list->root;
+
+ if (node != NULL)
+ {
+ while (node->right != NULL)
+ node = node->right;
+ }
+ return node;
+}
+
+/* Returns the node at the given position < gl_tree_size (list). */
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+node_at (gl_list_node_t root, size_t position)
+{
+ /* Here we know that root != NULL. */
+ gl_list_node_t node = root;
+
+ for (;;)
+ {
+ if (node->left != NULL)
+ {
+ if (position < node->left->branch_size)
+ {
+ node = node->left;
+ continue;
+ }
+ position -= node->left->branch_size;
+ }
+ if (position == 0)
+ break;
+ position--;
+ node = node->right;
+ }
+ return node;
+}
+
+static const void * _GL_ATTRIBUTE_PURE
+gl_tree_get_at (gl_list_t list, size_t position)
+{
+ gl_list_node_t node = list->root;
+
+ if (!(node != NULL && position < node->branch_size))
+ /* Invalid argument. */
+ abort ();
+ node = node_at (node, position);
+ return node->value;
+}
+
+static gl_list_node_t
+gl_tree_nx_set_at (gl_list_t list, size_t position, const void *elt)
+{
+ gl_list_node_t node = list->root;
+
+ if (!(node != NULL && position < node->branch_size))
+ /* Invalid argument. */
+ abort ();
+ node = node_at (node, position);
+#if WITH_HASHTABLE
+ if (elt != node->value)
+ {
+ size_t new_hashcode =
+ (list->base.hashcode_fn != NULL
+ ? list->base.hashcode_fn (elt)
+ : (size_t)(uintptr_t) elt);
+
+ if (new_hashcode != node->h.hashcode)
+ {
+ remove_from_bucket (list, node);
+ node->value = elt;
+ node->h.hashcode = new_hashcode;
+ if (add_to_bucket (list, node) < 0)
+ {
+ /* Out of memory. We removed node from a bucket but cannot add
+ it to another bucket. In order to avoid inconsistencies, we
+ must remove node entirely from the list. */
+ gl_tree_remove_node_from_tree (list, node);
+ free (node);
+ return NULL;
+ }
+ }
+ else
+ node->value = elt;
+ }
+#else
+ node->value = elt;
+#endif
+ return node;
+}
+
+#if !WITH_HASHTABLE
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_tree_search_from_to (gl_list_t list, size_t start_index, size_t end_index,
+ const void *elt)
+{
+ if (!(start_index <= end_index
+ && end_index <= (list->root != NULL ? list->root->branch_size : 0)))
+ /* Invalid arguments. */
+ abort ();
+ {
+ gl_listelement_equals_fn equals = list->base.equals_fn;
+ /* Iterate across all elements. */
+ gl_list_node_t node = list->root;
+ iterstack_t stack;
+ iterstack_item_t *stack_ptr = &stack[0];
+ size_t index = 0;
+
+ if (start_index == 0)
+ {
+ /* Consider all elements. */
+ for (;;)
+ {
+ /* Descend on left branch. */
+ for (;;)
+ {
+ if (node == NULL)
+ break;
+ stack_ptr->node = node;
+ stack_ptr->rightp = 0;
+ node = node->left;
+ stack_ptr++;
+ }
+ /* Climb up again. */
+ for (;;)
+ {
+ if (stack_ptr == &stack[0])
+ return NULL;
+ stack_ptr--;
+ if (!stack_ptr->rightp)
+ break;
+ }
+ node = stack_ptr->node;
+ /* Test against current element. */
+ if (equals != NULL ? equals (elt, node->value) : elt == node->value)
+ return node;
+ index++;
+ if (index >= end_index)
+ return NULL;
+ /* Descend on right branch. */
+ stack_ptr->rightp = 1;
+ node = node->right;
+ stack_ptr++;
+ }
+ }
+ else
+ {
+ /* Consider only elements at indices >= start_index.
+ In this case, rightp contains the difference between the start_index
+ for the parent node and the one for the child node (0 when the child
+ node is the parent's left child, > 0 when the child is the parent's
+ right child). */
+ for (;;)
+ {
+ /* Descend on left branch. */
+ for (;;)
+ {
+ if (node == NULL)
+ break;
+ if (node->branch_size <= start_index)
+ break;
+ stack_ptr->node = node;
+ stack_ptr->rightp = 0;
+ node = node->left;
+ stack_ptr++;
+ }
+ /* Climb up again. */
+ for (;;)
+ {
+ if (stack_ptr == &stack[0])
+ return NULL;
+ stack_ptr--;
+ if (!stack_ptr->rightp)
+ break;
+ start_index += stack_ptr->rightp;
+ }
+ node = stack_ptr->node;
+ {
+ size_t left_branch_size1 =
+ (node->left != NULL ? node->left->branch_size : 0) + 1;
+ if (start_index < left_branch_size1)
+ {
+ /* Test against current element. */
+ if (equals != NULL ? equals (elt, node->value) : elt == node->value)
+ return node;
+ /* Now that we have considered all indices < left_branch_size1,
+ we can increment start_index. */
+ start_index = left_branch_size1;
+ }
+ index++;
+ if (index >= end_index)
+ return NULL;
+ /* Descend on right branch. */
+ start_index -= left_branch_size1;
+ stack_ptr->rightp = left_branch_size1;
+ }
+ node = node->right;
+ stack_ptr++;
+ }
+ }
+ }
+}
+
+static size_t _GL_ATTRIBUTE_PURE
+gl_tree_indexof_from_to (gl_list_t list, size_t start_index, size_t end_index,
+ const void *elt)
+{
+ if (!(start_index <= end_index
+ && end_index <= (list->root != NULL ? list->root->branch_size : 0)))
+ /* Invalid arguments. */
+ abort ();
+ {
+ gl_listelement_equals_fn equals = list->base.equals_fn;
+ /* Iterate across all elements. */
+ gl_list_node_t node = list->root;
+ iterstack_t stack;
+ iterstack_item_t *stack_ptr = &stack[0];
+ size_t index = 0;
+
+ if (start_index == 0)
+ {
+ /* Consider all elements. */
+ for (;;)
+ {
+ /* Descend on left branch. */
+ for (;;)
+ {
+ if (node == NULL)
+ break;
+ stack_ptr->node = node;
+ stack_ptr->rightp = 0;
+ node = node->left;
+ stack_ptr++;
+ }
+ /* Climb up again. */
+ for (;;)
+ {
+ if (stack_ptr == &stack[0])
+ return (size_t)(-1);
+ stack_ptr--;
+ if (!stack_ptr->rightp)
+ break;
+ }
+ node = stack_ptr->node;
+ /* Test against current element. */
+ if (equals != NULL ? equals (elt, node->value) : elt == node->value)
+ return index;
+ index++;
+ if (index >= end_index)
+ return (size_t)(-1);
+ /* Descend on right branch. */
+ stack_ptr->rightp = 1;
+ node = node->right;
+ stack_ptr++;
+ }
+ }
+ else
+ {
+ /* Consider only elements at indices >= start_index.
+ In this case, rightp contains the difference between the start_index
+ for the parent node and the one for the child node (0 when the child
+ node is the parent's left child, > 0 when the child is the parent's
+ right child). */
+ for (;;)
+ {
+ /* Descend on left branch. */
+ for (;;)
+ {
+ if (node == NULL)
+ break;
+ if (node->branch_size <= start_index)
+ break;
+ stack_ptr->node = node;
+ stack_ptr->rightp = 0;
+ node = node->left;
+ stack_ptr++;
+ }
+ /* Climb up again. */
+ for (;;)
+ {
+ if (stack_ptr == &stack[0])
+ return (size_t)(-1);
+ stack_ptr--;
+ if (!stack_ptr->rightp)
+ break;
+ start_index += stack_ptr->rightp;
+ }
+ node = stack_ptr->node;
+ {
+ size_t left_branch_size1 =
+ (node->left != NULL ? node->left->branch_size : 0) + 1;
+ if (start_index < left_branch_size1)
+ {
+ /* Test against current element. */
+ if (equals != NULL ? equals (elt, node->value) : elt == node->value)
+ return index;
+ /* Now that we have considered all indices < left_branch_size1,
+ we can increment start_index. */
+ start_index = left_branch_size1;
+ }
+ index++;
+ if (index >= end_index)
+ return (size_t)(-1);
+ /* Descend on right branch. */
+ start_index -= left_branch_size1;
+ stack_ptr->rightp = left_branch_size1;
+ }
+ node = node->right;
+ stack_ptr++;
+ }
+ }
+ }
+}
+
+#endif
+
+static gl_list_node_t
+gl_tree_nx_add_at (gl_list_t list, size_t position, const void *elt)
+{
+ size_t count = (list->root != NULL ? list->root->branch_size : 0);
+
+ if (!(position <= count))
+ /* Invalid argument. */
+ abort ();
+ if (position == count)
+ return gl_tree_nx_add_last (list, elt);
+ else
+ return gl_tree_nx_add_before (list, node_at (list->root, position), elt);
+}
+
+static bool
+gl_tree_remove_node (gl_list_t list, gl_list_node_t node)
+{
+#if WITH_HASHTABLE
+ /* Remove node from the hash table.
+ Note that this is only possible _before_ the node is removed from the
+ tree structure, because remove_from_bucket() uses node_position(). */
+ remove_from_bucket (list, node);
+#endif
+
+ gl_tree_remove_node_from_tree (list, node);
+
+ if (list->base.dispose_fn != NULL)
+ list->base.dispose_fn (node->value);
+ free (node);
+ return true;
+}
+
+static bool
+gl_tree_remove_at (gl_list_t list, size_t position)
+{
+ gl_list_node_t node = list->root;
+
+ if (!(node != NULL && position < node->branch_size))
+ /* Invalid argument. */
+ abort ();
+ node = node_at (node, position);
+ return gl_tree_remove_node (list, node);
+}
+
+static bool
+gl_tree_remove (gl_list_t list, const void *elt)
+{
+ if (list->root != NULL)
+ {
+ gl_list_node_t node =
+ gl_tree_search_from_to (list, 0, list->root->branch_size, elt);
+
+ if (node != NULL)
+ return gl_tree_remove_node (list, node);
+ }
+ return false;
+}
+
+#if !WITH_HASHTABLE
+
+static void
+gl_tree_list_free (gl_list_t list)
+{
+ /* Iterate across all elements in post-order. */
+ gl_list_node_t node = list->root;
+ iterstack_t stack;
+ iterstack_item_t *stack_ptr = &stack[0];
+
+ for (;;)
+ {
+ /* Descend on left branch. */
+ for (;;)
+ {
+ if (node == NULL)
+ break;
+ stack_ptr->node = node;
+ stack_ptr->rightp = false;
+ node = node->left;
+ stack_ptr++;
+ }
+ /* Climb up again. */
+ for (;;)
+ {
+ if (stack_ptr == &stack[0])
+ goto done_iterate;
+ stack_ptr--;
+ node = stack_ptr->node;
+ if (!stack_ptr->rightp)
+ break;
+ /* Free the current node. */
+ if (list->base.dispose_fn != NULL)
+ list->base.dispose_fn (node->value);
+ free (node);
+ }
+ /* Descend on right branch. */
+ stack_ptr->rightp = true;
+ node = node->right;
+ stack_ptr++;
+ }
+ done_iterate:
+ free (list);
+}
+
+#endif
+
+/* --------------------- gl_list_iterator_t Data Type --------------------- */
+
+static gl_list_iterator_t _GL_ATTRIBUTE_PURE
+gl_tree_iterator (gl_list_t list)
+{
+ gl_list_iterator_t result;
+ gl_list_node_t node;
+
+ result.vtable = list->base.vtable;
+ result.list = list;
+ /* Start node is the leftmost node. */
+ node = list->root;
+ if (node != NULL)
+ while (node->left != NULL)
+ node = node->left;
+ result.p = node;
+ /* End point is past the rightmost node. */
+ result.q = NULL;
+#if defined GCC_LINT || defined lint
+ result.i = 0;
+ result.j = 0;
+ result.count = 0;
+#endif
+
+ return result;
+}
+
+static gl_list_iterator_t _GL_ATTRIBUTE_PURE
+gl_tree_iterator_from_to (gl_list_t list, size_t start_index, size_t end_index)
+{
+ size_t count = (list->root != NULL ? list->root->branch_size : 0);
+ gl_list_iterator_t result;
+
+ if (!(start_index <= end_index && end_index <= count))
+ /* Invalid arguments. */
+ abort ();
+ result.vtable = list->base.vtable;
+ result.list = list;
+ /* Start node is the node at position start_index. */
+ result.p = (start_index < count ? node_at (list->root, start_index) : NULL);
+ /* End point is the node at position end_index. */
+ result.q = (end_index < count ? node_at (list->root, end_index) : NULL);
+#if defined GCC_LINT || defined lint
+ result.i = 0;
+ result.j = 0;
+ result.count = 0;
+#endif
+
+ return result;
+}
+
+static bool
+gl_tree_iterator_next (gl_list_iterator_t *iterator,
+ const void **eltp, gl_list_node_t *nodep)
+{
+ if (iterator->p != iterator->q)
+ {
+ gl_list_node_t node = (gl_list_node_t) iterator->p;
+ *eltp = node->value;
+ if (nodep != NULL)
+ *nodep = node;
+ /* Advance to the next node. */
+ if (node->right != NULL)
+ {
+ node = node->right;
+ while (node->left != NULL)
+ node = node->left;
+ }
+ else
+ {
+ while (node->parent != NULL && node->parent->right == node)
+ node = node->parent;
+ node = node->parent;
+ }
+ iterator->p = node;
+ return true;
+ }
+ else
+ return false;
+}
+
+static void
+gl_tree_iterator_free (_GL_ATTRIBUTE_MAYBE_UNUSED gl_list_iterator_t *iterator)
+{
+}
+
+/* ---------------------- Sorted gl_list_t Data Type ---------------------- */
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_tree_sortedlist_search (gl_list_t list, gl_listelement_compar_fn compar,
+ const void *elt)
+{
+ gl_list_node_t node;
+
+ for (node = list->root; node != NULL; )
+ {
+ int cmp = compar (node->value, elt);
+
+ if (cmp < 0)
+ node = node->right;
+ else if (cmp > 0)
+ node = node->left;
+ else /* cmp == 0 */
+ {
+ /* We have an element equal to ELT. But we need the leftmost such
+ element. */
+ gl_list_node_t found = node;
+ node = node->left;
+ for (; node != NULL; )
+ {
+ int cmp2 = compar (node->value, elt);
+
+ if (cmp2 < 0)
+ node = node->right;
+ else if (cmp2 > 0)
+ /* The list was not sorted. */
+ abort ();
+ else /* cmp2 == 0 */
+ {
+ found = node;
+ node = node->left;
+ }
+ }
+ return found;
+ }
+ }
+ return NULL;
+}
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_tree_sortedlist_search_from_to (gl_list_t list,
+ gl_listelement_compar_fn compar,
+ size_t low, size_t high,
+ const void *elt)
+{
+ gl_list_node_t node;
+
+ if (!(low <= high
+ && high <= (list->root != NULL ? list->root->branch_size : 0)))
+ /* Invalid arguments. */
+ abort ();
+
+ for (node = list->root; node != NULL; )
+ {
+ size_t left_branch_size =
+ (node->left != NULL ? node->left->branch_size : 0);
+
+ if (low > left_branch_size)
+ {
+ low -= left_branch_size + 1;
+ high -= left_branch_size + 1;
+ node = node->right;
+ }
+ else if (high <= left_branch_size)
+ node = node->left;
+ else
+ {
+ /* Here low <= left_branch_size < high. */
+ int cmp = compar (node->value, elt);
+
+ if (cmp < 0)
+ {
+ low = 0;
+ high -= left_branch_size + 1;
+ node = node->right;
+ }
+ else if (cmp > 0)
+ node = node->left;
+ else /* cmp == 0 */
+ {
+ /* We have an element equal to ELT. But we need the leftmost
+ such element. */
+ gl_list_node_t found = node;
+ node = node->left;
+ for (; node != NULL; )
+ {
+ size_t left_branch_size2 =
+ (node->left != NULL ? node->left->branch_size : 0);
+
+ if (low > left_branch_size2)
+ {
+ low -= left_branch_size2 + 1;
+ node = node->right;
+ }
+ else
+ {
+ /* Here low <= left_branch_size2. */
+ int cmp2 = compar (node->value, elt);
+
+ if (cmp2 < 0)
+ {
+ low = 0;
+ node = node->right;
+ }
+ else if (cmp2 > 0)
+ /* The list was not sorted. */
+ abort ();
+ else /* cmp2 == 0 */
+ {
+ found = node;
+ node = node->left;
+ }
+ }
+ }
+ return found;
+ }
+ }
+ }
+ return NULL;
+}
+
+static size_t _GL_ATTRIBUTE_PURE
+gl_tree_sortedlist_indexof (gl_list_t list, gl_listelement_compar_fn compar,
+ const void *elt)
+{
+ gl_list_node_t node;
+ size_t position;
+
+ for (node = list->root, position = 0; node != NULL; )
+ {
+ int cmp = compar (node->value, elt);
+
+ if (cmp < 0)
+ {
+ if (node->left != NULL)
+ position += node->left->branch_size;
+ position++;
+ node = node->right;
+ }
+ else if (cmp > 0)
+ node = node->left;
+ else /* cmp == 0 */
+ {
+ /* We have an element equal to ELT. But we need the leftmost such
+ element. */
+ size_t found_position =
+ position + (node->left != NULL ? node->left->branch_size : 0);
+ node = node->left;
+ for (; node != NULL; )
+ {
+ int cmp2 = compar (node->value, elt);
+
+ if (cmp2 < 0)
+ {
+ if (node->left != NULL)
+ position += node->left->branch_size;
+ position++;
+ node = node->right;
+ }
+ else if (cmp2 > 0)
+ /* The list was not sorted. */
+ abort ();
+ else /* cmp2 == 0 */
+ {
+ found_position =
+ position
+ + (node->left != NULL ? node->left->branch_size : 0);
+ node = node->left;
+ }
+ }
+ return found_position;
+ }
+ }
+ return (size_t)(-1);
+}
+
+static size_t _GL_ATTRIBUTE_PURE
+gl_tree_sortedlist_indexof_from_to (gl_list_t list,
+ gl_listelement_compar_fn compar,
+ size_t low, size_t high,
+ const void *elt)
+{
+ gl_list_node_t node;
+ size_t position;
+
+ if (!(low <= high
+ && high <= (list->root != NULL ? list->root->branch_size : 0)))
+ /* Invalid arguments. */
+ abort ();
+
+ for (node = list->root, position = 0; node != NULL; )
+ {
+ size_t left_branch_size =
+ (node->left != NULL ? node->left->branch_size : 0);
+
+ if (low > left_branch_size)
+ {
+ low -= left_branch_size + 1;
+ high -= left_branch_size + 1;
+ position += left_branch_size + 1;
+ node = node->right;
+ }
+ else if (high <= left_branch_size)
+ node = node->left;
+ else
+ {
+ /* Here low <= left_branch_size < high. */
+ int cmp = compar (node->value, elt);
+
+ if (cmp < 0)
+ {
+ low = 0;
+ high -= left_branch_size + 1;
+ position += left_branch_size + 1;
+ node = node->right;
+ }
+ else if (cmp > 0)
+ node = node->left;
+ else /* cmp == 0 */
+ {
+ /* We have an element equal to ELT. But we need the leftmost
+ such element. */
+ size_t found_position =
+ position + (node->left != NULL ? node->left->branch_size : 0);
+ node = node->left;
+ for (; node != NULL; )
+ {
+ size_t left_branch_size2 =
+ (node->left != NULL ? node->left->branch_size : 0);
+
+ if (low > left_branch_size2)
+ {
+ low -= left_branch_size2 + 1;
+ node = node->right;
+ }
+ else
+ {
+ /* Here low <= left_branch_size2. */
+ int cmp2 = compar (node->value, elt);
+
+ if (cmp2 < 0)
+ {
+ position += left_branch_size2 + 1;
+ node = node->right;
+ }
+ else if (cmp2 > 0)
+ /* The list was not sorted. */
+ abort ();
+ else /* cmp2 == 0 */
+ {
+ found_position = position + left_branch_size2;
+ node = node->left;
+ }
+ }
+ }
+ return found_position;
+ }
+ }
+ }
+ return (size_t)(-1);
+}
+
+static gl_list_node_t
+gl_tree_sortedlist_nx_add (gl_list_t list, gl_listelement_compar_fn compar,
+ const void *elt)
+{
+ gl_list_node_t node = list->root;
+
+ if (node == NULL)
+ return gl_tree_nx_add_first (list, elt);
+
+ for (;;)
+ {
+ int cmp = compar (node->value, elt);
+
+ if (cmp < 0)
+ {
+ if (node->right == NULL)
+ return gl_tree_nx_add_after (list, node, elt);
+ node = node->right;
+ }
+ else if (cmp > 0)
+ {
+ if (node->left == NULL)
+ return gl_tree_nx_add_before (list, node, elt);
+ node = node->left;
+ }
+ else /* cmp == 0 */
+ return gl_tree_nx_add_before (list, node, elt);
+ }
+}
+
+static bool
+gl_tree_sortedlist_remove (gl_list_t list, gl_listelement_compar_fn compar,
+ const void *elt)
+{
+ gl_list_node_t node = gl_tree_sortedlist_search (list, compar, elt);
+ if (node != NULL)
+ return gl_tree_remove_node (list, node);
+ else
+ return false;
+}
diff --git a/gl/lib/gl_array_list.c b/gl/lib/gl_array_list.c
new file mode 100644
index 0000000..3018632
--- /dev/null
+++ b/gl/lib/gl_array_list.c
@@ -0,0 +1,697 @@
+/* Sequential list data type implemented by an array.
+ Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "gl_array_list.h"
+
+#include <stdint.h>
+#include <stdlib.h>
+/* Get memcpy. */
+#include <string.h>
+
+/* Checked size_t computations. */
+#include "xsize.h"
+
+/* -------------------------- gl_list_t Data Type -------------------------- */
+
+/* Concrete gl_list_impl type, valid for this file only. */
+struct gl_list_impl
+{
+ struct gl_list_impl_base base;
+ /* An array of ALLOCATED elements, of which the first COUNT are used.
+ 0 <= COUNT <= ALLOCATED. */
+ const void **elements;
+ size_t count;
+ size_t allocated;
+};
+
+/* struct gl_list_node_impl doesn't exist here. The pointers are actually
+ indices + 1. */
+#define INDEX_TO_NODE(index) (gl_list_node_t)(uintptr_t)(size_t)((index) + 1)
+#define NODE_TO_INDEX(node) ((uintptr_t)(node) - 1)
+
+static gl_list_t
+gl_array_nx_create_empty (gl_list_implementation_t implementation,
+ gl_listelement_equals_fn equals_fn,
+ gl_listelement_hashcode_fn hashcode_fn,
+ gl_listelement_dispose_fn dispose_fn,
+ bool allow_duplicates)
+{
+ struct gl_list_impl *list =
+ (struct gl_list_impl *) malloc (sizeof (struct gl_list_impl));
+
+ if (list == NULL)
+ return NULL;
+
+ list->base.vtable = implementation;
+ list->base.equals_fn = equals_fn;
+ list->base.hashcode_fn = hashcode_fn;
+ list->base.dispose_fn = dispose_fn;
+ list->base.allow_duplicates = allow_duplicates;
+ list->elements = NULL;
+ list->count = 0;
+ list->allocated = 0;
+
+ return list;
+}
+
+static gl_list_t
+gl_array_nx_create (gl_list_implementation_t implementation,
+ gl_listelement_equals_fn equals_fn,
+ gl_listelement_hashcode_fn hashcode_fn,
+ gl_listelement_dispose_fn dispose_fn,
+ bool allow_duplicates,
+ size_t count, const void **contents)
+{
+ struct gl_list_impl *list =
+ (struct gl_list_impl *) malloc (sizeof (struct gl_list_impl));
+
+ if (list == NULL)
+ return NULL;
+
+ list->base.vtable = implementation;
+ list->base.equals_fn = equals_fn;
+ list->base.hashcode_fn = hashcode_fn;
+ list->base.dispose_fn = dispose_fn;
+ list->base.allow_duplicates = allow_duplicates;
+ if (count > 0)
+ {
+ if (size_overflow_p (xtimes (count, sizeof (const void *))))
+ goto fail;
+ list->elements = (const void **) malloc (count * sizeof (const void *));
+ if (list->elements == NULL)
+ goto fail;
+ memcpy (list->elements, contents, count * sizeof (const void *));
+ }
+ else
+ list->elements = NULL;
+ list->count = count;
+ list->allocated = count;
+
+ return list;
+
+ fail:
+ free (list);
+ return NULL;
+}
+
+static size_t _GL_ATTRIBUTE_PURE
+gl_array_size (gl_list_t list)
+{
+ return list->count;
+}
+
+static const void * _GL_ATTRIBUTE_PURE
+gl_array_node_value (gl_list_t list, gl_list_node_t node)
+{
+ uintptr_t index = NODE_TO_INDEX (node);
+ if (!(index < list->count))
+ /* Invalid argument. */
+ abort ();
+ return list->elements[index];
+}
+
+static int
+gl_array_node_nx_set_value (gl_list_t list, gl_list_node_t node,
+ const void *elt)
+{
+ uintptr_t index = NODE_TO_INDEX (node);
+ if (!(index < list->count))
+ /* Invalid argument. */
+ abort ();
+ list->elements[index] = elt;
+ return 0;
+}
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_array_next_node (gl_list_t list, gl_list_node_t node)
+{
+ uintptr_t index = NODE_TO_INDEX (node);
+ if (!(index < list->count))
+ /* Invalid argument. */
+ abort ();
+ index++;
+ if (index < list->count)
+ return INDEX_TO_NODE (index);
+ else
+ return NULL;
+}
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_array_previous_node (gl_list_t list, gl_list_node_t node)
+{
+ uintptr_t index = NODE_TO_INDEX (node);
+ if (!(index < list->count))
+ /* Invalid argument. */
+ abort ();
+ if (index > 0)
+ return INDEX_TO_NODE (index - 1);
+ else
+ return NULL;
+}
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_array_first_node (gl_list_t list)
+{
+ if (list->count > 0)
+ return INDEX_TO_NODE (0);
+ else
+ return NULL;
+}
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_array_last_node (gl_list_t list)
+{
+ if (list->count > 0)
+ return INDEX_TO_NODE (list->count - 1);
+ else
+ return NULL;
+}
+
+static const void * _GL_ATTRIBUTE_PURE
+gl_array_get_at (gl_list_t list, size_t position)
+{
+ size_t count = list->count;
+
+ if (!(position < count))
+ /* Invalid argument. */
+ abort ();
+ return list->elements[position];
+}
+
+static gl_list_node_t
+gl_array_nx_set_at (gl_list_t list, size_t position, const void *elt)
+{
+ size_t count = list->count;
+
+ if (!(position < count))
+ /* Invalid argument. */
+ abort ();
+ list->elements[position] = elt;
+ return INDEX_TO_NODE (position);
+}
+
+static size_t _GL_ATTRIBUTE_PURE
+gl_array_indexof_from_to (gl_list_t list, size_t start_index, size_t end_index,
+ const void *elt)
+{
+ size_t count = list->count;
+
+ if (!(start_index <= end_index && end_index <= count))
+ /* Invalid arguments. */
+ abort ();
+
+ if (start_index < end_index)
+ {
+ gl_listelement_equals_fn equals = list->base.equals_fn;
+ if (equals != NULL)
+ {
+ size_t i;
+
+ for (i = start_index;;)
+ {
+ if (equals (elt, list->elements[i]))
+ return i;
+ i++;
+ if (i == end_index)
+ break;
+ }
+ }
+ else
+ {
+ size_t i;
+
+ for (i = start_index;;)
+ {
+ if (elt == list->elements[i])
+ return i;
+ i++;
+ if (i == end_index)
+ break;
+ }
+ }
+ }
+ return (size_t)(-1);
+}
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_array_search_from_to (gl_list_t list, size_t start_index, size_t end_index,
+ const void *elt)
+{
+ size_t index = gl_array_indexof_from_to (list, start_index, end_index, elt);
+ return INDEX_TO_NODE (index);
+}
+
+/* Ensure that list->allocated > list->count.
+ Return 0 upon success, -1 upon out-of-memory. */
+static int
+grow (gl_list_t list)
+{
+ size_t new_allocated;
+ size_t memory_size;
+ const void **memory;
+
+ new_allocated = xtimes (list->allocated, 2);
+ new_allocated = xsum (new_allocated, 1);
+ memory_size = xtimes (new_allocated, sizeof (const void *));
+ if (size_overflow_p (memory_size))
+ /* Overflow, would lead to out of memory. */
+ return -1;
+ memory = (const void **) realloc (list->elements, memory_size);
+ if (memory == NULL)
+ /* Out of memory. */
+ return -1;
+ list->elements = memory;
+ list->allocated = new_allocated;
+ return 0;
+}
+
+static gl_list_node_t
+gl_array_nx_add_first (gl_list_t list, const void *elt)
+{
+ size_t count = list->count;
+ const void **elements;
+ size_t i;
+
+ if (count == list->allocated)
+ if (grow (list) < 0)
+ return NULL;
+ elements = list->elements;
+ for (i = count; i > 0; i--)
+ elements[i] = elements[i - 1];
+ elements[0] = elt;
+ list->count = count + 1;
+ return INDEX_TO_NODE (0);
+}
+
+static gl_list_node_t
+gl_array_nx_add_last (gl_list_t list, const void *elt)
+{
+ size_t count = list->count;
+
+ if (count == list->allocated)
+ if (grow (list) < 0)
+ return NULL;
+ list->elements[count] = elt;
+ list->count = count + 1;
+ return INDEX_TO_NODE (count);
+}
+
+static gl_list_node_t
+gl_array_nx_add_before (gl_list_t list, gl_list_node_t node, const void *elt)
+{
+ size_t count = list->count;
+ uintptr_t index = NODE_TO_INDEX (node);
+ size_t position;
+ const void **elements;
+ size_t i;
+
+ if (!(index < count))
+ /* Invalid argument. */
+ abort ();
+ position = index;
+ if (count == list->allocated)
+ if (grow (list) < 0)
+ return NULL;
+ elements = list->elements;
+ for (i = count; i > position; i--)
+ elements[i] = elements[i - 1];
+ elements[position] = elt;
+ list->count = count + 1;
+ return INDEX_TO_NODE (position);
+}
+
+static gl_list_node_t
+gl_array_nx_add_after (gl_list_t list, gl_list_node_t node, const void *elt)
+{
+ size_t count = list->count;
+ uintptr_t index = NODE_TO_INDEX (node);
+ size_t position;
+ const void **elements;
+ size_t i;
+
+ if (!(index < count))
+ /* Invalid argument. */
+ abort ();
+ position = index + 1;
+ if (count == list->allocated)
+ if (grow (list) < 0)
+ return NULL;
+ elements = list->elements;
+ for (i = count; i > position; i--)
+ elements[i] = elements[i - 1];
+ elements[position] = elt;
+ list->count = count + 1;
+ return INDEX_TO_NODE (position);
+}
+
+static gl_list_node_t
+gl_array_nx_add_at (gl_list_t list, size_t position, const void *elt)
+{
+ size_t count = list->count;
+ const void **elements;
+ size_t i;
+
+ if (!(position <= count))
+ /* Invalid argument. */
+ abort ();
+ if (count == list->allocated)
+ if (grow (list) < 0)
+ return NULL;
+ elements = list->elements;
+ for (i = count; i > position; i--)
+ elements[i] = elements[i - 1];
+ elements[position] = elt;
+ list->count = count + 1;
+ return INDEX_TO_NODE (position);
+}
+
+static bool
+gl_array_remove_node (gl_list_t list, gl_list_node_t node)
+{
+ size_t count = list->count;
+ uintptr_t index = NODE_TO_INDEX (node);
+ size_t position;
+ const void **elements;
+ size_t i;
+
+ if (!(index < count))
+ /* Invalid argument. */
+ abort ();
+ position = index;
+ elements = list->elements;
+ if (list->base.dispose_fn != NULL)
+ list->base.dispose_fn (elements[position]);
+ for (i = position + 1; i < count; i++)
+ elements[i - 1] = elements[i];
+ list->count = count - 1;
+ return true;
+}
+
+static bool
+gl_array_remove_at (gl_list_t list, size_t position)
+{
+ size_t count = list->count;
+ const void **elements;
+ size_t i;
+
+ if (!(position < count))
+ /* Invalid argument. */
+ abort ();
+ elements = list->elements;
+ if (list->base.dispose_fn != NULL)
+ list->base.dispose_fn (elements[position]);
+ for (i = position + 1; i < count; i++)
+ elements[i - 1] = elements[i];
+ list->count = count - 1;
+ return true;
+}
+
+static bool
+gl_array_remove (gl_list_t list, const void *elt)
+{
+ size_t position = gl_array_indexof_from_to (list, 0, list->count, elt);
+ if (position == (size_t)(-1))
+ return false;
+ else
+ return gl_array_remove_at (list, position);
+}
+
+static void
+gl_array_list_free (gl_list_t list)
+{
+ if (list->elements != NULL)
+ {
+ if (list->base.dispose_fn != NULL)
+ {
+ size_t count = list->count;
+
+ if (count > 0)
+ {
+ gl_listelement_dispose_fn dispose = list->base.dispose_fn;
+ const void **elements = list->elements;
+
+ do
+ dispose (*elements++);
+ while (--count > 0);
+ }
+ }
+ free (list->elements);
+ }
+ free (list);
+}
+
+/* --------------------- gl_list_iterator_t Data Type --------------------- */
+
+static gl_list_iterator_t _GL_ATTRIBUTE_PURE
+gl_array_iterator (gl_list_t list)
+{
+ gl_list_iterator_t result;
+
+ result.vtable = list->base.vtable;
+ result.list = list;
+ result.count = list->count;
+ result.p = list->elements + 0;
+ result.q = list->elements + list->count;
+#if defined GCC_LINT || defined lint
+ result.i = 0;
+ result.j = 0;
+#endif
+
+ return result;
+}
+
+static gl_list_iterator_t _GL_ATTRIBUTE_PURE
+gl_array_iterator_from_to (gl_list_t list, size_t start_index, size_t end_index)
+{
+ gl_list_iterator_t result;
+
+ if (!(start_index <= end_index && end_index <= list->count))
+ /* Invalid arguments. */
+ abort ();
+ result.vtable = list->base.vtable;
+ result.list = list;
+ result.count = list->count;
+ result.p = list->elements + start_index;
+ result.q = list->elements + end_index;
+#if defined GCC_LINT || defined lint
+ result.i = 0;
+ result.j = 0;
+#endif
+
+ return result;
+}
+
+static bool
+gl_array_iterator_next (gl_list_iterator_t *iterator,
+ const void **eltp, gl_list_node_t *nodep)
+{
+ gl_list_t list = iterator->list;
+ if (iterator->count != list->count)
+ {
+ if (iterator->count != list->count + 1)
+ /* Concurrent modifications were done on the list. */
+ abort ();
+ /* The last returned element was removed. */
+ iterator->count--;
+ iterator->p = (const void **) iterator->p - 1;
+ iterator->q = (const void **) iterator->q - 1;
+ }
+ if (iterator->p < iterator->q)
+ {
+ const void **p = (const void **) iterator->p;
+ *eltp = *p;
+ if (nodep != NULL)
+ *nodep = INDEX_TO_NODE (p - list->elements);
+ iterator->p = p + 1;
+ return true;
+ }
+ else
+ return false;
+}
+
+static void
+gl_array_iterator_free (_GL_ATTRIBUTE_MAYBE_UNUSED gl_list_iterator_t *iterator)
+{
+}
+
+/* ---------------------- Sorted gl_list_t Data Type ---------------------- */
+
+static size_t _GL_ATTRIBUTE_PURE
+gl_array_sortedlist_indexof_from_to (gl_list_t list,
+ gl_listelement_compar_fn compar,
+ size_t low, size_t high,
+ const void *elt)
+{
+ if (!(low <= high && high <= list->count))
+ /* Invalid arguments. */
+ abort ();
+ if (low < high)
+ {
+ /* At each loop iteration, low < high; for indices < low the values
+ are smaller than ELT; for indices >= high the values are greater
+ than ELT. So, if the element occurs in the list, it is at
+ low <= position < high. */
+ do
+ {
+ size_t mid = low + (high - low) / 2; /* low <= mid < high */
+ int cmp = compar (list->elements[mid], elt);
+
+ if (cmp < 0)
+ low = mid + 1;
+ else if (cmp > 0)
+ high = mid;
+ else /* cmp == 0 */
+ {
+ /* We have an element equal to ELT at index MID. But we need
+ the minimal such index. */
+ high = mid;
+ /* At each loop iteration, low <= high and
+ compar (list->elements[high], elt) == 0,
+ and we know that the first occurrence of the element is at
+ low <= position <= high. */
+ while (low < high)
+ {
+ size_t mid2 = low + (high - low) / 2; /* low <= mid2 < high */
+ int cmp2 = compar (list->elements[mid2], elt);
+
+ if (cmp2 < 0)
+ low = mid2 + 1;
+ else if (cmp2 > 0)
+ /* The list was not sorted. */
+ abort ();
+ else /* cmp2 == 0 */
+ {
+ if (mid2 == low)
+ break;
+ high = mid2 - 1;
+ }
+ }
+ return low;
+ }
+ }
+ while (low < high);
+ /* Here low == high. */
+ }
+ return (size_t)(-1);
+}
+
+static size_t _GL_ATTRIBUTE_PURE
+gl_array_sortedlist_indexof (gl_list_t list, gl_listelement_compar_fn compar,
+ const void *elt)
+{
+ return gl_array_sortedlist_indexof_from_to (list, compar, 0, list->count,
+ elt);
+}
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_array_sortedlist_search_from_to (gl_list_t list,
+ gl_listelement_compar_fn compar,
+ size_t low, size_t high,
+ const void *elt)
+{
+ size_t index =
+ gl_array_sortedlist_indexof_from_to (list, compar, low, high, elt);
+ return INDEX_TO_NODE (index);
+}
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_array_sortedlist_search (gl_list_t list, gl_listelement_compar_fn compar,
+ const void *elt)
+{
+ size_t index =
+ gl_array_sortedlist_indexof_from_to (list, compar, 0, list->count, elt);
+ return INDEX_TO_NODE (index);
+}
+
+static gl_list_node_t
+gl_array_sortedlist_nx_add (gl_list_t list, gl_listelement_compar_fn compar,
+ const void *elt)
+{
+ size_t count = list->count;
+ size_t low = 0;
+ size_t high = count;
+
+ /* At each loop iteration, low <= high; for indices < low the values are
+ smaller than ELT; for indices >= high the values are greater than ELT. */
+ while (low < high)
+ {
+ size_t mid = low + (high - low) / 2; /* low <= mid < high */
+ int cmp = compar (list->elements[mid], elt);
+
+ if (cmp < 0)
+ low = mid + 1;
+ else if (cmp > 0)
+ high = mid;
+ else /* cmp == 0 */
+ {
+ low = mid;
+ break;
+ }
+ }
+ return gl_array_nx_add_at (list, low, elt);
+}
+
+static bool
+gl_array_sortedlist_remove (gl_list_t list, gl_listelement_compar_fn compar,
+ const void *elt)
+{
+ size_t index = gl_array_sortedlist_indexof (list, compar, elt);
+ if (index == (size_t)(-1))
+ return false;
+ else
+ return gl_array_remove_at (list, index);
+}
+
+
+const struct gl_list_implementation gl_array_list_implementation =
+ {
+ gl_array_nx_create_empty,
+ gl_array_nx_create,
+ gl_array_size,
+ gl_array_node_value,
+ gl_array_node_nx_set_value,
+ gl_array_next_node,
+ gl_array_previous_node,
+ gl_array_first_node,
+ gl_array_last_node,
+ gl_array_get_at,
+ gl_array_nx_set_at,
+ gl_array_search_from_to,
+ gl_array_indexof_from_to,
+ gl_array_nx_add_first,
+ gl_array_nx_add_last,
+ gl_array_nx_add_before,
+ gl_array_nx_add_after,
+ gl_array_nx_add_at,
+ gl_array_remove_node,
+ gl_array_remove_at,
+ gl_array_remove,
+ gl_array_list_free,
+ gl_array_iterator,
+ gl_array_iterator_from_to,
+ gl_array_iterator_next,
+ gl_array_iterator_free,
+ gl_array_sortedlist_search,
+ gl_array_sortedlist_search_from_to,
+ gl_array_sortedlist_indexof,
+ gl_array_sortedlist_indexof_from_to,
+ gl_array_sortedlist_nx_add,
+ gl_array_sortedlist_remove
+ };
diff --git a/gl/lib/gl_array_list.h b/gl/lib/gl_array_list.h
new file mode 100644
index 0000000..3d5b9f9
--- /dev/null
+++ b/gl/lib/gl_array_list.h
@@ -0,0 +1,34 @@
+/* Sequential list data type implemented by an array.
+ Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+ 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 2.1 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/>. */
+
+#ifndef _GL_ARRAY_LIST_H
+#define _GL_ARRAY_LIST_H
+
+#include "gl_list.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern const struct gl_list_implementation gl_array_list_implementation;
+#define GL_ARRAY_LIST &gl_array_list_implementation
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GL_ARRAY_LIST_H */
diff --git a/gl/lib/gl_hash_map.c b/gl/lib/gl_hash_map.c
new file mode 100644
index 0000000..6042b60
--- /dev/null
+++ b/gl/lib/gl_hash_map.c
@@ -0,0 +1,333 @@
+/* Map data type implemented by a hash table.
+ Copyright (C) 2006, 2008-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2018.
+
+ 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>
+
+/* Specification. */
+#include "gl_hash_map.h"
+
+#include <stdint.h> /* for uintptr_t, SIZE_MAX */
+#include <stdlib.h>
+
+#include "xsize.h"
+
+/* --------------------------- gl_map_t Data Type --------------------------- */
+
+#include "gl_anyhash1.h"
+
+/* Concrete list node implementation, valid for this file only. */
+struct gl_list_node_impl
+{
+ struct gl_hash_entry h; /* hash table entry fields; must be first */
+ const void *key;
+ const void *value;
+};
+typedef struct gl_list_node_impl * gl_list_node_t;
+
+/* Concrete gl_map_impl type, valid for this file only. */
+struct gl_map_impl
+{
+ struct gl_map_impl_base base;
+ gl_mapkey_hashcode_fn hashcode_fn;
+ /* A hash table: managed as an array of collision lists. */
+ struct gl_hash_entry **table;
+ size_t table_size;
+ /* Number of hash table entries. */
+ size_t count;
+};
+
+#define CONTAINER_T gl_map_t
+#define CONTAINER_COUNT(map) (map)->count
+#include "gl_anyhash2.h"
+
+/* --------------------------- gl_map_t Data Type --------------------------- */
+
+static gl_map_t
+gl_hash_nx_create_empty (gl_map_implementation_t implementation,
+ gl_mapkey_equals_fn equals_fn,
+ gl_mapkey_hashcode_fn hashcode_fn,
+ gl_mapkey_dispose_fn kdispose_fn,
+ gl_mapvalue_dispose_fn vdispose_fn)
+{
+ struct gl_map_impl *map =
+ (struct gl_map_impl *) malloc (sizeof (struct gl_map_impl));
+
+ if (map == NULL)
+ return NULL;
+
+ map->base.vtable = implementation;
+ map->base.equals_fn = equals_fn;
+ map->base.kdispose_fn = kdispose_fn;
+ map->base.vdispose_fn = vdispose_fn;
+ map->hashcode_fn = hashcode_fn;
+ map->table_size = 11;
+ map->table =
+ (gl_hash_entry_t *) calloc (map->table_size, sizeof (gl_hash_entry_t));
+ if (map->table == NULL)
+ goto fail;
+ map->count = 0;
+
+ return map;
+
+ fail:
+ free (map);
+ return NULL;
+}
+
+static size_t _GL_ATTRIBUTE_PURE
+gl_hash_size (gl_map_t map)
+{
+ return map->count;
+}
+
+static bool _GL_ATTRIBUTE_PURE
+gl_hash_search (gl_map_t map, const void *key, const void **valuep)
+{
+ size_t hashcode =
+ (map->hashcode_fn != NULL
+ ? map->hashcode_fn (key)
+ : (size_t)(uintptr_t) key);
+ size_t bucket = hashcode % map->table_size;
+ gl_mapkey_equals_fn equals = map->base.equals_fn;
+
+ /* Look for a match in the hash bucket. */
+ gl_list_node_t node;
+
+ for (node = (gl_list_node_t) map->table[bucket];
+ node != NULL;
+ node = (gl_list_node_t) node->h.hash_next)
+ if (node->h.hashcode == hashcode
+ && (equals != NULL
+ ? equals (key, node->key)
+ : key == node->key))
+ {
+ *valuep = node->value;
+ return true;
+ }
+ return false;
+}
+
+static int
+gl_hash_nx_getput (gl_map_t map, const void *key, const void *value,
+ const void **oldvaluep)
+{
+ size_t hashcode =
+ (map->hashcode_fn != NULL
+ ? map->hashcode_fn (key)
+ : (size_t)(uintptr_t) key);
+ size_t bucket = hashcode % map->table_size;
+ gl_mapkey_equals_fn equals = map->base.equals_fn;
+
+ /* Look for a match in the hash bucket. */
+ {
+ gl_list_node_t node;
+
+ for (node = (gl_list_node_t) map->table[bucket];
+ node != NULL;
+ node = (gl_list_node_t) node->h.hash_next)
+ if (node->h.hashcode == hashcode
+ && (equals != NULL
+ ? equals (key, node->key)
+ : key == node->key))
+ {
+ *oldvaluep = node->value;
+ node->value = value;
+ return 0;
+ }
+ }
+
+ /* Allocate a new node. */
+ gl_list_node_t node =
+ (struct gl_list_node_impl *) malloc (sizeof (struct gl_list_node_impl));
+
+ if (node == NULL)
+ return -1;
+
+ node->key = key;
+ node->value = value;
+ node->h.hashcode = hashcode;
+
+ /* Add node to the hash table. */
+ node->h.hash_next = map->table[bucket];
+ map->table[bucket] = &node->h;
+
+ /* Add node to the map. */
+ map->count++;
+
+ hash_resize_after_add (map);
+
+ return 1;
+}
+
+static bool
+gl_hash_getremove (gl_map_t map, const void *key, const void **oldvaluep)
+{
+ size_t hashcode =
+ (map->hashcode_fn != NULL
+ ? map->hashcode_fn (key)
+ : (size_t)(uintptr_t) key);
+ size_t bucket = hashcode % map->table_size;
+ gl_mapkey_equals_fn equals = map->base.equals_fn;
+
+ /* Look for the first match in the hash bucket. */
+ gl_list_node_t *nodep;
+
+ for (nodep = (gl_list_node_t *) &map->table[bucket];
+ *nodep != NULL;
+ nodep = (gl_list_node_t *) &(*nodep)->h.hash_next)
+ {
+ gl_list_node_t node = *nodep;
+ if (node->h.hashcode == hashcode
+ && (equals != NULL
+ ? equals (key, node->key)
+ : key == node->key))
+ {
+ *oldvaluep = node->value;
+
+ /* Remove node from the hash table. */
+ *nodep = (gl_list_node_t) node->h.hash_next;
+
+ /* Remove node from the map. */
+ map->count--;
+
+ if (map->base.kdispose_fn != NULL)
+ map->base.kdispose_fn (node->key);
+ free (node);
+ return true;
+ }
+ }
+
+ return false;
+}
+
+static void
+gl_hash_free (gl_map_t map)
+{
+ if (map->count > 0)
+ {
+ gl_mapkey_dispose_fn kdispose = map->base.kdispose_fn;
+ gl_mapvalue_dispose_fn vdispose = map->base.vdispose_fn;
+ struct gl_hash_entry **table = map->table;
+ size_t i;
+
+ for (i = map->table_size; i > 0; )
+ {
+ gl_hash_entry_t node = table[--i];
+
+ while (node != NULL)
+ {
+ gl_hash_entry_t next = node->hash_next;
+
+ /* Free the entry. */
+ if (vdispose != NULL)
+ vdispose (((gl_list_node_t) node)->value);
+ if (kdispose != NULL)
+ kdispose (((gl_list_node_t) node)->key);
+ free (node);
+
+ node = next;
+ }
+ }
+ }
+
+ free (map->table);
+ free (map);
+}
+
+/* ---------------------- gl_map_iterator_t Data Type ---------------------- */
+
+/* Here we iterate through the hash buckets. Therefore the order in which the
+ pairs are returned is unpredictable. */
+
+static gl_map_iterator_t
+gl_hash_iterator (gl_map_t map)
+{
+ gl_map_iterator_t result;
+
+ result.vtable = map->base.vtable;
+ result.map = map;
+ result.p = NULL; /* runs through the nodes of a bucket */
+ result.i = 0; /* index of the bucket that p points into + 1 */
+ result.j = map->table_size;
+#if defined GCC_LINT || defined lint
+ result.q = NULL;
+ result.count = 0;
+#endif
+
+ return result;
+}
+
+static bool
+gl_hash_iterator_next (gl_map_iterator_t *iterator,
+ const void **keyp, const void **valuep)
+{
+ if (iterator->p != NULL)
+ {
+ /* We're traversing a bucket. */
+ gl_list_node_t node = (gl_list_node_t) iterator->p;
+ *keyp = node->key;
+ *valuep = node->value;
+ iterator->p = (gl_list_node_t) node->h.hash_next;
+ return true;
+ }
+ else
+ {
+ /* Find the next bucket that is not empty. */
+ size_t j = iterator->j;
+ size_t i = iterator->i;
+
+ if (i < j)
+ {
+ gl_hash_entry_t *table = iterator->map->table;
+ do
+ {
+ gl_list_node_t node = (gl_list_node_t) table[i++];
+ if (node != NULL)
+ {
+ *keyp = node->key;
+ *valuep = node->value;
+ iterator->p = (gl_list_node_t) node->h.hash_next;
+ iterator->i = i;
+ return true;
+ }
+ }
+ while (i < j);
+ }
+ /* Here iterator->p is still NULL, and i == j. */
+ iterator->i = j;
+ return false;
+ }
+}
+
+static void
+gl_hash_iterator_free (gl_map_iterator_t *iterator)
+{
+}
+
+
+const struct gl_map_implementation gl_hash_map_implementation =
+ {
+ gl_hash_nx_create_empty,
+ gl_hash_size,
+ gl_hash_search,
+ gl_hash_nx_getput,
+ gl_hash_getremove,
+ gl_hash_free,
+ gl_hash_iterator,
+ gl_hash_iterator_next,
+ gl_hash_iterator_free
+ };
diff --git a/gl/lib/gl_hash_map.h b/gl/lib/gl_hash_map.h
new file mode 100644
index 0000000..6692776
--- /dev/null
+++ b/gl/lib/gl_hash_map.h
@@ -0,0 +1,34 @@
+/* Map data type implemented by a hash table.
+ Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2018.
+
+ 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 _GL_HASH_MAP_H
+#define _GL_HASH_MAP_H
+
+#include "gl_map.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern const struct gl_map_implementation gl_hash_map_implementation;
+#define GL_HASH_MAP &gl_hash_map_implementation
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GL_HASH_MAP_H */
diff --git a/gl/lib/gl_hash_set.c b/gl/lib/gl_hash_set.c
new file mode 100644
index 0000000..75b2e99
--- /dev/null
+++ b/gl/lib/gl_hash_set.c
@@ -0,0 +1,313 @@
+/* Set data type implemented by a hash table.
+ Copyright (C) 2006, 2008-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2018.
+
+ 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>
+
+/* Specification. */
+#include "gl_hash_set.h"
+
+#include <stdint.h> /* for uintptr_t, SIZE_MAX */
+#include <stdlib.h>
+
+#include "xsize.h"
+
+/* --------------------------- gl_set_t Data Type --------------------------- */
+
+#include "gl_anyhash1.h"
+
+/* Concrete list node implementation, valid for this file only. */
+struct gl_list_node_impl
+{
+ struct gl_hash_entry h; /* hash table entry fields; must be first */
+ const void *value;
+};
+typedef struct gl_list_node_impl * gl_list_node_t;
+
+/* Concrete gl_set_impl type, valid for this file only. */
+struct gl_set_impl
+{
+ struct gl_set_impl_base base;
+ gl_setelement_hashcode_fn hashcode_fn;
+ /* A hash table: managed as an array of collision lists. */
+ struct gl_hash_entry **table;
+ size_t table_size;
+ /* Number of hash table entries. */
+ size_t count;
+};
+
+#define CONTAINER_T gl_set_t
+#define CONTAINER_COUNT(set) (set)->count
+#include "gl_anyhash2.h"
+
+/* --------------------------- gl_set_t Data Type --------------------------- */
+
+static gl_set_t
+gl_hash_nx_create_empty (gl_set_implementation_t implementation,
+ gl_setelement_equals_fn equals_fn,
+ gl_setelement_hashcode_fn hashcode_fn,
+ gl_setelement_dispose_fn dispose_fn)
+{
+ struct gl_set_impl *set =
+ (struct gl_set_impl *) malloc (sizeof (struct gl_set_impl));
+
+ if (set == NULL)
+ return NULL;
+
+ set->base.vtable = implementation;
+ set->base.equals_fn = equals_fn;
+ set->base.dispose_fn = dispose_fn;
+ set->hashcode_fn = hashcode_fn;
+ set->table_size = 11;
+ set->table =
+ (gl_hash_entry_t *) calloc (set->table_size, sizeof (gl_hash_entry_t));
+ if (set->table == NULL)
+ goto fail;
+ set->count = 0;
+
+ return set;
+
+ fail:
+ free (set);
+ return NULL;
+}
+
+static size_t _GL_ATTRIBUTE_PURE
+gl_hash_size (gl_set_t set)
+{
+ return set->count;
+}
+
+static bool _GL_ATTRIBUTE_PURE
+gl_hash_search (gl_set_t set, const void *elt)
+{
+ size_t hashcode =
+ (set->hashcode_fn != NULL
+ ? set->hashcode_fn (elt)
+ : (size_t)(uintptr_t) elt);
+ size_t bucket = hashcode % set->table_size;
+ gl_setelement_equals_fn equals = set->base.equals_fn;
+
+ /* Look for a match in the hash bucket. */
+ gl_list_node_t node;
+
+ for (node = (gl_list_node_t) set->table[bucket];
+ node != NULL;
+ node = (gl_list_node_t) node->h.hash_next)
+ if (node->h.hashcode == hashcode
+ && (equals != NULL
+ ? equals (elt, node->value)
+ : elt == node->value))
+ return true;
+ return false;
+}
+
+static int
+gl_hash_nx_add (gl_set_t set, const void *elt)
+{
+ size_t hashcode =
+ (set->hashcode_fn != NULL
+ ? set->hashcode_fn (elt)
+ : (size_t)(uintptr_t) elt);
+ size_t bucket = hashcode % set->table_size;
+ gl_setelement_equals_fn equals = set->base.equals_fn;
+
+ /* Look for a match in the hash bucket. */
+ {
+ gl_list_node_t node;
+
+ for (node = (gl_list_node_t) set->table[bucket];
+ node != NULL;
+ node = (gl_list_node_t) node->h.hash_next)
+ if (node->h.hashcode == hashcode
+ && (equals != NULL
+ ? equals (elt, node->value)
+ : elt == node->value))
+ return 0;
+ }
+
+ /* Allocate a new node. */
+ gl_list_node_t node =
+ (struct gl_list_node_impl *) malloc (sizeof (struct gl_list_node_impl));
+
+ if (node == NULL)
+ return -1;
+
+ node->value = elt;
+ node->h.hashcode = hashcode;
+
+ /* Add node to the hash table. */
+ node->h.hash_next = set->table[bucket];
+ set->table[bucket] = &node->h;
+
+ /* Add node to the set. */
+ set->count++;
+
+ hash_resize_after_add (set);
+
+ return 1;
+}
+
+static bool
+gl_hash_remove (gl_set_t set, const void *elt)
+{
+ size_t hashcode =
+ (set->hashcode_fn != NULL
+ ? set->hashcode_fn (elt)
+ : (size_t)(uintptr_t) elt);
+ size_t bucket = hashcode % set->table_size;
+ gl_setelement_equals_fn equals = set->base.equals_fn;
+
+ /* Look for the first match in the hash bucket. */
+ gl_list_node_t *nodep;
+
+ for (nodep = (gl_list_node_t *) &set->table[bucket];
+ *nodep != NULL;
+ nodep = (gl_list_node_t *) &(*nodep)->h.hash_next)
+ {
+ gl_list_node_t node = *nodep;
+ if (node->h.hashcode == hashcode
+ && (equals != NULL
+ ? equals (elt, node->value)
+ : elt == node->value))
+ {
+ /* Remove node from the hash table. */
+ *nodep = (gl_list_node_t) node->h.hash_next;
+
+ /* Remove node from the set. */
+ set->count--;
+
+ if (set->base.dispose_fn != NULL)
+ set->base.dispose_fn (node->value);
+ free (node);
+ return true;
+ }
+ }
+
+ return false;
+}
+
+static void
+gl_hash_free (gl_set_t set)
+{
+ if (set->count > 0)
+ {
+ gl_setelement_dispose_fn dispose = set->base.dispose_fn;
+ struct gl_hash_entry **table = set->table;
+ size_t i;
+
+ for (i = set->table_size; i > 0; )
+ {
+ gl_hash_entry_t node = table[--i];
+
+ while (node != NULL)
+ {
+ gl_hash_entry_t next = node->hash_next;
+
+ /* Free the entry. */
+ if (dispose != NULL)
+ dispose (((gl_list_node_t) node)->value);
+ free (node);
+
+ node = next;
+ }
+ }
+ }
+
+ free (set->table);
+ free (set);
+}
+
+/* ---------------------- gl_set_iterator_t Data Type ---------------------- */
+
+/* Here we iterate through the hash buckets. Therefore the order in which the
+ elements are returned is unpredictable. */
+
+static gl_set_iterator_t
+gl_hash_iterator (gl_set_t set)
+{
+ gl_set_iterator_t result;
+
+ result.vtable = set->base.vtable;
+ result.set = set;
+ result.p = NULL; /* runs through the nodes of a bucket */
+ result.i = 0; /* index of the bucket that p points into + 1 */
+ result.j = set->table_size;
+#if defined GCC_LINT || defined lint
+ result.q = NULL;
+ result.count = 0;
+#endif
+
+ return result;
+}
+
+static bool
+gl_hash_iterator_next (gl_set_iterator_t *iterator, const void **eltp)
+{
+ if (iterator->p != NULL)
+ {
+ /* We're traversing a bucket. */
+ gl_list_node_t node = (gl_list_node_t) iterator->p;
+ *eltp = node->value;
+ iterator->p = (gl_list_node_t) node->h.hash_next;
+ return true;
+ }
+ else
+ {
+ /* Find the next bucket that is not empty. */
+ size_t j = iterator->j;
+ size_t i = iterator->i;
+
+ if (i < j)
+ {
+ gl_hash_entry_t *table = iterator->set->table;
+ do
+ {
+ gl_list_node_t node = (gl_list_node_t) table[i++];
+ if (node != NULL)
+ {
+ *eltp = node->value;
+ iterator->p = (gl_list_node_t) node->h.hash_next;
+ iterator->i = i;
+ return true;
+ }
+ }
+ while (i < j);
+ }
+ /* Here iterator->p is still NULL, and i == j. */
+ iterator->i = j;
+ return false;
+ }
+}
+
+static void
+gl_hash_iterator_free (gl_set_iterator_t *iterator)
+{
+}
+
+
+const struct gl_set_implementation gl_hash_set_implementation =
+ {
+ gl_hash_nx_create_empty,
+ gl_hash_size,
+ gl_hash_search,
+ gl_hash_nx_add,
+ gl_hash_remove,
+ gl_hash_free,
+ gl_hash_iterator,
+ gl_hash_iterator_next,
+ gl_hash_iterator_free
+ };
diff --git a/gl/lib/gl_hash_set.h b/gl/lib/gl_hash_set.h
new file mode 100644
index 0000000..ea61eb4
--- /dev/null
+++ b/gl/lib/gl_hash_set.h
@@ -0,0 +1,34 @@
+/* Set data type implemented by a hash table.
+ Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2018.
+
+ 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 _GL_HASH_SET_H
+#define _GL_HASH_SET_H
+
+#include "gl_set.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern const struct gl_set_implementation gl_hash_set_implementation;
+#define GL_HASH_SET &gl_hash_set_implementation
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GL_HASH_SET_H */
diff --git a/gl/lib/gl_linkedhash_list.c b/gl/lib/gl_linkedhash_list.c
new file mode 100644
index 0000000..dbf43de
--- /dev/null
+++ b/gl/lib/gl_linkedhash_list.c
@@ -0,0 +1,114 @@
+/* Sequential list data type implemented by a hash table with a linked list.
+ Copyright (C) 2006, 2008-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "gl_linkedhash_list.h"
+
+#include <stdint.h> /* for uintptr_t, SIZE_MAX */
+#include <stdlib.h>
+
+#include "xsize.h"
+
+#define WITH_HASHTABLE 1
+
+/* -------------------------- gl_list_t Data Type -------------------------- */
+
+/* Generic hash-table code. */
+#include "gl_anyhash1.h"
+
+/* Generic linked list code. */
+#include "gl_anylinked_list1.h"
+
+/* Generic hash-table code. */
+#define CONTAINER_T gl_list_t
+#define CONTAINER_COUNT(list) (list)->count
+#include "gl_anyhash2.h"
+
+/* Add a node to the hash table structure. */
+static void
+add_to_bucket (gl_list_t list, gl_list_node_t node)
+{
+ size_t bucket = node->h.hashcode % list->table_size;
+
+ node->h.hash_next = list->table[bucket];
+ list->table[bucket] = &node->h;
+}
+/* Tell all compilers that the return value is 0. */
+#define add_to_bucket(list,node) ((add_to_bucket) (list, node), 0)
+
+/* Remove a node from the hash table structure. */
+static void
+remove_from_bucket (gl_list_t list, gl_list_node_t node)
+{
+ size_t bucket = node->h.hashcode % list->table_size;
+ gl_hash_entry_t *p;
+
+ for (p = &list->table[bucket]; ; p = &(*p)->hash_next)
+ {
+ if (*p == &node->h)
+ {
+ *p = node->h.hash_next;
+ break;
+ }
+ if (*p == NULL)
+ /* node is not in the right bucket. Did the hash codes
+ change inadvertently? */
+ abort ();
+ }
+}
+
+/* Generic linked list code. */
+#include "gl_anylinked_list2.h"
+
+
+const struct gl_list_implementation gl_linkedhash_list_implementation =
+ {
+ gl_linked_nx_create_empty,
+ gl_linked_nx_create,
+ gl_linked_size,
+ gl_linked_node_value,
+ gl_linked_node_nx_set_value,
+ gl_linked_next_node,
+ gl_linked_previous_node,
+ gl_linked_first_node,
+ gl_linked_last_node,
+ gl_linked_get_at,
+ gl_linked_nx_set_at,
+ gl_linked_search_from_to,
+ gl_linked_indexof_from_to,
+ gl_linked_nx_add_first,
+ gl_linked_nx_add_last,
+ gl_linked_nx_add_before,
+ gl_linked_nx_add_after,
+ gl_linked_nx_add_at,
+ gl_linked_remove_node,
+ gl_linked_remove_at,
+ gl_linked_remove,
+ gl_linked_list_free,
+ gl_linked_iterator,
+ gl_linked_iterator_from_to,
+ gl_linked_iterator_next,
+ gl_linked_iterator_free,
+ gl_linked_sortedlist_search,
+ gl_linked_sortedlist_search_from_to,
+ gl_linked_sortedlist_indexof,
+ gl_linked_sortedlist_indexof_from_to,
+ gl_linked_sortedlist_nx_add,
+ gl_linked_sortedlist_remove
+ };
diff --git a/gl/lib/gl_linkedhash_list.h b/gl/lib/gl_linkedhash_list.h
new file mode 100644
index 0000000..77ef8f4
--- /dev/null
+++ b/gl/lib/gl_linkedhash_list.h
@@ -0,0 +1,34 @@
+/* Sequential list data type implemented by a hash table with a linked list.
+ Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+ 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 2.1 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/>. */
+
+#ifndef _GL_LINKEDHASH_LIST_H
+#define _GL_LINKEDHASH_LIST_H
+
+#include "gl_list.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern const struct gl_list_implementation gl_linkedhash_list_implementation;
+#define GL_LINKEDHASH_LIST &gl_linkedhash_list_implementation
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GL_LINKEDHASH_LIST_H */
diff --git a/gl/lib/gl_list.c b/gl/lib/gl_list.c
new file mode 100644
index 0000000..cccb39c
--- /dev/null
+++ b/gl/lib/gl_list.c
@@ -0,0 +1,21 @@
+/* Abstract sequential list data type.
+
+ Copyright (C) 2006-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+#define GL_LIST_INLINE _GL_EXTERN_INLINE
+#include "gl_list.h"
diff --git a/gl/lib/gl_list.h b/gl/lib/gl_list.h
new file mode 100644
index 0000000..bf6a2ba
--- /dev/null
+++ b/gl/lib/gl_list.h
@@ -0,0 +1,924 @@
+/* Abstract sequential list data type. -*- coding: utf-8 -*-
+ Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+ 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 2.1 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/>. */
+
+#ifndef _GL_LIST_H
+#define _GL_LIST_H
+
+#include <stdbool.h>
+#include <stddef.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef GL_LIST_INLINE
+# define GL_LIST_INLINE _GL_INLINE
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* gl_list is an abstract list data type. It can contain any number of
+ objects ('void *' or 'const void *' pointers) in any given order.
+ Duplicates are allowed, but can optionally be forbidden.
+
+ There are several implementations of this list datatype, optimized for
+ different operations or for memory. You can start using the simplest list
+ implementation, GL_ARRAY_LIST, and switch to a different implementation
+ later, when you realize which operations are performed the most frequently.
+ The API of the different implementations is exactly the same; when
+ switching to a different implementation, you only have to change the
+ gl_list_create call.
+
+ The implementations are:
+ GL_ARRAY_LIST a growable array
+ GL_CARRAY_LIST a growable circular array
+ GL_LINKED_LIST a linked list
+ GL_AVLTREE_LIST a binary tree (AVL tree)
+ GL_RBTREE_LIST a binary tree (red-black tree)
+ GL_LINKEDHASH_LIST a hash table with a linked list
+ GL_AVLTREEHASH_LIST a hash table with a binary tree (AVL tree)
+ GL_RBTREEHASH_LIST a hash table with a binary tree (red-black tree)
+
+ The memory consumption is asymptotically the same: O(1) for every object
+ in the list. When looking more closely at the average memory consumed
+ for an object, GL_ARRAY_LIST is the most compact representation, and
+ GL_LINKEDHASH_LIST and GL_TREEHASH_LIST need more memory.
+
+ The guaranteed average performance of the operations is, for a list of
+ n elements:
+
+ Operation ARRAY LINKED TREE LINKEDHASH TREEHASH
+ CARRAY with|without with|without
+ duplicates duplicates
+
+ gl_list_size O(1) O(1) O(1) O(1) O(1)
+ gl_list_node_value O(1) O(1) O(1) O(1) O(1)
+ gl_list_node_set_value O(1) O(1) O(1) O(1) O((log n)²)/O(1)
+ gl_list_next_node O(1) O(1) O(log n) O(1) O(log n)
+ gl_list_previous_node O(1) O(1) O(log n) O(1) O(log n)
+ gl_list_first_node O(1) O(1) O(log n) O(1) O(log n)
+ gl_list_last_node O(1) O(1) O(log n) O(1) O(log n)
+ gl_list_get_at O(1) O(n) O(log n) O(n) O(log n)
+ gl_list_get_first O(1) O(1) O(log n) O(1) O(log n)
+ gl_list_get_last O(1) O(1) O(log n) O(1) O(log n)
+ gl_list_set_at O(1) O(n) O(log n) O(n) O((log n)²)/O(log n)
+ gl_list_set_first O(1) O(1) O(log n) O(n)/O(1) O((log n)²)/O(log n)
+ gl_list_set_last O(1) O(1) O(log n) O(n)/O(1) O((log n)²)/O(log n)
+ gl_list_search O(n) O(n) O(n) O(n)/O(1) O(log n)/O(1)
+ gl_list_search_from O(n) O(n) O(n) O(n)/O(1) O((log n)²)/O(log n)
+ gl_list_search_from_to O(n) O(n) O(n) O(n)/O(1) O((log n)²)/O(log n)
+ gl_list_indexof O(n) O(n) O(n) O(n) O(log n)
+ gl_list_indexof_from O(n) O(n) O(n) O(n) O((log n)²)/O(log n)
+ gl_list_indexof_from_to O(n) O(n) O(n) O(n) O((log n)²)/O(log n)
+ gl_list_add_first O(n)/O(1) O(1) O(log n) O(1) O((log n)²)/O(log n)
+ gl_list_add_last O(1) O(1) O(log n) O(1) O((log n)²)/O(log n)
+ gl_list_add_before O(n) O(1) O(log n) O(1) O((log n)²)/O(log n)
+ gl_list_add_after O(n) O(1) O(log n) O(1) O((log n)²)/O(log n)
+ gl_list_add_at O(n) O(n) O(log n) O(n) O((log n)²)/O(log n)
+ gl_list_remove_node O(n) O(1) O(log n) O(n)/O(1) O((log n)²)/O(log n)
+ gl_list_remove_at O(n) O(n) O(log n) O(n) O((log n)²)/O(log n)
+ gl_list_remove_first O(n)/O(1) O(1) O(log n) O(n)/O(1) O((log n)²)/O(log n)
+ gl_list_remove_last O(1) O(1) O(log n) O(n)/O(1) O((log n)²)/O(log n)
+ gl_list_remove O(n) O(n) O(n) O(n)/O(1) O((log n)²)/O(log n)
+ gl_list_iterator O(1) O(1) O(log n) O(1) O(log n)
+ gl_list_iterator_from_to O(1) O(n) O(log n) O(n) O(log n)
+ gl_list_iterator_next O(1) O(1) O(log n) O(1) O(log n)
+ gl_sortedlist_search O(log n) O(n) O(log n) O(n) O(log n)
+ gl_sortedlist_search_from O(log n) O(n) O(log n) O(n) O(log n)
+ gl_sortedlist_indexof O(log n) O(n) O(log n) O(n) O(log n)
+ gl_sortedlist_indexof_fro O(log n) O(n) O(log n) O(n) O(log n)
+ gl_sortedlist_add O(n) O(n) O(log n) O(n) O((log n)²)/O(log n)
+ gl_sortedlist_remove O(n) O(n) O(log n) O(n) O((log n)²)/O(log n)
+ */
+
+/* -------------------------- gl_list_t Data Type -------------------------- */
+
+/* Type of function used to compare two elements.
+ NULL denotes pointer comparison. */
+typedef bool (*gl_listelement_equals_fn) (const void *elt1, const void *elt2);
+
+/* Type of function used to compute a hash code.
+ NULL denotes a function that depends only on the pointer itself. */
+typedef size_t (*gl_listelement_hashcode_fn) (const void *elt);
+
+/* Type of function used to dispose an element once it's removed from a list.
+ NULL denotes a no-op. */
+typedef void (*gl_listelement_dispose_fn) (const void *elt);
+
+struct gl_list_impl;
+/* Type representing an entire list. */
+typedef struct gl_list_impl * gl_list_t;
+
+struct gl_list_node_impl;
+/* Type representing the position of an element in the list, in a way that
+ is more adapted to the list implementation than a plain index.
+ Note: It is invalidated by insertions and removals! */
+typedef struct gl_list_node_impl * gl_list_node_t;
+
+struct gl_list_implementation;
+/* Type representing a list datatype implementation. */
+typedef const struct gl_list_implementation * gl_list_implementation_t;
+
+#if 0 /* Unless otherwise specified, these are defined inline below. */
+
+/* Creates an empty list.
+ IMPLEMENTATION is one of GL_ARRAY_LIST, GL_CARRAY_LIST, GL_LINKED_LIST,
+ GL_AVLTREE_LIST, GL_RBTREE_LIST, GL_LINKEDHASH_LIST, GL_AVLTREEHASH_LIST,
+ GL_RBTREEHASH_LIST.
+ EQUALS_FN is an element comparison function or NULL.
+ HASHCODE_FN is an element hash code function or NULL.
+ DISPOSE_FN is an element disposal function or NULL.
+ ALLOW_DUPLICATES is false if duplicate elements shall not be allowed in
+ the list. The implementation may verify this at runtime. */
+/* declared in gl_xlist.h */
+extern gl_list_t gl_list_create_empty (gl_list_implementation_t implementation,
+ gl_listelement_equals_fn equals_fn,
+ gl_listelement_hashcode_fn hashcode_fn,
+ gl_listelement_dispose_fn dispose_fn,
+ bool allow_duplicates)
+ /*_GL_ATTRIBUTE_DEALLOC (gl_list_free, 1)*/
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+/* Likewise. Returns NULL upon out-of-memory. */
+extern gl_list_t gl_list_nx_create_empty (gl_list_implementation_t implementation,
+ gl_listelement_equals_fn equals_fn,
+ gl_listelement_hashcode_fn hashcode_fn,
+ gl_listelement_dispose_fn dispose_fn,
+ bool allow_duplicates)
+ /*_GL_ATTRIBUTE_DEALLOC (gl_list_free, 1)*/;
+
+/* Creates a list with given contents.
+ IMPLEMENTATION is one of GL_ARRAY_LIST, GL_CARRAY_LIST, GL_LINKED_LIST,
+ GL_AVLTREE_LIST, GL_RBTREE_LIST, GL_LINKEDHASH_LIST, GL_AVLTREEHASH_LIST,
+ GL_RBTREEHASH_LIST.
+ EQUALS_FN is an element comparison function or NULL.
+ HASHCODE_FN is an element hash code function or NULL.
+ DISPOSE_FN is an element disposal function or NULL.
+ ALLOW_DUPLICATES is false if duplicate elements shall not be allowed in
+ the list. The implementation may verify this at runtime.
+ COUNT is the number of initial elements.
+ CONTENTS[0..COUNT-1] is the initial contents. */
+/* declared in gl_xlist.h */
+extern gl_list_t gl_list_create (gl_list_implementation_t implementation,
+ gl_listelement_equals_fn equals_fn,
+ gl_listelement_hashcode_fn hashcode_fn,
+ gl_listelement_dispose_fn dispose_fn,
+ bool allow_duplicates,
+ size_t count, const void **contents)
+ /*_GL_ATTRIBUTE_DEALLOC (gl_list_free, 1)*/
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+/* Likewise. Returns NULL upon out-of-memory. */
+extern gl_list_t gl_list_nx_create (gl_list_implementation_t implementation,
+ gl_listelement_equals_fn equals_fn,
+ gl_listelement_hashcode_fn hashcode_fn,
+ gl_listelement_dispose_fn dispose_fn,
+ bool allow_duplicates,
+ size_t count, const void **contents)
+ /*_GL_ATTRIBUTE_DEALLOC (gl_list_free, 1)*/;
+
+/* Returns the current number of elements in a list. */
+extern size_t gl_list_size (gl_list_t list);
+
+/* Returns the element value represented by a list node. */
+extern const void * gl_list_node_value (gl_list_t list, gl_list_node_t node);
+
+/* Replaces the element value represented by a list node. */
+/* declared in gl_xlist.h */
+extern void gl_list_node_set_value (gl_list_t list, gl_list_node_t node,
+ const void *elt);
+/* Likewise. Returns 0 upon success, -1 upon out-of-memory. */
+_GL_ATTRIBUTE_NODISCARD
+extern int gl_list_node_nx_set_value (gl_list_t list, gl_list_node_t node,
+ const void *elt);
+
+/* Returns the node immediately after the given node in the list, or NULL
+ if the given node is the last (rightmost) one in the list. */
+extern gl_list_node_t gl_list_next_node (gl_list_t list, gl_list_node_t node);
+
+/* Returns the node immediately before the given node in the list, or NULL
+ if the given node is the first (leftmost) one in the list. */
+extern gl_list_node_t gl_list_previous_node (gl_list_t list, gl_list_node_t node);
+
+/* Returns the first node in the list, or NULL if the list is empty.
+ This function is useful for iterating through the list like this:
+ gl_list_node_t node;
+ for (node = gl_list_first_node (list); node != NULL; node = gl_list_next_node (node))
+ ...
+ */
+extern gl_list_node_t gl_list_first_node (gl_list_t list);
+
+/* Returns the last node in the list, or NULL if the list is empty.
+ This function is useful for iterating through the list in backward order,
+ like this:
+ gl_list_node_t node;
+ for (node = gl_list_last_node (list); node != NULL; node = gl_list_previous_node (node))
+ ...
+ */
+extern gl_list_node_t gl_list_last_node (gl_list_t list);
+
+/* Returns the element at a given position in the list.
+ POSITION must be >= 0 and < gl_list_size (list). */
+extern const void * gl_list_get_at (gl_list_t list, size_t position);
+
+/* Returns the element at the first position in the list.
+ The list must be non-empty. */
+extern const void * gl_list_get_first (gl_list_t list);
+
+/* Returns the element at the last position in the list.
+ The list must be non-empty. */
+extern const void * gl_list_get_last (gl_list_t list);
+
+/* Replaces the element at a given position in the list.
+ POSITION must be >= 0 and < gl_list_size (list).
+ Returns its node. */
+/* declared in gl_xlist.h */
+extern gl_list_node_t gl_list_set_at (gl_list_t list, size_t position,
+ const void *elt);
+/* Likewise. Returns NULL upon out-of-memory. */
+_GL_ATTRIBUTE_NODISCARD
+extern gl_list_node_t gl_list_nx_set_at (gl_list_t list, size_t position,
+ const void *elt);
+
+/* Replaces the element at the first position in the list.
+ Returns its node.
+ The list must be non-empty. */
+/* declared in gl_xlist.h */
+extern gl_list_node_t gl_list_set_first (gl_list_t list, const void *elt);
+/* Likewise. Returns NULL upon out-of-memory. */
+_GL_ATTRIBUTE_NODISCARD
+extern gl_list_node_t gl_list_nx_set_first (gl_list_t list, const void *elt);
+
+/* Replaces the element at the last position in the list.
+ Returns its node.
+ The list must be non-empty. */
+/* declared in gl_xlist.h */
+extern gl_list_node_t gl_list_set_last (gl_list_t list, const void *elt);
+/* Likewise. Returns NULL upon out-of-memory. */
+_GL_ATTRIBUTE_NODISCARD
+extern gl_list_node_t gl_list_nx_set_last (gl_list_t list, const void *elt);
+
+/* Searches whether an element is already in the list.
+ Returns its node if found, or NULL if not present in the list. */
+extern gl_list_node_t gl_list_search (gl_list_t list, const void *elt);
+
+/* Searches whether an element is already in the list,
+ at a position >= START_INDEX.
+ Returns its node if found, or NULL if not present in the list. */
+extern gl_list_node_t gl_list_search_from (gl_list_t list, size_t start_index,
+ const void *elt);
+
+/* Searches whether an element is already in the list,
+ at a position >= START_INDEX and < END_INDEX.
+ Returns its node if found, or NULL if not present in the list. */
+extern gl_list_node_t gl_list_search_from_to (gl_list_t list,
+ size_t start_index,
+ size_t end_index,
+ const void *elt);
+
+/* Searches whether an element is already in the list.
+ Returns its position if found, or (size_t)(-1) if not present in the list. */
+extern size_t gl_list_indexof (gl_list_t list, const void *elt);
+
+/* Searches whether an element is already in the list,
+ at a position >= START_INDEX.
+ Returns its position if found, or (size_t)(-1) if not present in the list. */
+extern size_t gl_list_indexof_from (gl_list_t list, size_t start_index,
+ const void *elt);
+
+/* Searches whether an element is already in the list,
+ at a position >= START_INDEX and < END_INDEX.
+ Returns its position if found, or (size_t)(-1) if not present in the list. */
+extern size_t gl_list_indexof_from_to (gl_list_t list,
+ size_t start_index, size_t end_index,
+ const void *elt);
+
+/* Adds an element as the first element of the list.
+ Returns its node. */
+/* declared in gl_xlist.h */
+extern gl_list_node_t gl_list_add_first (gl_list_t list, const void *elt);
+/* Likewise. Returns NULL upon out-of-memory. */
+_GL_ATTRIBUTE_NODISCARD
+extern gl_list_node_t gl_list_nx_add_first (gl_list_t list, const void *elt);
+
+/* Adds an element as the last element of the list.
+ Returns its node. */
+/* declared in gl_xlist.h */
+extern gl_list_node_t gl_list_add_last (gl_list_t list, const void *elt);
+/* Likewise. Returns NULL upon out-of-memory. */
+_GL_ATTRIBUTE_NODISCARD
+extern gl_list_node_t gl_list_nx_add_last (gl_list_t list, const void *elt);
+
+/* Adds an element before a given element node of the list.
+ Returns its node. */
+/* declared in gl_xlist.h */
+extern gl_list_node_t gl_list_add_before (gl_list_t list, gl_list_node_t node,
+ const void *elt);
+/* Likewise. Returns NULL upon out-of-memory. */
+_GL_ATTRIBUTE_NODISCARD
+extern gl_list_node_t gl_list_nx_add_before (gl_list_t list,
+ gl_list_node_t node,
+ const void *elt);
+
+/* Adds an element after a given element node of the list.
+ Returns its node. */
+/* declared in gl_xlist.h */
+extern gl_list_node_t gl_list_add_after (gl_list_t list, gl_list_node_t node,
+ const void *elt);
+/* Likewise. Returns NULL upon out-of-memory. */
+_GL_ATTRIBUTE_NODISCARD
+extern gl_list_node_t gl_list_nx_add_after (gl_list_t list, gl_list_node_t node,
+ const void *elt);
+
+/* Adds an element at a given position in the list.
+ POSITION must be >= 0 and <= gl_list_size (list). */
+/* declared in gl_xlist.h */
+extern gl_list_node_t gl_list_add_at (gl_list_t list, size_t position,
+ const void *elt);
+/* Likewise. Returns NULL upon out-of-memory. */
+_GL_ATTRIBUTE_NODISCARD
+extern gl_list_node_t gl_list_nx_add_at (gl_list_t list, size_t position,
+ const void *elt);
+
+/* Removes an element from the list.
+ Returns true. */
+extern bool gl_list_remove_node (gl_list_t list, gl_list_node_t node);
+
+/* Removes an element at a given position from the list.
+ POSITION must be >= 0 and < gl_list_size (list).
+ Returns true. */
+extern bool gl_list_remove_at (gl_list_t list, size_t position);
+
+/* Removes the element at the first position from the list.
+ Returns true if it was found and removed, or false if the list was empty. */
+extern bool gl_list_remove_first (gl_list_t list);
+
+/* Removes the element at the last position from the list.
+ Returns true if it was found and removed, or false if the list was empty. */
+extern bool gl_list_remove_last (gl_list_t list);
+
+/* Searches and removes an element from the list.
+ Returns true if it was found and removed. */
+extern bool gl_list_remove (gl_list_t list, const void *elt);
+
+/* Frees an entire list.
+ (But this call does not free the elements of the list. It only invokes
+ the DISPOSE_FN on each of the elements of the list, and only if the list
+ is not a sublist.) */
+extern void gl_list_free (gl_list_t list);
+
+#endif /* End of inline and gl_xlist.h-defined functions. */
+
+/* --------------------- gl_list_iterator_t Data Type --------------------- */
+
+/* Functions for iterating through a list. */
+
+/* Type of an iterator that traverses a list.
+ This is a fixed-size struct, so that creation of an iterator doesn't need
+ memory allocation on the heap. */
+typedef struct
+{
+ /* For fast dispatch of gl_list_iterator_next. */
+ const struct gl_list_implementation *vtable;
+ /* For detecting whether the last returned element was removed. */
+ gl_list_t list;
+ size_t count;
+ /* Other, implementation-private fields. */
+ void *p; void *q;
+ size_t i; size_t j;
+} gl_list_iterator_t;
+
+#if 0 /* These are defined inline below. */
+
+/* Creates an iterator traversing a list.
+ The list contents must not be modified while the iterator is in use,
+ except for replacing or removing the last returned element. */
+extern gl_list_iterator_t gl_list_iterator (gl_list_t list);
+
+/* Creates an iterator traversing the element with indices i,
+ start_index <= i < end_index, of a list.
+ The list contents must not be modified while the iterator is in use,
+ except for replacing or removing the last returned element. */
+extern gl_list_iterator_t gl_list_iterator_from_to (gl_list_t list,
+ size_t start_index,
+ size_t end_index);
+
+/* If there is a next element, stores the next element in *ELTP, stores its
+ node in *NODEP if NODEP is non-NULL, advances the iterator and returns true.
+ Otherwise, returns false. */
+extern bool gl_list_iterator_next (gl_list_iterator_t *iterator,
+ const void **eltp, gl_list_node_t *nodep);
+
+/* Frees an iterator. */
+extern void gl_list_iterator_free (gl_list_iterator_t *iterator);
+
+#endif /* End of inline functions. */
+
+/* ---------------------- Sorted gl_list_t Data Type ---------------------- */
+
+/* The following functions are for lists without duplicates where the
+ order is given by a sort criterion. */
+
+/* Type of function used to compare two elements. Same as for qsort().
+ NULL denotes pointer comparison. */
+typedef int (*gl_listelement_compar_fn) (const void *elt1, const void *elt2);
+
+#if 0 /* Unless otherwise specified, these are defined inline below. */
+
+/* Searches whether an element is already in the list.
+ The list is assumed to be sorted with COMPAR.
+ Returns its node if found, or NULL if not present in the list.
+ If the list contains several copies of ELT, the node of the leftmost one is
+ returned. */
+extern gl_list_node_t gl_sortedlist_search (gl_list_t list,
+ gl_listelement_compar_fn compar,
+ const void *elt);
+
+/* Searches whether an element is already in the list.
+ The list is assumed to be sorted with COMPAR.
+ Only list elements with indices >= START_INDEX and < END_INDEX are
+ considered; the implementation uses these bounds to minimize the number
+ of COMPAR invocations.
+ Returns its node if found, or NULL if not present in the list.
+ If the list contains several copies of ELT, the node of the leftmost one is
+ returned. */
+extern gl_list_node_t gl_sortedlist_search_from_to (gl_list_t list,
+ gl_listelement_compar_fn compar,
+ size_t start_index,
+ size_t end_index,
+ const void *elt);
+
+/* Searches whether an element is already in the list.
+ The list is assumed to be sorted with COMPAR.
+ Returns its position if found, or (size_t)(-1) if not present in the list.
+ If the list contains several copies of ELT, the position of the leftmost one
+ is returned. */
+extern size_t gl_sortedlist_indexof (gl_list_t list,
+ gl_listelement_compar_fn compar,
+ const void *elt);
+
+/* Searches whether an element is already in the list.
+ The list is assumed to be sorted with COMPAR.
+ Only list elements with indices >= START_INDEX and < END_INDEX are
+ considered; the implementation uses these bounds to minimize the number
+ of COMPAR invocations.
+ Returns its position if found, or (size_t)(-1) if not present in the list.
+ If the list contains several copies of ELT, the position of the leftmost one
+ is returned. */
+extern size_t gl_sortedlist_indexof_from_to (gl_list_t list,
+ gl_listelement_compar_fn compar,
+ size_t start_index,
+ size_t end_index,
+ const void *elt);
+
+/* Adds an element at the appropriate position in the list.
+ The list is assumed to be sorted with COMPAR.
+ Returns its node. */
+/* declared in gl_xlist.h */
+extern gl_list_node_t gl_sortedlist_add (gl_list_t list,
+ gl_listelement_compar_fn compar,
+ const void *elt);
+/* Likewise. Returns NULL upon out-of-memory. */
+_GL_ATTRIBUTE_NODISCARD
+extern gl_list_node_t gl_sortedlist_nx_add (gl_list_t list,
+ gl_listelement_compar_fn compar,
+ const void *elt);
+
+/* Searches and removes an element from the list.
+ The list is assumed to be sorted with COMPAR.
+ Returns true if it was found and removed.
+ If the list contains several copies of ELT, only the leftmost one is
+ removed. */
+extern bool gl_sortedlist_remove (gl_list_t list,
+ gl_listelement_compar_fn compar,
+ const void *elt);
+
+#endif /* End of inline and gl_xlist.h-defined functions. */
+
+/* ------------------------ Implementation Details ------------------------ */
+
+struct gl_list_implementation
+{
+ /* gl_list_t functions. */
+ gl_list_t (*nx_create_empty) (gl_list_implementation_t implementation,
+ gl_listelement_equals_fn equals_fn,
+ gl_listelement_hashcode_fn hashcode_fn,
+ gl_listelement_dispose_fn dispose_fn,
+ bool allow_duplicates);
+ gl_list_t (*nx_create) (gl_list_implementation_t implementation,
+ gl_listelement_equals_fn equals_fn,
+ gl_listelement_hashcode_fn hashcode_fn,
+ gl_listelement_dispose_fn dispose_fn,
+ bool allow_duplicates,
+ size_t count, const void **contents);
+ size_t (*size) (gl_list_t list);
+ const void * (*node_value) (gl_list_t list, gl_list_node_t node);
+ int (*node_nx_set_value) (gl_list_t list, gl_list_node_t node,
+ const void *elt);
+ gl_list_node_t (*next_node) (gl_list_t list, gl_list_node_t node);
+ gl_list_node_t (*previous_node) (gl_list_t list, gl_list_node_t node);
+ gl_list_node_t (*first_node) (gl_list_t list);
+ gl_list_node_t (*last_node) (gl_list_t list);
+ const void * (*get_at) (gl_list_t list, size_t position);
+ gl_list_node_t (*nx_set_at) (gl_list_t list, size_t position,
+ const void *elt);
+ gl_list_node_t (*search_from_to) (gl_list_t list, size_t start_index,
+ size_t end_index, const void *elt);
+ size_t (*indexof_from_to) (gl_list_t list, size_t start_index,
+ size_t end_index, const void *elt);
+ gl_list_node_t (*nx_add_first) (gl_list_t list, const void *elt);
+ gl_list_node_t (*nx_add_last) (gl_list_t list, const void *elt);
+ gl_list_node_t (*nx_add_before) (gl_list_t list, gl_list_node_t node,
+ const void *elt);
+ gl_list_node_t (*nx_add_after) (gl_list_t list, gl_list_node_t node,
+ const void *elt);
+ gl_list_node_t (*nx_add_at) (gl_list_t list, size_t position,
+ const void *elt);
+ bool (*remove_node) (gl_list_t list, gl_list_node_t node);
+ bool (*remove_at) (gl_list_t list, size_t position);
+ bool (*remove_elt) (gl_list_t list, const void *elt);
+ void (*list_free) (gl_list_t list);
+ /* gl_list_iterator_t functions. */
+ gl_list_iterator_t (*iterator) (gl_list_t list);
+ gl_list_iterator_t (*iterator_from_to) (gl_list_t list,
+ size_t start_index,
+ size_t end_index);
+ bool (*iterator_next) (gl_list_iterator_t *iterator,
+ const void **eltp, gl_list_node_t *nodep);
+ void (*iterator_free) (gl_list_iterator_t *iterator);
+ /* Sorted gl_list_t functions. */
+ gl_list_node_t (*sortedlist_search) (gl_list_t list,
+ gl_listelement_compar_fn compar,
+ const void *elt);
+ gl_list_node_t (*sortedlist_search_from_to) (gl_list_t list,
+ gl_listelement_compar_fn compar,
+ size_t start_index,
+ size_t end_index,
+ const void *elt);
+ size_t (*sortedlist_indexof) (gl_list_t list,
+ gl_listelement_compar_fn compar,
+ const void *elt);
+ size_t (*sortedlist_indexof_from_to) (gl_list_t list,
+ gl_listelement_compar_fn compar,
+ size_t start_index, size_t end_index,
+ const void *elt);
+ gl_list_node_t (*sortedlist_nx_add) (gl_list_t list,
+ gl_listelement_compar_fn compar,
+ const void *elt);
+ bool (*sortedlist_remove) (gl_list_t list,
+ gl_listelement_compar_fn compar,
+ const void *elt);
+};
+
+struct gl_list_impl_base
+{
+ const struct gl_list_implementation *vtable;
+ gl_listelement_equals_fn equals_fn;
+ gl_listelement_hashcode_fn hashcode_fn;
+ gl_listelement_dispose_fn dispose_fn;
+ bool allow_duplicates;
+};
+
+/* Define all functions of this file as accesses to the
+ struct gl_list_implementation. */
+
+GL_LIST_INLINE
+/*_GL_ATTRIBUTE_DEALLOC (gl_list_free, 1)*/
+gl_list_t
+gl_list_nx_create_empty (gl_list_implementation_t implementation,
+ gl_listelement_equals_fn equals_fn,
+ gl_listelement_hashcode_fn hashcode_fn,
+ gl_listelement_dispose_fn dispose_fn,
+ bool allow_duplicates)
+{
+ return implementation->nx_create_empty (implementation, equals_fn,
+ hashcode_fn, dispose_fn,
+ allow_duplicates);
+}
+
+GL_LIST_INLINE
+/*_GL_ATTRIBUTE_DEALLOC (gl_list_free, 1)*/
+gl_list_t
+gl_list_nx_create (gl_list_implementation_t implementation,
+ gl_listelement_equals_fn equals_fn,
+ gl_listelement_hashcode_fn hashcode_fn,
+ gl_listelement_dispose_fn dispose_fn,
+ bool allow_duplicates,
+ size_t count, const void **contents)
+{
+ return implementation->nx_create (implementation, equals_fn, hashcode_fn,
+ dispose_fn, allow_duplicates, count,
+ contents);
+}
+
+GL_LIST_INLINE size_t
+gl_list_size (gl_list_t list)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->size (list);
+}
+
+GL_LIST_INLINE const void *
+gl_list_node_value (gl_list_t list, gl_list_node_t node)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->node_value (list, node);
+}
+
+_GL_ATTRIBUTE_NODISCARD GL_LIST_INLINE int
+gl_list_node_nx_set_value (gl_list_t list, gl_list_node_t node,
+ const void *elt)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->node_nx_set_value (list, node, elt);
+}
+
+GL_LIST_INLINE gl_list_node_t
+gl_list_next_node (gl_list_t list, gl_list_node_t node)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->next_node (list, node);
+}
+
+GL_LIST_INLINE gl_list_node_t
+gl_list_previous_node (gl_list_t list, gl_list_node_t node)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->previous_node (list, node);
+}
+
+GL_LIST_INLINE gl_list_node_t
+gl_list_first_node (gl_list_t list)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->first_node (list);
+}
+
+GL_LIST_INLINE gl_list_node_t
+gl_list_last_node (gl_list_t list)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->last_node (list);
+}
+
+GL_LIST_INLINE const void *
+gl_list_get_at (gl_list_t list, size_t position)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->get_at (list, position);
+}
+
+GL_LIST_INLINE const void *
+gl_list_get_first (gl_list_t list)
+{
+ return gl_list_get_at (list, 0);
+}
+
+GL_LIST_INLINE const void *
+gl_list_get_last (gl_list_t list)
+{
+ return gl_list_get_at (list, gl_list_size (list) - 1);
+}
+
+_GL_ATTRIBUTE_NODISCARD GL_LIST_INLINE gl_list_node_t
+gl_list_nx_set_at (gl_list_t list, size_t position, const void *elt)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->nx_set_at (list, position, elt);
+}
+
+_GL_ATTRIBUTE_NODISCARD GL_LIST_INLINE gl_list_node_t
+gl_list_nx_set_first (gl_list_t list, const void *elt)
+{
+ return gl_list_nx_set_at (list, 0, elt);
+}
+
+_GL_ATTRIBUTE_NODISCARD GL_LIST_INLINE gl_list_node_t
+gl_list_nx_set_last (gl_list_t list, const void *elt)
+{
+ return gl_list_nx_set_at (list, gl_list_size (list) - 1, elt);
+}
+
+GL_LIST_INLINE gl_list_node_t
+gl_list_search (gl_list_t list, const void *elt)
+{
+ size_t size = ((const struct gl_list_impl_base *) list)->vtable->size (list);
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->search_from_to (list, 0, size, elt);
+}
+
+GL_LIST_INLINE gl_list_node_t
+gl_list_search_from (gl_list_t list, size_t start_index, const void *elt)
+{
+ size_t size = ((const struct gl_list_impl_base *) list)->vtable->size (list);
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->search_from_to (list, start_index, size, elt);
+}
+
+GL_LIST_INLINE gl_list_node_t
+gl_list_search_from_to (gl_list_t list, size_t start_index, size_t end_index,
+ const void *elt)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->search_from_to (list, start_index, end_index, elt);
+}
+
+GL_LIST_INLINE size_t
+gl_list_indexof (gl_list_t list, const void *elt)
+{
+ size_t size = ((const struct gl_list_impl_base *) list)->vtable->size (list);
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->indexof_from_to (list, 0, size, elt);
+}
+
+GL_LIST_INLINE size_t
+gl_list_indexof_from (gl_list_t list, size_t start_index, const void *elt)
+{
+ size_t size = ((const struct gl_list_impl_base *) list)->vtable->size (list);
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->indexof_from_to (list, start_index, size, elt);
+}
+
+GL_LIST_INLINE size_t
+gl_list_indexof_from_to (gl_list_t list, size_t start_index, size_t end_index,
+ const void *elt)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->indexof_from_to (list, start_index, end_index, elt);
+}
+
+_GL_ATTRIBUTE_NODISCARD GL_LIST_INLINE gl_list_node_t
+gl_list_nx_add_first (gl_list_t list, const void *elt)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->nx_add_first (list, elt);
+}
+
+_GL_ATTRIBUTE_NODISCARD GL_LIST_INLINE gl_list_node_t
+gl_list_nx_add_last (gl_list_t list, const void *elt)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->nx_add_last (list, elt);
+}
+
+_GL_ATTRIBUTE_NODISCARD GL_LIST_INLINE gl_list_node_t
+gl_list_nx_add_before (gl_list_t list, gl_list_node_t node, const void *elt)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->nx_add_before (list, node, elt);
+}
+
+_GL_ATTRIBUTE_NODISCARD GL_LIST_INLINE gl_list_node_t
+gl_list_nx_add_after (gl_list_t list, gl_list_node_t node, const void *elt)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->nx_add_after (list, node, elt);
+}
+
+_GL_ATTRIBUTE_NODISCARD GL_LIST_INLINE gl_list_node_t
+gl_list_nx_add_at (gl_list_t list, size_t position, const void *elt)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->nx_add_at (list, position, elt);
+}
+
+GL_LIST_INLINE bool
+gl_list_remove_node (gl_list_t list, gl_list_node_t node)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->remove_node (list, node);
+}
+
+GL_LIST_INLINE bool
+gl_list_remove_at (gl_list_t list, size_t position)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->remove_at (list, position);
+}
+
+GL_LIST_INLINE bool
+gl_list_remove_first (gl_list_t list)
+{
+ size_t size = gl_list_size (list);
+ if (size > 0)
+ return gl_list_remove_at (list, 0);
+ else
+ return false;
+}
+
+GL_LIST_INLINE bool
+gl_list_remove_last (gl_list_t list)
+{
+ size_t size = gl_list_size (list);
+ if (size > 0)
+ return gl_list_remove_at (list, size - 1);
+ else
+ return false;
+}
+
+GL_LIST_INLINE bool
+gl_list_remove (gl_list_t list, const void *elt)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->remove_elt (list, elt);
+}
+
+GL_LIST_INLINE void
+gl_list_free (gl_list_t list)
+{
+ ((const struct gl_list_impl_base *) list)->vtable->list_free (list);
+}
+
+GL_LIST_INLINE gl_list_iterator_t
+gl_list_iterator (gl_list_t list)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->iterator (list);
+}
+
+GL_LIST_INLINE gl_list_iterator_t
+gl_list_iterator_from_to (gl_list_t list, size_t start_index, size_t end_index)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->iterator_from_to (list, start_index, end_index);
+}
+
+GL_LIST_INLINE bool
+gl_list_iterator_next (gl_list_iterator_t *iterator,
+ const void **eltp, gl_list_node_t *nodep)
+{
+ return iterator->vtable->iterator_next (iterator, eltp, nodep);
+}
+
+GL_LIST_INLINE void
+gl_list_iterator_free (gl_list_iterator_t *iterator)
+{
+ iterator->vtable->iterator_free (iterator);
+}
+
+GL_LIST_INLINE gl_list_node_t
+gl_sortedlist_search (gl_list_t list, gl_listelement_compar_fn compar, const void *elt)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->sortedlist_search (list, compar, elt);
+}
+
+GL_LIST_INLINE gl_list_node_t
+gl_sortedlist_search_from_to (gl_list_t list, gl_listelement_compar_fn compar, size_t start_index, size_t end_index, const void *elt)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->sortedlist_search_from_to (list, compar, start_index, end_index,
+ elt);
+}
+
+GL_LIST_INLINE size_t
+gl_sortedlist_indexof (gl_list_t list, gl_listelement_compar_fn compar, const void *elt)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->sortedlist_indexof (list, compar, elt);
+}
+
+GL_LIST_INLINE size_t
+gl_sortedlist_indexof_from_to (gl_list_t list, gl_listelement_compar_fn compar, size_t start_index, size_t end_index, const void *elt)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->sortedlist_indexof_from_to (list, compar, start_index, end_index,
+ elt);
+}
+
+_GL_ATTRIBUTE_NODISCARD GL_LIST_INLINE gl_list_node_t
+gl_sortedlist_nx_add (gl_list_t list, gl_listelement_compar_fn compar, const void *elt)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->sortedlist_nx_add (list, compar, elt);
+}
+
+GL_LIST_INLINE bool
+gl_sortedlist_remove (gl_list_t list, gl_listelement_compar_fn compar, const void *elt)
+{
+ return ((const struct gl_list_impl_base *) list)->vtable
+ ->sortedlist_remove (list, compar, elt);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif /* _GL_LIST_H */
diff --git a/gl/lib/gl_map.c b/gl/lib/gl_map.c
new file mode 100644
index 0000000..5604354
--- /dev/null
+++ b/gl/lib/gl_map.c
@@ -0,0 +1,21 @@
+/* Abstract map data type.
+
+ Copyright (C) 2018-2022 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/>. */
+
+#include <config.h>
+
+#define GL_MAP_INLINE _GL_EXTERN_INLINE
+#include "gl_map.h"
diff --git a/gl/lib/gl_map.h b/gl/lib/gl_map.h
new file mode 100644
index 0000000..a7a3764
--- /dev/null
+++ b/gl/lib/gl_map.h
@@ -0,0 +1,375 @@
+/* Abstract map data type.
+ Copyright (C) 2006-2007, 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2018.
+
+ 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 _GL_MAP_H
+#define _GL_MAP_H
+
+#include <stdbool.h>
+#include <stddef.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef GL_MAP_INLINE
+# define GL_MAP_INLINE _GL_INLINE
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* gl_map is an abstract map data type. It can contain any number of
+ (key, value) pairs, where
+ - keys and values are objects ('void *' or 'const void *' pointers),
+ - There are no (key, value1) and (key, value2) pairs with the same key
+ (in the sense of a given comparator function).
+
+ There are several implementations of this map datatype, optimized for
+ different operations or for memory. You can start using the simplest map
+ implementation, GL_ARRAY_MAP, and switch to a different implementation
+ later, when you realize which operations are performed the most frequently.
+ The API of the different implementations is exactly the same; when switching
+ to a different implementation, you only have to change the gl_map_create
+ call.
+
+ The implementations are:
+ GL_ARRAY_MAP a growable array
+ GL_LINKEDHASH_MAP a hash table with a linked list
+ GL_HASH_MAP a hash table
+
+ The memory consumption is asymptotically the same: O(1) for every pair
+ in the map. When looking more closely at the average memory consumed
+ for an object, GL_ARRAY_MAP is the most compact representation, then comes
+ GL_HASH_MAP, and GL_LINKEDHASH_MAP needs the most memory.
+
+ The guaranteed average performance of the operations is, for a map of
+ n pairs:
+
+ Operation ARRAY LINKEDHASH
+ HASH
+
+ gl_map_size O(1) O(1)
+ gl_map_get O(n) O(1)
+ gl_map_put O(n) O(1)
+ gl_map_remove O(n) O(1)
+ gl_map_search O(n) O(1)
+ gl_map_iterator O(1) O(1)
+ gl_map_iterator_next O(1) O(1)
+ */
+
+/* --------------------------- gl_map_t Data Type --------------------------- */
+
+/* Type of function used to compare two keys.
+ NULL denotes pointer comparison. */
+typedef bool (*gl_mapkey_equals_fn) (const void *key1, const void *key2);
+
+/* Type of function used to compute a hash code.
+ NULL denotes a function that depends only on the pointer itself. */
+typedef size_t (*gl_mapkey_hashcode_fn) (const void *key);
+
+#ifndef _GL_MAP_DISPOSE_FNS_DEFINED
+
+/* Type of function used to dispose a key once a (key, value) pair is removed
+ from a map. NULL denotes a no-op. */
+typedef void (*gl_mapkey_dispose_fn) (const void *key);
+
+/* Type of function used to dispose a value once a (key, value) pair is removed
+ from a map. NULL denotes a no-op. */
+typedef void (*gl_mapvalue_dispose_fn) (const void *value);
+
+# define _GL_MAP_DISPOSE_FNS_DEFINED 1
+#endif
+
+struct gl_map_impl;
+/* Type representing an entire map. */
+typedef struct gl_map_impl * gl_map_t;
+
+struct gl_map_implementation;
+/* Type representing a map datatype implementation. */
+typedef const struct gl_map_implementation * gl_map_implementation_t;
+
+#if 0 /* Unless otherwise specified, these are defined inline below. */
+
+/* Creates an empty map.
+ IMPLEMENTATION is one of GL_ARRAY_MAP, GL_LINKEDHASH_MAP, GL_HASH_MAP.
+ EQUALS_FN is a key comparison function or NULL.
+ HASHCODE_FN is a key hash code function or NULL.
+ KDISPOSE_FN is a key disposal function or NULL.
+ VDISPOSE_FN is a value disposal function or NULL. */
+/* declared in gl_xmap.h */
+extern gl_map_t gl_map_create_empty (gl_map_implementation_t implementation,
+ gl_mapkey_equals_fn equals_fn,
+ gl_mapkey_hashcode_fn hashcode_fn,
+ gl_mapkey_dispose_fn kdispose_fn,
+ gl_mapvalue_dispose_fn vdispose_fn)
+ /*_GL_ATTRIBUTE_DEALLOC (gl_map_free, 1)*/
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+/* Likewise. Returns NULL upon out-of-memory. */
+extern gl_map_t gl_map_nx_create_empty (gl_map_implementation_t implementation,
+ gl_mapkey_equals_fn equals_fn,
+ gl_mapkey_hashcode_fn hashcode_fn,
+ gl_mapkey_dispose_fn kdispose_fn,
+ gl_mapvalue_dispose_fn vdispose_fn)
+ /*_GL_ATTRIBUTE_DEALLOC (gl_map_free, 1)*/;
+
+/* Returns the current number of pairs in a map. */
+extern size_t gl_map_size (gl_map_t map);
+
+/* Searches whether a pair with the given key is already in the map.
+ Returns the value if found, or NULL if not present in the map. */
+extern const void * gl_map_get (gl_map_t map, const void *key);
+
+/* Searches whether a pair with the given key is already in the map.
+ Returns true and sets *VALUEP to the value if found.
+ Returns false if not present in the map. */
+extern bool gl_map_search (gl_map_t map, const void *key, const void **valuep);
+
+/* Adds a pair to a map.
+ Returns true if a pair with the given key was not already in the map and so
+ this pair was added.
+ Returns false if a pair with the given key was already in the map and only
+ its value was replaced. */
+/* declared in gl_xmap.h */
+extern bool gl_map_put (gl_map_t map, const void *key, const void *value);
+/* Likewise. Returns -1 upon out-of-memory. */
+_GL_ATTRIBUTE_NODISCARD
+extern int gl_map_nx_put (gl_map_t map, const void *key, const void *value);
+
+/* Adds a pair to a map and retrieves the previous value.
+ Returns true if a pair with the given key was not already in the map and so
+ this pair was added.
+ Returns false and sets *OLDVALUEP to the previous value, if a pair with the
+ given key was already in the map and only its value was replaced. */
+/* declared in gl_xmap.h */
+extern bool gl_map_getput (gl_map_t map, const void *key, const void *value,
+ const void **oldvaluep);
+/* Likewise. Returns -1 upon out-of-memory. */
+_GL_ATTRIBUTE_NODISCARD
+extern int gl_map_nx_getput (gl_map_t map, const void *key, const void *value,
+ const void **oldvaluep);
+
+/* Removes a pair from a map.
+ Returns true if the key was found and its pair removed.
+ Returns false otherwise. */
+extern bool gl_map_remove (gl_map_t map, const void *key);
+
+/* Removes a pair from a map and retrieves the previous value.
+ Returns true and sets *OLDVALUEP to the previous value, if the key was found
+ and its pair removed.
+ Returns false otherwise. */
+extern bool gl_map_getremove (gl_map_t map, const void *key,
+ const void **oldvaluep);
+
+/* Frees an entire map.
+ (But this call does not free the keys and values of the pairs in the map.
+ It only invokes the KDISPOSE_FN on each key and the VDISPOSE_FN on each value
+ of the pairs in the map.) */
+extern void gl_map_free (gl_map_t map);
+
+#endif /* End of inline and gl_xmap.h-defined functions. */
+
+/* ---------------------- gl_map_iterator_t Data Type ---------------------- */
+
+/* Functions for iterating through a map.
+ Note: Iterating through a map of type GL_HASH_MAP returns the pairs in an
+ unpredictable order. If you need a predictable order, use GL_LINKEDHASH_MAP
+ instead of GL_HASH_MAP. */
+
+/* Type of an iterator that traverses a map.
+ This is a fixed-size struct, so that creation of an iterator doesn't need
+ memory allocation on the heap. */
+typedef struct
+{
+ /* For fast dispatch of gl_map_iterator_next. */
+ const struct gl_map_implementation *vtable;
+ /* For detecting whether the last returned pair was removed. */
+ gl_map_t map;
+ size_t count;
+ /* Other, implementation-private fields. */
+ void *p; void *q;
+ size_t i; size_t j;
+} gl_map_iterator_t;
+
+#if 0 /* These are defined inline below. */
+
+/* Creates an iterator traversing a map.
+ The map's contents must not be modified while the iterator is in use,
+ except for modifying the value of the last returned key or removing the
+ last returned pair. */
+extern gl_map_iterator_t gl_map_iterator (gl_map_t map);
+
+/* If there is a next pair, stores the next pair in *KEYP and *VALUEP, advances
+ the iterator, and returns true. Otherwise, returns false. */
+extern bool gl_map_iterator_next (gl_map_iterator_t *iterator,
+ const void **keyp, const void **valuep);
+
+/* Frees an iterator. */
+extern void gl_map_iterator_free (gl_map_iterator_t *iterator);
+
+#endif /* End of inline functions. */
+
+/* ------------------------- Implementation Details ------------------------- */
+
+struct gl_map_implementation
+{
+ /* gl_map_t functions. */
+ gl_map_t (*nx_create_empty) (gl_map_implementation_t implementation,
+ gl_mapkey_equals_fn equals_fn,
+ gl_mapkey_hashcode_fn hashcode_fn,
+ gl_mapkey_dispose_fn kdispose_fn,
+ gl_mapvalue_dispose_fn vdispose_fn);
+ size_t (*size) (gl_map_t map);
+ bool (*search) (gl_map_t map, const void *key, const void **valuep);
+ int (*nx_getput) (gl_map_t map, const void *key, const void *value,
+ const void **oldvaluep);
+ bool (*getremove) (gl_map_t map, const void *key, const void **oldvaluep);
+ void (*map_free) (gl_map_t map);
+ /* gl_map_iterator_t functions. */
+ gl_map_iterator_t (*iterator) (gl_map_t map);
+ bool (*iterator_next) (gl_map_iterator_t *iterator,
+ const void **keyp, const void **valuep);
+ void (*iterator_free) (gl_map_iterator_t *iterator);
+};
+
+struct gl_map_impl_base
+{
+ const struct gl_map_implementation *vtable;
+ gl_mapkey_equals_fn equals_fn;
+ gl_mapkey_dispose_fn kdispose_fn;
+ gl_mapvalue_dispose_fn vdispose_fn;
+};
+
+/* Define most functions of this file as accesses to the
+ struct gl_map_implementation. */
+
+GL_MAP_INLINE
+/*_GL_ATTRIBUTE_DEALLOC (gl_map_free, 1)*/
+gl_map_t
+gl_map_nx_create_empty (gl_map_implementation_t implementation,
+ gl_mapkey_equals_fn equals_fn,
+ gl_mapkey_hashcode_fn hashcode_fn,
+ gl_mapkey_dispose_fn kdispose_fn,
+ gl_mapvalue_dispose_fn vdispose_fn)
+{
+ return implementation->nx_create_empty (implementation,
+ equals_fn, hashcode_fn,
+ kdispose_fn, vdispose_fn);
+}
+
+GL_MAP_INLINE size_t
+gl_map_size (gl_map_t map)
+{
+ return ((const struct gl_map_impl_base *) map)->vtable->size (map);
+}
+
+GL_MAP_INLINE bool
+gl_map_search (gl_map_t map, const void *key, const void **valuep)
+{
+ return ((const struct gl_map_impl_base *) map)->vtable
+ ->search (map, key, valuep);
+}
+
+_GL_ATTRIBUTE_NODISCARD GL_MAP_INLINE int
+gl_map_nx_getput (gl_map_t map, const void *key, const void *value,
+ const void **oldvaluep)
+{
+ return ((const struct gl_map_impl_base *) map)->vtable
+ ->nx_getput (map, key, value, oldvaluep);
+}
+
+GL_MAP_INLINE bool
+gl_map_getremove (gl_map_t map, const void *key, const void **oldvaluep)
+{
+ return ((const struct gl_map_impl_base *) map)->vtable
+ ->getremove (map, key, oldvaluep);
+}
+
+GL_MAP_INLINE void
+gl_map_free (gl_map_t map)
+{
+ ((const struct gl_map_impl_base *) map)->vtable->map_free (map);
+}
+
+GL_MAP_INLINE gl_map_iterator_t
+gl_map_iterator (gl_map_t map)
+{
+ return ((const struct gl_map_impl_base *) map)->vtable->iterator (map);
+}
+
+GL_MAP_INLINE bool
+gl_map_iterator_next (gl_map_iterator_t *iterator,
+ const void **keyp, const void **valuep)
+{
+ return iterator->vtable->iterator_next (iterator, keyp, valuep);
+}
+
+GL_MAP_INLINE void
+gl_map_iterator_free (gl_map_iterator_t *iterator)
+{
+ iterator->vtable->iterator_free (iterator);
+}
+
+/* Define the convenience functions, that is, the functions that are independent
+ of the implementation. */
+
+GL_MAP_INLINE const void *
+gl_map_get (gl_map_t map, const void *key)
+{
+ const void *value = NULL;
+ gl_map_search (map, key, &value);
+ return value;
+}
+
+_GL_ATTRIBUTE_NODISCARD GL_MAP_INLINE int
+gl_map_nx_put (gl_map_t map, const void *key, const void *value)
+{
+ const void *oldvalue;
+ int result = gl_map_nx_getput (map, key, value, &oldvalue);
+ if (result == 0)
+ {
+ gl_mapvalue_dispose_fn vdispose_fn =
+ ((const struct gl_map_impl_base *) map)->vdispose_fn;
+ if (vdispose_fn != NULL)
+ vdispose_fn (oldvalue);
+ }
+ return result;
+}
+
+GL_MAP_INLINE bool
+gl_map_remove (gl_map_t map, const void *key)
+{
+ const void *oldvalue;
+ bool result = gl_map_getremove (map, key, &oldvalue);
+ if (result)
+ {
+ gl_mapvalue_dispose_fn vdispose_fn =
+ ((const struct gl_map_impl_base *) map)->vdispose_fn;
+ if (vdispose_fn != NULL)
+ vdispose_fn (oldvalue);
+ }
+ return result;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif /* _GL_MAP_H */
diff --git a/gl/lib/gl_rbtree_list.c b/gl/lib/gl_rbtree_list.c
new file mode 100644
index 0000000..a7c3515
--- /dev/null
+++ b/gl/lib/gl_rbtree_list.c
@@ -0,0 +1,106 @@
+/* Sequential list data type implemented by a binary tree.
+ Copyright (C) 2006, 2008-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "gl_rbtree_list.h"
+
+#include <stdlib.h>
+
+/* -------------------------- gl_list_t Data Type -------------------------- */
+
+/* Generic red-black tree code. */
+#include "gl_anyrbtree_list1.h"
+
+/* Generic binary tree code. */
+#include "gl_anytree_list1.h"
+
+/* Generic red-black tree code. */
+#include "gl_anyrbtree_list2.h"
+
+/* Generic binary tree code. */
+#include "gl_anytree_list2.h"
+
+/* For debugging. */
+extern void gl_rbtree_list_check_invariants (gl_list_t list);
+
+static unsigned int
+check_invariants (gl_list_node_t node, gl_list_node_t parent)
+{
+ unsigned int left_blackheight =
+ (node->left != NULL ? check_invariants (node->left, node) : 0);
+ unsigned int right_blackheight =
+ (node->right != NULL ? check_invariants (node->right, node) : 0);
+
+ if (!(node->parent == parent))
+ abort ();
+ if (!(node->branch_size
+ == (node->left != NULL ? node->left->branch_size : 0)
+ + 1 + (node->right != NULL ? node->right->branch_size : 0)))
+ abort ();
+ if (!(node->color == BLACK || node->color == RED))
+ abort ();
+ if (parent == NULL && !(node->color == BLACK))
+ abort ();
+ if (!(left_blackheight == right_blackheight))
+ abort ();
+
+ return left_blackheight + (node->color == BLACK ? 1 : 0);
+}
+void
+gl_rbtree_list_check_invariants (gl_list_t list)
+{
+ if (list->root != NULL)
+ (void) check_invariants (list->root, NULL);
+}
+
+const struct gl_list_implementation gl_rbtree_list_implementation =
+ {
+ gl_tree_nx_create_empty,
+ gl_tree_nx_create,
+ gl_tree_size,
+ gl_tree_node_value,
+ gl_tree_node_nx_set_value,
+ gl_tree_next_node,
+ gl_tree_previous_node,
+ gl_tree_first_node,
+ gl_tree_last_node,
+ gl_tree_get_at,
+ gl_tree_nx_set_at,
+ gl_tree_search_from_to,
+ gl_tree_indexof_from_to,
+ gl_tree_nx_add_first,
+ gl_tree_nx_add_last,
+ gl_tree_nx_add_before,
+ gl_tree_nx_add_after,
+ gl_tree_nx_add_at,
+ gl_tree_remove_node,
+ gl_tree_remove_at,
+ gl_tree_remove,
+ gl_tree_list_free,
+ gl_tree_iterator,
+ gl_tree_iterator_from_to,
+ gl_tree_iterator_next,
+ gl_tree_iterator_free,
+ gl_tree_sortedlist_search,
+ gl_tree_sortedlist_search_from_to,
+ gl_tree_sortedlist_indexof,
+ gl_tree_sortedlist_indexof_from_to,
+ gl_tree_sortedlist_nx_add,
+ gl_tree_sortedlist_remove
+ };
diff --git a/gl/lib/gl_rbtree_list.h b/gl/lib/gl_rbtree_list.h
new file mode 100644
index 0000000..4ff4f1e
--- /dev/null
+++ b/gl/lib/gl_rbtree_list.h
@@ -0,0 +1,34 @@
+/* Sequential list data type implemented by a binary tree.
+ Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+ 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 2.1 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/>. */
+
+#ifndef _GL_RBTREE_LIST_H
+#define _GL_RBTREE_LIST_H
+
+#include "gl_list.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern const struct gl_list_implementation gl_rbtree_list_implementation;
+#define GL_RBTREE_LIST &gl_rbtree_list_implementation
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GL_RBTREE_LIST_H */
diff --git a/gl/lib/gl_set.c b/gl/lib/gl_set.c
new file mode 100644
index 0000000..d8e53d6
--- /dev/null
+++ b/gl/lib/gl_set.c
@@ -0,0 +1,21 @@
+/* Abstract set data type.
+
+ Copyright (C) 2018-2022 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/>. */
+
+#include <config.h>
+
+#define GL_SET_INLINE _GL_EXTERN_INLINE
+#include "gl_set.h"
diff --git a/gl/lib/gl_set.h b/gl/lib/gl_set.h
new file mode 100644
index 0000000..14b3053
--- /dev/null
+++ b/gl/lib/gl_set.h
@@ -0,0 +1,281 @@
+/* Abstract set data type.
+ Copyright (C) 2006-2007, 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2018.
+
+ 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 _GL_SET_H
+#define _GL_SET_H
+
+#include <stdbool.h>
+#include <stddef.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef GL_SET_INLINE
+# define GL_SET_INLINE _GL_INLINE
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* gl_set is an abstract set data type. It can contain any number of objects
+ ('void *' or 'const void *' pointers); the order does not matter.
+ Duplicates (in the sense of the comparator) are forbidden.
+
+ There are several implementations of this set datatype, optimized for
+ different operations or for memory. You can start using the simplest set
+ implementation, GL_ARRAY_SET, and switch to a different implementation
+ later, when you realize which operations are performed the most frequently.
+ The API of the different implementations is exactly the same; when switching
+ to a different implementation, you only have to change the gl_set_create
+ call.
+
+ The implementations are:
+ GL_ARRAY_SET a growable array
+ GL_LINKEDHASH_SET a hash table with a linked list
+ GL_HASH_SET a hash table
+
+ The memory consumption is asymptotically the same: O(1) for every object
+ in the set. When looking more closely at the average memory consumed
+ for an object, GL_ARRAY_SET is the most compact representation, then comes
+ GL_HASH_SET, and GL_LINKEDHASH_SET needs the most memory.
+
+ The guaranteed average performance of the operations is, for a set of
+ n elements:
+
+ Operation ARRAY LINKEDHASH
+ HASH
+
+ gl_set_size O(1) O(1)
+ gl_set_add O(n) O(1)
+ gl_set_remove O(n) O(1)
+ gl_set_search O(n) O(1)
+ gl_set_iterator O(1) O(1)
+ gl_set_iterator_next O(1) O(1)
+ */
+
+/* --------------------------- gl_set_t Data Type --------------------------- */
+
+/* Type of function used to compare two elements.
+ NULL denotes pointer comparison. */
+typedef bool (*gl_setelement_equals_fn) (const void *elt1, const void *elt2);
+
+/* Type of function used to compute a hash code.
+ NULL denotes a function that depends only on the pointer itself. */
+typedef size_t (*gl_setelement_hashcode_fn) (const void *elt);
+
+#ifndef _GL_SETELEMENT_DISPOSE_FN_DEFINED
+/* Type of function used to dispose an element once it's removed from a set.
+ NULL denotes a no-op. */
+typedef void (*gl_setelement_dispose_fn) (const void *elt);
+# define _GL_SETELEMENT_DISPOSE_FN_DEFINED 1
+#endif
+
+struct gl_set_impl;
+/* Type representing an entire set. */
+typedef struct gl_set_impl * gl_set_t;
+
+struct gl_set_implementation;
+/* Type representing a set datatype implementation. */
+typedef const struct gl_set_implementation * gl_set_implementation_t;
+
+#if 0 /* Unless otherwise specified, these are defined inline below. */
+
+/* Creates an empty set.
+ IMPLEMENTATION is one of GL_ARRAY_SET, GL_LINKEDHASH_SET, GL_HASH_SET.
+ EQUALS_FN is an element comparison function or NULL.
+ HASHCODE_FN is an element hash code function or NULL.
+ DISPOSE_FN is an element disposal function or NULL. */
+/* declared in gl_xset.h */
+extern gl_set_t gl_set_create_empty (gl_set_implementation_t implementation,
+ gl_setelement_equals_fn equals_fn,
+ gl_setelement_hashcode_fn hashcode_fn,
+ gl_setelement_dispose_fn dispose_fn)
+ /*_GL_ATTRIBUTE_DEALLOC (gl_set_free, 1)*/
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+/* Likewise. Returns NULL upon out-of-memory. */
+extern gl_set_t gl_set_nx_create_empty (gl_set_implementation_t implementation,
+ gl_setelement_equals_fn equals_fn,
+ gl_setelement_hashcode_fn hashcode_fn,
+ gl_setelement_dispose_fn dispose_fn)
+ /*_GL_ATTRIBUTE_DEALLOC (gl_set_free, 1)*/;
+
+/* Returns the current number of elements in a set. */
+extern size_t gl_set_size (gl_set_t set);
+
+/* Searches whether an element is already in the set.
+ Returns true if found, or false if not present in the set. */
+extern bool gl_set_search (gl_set_t set, const void *elt);
+
+/* Adds an element to a set.
+ Returns true if it was not already in the set and added, false otherwise. */
+/* declared in gl_xset.h */
+extern bool gl_set_add (gl_set_t set, const void *elt);
+
+/* Likewise. Returns -1 upon out-of-memory. */
+_GL_ATTRIBUTE_NODISCARD
+extern int gl_set_nx_add (gl_set_t set, const void *elt);
+
+/* Removes an element from a set.
+ Returns true if it was found and removed. */
+extern bool gl_set_remove (gl_set_t set, const void *elt);
+
+/* Frees an entire set.
+ (But this call does not free the elements of the set. It only invokes
+ the DISPOSE_FN on each of the elements of the set.) */
+extern void gl_set_free (gl_set_t set);
+
+#endif /* End of inline and gl_xset.h-defined functions. */
+
+/* ---------------------- gl_set_iterator_t Data Type ---------------------- */
+
+/* Functions for iterating through a set.
+ Note: Iterating through a set of type GL_HASH_SET returns the elements in an
+ unpredictable order. If you need a predictable order, use GL_LINKEDHASH_SET
+ instead of GL_HASH_SET. */
+
+/* Type of an iterator that traverses a set.
+ This is a fixed-size struct, so that creation of an iterator doesn't need
+ memory allocation on the heap. */
+typedef struct
+{
+ /* For fast dispatch of gl_set_iterator_next. */
+ const struct gl_set_implementation *vtable;
+ /* For detecting whether the last returned element was removed. */
+ gl_set_t set;
+ size_t count;
+ /* Other, implementation-private fields. */
+ void *p; void *q;
+ size_t i; size_t j;
+} gl_set_iterator_t;
+
+#if 0 /* These are defined inline below. */
+
+/* Creates an iterator traversing a set.
+ The set's contents must not be modified while the iterator is in use,
+ except for removing the last returned element. */
+extern gl_set_iterator_t gl_set_iterator (gl_set_t set);
+
+/* If there is a next element, stores the next element in *ELTP, advances the
+ iterator and returns true. Otherwise, returns false. */
+extern bool gl_set_iterator_next (gl_set_iterator_t *iterator,
+ const void **eltp);
+
+/* Frees an iterator. */
+extern void gl_set_iterator_free (gl_set_iterator_t *iterator);
+
+#endif /* End of inline functions. */
+
+/* ------------------------ Implementation Details ------------------------ */
+
+struct gl_set_implementation
+{
+ /* gl_set_t functions. */
+ gl_set_t (*nx_create_empty) (gl_set_implementation_t implementation,
+ gl_setelement_equals_fn equals_fn,
+ gl_setelement_hashcode_fn hashcode_fn,
+ gl_setelement_dispose_fn dispose_fn);
+ size_t (*size) (gl_set_t set);
+ bool (*search) (gl_set_t set, const void *elt);
+ int (*nx_add) (gl_set_t set, const void *elt);
+ bool (*remove_elt) (gl_set_t set, const void *elt);
+ void (*set_free) (gl_set_t set);
+ /* gl_set_iterator_t functions. */
+ gl_set_iterator_t (*iterator) (gl_set_t set);
+ bool (*iterator_next) (gl_set_iterator_t *iterator, const void **eltp);
+ void (*iterator_free) (gl_set_iterator_t *iterator);
+};
+
+struct gl_set_impl_base
+{
+ const struct gl_set_implementation *vtable;
+ gl_setelement_equals_fn equals_fn;
+ gl_setelement_dispose_fn dispose_fn;
+};
+
+/* Define all functions of this file as accesses to the
+ struct gl_set_implementation. */
+
+GL_SET_INLINE
+/*_GL_ATTRIBUTE_DEALLOC (gl_set_free, 1)*/
+gl_set_t
+gl_set_nx_create_empty (gl_set_implementation_t implementation,
+ gl_setelement_equals_fn equals_fn,
+ gl_setelement_hashcode_fn hashcode_fn,
+ gl_setelement_dispose_fn dispose_fn)
+{
+ return implementation->nx_create_empty (implementation, equals_fn,
+ hashcode_fn, dispose_fn);
+}
+
+GL_SET_INLINE size_t
+gl_set_size (gl_set_t set)
+{
+ return ((const struct gl_set_impl_base *) set)->vtable->size (set);
+}
+
+GL_SET_INLINE bool
+gl_set_search (gl_set_t set, const void *elt)
+{
+ return ((const struct gl_set_impl_base *) set)->vtable->search (set, elt);
+}
+
+_GL_ATTRIBUTE_NODISCARD GL_SET_INLINE int
+gl_set_nx_add (gl_set_t set, const void *elt)
+{
+ return ((const struct gl_set_impl_base *) set)->vtable->nx_add (set, elt);
+}
+
+GL_SET_INLINE bool
+gl_set_remove (gl_set_t set, const void *elt)
+{
+ return ((const struct gl_set_impl_base *) set)->vtable->remove_elt (set, elt);
+}
+
+GL_SET_INLINE void
+gl_set_free (gl_set_t set)
+{
+ ((const struct gl_set_impl_base *) set)->vtable->set_free (set);
+}
+
+GL_SET_INLINE gl_set_iterator_t
+gl_set_iterator (gl_set_t set)
+{
+ return ((const struct gl_set_impl_base *) set)->vtable->iterator (set);
+}
+
+GL_SET_INLINE bool
+gl_set_iterator_next (gl_set_iterator_t *iterator, const void **eltp)
+{
+ return iterator->vtable->iterator_next (iterator, eltp);
+}
+
+GL_SET_INLINE void
+gl_set_iterator_free (gl_set_iterator_t *iterator)
+{
+ iterator->vtable->iterator_free (iterator);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif /* _GL_SET_H */
diff --git a/gl/lib/gl_xlist.c b/gl/lib/gl_xlist.c
new file mode 100644
index 0000000..204698e
--- /dev/null
+++ b/gl/lib/gl_xlist.c
@@ -0,0 +1,21 @@
+/* Abstract sequential list data type, with out-of-memory checking.
+
+ Copyright (C) 2009-2022 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/>. */
+
+#include <config.h>
+
+#define GL_XLIST_INLINE _GL_EXTERN_INLINE
+#include "gl_xlist.h"
diff --git a/gl/lib/gl_xlist.h b/gl/lib/gl_xlist.h
new file mode 100644
index 0000000..abef383
--- /dev/null
+++ b/gl/lib/gl_xlist.h
@@ -0,0 +1,207 @@
+/* Abstract sequential list data type, with out-of-memory checking.
+ Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2009.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (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 _GL_XLIST_H
+#define _GL_XLIST_H
+
+#include "gl_list.h"
+#include "xalloc.h"
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef GL_XLIST_INLINE
+# define GL_XLIST_INLINE _GL_INLINE
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* These functions are thin wrappers around the corresponding functions with
+ _nx_ infix from gl_list.h. Upon out-of-memory, they invoke xalloc_die (),
+ instead of returning an error indicator. */
+#if 0 /* These are defined inline below. */
+extern gl_list_t gl_list_create_empty (gl_list_implementation_t implementation,
+ gl_listelement_equals_fn equals_fn,
+ gl_listelement_hashcode_fn hashcode_fn,
+ gl_listelement_dispose_fn dispose_fn,
+ bool allow_duplicates)
+ /*_GL_ATTRIBUTE_DEALLOC (gl_list_free, 1)*/
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+extern gl_list_t gl_list_create (gl_list_implementation_t implementation,
+ gl_listelement_equals_fn equals_fn,
+ gl_listelement_hashcode_fn hashcode_fn,
+ gl_listelement_dispose_fn dispose_fn,
+ bool allow_duplicates,
+ size_t count, const void **contents)
+ /*_GL_ATTRIBUTE_DEALLOC (gl_list_free, 1)*/
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+extern void gl_list_node_set_value (gl_list_t list, gl_list_node_t node,
+ const void *elt);
+extern gl_list_node_t gl_list_set_at (gl_list_t list, size_t position,
+ const void *elt);
+extern gl_list_node_t gl_list_set_first (gl_list_t list, const void *elt);
+extern gl_list_node_t gl_list_set_last (gl_list_t list, const void *elt);
+extern gl_list_node_t gl_list_add_first (gl_list_t list, const void *elt);
+extern gl_list_node_t gl_list_add_last (gl_list_t list, const void *elt);
+extern gl_list_node_t gl_list_add_before (gl_list_t list, gl_list_node_t node,
+ const void *elt);
+extern gl_list_node_t gl_list_add_after (gl_list_t list, gl_list_node_t node,
+ const void *elt);
+extern gl_list_node_t gl_list_add_at (gl_list_t list, size_t position,
+ const void *elt);
+extern gl_list_node_t gl_sortedlist_add (gl_list_t list,
+ gl_listelement_compar_fn compar,
+ const void *elt);
+#endif
+
+GL_XLIST_INLINE
+/*_GL_ATTRIBUTE_DEALLOC (gl_list_free, 1)*/
+_GL_ATTRIBUTE_RETURNS_NONNULL
+gl_list_t
+gl_list_create_empty (gl_list_implementation_t implementation,
+ gl_listelement_equals_fn equals_fn,
+ gl_listelement_hashcode_fn hashcode_fn,
+ gl_listelement_dispose_fn dispose_fn,
+ bool allow_duplicates)
+{
+ gl_list_t result =
+ gl_list_nx_create_empty (implementation, equals_fn, hashcode_fn, dispose_fn,
+ allow_duplicates);
+ if (result == NULL)
+ xalloc_die ();
+ return result;
+}
+
+GL_XLIST_INLINE
+/*_GL_ATTRIBUTE_DEALLOC (gl_list_free, 1)*/
+_GL_ATTRIBUTE_RETURNS_NONNULL
+gl_list_t
+gl_list_create (gl_list_implementation_t implementation,
+ gl_listelement_equals_fn equals_fn,
+ gl_listelement_hashcode_fn hashcode_fn,
+ gl_listelement_dispose_fn dispose_fn,
+ bool allow_duplicates,
+ size_t count, const void **contents)
+{
+ gl_list_t result =
+ gl_list_nx_create (implementation, equals_fn, hashcode_fn, dispose_fn,
+ allow_duplicates, count, contents);
+ if (result == NULL)
+ xalloc_die ();
+ return result;
+}
+
+GL_XLIST_INLINE void
+gl_list_node_set_value (gl_list_t list, gl_list_node_t node, const void *elt)
+{
+ int result = gl_list_node_nx_set_value (list, node, elt);
+ if (result < 0)
+ xalloc_die ();
+}
+
+GL_XLIST_INLINE gl_list_node_t
+gl_list_set_at (gl_list_t list, size_t position, const void *elt)
+{
+ gl_list_node_t result = gl_list_nx_set_at (list, position, elt);
+ if (result == NULL)
+ xalloc_die ();
+ return result;
+}
+
+GL_XLIST_INLINE gl_list_node_t
+gl_list_set_first (gl_list_t list, const void *elt)
+{
+ gl_list_node_t result = gl_list_nx_set_first (list, elt);
+ if (result == NULL)
+ xalloc_die ();
+ return result;
+}
+
+GL_XLIST_INLINE gl_list_node_t
+gl_list_set_last (gl_list_t list, const void *elt)
+{
+ gl_list_node_t result = gl_list_nx_set_last (list, elt);
+ if (result == NULL)
+ xalloc_die ();
+ return result;
+}
+
+GL_XLIST_INLINE gl_list_node_t
+gl_list_add_first (gl_list_t list, const void *elt)
+{
+ gl_list_node_t result = gl_list_nx_add_first (list, elt);
+ if (result == NULL)
+ xalloc_die ();
+ return result;
+}
+
+GL_XLIST_INLINE gl_list_node_t
+gl_list_add_last (gl_list_t list, const void *elt)
+{
+ gl_list_node_t result = gl_list_nx_add_last (list, elt);
+ if (result == NULL)
+ xalloc_die ();
+ return result;
+}
+
+GL_XLIST_INLINE gl_list_node_t
+gl_list_add_before (gl_list_t list, gl_list_node_t node, const void *elt)
+{
+ gl_list_node_t result = gl_list_nx_add_before (list, node, elt);
+ if (result == NULL)
+ xalloc_die ();
+ return result;
+}
+
+GL_XLIST_INLINE gl_list_node_t
+gl_list_add_after (gl_list_t list, gl_list_node_t node, const void *elt)
+{
+ gl_list_node_t result = gl_list_nx_add_after (list, node, elt);
+ if (result == NULL)
+ xalloc_die ();
+ return result;
+}
+
+GL_XLIST_INLINE gl_list_node_t
+gl_list_add_at (gl_list_t list, size_t position, const void *elt)
+{
+ gl_list_node_t result = gl_list_nx_add_at (list, position, elt);
+ if (result == NULL)
+ xalloc_die ();
+ return result;
+}
+
+GL_XLIST_INLINE gl_list_node_t
+gl_sortedlist_add (gl_list_t list, gl_listelement_compar_fn compar,
+ const void *elt)
+{
+ gl_list_node_t result = gl_sortedlist_nx_add (list, compar, elt);
+ if (result == NULL)
+ xalloc_die ();
+ return result;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif /* _GL_XLIST_H */
diff --git a/gl/lib/gl_xmap.c b/gl/lib/gl_xmap.c
new file mode 100644
index 0000000..3a9e886
--- /dev/null
+++ b/gl/lib/gl_xmap.c
@@ -0,0 +1,21 @@
+/* Abstract map data type, with out-of-memory checking.
+
+ Copyright (C) 2018-2022 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/>. */
+
+#include <config.h>
+
+#define GL_XMAP_INLINE _GL_EXTERN_INLINE
+#include "gl_xmap.h"
diff --git a/gl/lib/gl_xmap.h b/gl/lib/gl_xmap.h
new file mode 100644
index 0000000..85dc153
--- /dev/null
+++ b/gl/lib/gl_xmap.h
@@ -0,0 +1,96 @@
+/* Abstract map data type, with out-of-memory checking.
+ Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2018.
+
+ 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 _GL_XMAP_H
+#define _GL_XMAP_H
+
+#include "gl_map.h"
+#include "xalloc.h"
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef GL_XMAP_INLINE
+# define GL_XMAP_INLINE _GL_INLINE
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* These functions are thin wrappers around the corresponding functions with
+ _nx_ infix from gl_map.h. Upon out-of-memory, they invoke xalloc_die (),
+ instead of returning an error indicator. */
+#if 0 /* These are defined inline below. */
+extern gl_map_t gl_map_create_empty (gl_map_implementation_t implementation,
+ gl_mapkey_equals_fn equals_fn,
+ gl_mapkey_hashcode_fn hashcode_fn,
+ gl_mapkey_dispose_fn kdispose_fn,
+ gl_mapvalue_dispose_fn vdispose_fn)
+ /*_GL_ATTRIBUTE_DEALLOC (gl_map_free, 1)*/
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+extern bool gl_map_put (gl_map_t map, const void *key, const void *value);
+extern bool gl_map_getput (gl_map_t map, const void *key, const void *value,
+ const void **oldvaluep);
+#endif
+
+GL_XMAP_INLINE
+/*_GL_ATTRIBUTE_DEALLOC (gl_map_free, 1)*/
+_GL_ATTRIBUTE_RETURNS_NONNULL
+gl_map_t
+gl_map_create_empty (gl_map_implementation_t implementation,
+ gl_mapkey_equals_fn equals_fn,
+ gl_mapkey_hashcode_fn hashcode_fn,
+ gl_mapkey_dispose_fn kdispose_fn,
+ gl_mapvalue_dispose_fn vdispose_fn)
+{
+ gl_map_t result =
+ gl_map_nx_create_empty (implementation, equals_fn, hashcode_fn,
+ kdispose_fn, vdispose_fn);
+ if (result == NULL)
+ xalloc_die ();
+ return result;
+}
+
+GL_XMAP_INLINE bool
+gl_map_put (gl_map_t map, const void *key, const void *value)
+{
+ int result = gl_map_nx_put (map, key, value);
+ if (result < 0)
+ xalloc_die ();
+ return result;
+}
+
+GL_XMAP_INLINE bool
+gl_map_getput (gl_map_t map, const void *key, const void *value,
+ const void **oldvaluep)
+{
+ int result = gl_map_nx_getput (map, key, value, oldvaluep);
+ if (result < 0)
+ xalloc_die ();
+ return result;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif /* _GL_XMAP_H */
diff --git a/gl/lib/gl_xset.c b/gl/lib/gl_xset.c
new file mode 100644
index 0000000..fb7c146
--- /dev/null
+++ b/gl/lib/gl_xset.c
@@ -0,0 +1,21 @@
+/* Abstract set data type, with out-of-memory checking.
+
+ Copyright (C) 2018-2022 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/>. */
+
+#include <config.h>
+
+#define GL_XSET_INLINE _GL_EXTERN_INLINE
+#include "gl_xset.h"
diff --git a/gl/lib/gl_xset.h b/gl/lib/gl_xset.h
new file mode 100644
index 0000000..ad80a8c
--- /dev/null
+++ b/gl/lib/gl_xset.h
@@ -0,0 +1,81 @@
+/* Abstract set data type, with out-of-memory checking.
+ Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2009.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (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 _GL_XSET_H
+#define _GL_XSET_H
+
+#include "gl_set.h"
+#include "xalloc.h"
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef GL_XSET_INLINE
+# define GL_XSET_INLINE _GL_INLINE
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* These functions are thin wrappers around the corresponding functions with
+ _nx_ infix from gl_set.h. Upon out-of-memory, they invoke xalloc_die (),
+ instead of returning an error indicator. */
+#if 0 /* These are defined inline below. */
+extern gl_set_t gl_set_create_empty (gl_set_implementation_t implementation,
+ gl_setelement_equals_fn equals_fn,
+ gl_setelement_hashcode_fn hashcode_fn,
+ gl_setelement_dispose_fn dispose_fn)
+ /*_GL_ATTRIBUTE_DEALLOC (gl_set_free, 1)*/
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+extern bool gl_set_add (gl_set_t set, const void *elt);
+#endif
+
+GL_XSET_INLINE
+/*_GL_ATTRIBUTE_DEALLOC (gl_set_free, 1)*/
+_GL_ATTRIBUTE_RETURNS_NONNULL
+gl_set_t
+gl_set_create_empty (gl_set_implementation_t implementation,
+ gl_setelement_equals_fn equals_fn,
+ gl_setelement_hashcode_fn hashcode_fn,
+ gl_setelement_dispose_fn dispose_fn)
+{
+ gl_set_t result =
+ gl_set_nx_create_empty (implementation, equals_fn, hashcode_fn, dispose_fn);
+ if (result == NULL)
+ xalloc_die ();
+ return result;
+}
+
+GL_XSET_INLINE bool
+gl_set_add (gl_set_t set, const void *elt)
+{
+ int result = gl_set_nx_add (set, elt);
+ if (result < 0)
+ xalloc_die ();
+ return result;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif /* _GL_XSET_H */
diff --git a/gl/lib/glob-libc.h b/gl/lib/glob-libc.h
new file mode 100644
index 0000000..efef63d
--- /dev/null
+++ b/gl/lib/glob-libc.h
@@ -0,0 +1,195 @@
+/* Copyright (C) 1991-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _GLOB_H
+#define _GLOB_H 1
+
+#ifndef __GLOB_GNULIB
+# include <sys/cdefs.h>
+#endif
+
+__BEGIN_DECLS
+
+#define __need_size_t
+#include <stddef.h>
+
+/* Bits set in the FLAGS argument to 'glob'. */
+#define GLOB_ERR (1 << 0)/* Return on read errors. */
+#define GLOB_MARK (1 << 1)/* Append a slash to each name. */
+#define GLOB_NOSORT (1 << 2)/* Don't sort the names. */
+#define GLOB_DOOFFS (1 << 3)/* Insert PGLOB->gl_offs NULLs. */
+#define GLOB_NOCHECK (1 << 4)/* If nothing matches, return the pattern. */
+#define GLOB_APPEND (1 << 5)/* Append to results of a previous call. */
+#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
+#define GLOB_PERIOD (1 << 7)/* Leading '.' can be matched by metachars. */
+
+#if !defined __USE_POSIX2 || defined __USE_MISC
+# define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
+# define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
+# define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */
+# define GLOB_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */
+# define GLOB_TILDE (1 << 12)/* Expand ~user and ~ to home directories. */
+# define GLOB_ONLYDIR (1 << 13)/* Match only directories. */
+# define GLOB_TILDE_CHECK (1 << 14)/* Like GLOB_TILDE but return an error
+ if the user name is not available. */
+# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS \
+ |GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND \
+ |GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE \
+ |GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
+#else
+# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS \
+ |GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND \
+ |GLOB_PERIOD)
+#endif
+
+/* Error returns from 'glob'. */
+#define GLOB_NOSPACE 1 /* Ran out of memory. */
+#define GLOB_ABORTED 2 /* Read error. */
+#define GLOB_NOMATCH 3 /* No matches found. */
+#define GLOB_NOSYS 4 /* Not implemented. */
+#ifdef __USE_GNU
+/* Previous versions of this file defined GLOB_ABEND instead of
+ GLOB_ABORTED. Provide a compatibility definition here. */
+# define GLOB_ABEND GLOB_ABORTED
+#endif
+
+/* Structure describing a globbing run. */
+#ifdef __USE_GNU
+struct stat;
+#endif
+typedef struct
+ {
+ size_t gl_pathc; /* Count of paths matched by the pattern. */
+ char **gl_pathv; /* List of matched pathnames. */
+ size_t gl_offs; /* Slots to reserve in 'gl_pathv'. */
+ int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
+
+ /* If the GLOB_ALTDIRFUNC flag is set, the following functions
+ are used instead of the normal file access functions. */
+ void (*gl_closedir) (void *);
+#ifdef __USE_GNU
+ struct dirent *(*gl_readdir) (void *);
+#else
+ void *(*gl_readdir) (void *);
+#endif
+ void *(*gl_opendir) (const char *);
+#ifdef __USE_GNU
+ int (*gl_lstat) (const char *__restrict, struct stat *__restrict);
+ int (*gl_stat) (const char *__restrict, struct stat *__restrict);
+#else
+ int (*gl_lstat) (const char *__restrict, void *__restrict);
+ int (*gl_stat) (const char *__restrict, void *__restrict);
+#endif
+ } glob_t;
+
+#ifdef __USE_LARGEFILE64
+# ifdef __USE_GNU
+struct stat64;
+# endif
+typedef struct
+ {
+ size_t gl_pathc;
+ char **gl_pathv;
+ size_t gl_offs;
+ int gl_flags;
+
+ /* If the GLOB_ALTDIRFUNC flag is set, the following functions
+ are used instead of the normal file access functions. */
+ void (*gl_closedir) (void *);
+# ifdef __USE_GNU
+ struct dirent64 *(*gl_readdir) (void *);
+# else
+ void *(*gl_readdir) (void *);
+# endif
+ void *(*gl_opendir) (const char *);
+# ifdef __USE_GNU
+ int (*gl_lstat) (const char *__restrict, struct stat64 *__restrict);
+ int (*gl_stat) (const char *__restrict, struct stat64 *__restrict);
+# else
+ int (*gl_lstat) (const char *__restrict, void *__restrict);
+ int (*gl_stat) (const char *__restrict, void *__restrict);
+# endif
+ } glob64_t;
+#endif
+
+/* Do glob searching for PATTERN, placing results in PGLOB.
+ The bits defined above may be set in FLAGS.
+ If a directory cannot be opened or read and ERRFUNC is not nil,
+ it is called with the pathname that caused the error, and the
+ 'errno' value from the failing call; if it returns non-zero
+ 'glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
+ If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
+ Otherwise, 'glob' returns zero. */
+#if !defined __USE_FILE_OFFSET64 || defined __GLOB_GNULIB
+extern int glob (const char *__restrict __pattern, int __flags,
+ int (*__errfunc) (const char *, int),
+ glob_t *__restrict __pglob) __THROWNL;
+
+/* Free storage allocated in PGLOB by a previous 'glob' call. */
+extern void globfree (glob_t *__pglob) __THROW;
+#else
+# ifdef __USE_TIME_BITS64
+extern int __REDIRECT_NTHNL (glob, (const char *__restrict __pattern,
+ int __flags,
+ int (*__errfunc) (const char *, int),
+ glob_t *__restrict __pglob),
+ __glob64_time64);
+
+extern void __REDIRECT_NTH (globfree, (glob_t *__pglob),
+ __globfree64_time64);
+# else
+extern int __REDIRECT_NTHNL (glob, (const char *__restrict __pattern,
+ int __flags,
+ int (*__errfunc) (const char *, int),
+ glob_t *__restrict __pglob), glob64);
+
+extern void __REDIRECT_NTH (globfree, (glob_t *__pglob), globfree64);
+# endif
+#endif
+
+#ifdef __USE_LARGEFILE64
+# ifdef __USE_TIME_BITS64
+extern int __REDIRECT_NTHNL (glob64, (const char *__restrict __pattern,
+ int __flags,
+ int (*__errfunc) (const char *, int),
+ glob64_t *__restrict __pglob),
+ __glob64_time64);
+
+extern void __REDIRECT_NTH (globfree64, (glob64_t *__pglob),
+ __globfree64_time64);
+# else
+extern int glob64 (const char *__restrict __pattern, int __flags,
+ int (*__errfunc) (const char *, int),
+ glob64_t *__restrict __pglob) __THROWNL;
+
+extern void globfree64 (glob64_t *__pglob) __THROW;
+# endif
+#endif
+
+
+#ifdef __USE_GNU
+/* Return nonzero if PATTERN contains any metacharacters.
+ Metacharacters can be quoted with backslashes if QUOTE is nonzero.
+
+ This function is not part of the interface specified by POSIX.2
+ but several programs want to use it. */
+extern int glob_pattern_p (const char *__pattern, int __quote) __THROW;
+#endif
+
+__END_DECLS
+
+#endif /* glob.h */
diff --git a/gl/lib/glob.c b/gl/lib/glob.c
new file mode 100644
index 0000000..57cb3bd
--- /dev/null
+++ b/gl/lib/glob.c
@@ -0,0 +1,1548 @@
+/* Copyright (C) 1991-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+
+/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
+ optimizes away the pattern == NULL test below. */
+# define _GL_ARG_NONNULL(params)
+
+# include <libc-config.h>
+
+#endif
+
+#include <glob.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <assert.h>
+#include <unistd.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+# define WINDOWS32
+#endif
+
+#ifndef WINDOWS32
+# include <pwd.h>
+#endif
+
+#include <errno.h>
+#include <dirent.h>
+#include <stdlib.h>
+#include <string.h>
+#include <alloca.h>
+
+#ifdef _LIBC
+# undef strdup
+# define strdup(str) __strdup (str)
+# define sysconf(id) __sysconf (id)
+# define closedir(dir) __closedir (dir)
+# define opendir(name) __opendir (name)
+# undef dirfd
+# define dirfd(str) __dirfd (str)
+# define readdir(str) __readdir64 (str)
+# define getpwnam_r(name, bufp, buf, len, res) \
+ __getpwnam_r (name, bufp, buf, len, res)
+# define FLEXIBLE_ARRAY_MEMBER
+# ifndef struct_stat
+# define struct_stat struct stat
+# endif
+# ifndef struct_stat64
+# define struct_stat64 struct stat64
+# endif
+# ifndef GLOB_LSTAT
+# define GLOB_LSTAT gl_lstat
+# endif
+# ifndef GLOB_FSTATAT64
+# define GLOB_FSTATAT64 __fstatat64
+# endif
+# include <shlib-compat.h>
+#else /* !_LIBC */
+# define __glob glob
+# define __getlogin_r(buf, len) getlogin_r (buf, len)
+# define __fxstatat64(_, d, f, st, flag) fstatat (d, f, st, flag)
+# ifndef __MVS__
+# define __alloca alloca
+# endif
+# define __readdir readdir
+# define COMPILE_GLOB64
+# define struct_stat struct stat
+# define struct_stat64 struct stat
+# define GLOB_LSTAT gl_lstat
+# define GLOB_FSTATAT64 fstatat
+#endif /* _LIBC */
+
+#include <fnmatch.h>
+
+#include <flexmember.h>
+#include <glob_internal.h>
+#include <scratch_buffer.h>
+
+static const char *next_brace_sub (const char *begin, int flags) __THROWNL;
+
+/* The type of ((struct dirent *) 0)->d_type is 'unsigned char' on most
+ platforms, but 'unsigned int' in the mingw from mingw.org. */
+typedef uint_fast32_t dirent_type;
+
+#if !defined _LIBC && !defined HAVE_STRUCT_DIRENT_D_TYPE
+/* Any distinct values will do here.
+ Undef any existing macros out of the way. */
+# undef DT_UNKNOWN
+# undef DT_DIR
+# undef DT_LNK
+# define DT_UNKNOWN 0
+# define DT_DIR 1
+# define DT_LNK 2
+#endif
+
+/* A representation of a directory entry which does not depend on the
+ layout of struct dirent, or the size of ino_t. */
+struct readdir_result
+{
+ const char *name;
+#if defined _DIRENT_HAVE_D_TYPE || defined HAVE_STRUCT_DIRENT_D_TYPE
+ dirent_type type;
+#endif
+};
+
+/* Initialize and return type member of struct readdir_result. */
+static dirent_type
+readdir_result_type (struct readdir_result d)
+{
+#if defined _DIRENT_HAVE_D_TYPE || defined HAVE_STRUCT_DIRENT_D_TYPE
+# define D_TYPE_TO_RESULT(source) (source)->d_type,
+ return d.type;
+#else
+# define D_TYPE_TO_RESULT(source)
+ return DT_UNKNOWN;
+#endif
+}
+
+/* Construct an initializer for a struct readdir_result object from a
+ struct dirent *. No copy of the name is made. */
+#define READDIR_RESULT_INITIALIZER(source) \
+ { \
+ source->d_name, \
+ D_TYPE_TO_RESULT (source) \
+ }
+
+/* Call gl_readdir on STREAM. This macro can be overridden to reduce
+ type safety if an old interface version needs to be supported. */
+#ifndef GL_READDIR
+# define GL_READDIR(pglob, stream) ((pglob)->gl_readdir (stream))
+#endif
+
+/* Extract name and type from directory entry. No copy of the name is
+ made. If SOURCE is NULL, result name is NULL. Keep in sync with
+ convert_dirent64 below. */
+static struct readdir_result
+convert_dirent (const struct dirent *source)
+{
+ if (source == NULL)
+ {
+ struct readdir_result result = { NULL, };
+ return result;
+ }
+ struct readdir_result result = READDIR_RESULT_INITIALIZER (source);
+ return result;
+}
+
+#ifndef COMPILE_GLOB64
+/* Like convert_dirent, but works on struct dirent64 instead. Keep in
+ sync with convert_dirent above. */
+static struct readdir_result
+convert_dirent64 (const struct dirent64 *source)
+{
+ if (source == NULL)
+ {
+ struct readdir_result result = { NULL, };
+ return result;
+ }
+ struct readdir_result result = READDIR_RESULT_INITIALIZER (source);
+ return result;
+}
+#endif
+
+#ifndef _LIBC
+/* The results of opendir() in this file are not used with dirfd and fchdir,
+ and we do not leak fds to any single-threaded code that could use stdio,
+ therefore save some unnecessary recursion in fchdir.c and opendir_safer.c.
+ FIXME - if the kernel ever adds support for multi-thread safety for
+ avoiding standard fds, then we should use opendir_safer. */
+# ifdef GNULIB_defined_opendir
+# undef opendir
+# endif
+# ifdef GNULIB_defined_closedir
+# undef closedir
+# endif
+
+/* Just use malloc. */
+# define __libc_use_alloca(n) false
+# define alloca_account(len, avar) ((void) (len), (void) (avar), (void *) 0)
+# define extend_alloca_account(buf, len, newlen, avar) \
+ ((void) (buf), (void) (len), (void) (newlen), (void) (avar), (void *) 0)
+#endif
+
+static int
+glob_lstat (glob_t *pglob, int flags, const char *fullname)
+{
+/* Use on glob-lstat-compat.c to provide a compat symbol which does not
+ use lstat / gl_lstat. */
+ union
+ {
+ struct_stat st;
+ struct_stat64 st64;
+ } ust;
+ return (__glibc_unlikely (flags & GLOB_ALTDIRFUNC)
+ ? pglob->GLOB_LSTAT (fullname, &ust.st)
+ : GLOB_FSTATAT64 (AT_FDCWD, fullname, &ust.st64,
+ AT_SYMLINK_NOFOLLOW));
+}
+
+/* Set *R = A + B. Return true if the answer is mathematically
+ incorrect due to overflow; in this case, *R is the low order
+ bits of the correct answer. */
+
+static bool
+size_add_wrapv (size_t a, size_t b, size_t *r)
+{
+#if 7 <= __GNUC__ && !defined __ICC
+ return __builtin_add_overflow (a, b, r);
+#else
+ *r = a + b;
+ return *r < a;
+#endif
+}
+
+static bool
+glob_use_alloca (size_t alloca_used, size_t len)
+{
+ size_t size;
+ return (!size_add_wrapv (alloca_used, len, &size)
+ && __libc_use_alloca (size));
+}
+
+static int glob_in_dir (const char *pattern, const char *directory,
+ int flags, int (*errfunc) (const char *, int),
+ glob_t *pglob, size_t alloca_used);
+static int prefix_array (const char *prefix, char **array, size_t n) __THROWNL;
+static int collated_compare (const void *, const void *) __THROWNL;
+
+
+/* Return true if FILENAME is a directory or a symbolic link to a directory.
+ Use FLAGS and PGLOB to resolve the filename. */
+static bool
+is_dir (char const *filename, int flags, glob_t const *pglob)
+{
+ struct_stat st;
+ struct_stat64 st64;
+ return (__glibc_unlikely (flags & GLOB_ALTDIRFUNC)
+ ? pglob->gl_stat (filename, &st) == 0 && S_ISDIR (st.st_mode)
+ : (GLOB_FSTATAT64 (AT_FDCWD, filename, &st64, 0) == 0
+ && S_ISDIR (st64.st_mode)));
+}
+
+/* Find the end of the sub-pattern in a brace expression. */
+static const char *
+next_brace_sub (const char *cp, int flags)
+{
+ size_t depth = 0;
+ while (*cp != '\0')
+ if ((flags & GLOB_NOESCAPE) == 0 && *cp == '\\')
+ {
+ if (*++cp == '\0')
+ break;
+ ++cp;
+ }
+ else
+ {
+ if ((*cp == '}' && depth-- == 0) || (*cp == ',' && depth == 0))
+ break;
+
+ if (*cp++ == '{')
+ depth++;
+ }
+
+ return *cp != '\0' ? cp : NULL;
+}
+
+#ifndef GLOB_ATTRIBUTE
+# define GLOB_ATTRIBUTE
+#endif
+
+/* Do glob searching for PATTERN, placing results in PGLOB.
+ The bits defined above may be set in FLAGS.
+ If a directory cannot be opened or read and ERRFUNC is not nil,
+ it is called with the pathname that caused the error, and the
+ 'errno' value from the failing call; if it returns non-zero
+ 'glob' returns GLOB_ABORTED; if it returns zero, the error is ignored.
+ If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
+ Otherwise, 'glob' returns zero. */
+int
+GLOB_ATTRIBUTE
+__glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
+ glob_t *pglob)
+{
+ const char *filename;
+ char *dirname = NULL;
+ size_t dirlen;
+ int status;
+ size_t oldcount;
+ int meta;
+ int dirname_modified;
+ int malloc_dirname = 0;
+ glob_t dirs;
+ int retval = 0;
+ size_t alloca_used = 0;
+
+ if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ /* POSIX requires all slashes to be matched. This means that with
+ a trailing slash we must match only directories. */
+ if (pattern[0] && pattern[strlen (pattern) - 1] == '/')
+ flags |= GLOB_ONLYDIR;
+
+ if (!(flags & GLOB_DOOFFS))
+ /* Have to do this so 'globfree' knows where to start freeing. It
+ also makes all the code that uses gl_offs simpler. */
+ pglob->gl_offs = 0;
+
+ if (!(flags & GLOB_APPEND))
+ {
+ pglob->gl_pathc = 0;
+ if (!(flags & GLOB_DOOFFS))
+ pglob->gl_pathv = NULL;
+ else
+ {
+ size_t i;
+
+ if (pglob->gl_offs >= ~((size_t) 0) / sizeof (char *))
+ return GLOB_NOSPACE;
+
+ pglob->gl_pathv = (char **) malloc ((pglob->gl_offs + 1)
+ * sizeof (char *));
+ if (pglob->gl_pathv == NULL)
+ return GLOB_NOSPACE;
+
+ for (i = 0; i <= pglob->gl_offs; ++i)
+ pglob->gl_pathv[i] = NULL;
+ }
+ }
+
+ if (flags & GLOB_BRACE)
+ {
+ const char *begin;
+
+ if (flags & GLOB_NOESCAPE)
+ begin = strchr (pattern, '{');
+ else
+ {
+ begin = pattern;
+ while (1)
+ {
+ if (*begin == '\0')
+ {
+ begin = NULL;
+ break;
+ }
+
+ if (*begin == '\\' && begin[1] != '\0')
+ ++begin;
+ else if (*begin == '{')
+ break;
+
+ ++begin;
+ }
+ }
+
+ if (begin != NULL)
+ {
+ /* Allocate working buffer large enough for our work. Note that
+ we have at least an opening and closing brace. */
+ size_t firstc;
+ char *alt_start;
+ const char *p;
+ const char *next;
+ const char *rest;
+ size_t rest_len;
+ char *onealt;
+ size_t pattern_len = strlen (pattern) - 1;
+ int alloca_onealt = glob_use_alloca (alloca_used, pattern_len);
+ if (alloca_onealt)
+ onealt = alloca_account (pattern_len, alloca_used);
+ else
+ {
+ onealt = malloc (pattern_len);
+ if (onealt == NULL)
+ return GLOB_NOSPACE;
+ }
+
+ /* We know the prefix for all sub-patterns. */
+ alt_start = mempcpy (onealt, pattern, begin - pattern);
+
+ /* Find the first sub-pattern and at the same time find the
+ rest after the closing brace. */
+ next = next_brace_sub (begin + 1, flags);
+ if (next == NULL)
+ {
+ /* It is an invalid expression. */
+ illegal_brace:
+ if (__glibc_unlikely (!alloca_onealt))
+ free (onealt);
+ flags &= ~GLOB_BRACE;
+ goto no_brace;
+ }
+
+ /* Now find the end of the whole brace expression. */
+ rest = next;
+ while (*rest != '}')
+ {
+ rest = next_brace_sub (rest + 1, flags);
+ if (rest == NULL)
+ /* It is an illegal expression. */
+ goto illegal_brace;
+ }
+ /* Please note that we now can be sure the brace expression
+ is well-formed. */
+ rest_len = strlen (++rest) + 1;
+
+ /* We have a brace expression. BEGIN points to the opening {,
+ NEXT points past the terminator of the first element, and END
+ points past the final }. We will accumulate result names from
+ recursive runs for each brace alternative in the buffer using
+ GLOB_APPEND. */
+ firstc = pglob->gl_pathc;
+
+ p = begin + 1;
+ while (1)
+ {
+ int result;
+
+ /* Construct the new glob expression. */
+ mempcpy (mempcpy (alt_start, p, next - p), rest, rest_len);
+
+ result = __glob (onealt,
+ ((flags & ~(GLOB_NOCHECK | GLOB_NOMAGIC))
+ | GLOB_APPEND),
+ errfunc, pglob);
+
+ /* If we got an error, return it. */
+ if (result && result != GLOB_NOMATCH)
+ {
+ if (__glibc_unlikely (!alloca_onealt))
+ free (onealt);
+ if (!(flags & GLOB_APPEND))
+ {
+ globfree (pglob);
+ pglob->gl_pathc = 0;
+ }
+ return result;
+ }
+
+ if (*next == '}')
+ /* We saw the last entry. */
+ break;
+
+ p = next + 1;
+ next = next_brace_sub (p, flags);
+ assert (next != NULL);
+ }
+
+ if (__glibc_unlikely (!alloca_onealt))
+ free (onealt);
+
+ if (pglob->gl_pathc != firstc)
+ /* We found some entries. */
+ return 0;
+ else if (!(flags & (GLOB_NOCHECK|GLOB_NOMAGIC)))
+ return GLOB_NOMATCH;
+ }
+ }
+
+ no_brace:
+ oldcount = pglob->gl_pathc + pglob->gl_offs;
+
+ /* Find the filename. */
+ filename = strrchr (pattern, '/');
+
+#if defined __MSDOS__ || defined WINDOWS32
+ /* The case of "d:pattern". Since ':' is not allowed in
+ file names, we can safely assume that wherever it
+ happens in pattern, it signals the filename part. This
+ is so we could some day support patterns like "[a-z]:foo". */
+ if (filename == NULL)
+ filename = strchr (pattern, ':');
+#endif /* __MSDOS__ || WINDOWS32 */
+
+ dirname_modified = 0;
+ if (filename == NULL)
+ {
+ /* This can mean two things: a simple name or "~name". The latter
+ case is nothing but a notation for a directory. */
+ if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && pattern[0] == '~')
+ {
+ dirname = (char *) pattern;
+ dirlen = strlen (pattern);
+
+ /* Set FILENAME to NULL as a special flag. This is ugly but
+ other solutions would require much more code. We test for
+ this special case below. */
+ filename = NULL;
+ }
+ else
+ {
+ if (__glibc_unlikely (pattern[0] == '\0'))
+ {
+ dirs.gl_pathv = NULL;
+ goto no_matches;
+ }
+
+ filename = pattern;
+ dirname = (char *) ".";
+ dirlen = 0;
+ }
+ }
+ else if (filename == pattern
+ || (filename == pattern + 1 && pattern[0] == '\\'
+ && (flags & GLOB_NOESCAPE) == 0))
+ {
+ /* "/pattern" or "\\/pattern". */
+ dirname = (char *) "/";
+ dirlen = 1;
+ ++filename;
+ }
+ else
+ {
+ char *newp;
+ dirlen = filename - pattern;
+#if defined __MSDOS__ || defined WINDOWS32
+ if (*filename == ':'
+ || (filename > pattern + 1 && filename[-1] == ':'))
+ {
+ char *drive_spec;
+
+ ++dirlen;
+ drive_spec = __alloca (dirlen + 1);
+ *((char *) mempcpy (drive_spec, pattern, dirlen)) = '\0';
+ /* For now, disallow wildcards in the drive spec, to
+ prevent infinite recursion in glob. */
+ if (__glob_pattern_p (drive_spec, !(flags & GLOB_NOESCAPE)))
+ return GLOB_NOMATCH;
+ /* If this is "d:pattern", we need to copy ':' to DIRNAME
+ as well. If it's "d:/pattern", don't remove the slash
+ from "d:/", since "d:" and "d:/" are not the same.*/
+ }
+#endif
+
+ if (glob_use_alloca (alloca_used, dirlen + 1))
+ newp = alloca_account (dirlen + 1, alloca_used);
+ else
+ {
+ newp = malloc (dirlen + 1);
+ if (newp == NULL)
+ return GLOB_NOSPACE;
+ malloc_dirname = 1;
+ }
+ *((char *) mempcpy (newp, pattern, dirlen)) = '\0';
+ dirname = newp;
+ ++filename;
+
+#if defined __MSDOS__ || defined WINDOWS32
+ bool drive_root = (dirlen > 1
+ && (dirname[dirlen - 1] == ':'
+ || (dirlen > 2 && dirname[dirlen - 2] == ':'
+ && dirname[dirlen - 1] == '/')));
+#else
+ bool drive_root = false;
+#endif
+
+ if (filename[0] == '\0' && dirlen > 1 && !drive_root)
+ /* "pattern/". Expand "pattern", appending slashes. */
+ {
+ int orig_flags = flags;
+ if (!(flags & GLOB_NOESCAPE) && dirname[dirlen - 1] == '\\')
+ {
+ /* "pattern\\/". Remove the final backslash if it hasn't
+ been quoted. */
+ char *p = (char *) &dirname[dirlen - 1];
+
+ while (p > dirname && p[-1] == '\\') --p;
+ if ((&dirname[dirlen] - p) & 1)
+ {
+ *(char *) &dirname[--dirlen] = '\0';
+ flags &= ~(GLOB_NOCHECK | GLOB_NOMAGIC);
+ }
+ }
+ int val = __glob (dirname, flags | GLOB_MARK, errfunc, pglob);
+ if (val == 0)
+ pglob->gl_flags = ((pglob->gl_flags & ~GLOB_MARK)
+ | (flags & GLOB_MARK));
+ else if (val == GLOB_NOMATCH && flags != orig_flags)
+ {
+ /* Make sure globfree (&dirs); is a nop. */
+ dirs.gl_pathv = NULL;
+ flags = orig_flags;
+ oldcount = pglob->gl_pathc + pglob->gl_offs;
+ goto no_matches;
+ }
+ retval = val;
+ goto out;
+ }
+ }
+
+ if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && dirname[0] == '~')
+ {
+ if (dirname[1] == '\0' || dirname[1] == '/'
+ || (!(flags & GLOB_NOESCAPE) && dirname[1] == '\\'
+ && (dirname[2] == '\0' || dirname[2] == '/')))
+ {
+ /* Look up home directory. */
+ char *home_dir = getenv ("HOME");
+ int malloc_home_dir = 0;
+ if (home_dir == NULL || home_dir[0] == '\0')
+ {
+#ifdef WINDOWS32
+ /* Windows NT defines HOMEDRIVE and HOMEPATH. But give
+ preference to HOME, because the user can change HOME. */
+ const char *home_drive = getenv ("HOMEDRIVE");
+ const char *home_path = getenv ("HOMEPATH");
+
+ if (home_drive != NULL && home_path != NULL)
+ {
+ size_t home_drive_len = strlen (home_drive);
+ size_t home_path_len = strlen (home_path);
+ char *mem = alloca (home_drive_len + home_path_len + 1);
+
+ memcpy (mem, home_drive, home_drive_len);
+ memcpy (mem + home_drive_len, home_path, home_path_len + 1);
+ home_dir = mem;
+ }
+ else
+ home_dir = "c:/users/default"; /* poor default */
+#else
+ int err;
+ struct passwd *p;
+ struct passwd pwbuf;
+ struct scratch_buffer s;
+ scratch_buffer_init (&s);
+ while (true)
+ {
+ p = NULL;
+ err = __getlogin_r (s.data, s.length);
+ if (err == 0)
+ {
+# if defined HAVE_GETPWNAM_R || defined _LIBC
+ size_t ssize = strlen (s.data) + 1;
+ char *sdata = s.data;
+ err = getpwnam_r (sdata, &pwbuf, sdata + ssize,
+ s.length - ssize, &p);
+# else
+ p = getpwnam (s.data);
+ if (p == NULL)
+ err = errno;
+# endif
+ }
+ if (err != ERANGE)
+ break;
+ if (!scratch_buffer_grow (&s))
+ {
+ retval = GLOB_NOSPACE;
+ goto out;
+ }
+ }
+ if (err == 0)
+ {
+ home_dir = strdup (p->pw_dir);
+ malloc_home_dir = 1;
+ }
+ scratch_buffer_free (&s);
+ if (err == 0 && home_dir == NULL)
+ {
+ retval = GLOB_NOSPACE;
+ goto out;
+ }
+#endif /* WINDOWS32 */
+ }
+ if (home_dir == NULL || home_dir[0] == '\0')
+ {
+ if (__glibc_unlikely (malloc_home_dir))
+ free (home_dir);
+ if (flags & GLOB_TILDE_CHECK)
+ {
+ retval = GLOB_NOMATCH;
+ goto out;
+ }
+ else
+ {
+ home_dir = (char *) "~"; /* No luck. */
+ malloc_home_dir = 0;
+ }
+ }
+ /* Now construct the full directory. */
+ if (dirname[1] == '\0')
+ {
+ if (__glibc_unlikely (malloc_dirname))
+ free (dirname);
+
+ dirname = home_dir;
+ dirlen = strlen (dirname);
+ malloc_dirname = malloc_home_dir;
+ }
+ else
+ {
+ char *newp;
+ size_t home_len = strlen (home_dir);
+ int use_alloca = glob_use_alloca (alloca_used, home_len + dirlen);
+ if (use_alloca)
+ newp = alloca_account (home_len + dirlen, alloca_used);
+ else
+ {
+ newp = malloc (home_len + dirlen);
+ if (newp == NULL)
+ {
+ if (__glibc_unlikely (malloc_home_dir))
+ free (home_dir);
+ retval = GLOB_NOSPACE;
+ goto out;
+ }
+ }
+
+ mempcpy (mempcpy (newp, home_dir, home_len),
+ &dirname[1], dirlen);
+
+ if (__glibc_unlikely (malloc_dirname))
+ free (dirname);
+
+ dirname = newp;
+ dirlen += home_len - 1;
+ malloc_dirname = !use_alloca;
+
+ if (__glibc_unlikely (malloc_home_dir))
+ free (home_dir);
+ }
+ dirname_modified = 1;
+ }
+ else
+ {
+#ifndef WINDOWS32
+ /* Recognize ~user as a shorthand for the specified user's home
+ directory. */
+ char *end_name = strchr (dirname, '/');
+ char *user_name;
+ int malloc_user_name = 0;
+ char *unescape = NULL;
+
+ if (!(flags & GLOB_NOESCAPE))
+ {
+ if (end_name == NULL)
+ {
+ unescape = strchr (dirname, '\\');
+ if (unescape)
+ end_name = strchr (unescape, '\0');
+ }
+ else
+ unescape = memchr (dirname, '\\', end_name - dirname);
+ }
+ if (end_name == NULL)
+ user_name = dirname + 1;
+ else
+ {
+ char *newp;
+ if (glob_use_alloca (alloca_used, end_name - dirname))
+ newp = alloca_account (end_name - dirname, alloca_used);
+ else
+ {
+ newp = malloc (end_name - dirname);
+ if (newp == NULL)
+ {
+ retval = GLOB_NOSPACE;
+ goto out;
+ }
+ malloc_user_name = 1;
+ }
+ if (unescape != NULL)
+ {
+ char *p = mempcpy (newp, dirname + 1,
+ unescape - dirname - 1);
+ char *q = unescape;
+ while (q != end_name)
+ {
+ if (*q == '\\')
+ {
+ if (q + 1 == end_name)
+ {
+ /* "~fo\\o\\" unescape to user_name "foo\\",
+ but "~fo\\o\\/" unescape to user_name
+ "foo". */
+ if (filename == NULL)
+ *p++ = '\\';
+ break;
+ }
+ ++q;
+ }
+ *p++ = *q++;
+ }
+ *p = '\0';
+ }
+ else
+ *((char *) mempcpy (newp, dirname + 1, end_name - dirname - 1))
+ = '\0';
+ user_name = newp;
+ }
+
+ /* Look up specific user's home directory. */
+ {
+ struct passwd *p;
+ struct scratch_buffer pwtmpbuf;
+ scratch_buffer_init (&pwtmpbuf);
+
+# if defined HAVE_GETPWNAM_R || defined _LIBC
+ struct passwd pwbuf;
+
+ while (getpwnam_r (user_name, &pwbuf,
+ pwtmpbuf.data, pwtmpbuf.length, &p)
+ == ERANGE)
+ {
+ if (!scratch_buffer_grow (&pwtmpbuf))
+ {
+ retval = GLOB_NOSPACE;
+ goto out;
+ }
+ }
+# else
+ p = getpwnam (user_name);
+# endif
+
+ if (__glibc_unlikely (malloc_user_name))
+ free (user_name);
+
+ /* If we found a home directory use this. */
+ if (p != NULL)
+ {
+ size_t home_len = strlen (p->pw_dir);
+ size_t rest_len = end_name == NULL ? 0 : strlen (end_name);
+ /* dirname contains end_name; we can't free it now. */
+ char *prev_dirname =
+ (__glibc_unlikely (malloc_dirname) ? dirname : NULL);
+ char *d;
+
+ malloc_dirname = 0;
+
+ if (glob_use_alloca (alloca_used, home_len + rest_len + 1))
+ dirname = alloca_account (home_len + rest_len + 1,
+ alloca_used);
+ else
+ {
+ dirname = malloc (home_len + rest_len + 1);
+ if (dirname == NULL)
+ {
+ free (prev_dirname);
+ scratch_buffer_free (&pwtmpbuf);
+ retval = GLOB_NOSPACE;
+ goto out;
+ }
+ malloc_dirname = 1;
+ }
+ d = mempcpy (dirname, p->pw_dir, home_len);
+ if (end_name != NULL)
+ d = mempcpy (d, end_name, rest_len);
+ *d = '\0';
+
+ free (prev_dirname);
+
+ dirlen = home_len + rest_len;
+ dirname_modified = 1;
+ }
+ else
+ {
+ if (flags & GLOB_TILDE_CHECK)
+ {
+ /* We have to regard it as an error if we cannot find the
+ home directory. */
+ retval = GLOB_NOMATCH;
+ goto out;
+ }
+ }
+ scratch_buffer_free (&pwtmpbuf);
+ }
+#else /* WINDOWS32 */
+ /* On native Windows, access to a user's home directory
+ (via GetUserProfileDirectory) or to a user's environment
+ variables (via ExpandEnvironmentStringsForUser) requires
+ the credentials of the user. Therefore we cannot support
+ the ~user syntax on this platform.
+ Handling ~user specially (and treat it like plain ~) if
+ user is getenv ("USERNAME") would not be a good idea,
+ since it would make people think that ~user is supported
+ in general. */
+ if (flags & GLOB_TILDE_CHECK)
+ {
+ retval = GLOB_NOMATCH;
+ goto out;
+ }
+#endif /* WINDOWS32 */
+ }
+ }
+
+ /* Now test whether we looked for "~" or "~NAME". In this case we
+ can give the answer now. */
+ if (filename == NULL)
+ {
+ size_t newcount = pglob->gl_pathc + pglob->gl_offs;
+ char **new_gl_pathv;
+
+ if (newcount > SIZE_MAX / sizeof (char *) - 2)
+ {
+ nospace:
+ free (pglob->gl_pathv);
+ pglob->gl_pathv = NULL;
+ pglob->gl_pathc = 0;
+ retval = GLOB_NOSPACE;
+ goto out;
+ }
+
+ new_gl_pathv = realloc (pglob->gl_pathv,
+ (newcount + 2) * sizeof (char *));
+ if (new_gl_pathv == NULL)
+ goto nospace;
+ pglob->gl_pathv = new_gl_pathv;
+
+ if (flags & GLOB_MARK && is_dir (dirname, flags, pglob))
+ {
+ char *p;
+ pglob->gl_pathv[newcount] = malloc (dirlen + 2);
+ if (pglob->gl_pathv[newcount] == NULL)
+ goto nospace;
+ p = mempcpy (pglob->gl_pathv[newcount], dirname, dirlen);
+ p[0] = '/';
+ p[1] = '\0';
+ if (__glibc_unlikely (malloc_dirname))
+ free (dirname);
+ }
+ else
+ {
+ if (__glibc_unlikely (malloc_dirname))
+ pglob->gl_pathv[newcount] = dirname;
+ else
+ {
+ pglob->gl_pathv[newcount] = strdup (dirname);
+ if (pglob->gl_pathv[newcount] == NULL)
+ goto nospace;
+ }
+ }
+ pglob->gl_pathv[++newcount] = NULL;
+ ++pglob->gl_pathc;
+ pglob->gl_flags = flags;
+
+ return 0;
+ }
+
+ meta = __glob_pattern_type (dirname, !(flags & GLOB_NOESCAPE));
+ /* meta is 1 if correct glob pattern containing metacharacters.
+ If meta has bit (1 << 2) set, it means there was an unterminated
+ [ which we handle the same, using fnmatch. Broken unterminated
+ pattern bracket expressions ought to be rare enough that it is
+ not worth special casing them, fnmatch will do the right thing. */
+ if (meta & (GLOBPAT_SPECIAL | GLOBPAT_BRACKET))
+ {
+ /* The directory name contains metacharacters, so we
+ have to glob for the directory, and then glob for
+ the pattern in each directory found. */
+ size_t i;
+
+ if (!(flags & GLOB_NOESCAPE) && dirlen > 0 && dirname[dirlen - 1] == '\\')
+ {
+ /* "foo\\/bar". Remove the final backslash from dirname
+ if it has not been quoted. */
+ char *p = (char *) &dirname[dirlen - 1];
+
+ while (p > dirname && p[-1] == '\\') --p;
+ if ((&dirname[dirlen] - p) & 1)
+ *(char *) &dirname[--dirlen] = '\0';
+ }
+
+ if (__glibc_unlikely ((flags & GLOB_ALTDIRFUNC) != 0))
+ {
+ /* Use the alternative access functions also in the recursive
+ call. */
+ dirs.gl_opendir = pglob->gl_opendir;
+ dirs.gl_readdir = pglob->gl_readdir;
+ dirs.gl_closedir = pglob->gl_closedir;
+ dirs.gl_stat = pglob->gl_stat;
+ dirs.gl_lstat = pglob->gl_lstat;
+ }
+
+ status = __glob (dirname,
+ ((flags & (GLOB_ERR | GLOB_NOESCAPE | GLOB_ALTDIRFUNC))
+ | GLOB_NOSORT | GLOB_ONLYDIR),
+ errfunc, &dirs);
+ if (status != 0)
+ {
+ if ((flags & GLOB_NOCHECK) == 0 || status != GLOB_NOMATCH)
+ {
+ retval = status;
+ goto out;
+ }
+ goto no_matches;
+ }
+
+ /* We have successfully globbed the preceding directory name.
+ For each name we found, call glob_in_dir on it and FILENAME,
+ appending the results to PGLOB. */
+ for (i = 0; i < dirs.gl_pathc; ++i)
+ {
+ size_t old_pathc;
+
+ old_pathc = pglob->gl_pathc;
+ status = glob_in_dir (filename, dirs.gl_pathv[i],
+ ((flags | GLOB_APPEND)
+ & ~(GLOB_NOCHECK | GLOB_NOMAGIC)),
+ errfunc, pglob, alloca_used);
+ if (status == GLOB_NOMATCH)
+ /* No matches in this directory. Try the next. */
+ continue;
+
+ if (status != 0)
+ {
+ globfree (&dirs);
+ globfree (pglob);
+ pglob->gl_pathc = 0;
+ retval = status;
+ goto out;
+ }
+
+ /* Stick the directory on the front of each name. */
+ if (prefix_array (dirs.gl_pathv[i],
+ &pglob->gl_pathv[old_pathc + pglob->gl_offs],
+ pglob->gl_pathc - old_pathc))
+ {
+ globfree (&dirs);
+ globfree (pglob);
+ pglob->gl_pathc = 0;
+ retval = GLOB_NOSPACE;
+ goto out;
+ }
+ }
+
+ flags |= GLOB_MAGCHAR;
+
+ /* We have ignored the GLOB_NOCHECK flag in the 'glob_in_dir' calls.
+ But if we have not found any matching entry and the GLOB_NOCHECK
+ flag was set we must return the input pattern itself. */
+ if (pglob->gl_pathc + pglob->gl_offs == oldcount)
+ {
+ no_matches:
+ /* No matches. */
+ if (flags & GLOB_NOCHECK)
+ {
+ size_t newcount = pglob->gl_pathc + pglob->gl_offs;
+ char **new_gl_pathv;
+
+ if (newcount > SIZE_MAX / sizeof (char *) - 2)
+ {
+ nospace2:
+ globfree (&dirs);
+ retval = GLOB_NOSPACE;
+ goto out;
+ }
+
+ new_gl_pathv = realloc (pglob->gl_pathv,
+ (newcount + 2) * sizeof (char *));
+ if (new_gl_pathv == NULL)
+ goto nospace2;
+ pglob->gl_pathv = new_gl_pathv;
+
+ pglob->gl_pathv[newcount] = strdup (pattern);
+ if (pglob->gl_pathv[newcount] == NULL)
+ {
+ globfree (&dirs);
+ globfree (pglob);
+ pglob->gl_pathc = 0;
+ retval = GLOB_NOSPACE;
+ goto out;
+ }
+
+ ++pglob->gl_pathc;
+ ++newcount;
+
+ pglob->gl_pathv[newcount] = NULL;
+ pglob->gl_flags = flags;
+ }
+ else
+ {
+ globfree (&dirs);
+ retval = GLOB_NOMATCH;
+ goto out;
+ }
+ }
+
+ globfree (&dirs);
+ }
+ else
+ {
+ size_t old_pathc = pglob->gl_pathc;
+ int orig_flags = flags;
+
+ if (meta & GLOBPAT_BACKSLASH)
+ {
+ char *p = strchr (dirname, '\\'), *q;
+ /* We need to unescape the dirname string. It is certainly
+ allocated by alloca, as otherwise filename would be NULL
+ or dirname wouldn't contain backslashes. */
+ q = p;
+ do
+ {
+ if (*p == '\\')
+ {
+ *q = *++p;
+ --dirlen;
+ }
+ else
+ *q = *p;
+ ++q;
+ }
+ while (*p++ != '\0');
+ dirname_modified = 1;
+ }
+ if (dirname_modified)
+ flags &= ~(GLOB_NOCHECK | GLOB_NOMAGIC);
+ status = glob_in_dir (filename, dirname, flags, errfunc, pglob,
+ alloca_used);
+ if (status != 0)
+ {
+ if (status == GLOB_NOMATCH && flags != orig_flags
+ && pglob->gl_pathc + pglob->gl_offs == oldcount)
+ {
+ /* Make sure globfree (&dirs); is a nop. */
+ dirs.gl_pathv = NULL;
+ flags = orig_flags;
+ goto no_matches;
+ }
+ retval = status;
+ goto out;
+ }
+
+ if (dirlen > 0)
+ {
+ /* Stick the directory on the front of each name. */
+ if (prefix_array (dirname,
+ &pglob->gl_pathv[old_pathc + pglob->gl_offs],
+ pglob->gl_pathc - old_pathc))
+ {
+ globfree (pglob);
+ pglob->gl_pathc = 0;
+ retval = GLOB_NOSPACE;
+ goto out;
+ }
+ }
+ }
+
+ if (flags & GLOB_MARK)
+ {
+ /* Append slashes to directory names. */
+ size_t i;
+
+ for (i = oldcount; i < pglob->gl_pathc + pglob->gl_offs; ++i)
+ if (is_dir (pglob->gl_pathv[i], flags, pglob))
+ {
+ size_t len = strlen (pglob->gl_pathv[i]) + 2;
+ char *new = realloc (pglob->gl_pathv[i], len);
+ if (new == NULL)
+ {
+ globfree (pglob);
+ pglob->gl_pathc = 0;
+ retval = GLOB_NOSPACE;
+ goto out;
+ }
+ strcpy (&new[len - 2], "/");
+ pglob->gl_pathv[i] = new;
+ }
+ }
+
+ if (!(flags & GLOB_NOSORT))
+ {
+ /* Sort the vector. */
+ qsort (&pglob->gl_pathv[oldcount],
+ pglob->gl_pathc + pglob->gl_offs - oldcount,
+ sizeof (char *), collated_compare);
+ }
+
+ out:
+ if (__glibc_unlikely (malloc_dirname))
+ free (dirname);
+
+ return retval;
+}
+#if defined _LIBC && !defined __glob
+versioned_symbol (libc, __glob, glob, GLIBC_2_27);
+libc_hidden_ver (__glob, glob)
+#endif
+
+
+/* Do a collated comparison of A and B. */
+static int
+collated_compare (const void *a, const void *b)
+{
+ char *const *ps1 = a; char *s1 = *ps1;
+ char *const *ps2 = b; char *s2 = *ps2;
+
+ if (s1 == s2)
+ return 0;
+ if (s1 == NULL)
+ return 1;
+ if (s2 == NULL)
+ return -1;
+ return strcoll (s1, s2);
+}
+
+
+/* Prepend DIRNAME to each of N members of ARRAY, replacing ARRAY's
+ elements in place. Return nonzero if out of memory, zero if successful.
+ A slash is inserted between DIRNAME and each elt of ARRAY,
+ unless DIRNAME is just "/". Each old element of ARRAY is freed. */
+static int
+prefix_array (const char *dirname, char **array, size_t n)
+{
+ size_t i;
+ size_t dirlen = strlen (dirname);
+ char dirsep_char = '/';
+
+ if (dirlen == 1 && dirname[0] == '/')
+ /* DIRNAME is just "/", so normal prepending would get us "//foo".
+ We want "/foo" instead, so don't prepend any chars from DIRNAME. */
+ dirlen = 0;
+
+#if defined __MSDOS__ || defined WINDOWS32
+ if (dirlen > 1)
+ {
+ if (dirname[dirlen - 1] == '/' && dirname[dirlen - 2] == ':')
+ /* DIRNAME is "d:/". Don't prepend the slash from DIRNAME. */
+ --dirlen;
+ else if (dirname[dirlen - 1] == ':')
+ {
+ /* DIRNAME is "d:". Use ':' instead of '/'. */
+ --dirlen;
+ dirsep_char = ':';
+ }
+ }
+#endif
+
+ for (i = 0; i < n; ++i)
+ {
+ size_t eltlen = strlen (array[i]) + 1;
+ char *new = malloc (dirlen + 1 + eltlen);
+ if (new == NULL)
+ {
+ while (i > 0)
+ free (array[--i]);
+ return 1;
+ }
+
+ {
+ char *endp = mempcpy (new, dirname, dirlen);
+ *endp++ = dirsep_char;
+ mempcpy (endp, array[i], eltlen);
+ }
+ free (array[i]);
+ array[i] = new;
+ }
+
+ return 0;
+}
+
+/* Like 'glob', but PATTERN is a final pathname component,
+ and matches are searched for in DIRECTORY.
+ The GLOB_NOSORT bit in FLAGS is ignored. No sorting is ever done.
+ The GLOB_APPEND flag is assumed to be set (always appends). */
+static int
+glob_in_dir (const char *pattern, const char *directory, int flags,
+ int (*errfunc) (const char *, int),
+ glob_t *pglob, size_t alloca_used)
+{
+ size_t dirlen = strlen (directory);
+ void *stream = NULL;
+ struct scratch_buffer s;
+ scratch_buffer_init (&s);
+# define GLOBNAMES_MEMBERS(nnames) \
+ struct globnames *next; size_t count; char *name[nnames];
+ struct globnames { GLOBNAMES_MEMBERS (FLEXIBLE_ARRAY_MEMBER) };
+ struct { GLOBNAMES_MEMBERS (64) } init_names_buf;
+ struct globnames *init_names = (struct globnames *) &init_names_buf;
+ struct globnames *names = init_names;
+ struct globnames *names_alloca = init_names;
+ size_t nfound = 0;
+ size_t cur = 0;
+ int meta;
+ int save;
+ int result;
+
+ alloca_used += sizeof init_names_buf;
+
+ init_names->next = NULL;
+ init_names->count = ((sizeof init_names_buf
+ - offsetof (struct globnames, name))
+ / sizeof init_names->name[0]);
+
+ meta = __glob_pattern_type (pattern, !(flags & GLOB_NOESCAPE));
+ if (meta == GLOBPAT_NONE && (flags & (GLOB_NOCHECK|GLOB_NOMAGIC)))
+ {
+ /* We need not do any tests. The PATTERN contains no meta
+ characters and we must not return an error therefore the
+ result will always contain exactly one name. */
+ flags |= GLOB_NOCHECK;
+ }
+ else if (meta == GLOBPAT_NONE)
+ {
+ size_t patlen = strlen (pattern);
+ size_t fullsize;
+ bool alloca_fullname
+ = (! size_add_wrapv (dirlen + 1, patlen + 1, &fullsize)
+ && glob_use_alloca (alloca_used, fullsize));
+ char *fullname;
+ if (alloca_fullname)
+ fullname = alloca_account (fullsize, alloca_used);
+ else
+ {
+ fullname = malloc (fullsize);
+ if (fullname == NULL)
+ return GLOB_NOSPACE;
+ }
+
+ mempcpy (mempcpy (mempcpy (fullname, directory, dirlen),
+ "/", 1),
+ pattern, patlen + 1);
+ if (glob_lstat (pglob, flags, fullname) == 0
+ || errno == EOVERFLOW)
+ /* We found this file to be existing. Now tell the rest
+ of the function to copy this name into the result. */
+ flags |= GLOB_NOCHECK;
+
+ if (__glibc_unlikely (!alloca_fullname))
+ free (fullname);
+ }
+ else
+ {
+ stream = (__builtin_expect (flags & GLOB_ALTDIRFUNC, 0)
+ ? (*pglob->gl_opendir) (directory)
+ : opendir (directory));
+ if (stream == NULL)
+ {
+ if (errno != ENOTDIR
+ && ((errfunc != NULL && (*errfunc) (directory, errno))
+ || (flags & GLOB_ERR)))
+ return GLOB_ABORTED;
+ }
+ else
+ {
+ DIR *dirp = stream;
+ int dfd = dirfd (dirp);
+ int fnm_flags = ((!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0)
+ | ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0));
+ flags |= GLOB_MAGCHAR;
+
+ while (1)
+ {
+ struct readdir_result d;
+ {
+ if (__builtin_expect (flags & GLOB_ALTDIRFUNC, 0))
+ d = convert_dirent (GL_READDIR (pglob, stream));
+ else
+ {
+#ifdef COMPILE_GLOB64
+ d = convert_dirent (__readdir (stream));
+#else
+ d = convert_dirent64 (__readdir64 (stream));
+#endif
+ }
+ }
+ if (d.name == NULL)
+ break;
+
+ /* If we shall match only directories use the information
+ provided by the dirent call if possible. */
+ if (flags & GLOB_ONLYDIR)
+ switch (readdir_result_type (d))
+ {
+ default: continue;
+ case DT_DIR: break;
+ case DT_LNK: case DT_UNKNOWN:
+ /* The filesystem was too lazy to give us a hint,
+ so we have to do it the hard way. */
+ if (__glibc_unlikely (dfd < 0 || flags & GLOB_ALTDIRFUNC))
+ {
+ size_t namelen = strlen (d.name);
+ size_t need = dirlen + 1 + namelen + 1;
+ if (s.length < need
+ && !scratch_buffer_set_array_size (&s, need, 1))
+ goto memory_error;
+ char *p = mempcpy (s.data, directory, dirlen);
+ *p = '/';
+ p += p[-1] != '/';
+ memcpy (p, d.name, namelen + 1);
+ if (! is_dir (s.data, flags, pglob))
+ continue;
+ }
+ else
+ {
+ struct_stat64 st64;
+ if (! (GLOB_FSTATAT64 (dfd, d.name, &st64, 0) == 0
+ && S_ISDIR (st64.st_mode)))
+ continue;
+ }
+ }
+
+ if (fnmatch (pattern, d.name, fnm_flags) == 0)
+ {
+ if (cur == names->count)
+ {
+ struct globnames *newnames;
+ size_t count = names->count * 2;
+ size_t nameoff = offsetof (struct globnames, name);
+ size_t size = FLEXSIZEOF (struct globnames, name,
+ count * sizeof (char *));
+ if ((SIZE_MAX - nameoff) / 2 / sizeof (char *)
+ < names->count)
+ goto memory_error;
+ if (glob_use_alloca (alloca_used, size))
+ newnames = names_alloca
+ = alloca_account (size, alloca_used);
+ else if ((newnames = malloc (size))
+ == NULL)
+ goto memory_error;
+ newnames->count = count;
+ newnames->next = names;
+ names = newnames;
+ cur = 0;
+ }
+ names->name[cur] = strdup (d.name);
+ if (names->name[cur] == NULL)
+ goto memory_error;
+ ++cur;
+ ++nfound;
+ if (SIZE_MAX - pglob->gl_offs <= nfound)
+ goto memory_error;
+ }
+ }
+ }
+ }
+
+ if (nfound == 0 && (flags & GLOB_NOCHECK))
+ {
+ size_t len = strlen (pattern);
+ nfound = 1;
+ names->name[cur] = malloc (len + 1);
+ if (names->name[cur] == NULL)
+ goto memory_error;
+ *((char *) mempcpy (names->name[cur++], pattern, len)) = '\0';
+ }
+
+ result = GLOB_NOMATCH;
+ if (nfound != 0)
+ {
+ char **new_gl_pathv;
+ result = 0;
+
+ if (SIZE_MAX / sizeof (char *) - pglob->gl_pathc
+ < pglob->gl_offs + nfound + 1)
+ goto memory_error;
+
+ new_gl_pathv
+ = realloc (pglob->gl_pathv,
+ (pglob->gl_pathc + pglob->gl_offs + nfound + 1)
+ * sizeof (char *));
+
+ if (new_gl_pathv == NULL)
+ {
+ memory_error:
+ while (1)
+ {
+ struct globnames *old = names;
+ for (size_t i = 0; i < cur; ++i)
+ free (names->name[i]);
+ names = names->next;
+ /* NB: we will not leak memory here if we exit without
+ freeing the current block assigned to OLD. At least
+ the very first block is always allocated on the stack
+ and this is the block assigned to OLD here. */
+ if (names == NULL)
+ {
+ assert (old == init_names);
+ break;
+ }
+ cur = names->count;
+ if (old == names_alloca)
+ names_alloca = names;
+ else
+ free (old);
+ }
+ result = GLOB_NOSPACE;
+ }
+ else
+ {
+ while (1)
+ {
+ struct globnames *old = names;
+ for (size_t i = 0; i < cur; ++i)
+ new_gl_pathv[pglob->gl_offs + pglob->gl_pathc++]
+ = names->name[i];
+ names = names->next;
+ /* NB: we will not leak memory here if we exit without
+ freeing the current block assigned to OLD. At least
+ the very first block is always allocated on the stack
+ and this is the block assigned to OLD here. */
+ if (names == NULL)
+ {
+ assert (old == init_names);
+ break;
+ }
+ cur = names->count;
+ if (old == names_alloca)
+ names_alloca = names;
+ else
+ free (old);
+ }
+
+ pglob->gl_pathv = new_gl_pathv;
+
+ pglob->gl_pathv[pglob->gl_offs + pglob->gl_pathc] = NULL;
+
+ pglob->gl_flags = flags;
+ }
+ }
+
+ if (stream != NULL)
+ {
+ save = errno;
+ if (__glibc_unlikely (flags & GLOB_ALTDIRFUNC))
+ (*pglob->gl_closedir) (stream);
+ else
+ closedir (stream);
+ __set_errno (save);
+ }
+
+ scratch_buffer_free (&s);
+ return result;
+}
diff --git a/gl/lib/glob.in.h b/gl/lib/glob.in.h
new file mode 100644
index 0000000..a0a3156
--- /dev/null
+++ b/gl/lib/glob.in.h
@@ -0,0 +1,177 @@
+/* glob.h -- Find a path matching a pattern.
+
+ Copyright (C) 2005-2007, 2009-2022 Free Software Foundation, Inc.
+
+ Written by Derek Price <derek@ximbiot.com> & Paul Eggert <eggert@CS.UCLA.EDU>
+
+ 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 2.1 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/>. */
+
+#ifndef _@GUARD_PREFIX@_GLOB_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_GLOB_H@ && !@REPLACE_GLOB@
+# @INCLUDE_NEXT@ @NEXT_GLOB_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_GLOB_H
+#define _@GUARD_PREFIX@_GLOB_H
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* For plain 'restrict', use glibc's __restrict if defined.
+ Otherwise, GCC 2.95 and later have "__restrict"; C99 compilers have
+ "restrict", and "configure" may have defined "restrict".
+ Other compilers use __restrict, __restrict__, and _Restrict, and
+ 'configure' might #define 'restrict' to those words, so pick a
+ different name. */
+#ifndef _Restrict_
+# if defined __restrict \
+ || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \
+ || __clang_major__ >= 3
+# define _Restrict_ __restrict
+# elif 199901L <= __STDC_VERSION__ || defined restrict
+# define _Restrict_ restrict
+# else
+# define _Restrict_
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (*_gl_glob_errfunc_fn) (const char *, int);
+#ifdef __cplusplus
+}
+#endif
+
+
+#if !@HAVE_GLOB_H@ || @REPLACE_GLOB@
+
+
+/* Preparations for including the standard GNU C Library header. */
+
+# include <stddef.h>
+
+/* On some systems, such as AIX 5.1, <sys/stat.h> does a "#define stat stat64".
+ Make sure this definition is seen before glob-libc.h defines types that
+ rely on 'struct stat'. */
+# include <sys/stat.h>
+
+# if @REPLACE_GLOB@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define glob rpl_glob
+# define globfree rpl_globfree
+# endif
+# endif
+# if @REPLACE_GLOB_PATTERN_P@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define glob_pattern_p rpl_glob_pattern_p
+# endif
+# endif
+# define __glob_pattern_p glob_pattern_p
+
+# define __GLOB_GNULIB 1
+
+
+/* Now the standard GNU C Library header should work. */
+# include "glob-libc.gl.h"
+
+
+#endif
+
+
+#if @GNULIB_GLOB@
+# if @REPLACE_GLOB@
+_GL_FUNCDECL_RPL (glob, int, (const char *_Restrict_ __pattern, int __flags,
+ _gl_glob_errfunc_fn __errfunc,
+ glob_t *_Restrict_ __pglob)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (glob, int, (const char *_Restrict_ __pattern, int __flags,
+ _gl_glob_errfunc_fn __errfunc,
+ glob_t *_Restrict_ __pglob));
+# else
+# if !@HAVE_GLOB@
+_GL_FUNCDECL_SYS (glob, int, (const char *_Restrict_ __pattern, int __flags,
+ _gl_glob_errfunc_fn __errfunc,
+ glob_t *_Restrict_ __pglob)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (glob, int, (const char *_Restrict_ __pattern, int __flags,
+ _gl_glob_errfunc_fn __errfunc,
+ glob_t *_Restrict_ __pglob));
+# endif
+_GL_CXXALIASWARN (glob);
+#elif defined GNULIB_POSIXCHECK
+# undef glob
+# if HAVE_RAW_DECL_GLOB
+_GL_WARN_ON_USE (glob,
+ "glob is unportable - "
+ "use gnulib module glob for portability");
+# endif
+#endif
+
+#if @GNULIB_GLOB@
+# if @REPLACE_GLOB@
+_GL_FUNCDECL_RPL (globfree, void, (glob_t *__pglob) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (globfree, void, (glob_t *__pglob));
+# else
+# if !@HAVE_GLOB@
+_GL_FUNCDECL_SYS (globfree, void, (glob_t *__pglob) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (globfree, void, (glob_t *__pglob));
+# endif
+_GL_CXXALIASWARN (globfree);
+#elif defined GNULIB_POSIXCHECK
+# undef globfree
+# if HAVE_RAW_DECL_GLOBFREE
+_GL_WARN_ON_USE (globfree,
+ "globfree is unportable - "
+ "use gnulib module glob for portability");
+# endif
+#endif
+
+#if @GNULIB_GLOB@
+# if @REPLACE_GLOB_PATTERN_P@
+_GL_FUNCDECL_RPL (glob_pattern_p, int, (const char *__pattern, int __quote)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (glob_pattern_p, int, (const char *__pattern, int __quote));
+# else
+# if !@HAVE_GLOB_PATTERN_P@
+_GL_FUNCDECL_SYS (glob_pattern_p, int, (const char *__pattern, int __quote)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (glob_pattern_p, int, (const char *__pattern, int __quote));
+# endif
+_GL_CXXALIASWARN (glob_pattern_p);
+#elif defined GNULIB_POSIXCHECK
+# undef glob_pattern_p
+# if HAVE_RAW_DECL_GLOB_PATTERN_P
+_GL_WARN_ON_USE (glob_pattern_p,
+ "glob_pattern_p is unportable - "
+ "use gnulib module glob for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_GLOB_H */
+#endif /* _@GUARD_PREFIX@_GLOB_H */
diff --git a/gl/lib/glob_internal.h b/gl/lib/glob_internal.h
new file mode 100644
index 0000000..bd02392
--- /dev/null
+++ b/gl/lib/glob_internal.h
@@ -0,0 +1,65 @@
+/* Shared definition for glob and glob_pattern_p.
+ Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef GLOB_INTERNAL_H
+# define GLOB_INTERNAL_H
+
+enum
+{
+ GLOBPAT_NONE = 0x0,
+ GLOBPAT_SPECIAL = 0x1,
+ GLOBPAT_BACKSLASH = 0x2,
+ GLOBPAT_BRACKET = 0x4
+};
+
+static inline int
+__glob_pattern_type (const char *pattern, int quote)
+{
+ const char *p;
+ int ret = GLOBPAT_NONE;
+
+ for (p = pattern; *p != '\0'; ++p)
+ switch (*p)
+ {
+ case '?':
+ case '*':
+ return GLOBPAT_SPECIAL;
+
+ case '\\':
+ if (quote)
+ {
+ if (p[1] != '\0')
+ ++p;
+ ret |= GLOBPAT_BACKSLASH;
+ }
+ break;
+
+ case '[':
+ ret |= GLOBPAT_BRACKET;
+ break;
+
+ case ']':
+ if (ret & 4)
+ return GLOBPAT_SPECIAL;
+ break;
+ }
+
+ return ret;
+}
+
+#endif /* GLOB_INTERNAL_H */
diff --git a/gl/lib/glob_pattern_p.c b/gl/lib/glob_pattern_p.c
new file mode 100644
index 0000000..4044a50
--- /dev/null
+++ b/gl/lib/glob_pattern_p.c
@@ -0,0 +1,33 @@
+/* Return nonzero if PATTERN contains any metacharacters.
+ Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <glob.h>
+#include "glob_internal.h"
+
+/* Return nonzero if PATTERN contains any metacharacters.
+ Metacharacters can be quoted with backslashes if QUOTE is nonzero. */
+int
+__glob_pattern_p (const char *pattern, int quote)
+{
+ return __glob_pattern_type (pattern, quote) == GLOBPAT_SPECIAL;
+}
+weak_alias (__glob_pattern_p, glob_pattern_p)
diff --git a/gl/lib/globfree.c b/gl/lib/globfree.c
new file mode 100644
index 0000000..f034bec
--- /dev/null
+++ b/gl/lib/globfree.c
@@ -0,0 +1,41 @@
+/* Frees the dynamically allocated storage from an earlier call to glob.
+ Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <glob.h>
+#include <stdlib.h>
+
+/* Free storage allocated in PGLOB by a previous `glob' call. */
+void
+globfree (glob_t *pglob)
+{
+ if (pglob->gl_pathv != NULL)
+ {
+ size_t i;
+ for (i = 0; i < pglob->gl_pathc; ++i)
+ free (pglob->gl_pathv[pglob->gl_offs + i]);
+ free (pglob->gl_pathv);
+ pglob->gl_pathv = NULL;
+ }
+}
+#ifndef globfree
+libc_hidden_def (globfree)
+#endif
diff --git a/gl/lib/glthread/lock.c b/gl/lib/glthread/lock.c
new file mode 100644
index 0000000..b650c21
--- /dev/null
+++ b/gl/lib/glthread/lock.c
@@ -0,0 +1,749 @@
+/* Locking in multithreaded situations.
+ Copyright (C) 2005-2022 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 2.1 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>, 2005.
+ Based on GCC's gthr-posix.h, gthr-posix95.h. */
+
+#include <config.h>
+
+#include "glthread/lock.h"
+
+/* ========================================================================= */
+
+#if USE_ISOC_THREADS || USE_ISOC_AND_POSIX_THREADS
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+int
+glthread_lock_init (gl_lock_t *lock)
+{
+ if (mtx_init (&lock->mutex, mtx_plain) != thrd_success)
+ return ENOMEM;
+ lock->init_needed = 0;
+ return 0;
+}
+
+int
+glthread_lock_lock (gl_lock_t *lock)
+{
+ if (lock->init_needed)
+ call_once (&lock->init_once, lock->init_func);
+ if (mtx_lock (&lock->mutex) != thrd_success)
+ return EAGAIN;
+ return 0;
+}
+
+int
+glthread_lock_unlock (gl_lock_t *lock)
+{
+ if (lock->init_needed)
+ call_once (&lock->init_once, lock->init_func);
+ if (mtx_unlock (&lock->mutex) != thrd_success)
+ return EINVAL;
+ return 0;
+}
+
+int
+glthread_lock_destroy (gl_lock_t *lock)
+{
+ if (lock->init_needed)
+ call_once (&lock->init_once, lock->init_func);
+ mtx_destroy (&lock->mutex);
+ return 0;
+}
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+int
+glthread_rwlock_init (gl_rwlock_t *lock)
+{
+ if (mtx_init (&lock->lock, mtx_plain) != thrd_success
+ || cnd_init (&lock->waiting_readers) != thrd_success
+ || cnd_init (&lock->waiting_writers) != thrd_success)
+ return ENOMEM;
+ lock->waiting_writers_count = 0;
+ lock->runcount = 0;
+ lock->init_needed = 0;
+ return 0;
+}
+
+int
+glthread_rwlock_rdlock (gl_rwlock_t *lock)
+{
+ if (lock->init_needed)
+ call_once (&lock->init_once, lock->init_func);
+ if (mtx_lock (&lock->lock) != thrd_success)
+ return EAGAIN;
+ /* Test whether only readers are currently running, and whether the runcount
+ field will not overflow, and whether no writer is waiting. The latter
+ condition is because POSIX recommends that "write locks shall take
+ precedence over read locks", to avoid "writer starvation". */
+ while (!(lock->runcount + 1 > 0 && lock->waiting_writers_count == 0))
+ {
+ /* This thread has to wait for a while. Enqueue it among the
+ waiting_readers. */
+ if (cnd_wait (&lock->waiting_readers, &lock->lock) != thrd_success)
+ {
+ mtx_unlock (&lock->lock);
+ return EINVAL;
+ }
+ }
+ lock->runcount++;
+ if (mtx_unlock (&lock->lock) != thrd_success)
+ return EINVAL;
+ return 0;
+}
+
+int
+glthread_rwlock_wrlock (gl_rwlock_t *lock)
+{
+ if (lock->init_needed)
+ call_once (&lock->init_once, lock->init_func);
+ if (mtx_lock (&lock->lock) != thrd_success)
+ return EAGAIN;
+ /* Test whether no readers or writers are currently running. */
+ while (!(lock->runcount == 0))
+ {
+ /* This thread has to wait for a while. Enqueue it among the
+ waiting_writers. */
+ lock->waiting_writers_count++;
+ if (cnd_wait (&lock->waiting_writers, &lock->lock) != thrd_success)
+ {
+ lock->waiting_writers_count--;
+ mtx_unlock (&lock->lock);
+ return EINVAL;
+ }
+ lock->waiting_writers_count--;
+ }
+ lock->runcount--; /* runcount becomes -1 */
+ if (mtx_unlock (&lock->lock) != thrd_success)
+ return EINVAL;
+ return 0;
+}
+
+int
+glthread_rwlock_unlock (gl_rwlock_t *lock)
+{
+ if (lock->init_needed)
+ call_once (&lock->init_once, lock->init_func);
+ if (mtx_lock (&lock->lock) != thrd_success)
+ return EAGAIN;
+ if (lock->runcount < 0)
+ {
+ /* Drop a writer lock. */
+ if (!(lock->runcount == -1))
+ {
+ mtx_unlock (&lock->lock);
+ return EINVAL;
+ }
+ lock->runcount = 0;
+ }
+ else
+ {
+ /* Drop a reader lock. */
+ if (!(lock->runcount > 0))
+ {
+ mtx_unlock (&lock->lock);
+ return EINVAL;
+ }
+ lock->runcount--;
+ }
+ if (lock->runcount == 0)
+ {
+ /* POSIX recommends that "write locks shall take precedence over read
+ locks", to avoid "writer starvation". */
+ if (lock->waiting_writers_count > 0)
+ {
+ /* Wake up one of the waiting writers. */
+ if (cnd_signal (&lock->waiting_writers) != thrd_success)
+ {
+ mtx_unlock (&lock->lock);
+ return EINVAL;
+ }
+ }
+ else
+ {
+ /* Wake up all waiting readers. */
+ if (cnd_broadcast (&lock->waiting_readers) != thrd_success)
+ {
+ mtx_unlock (&lock->lock);
+ return EINVAL;
+ }
+ }
+ }
+ if (mtx_unlock (&lock->lock) != thrd_success)
+ return EINVAL;
+ return 0;
+}
+
+int
+glthread_rwlock_destroy (gl_rwlock_t *lock)
+{
+ if (lock->init_needed)
+ call_once (&lock->init_once, lock->init_func);
+ mtx_destroy (&lock->lock);
+ cnd_destroy (&lock->waiting_readers);
+ cnd_destroy (&lock->waiting_writers);
+ return 0;
+}
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+int
+glthread_recursive_lock_init (gl_recursive_lock_t *lock)
+{
+ if (mtx_init (&lock->mutex, mtx_plain | mtx_recursive) != thrd_success)
+ return ENOMEM;
+ lock->init_needed = 0;
+ return 0;
+}
+
+int
+glthread_recursive_lock_lock (gl_recursive_lock_t *lock)
+{
+ if (lock->init_needed)
+ call_once (&lock->init_once, lock->init_func);
+ if (mtx_lock (&lock->mutex) != thrd_success)
+ return EAGAIN;
+ return 0;
+}
+
+int
+glthread_recursive_lock_unlock (gl_recursive_lock_t *lock)
+{
+ if (lock->init_needed)
+ call_once (&lock->init_once, lock->init_func);
+ if (mtx_unlock (&lock->mutex) != thrd_success)
+ return EINVAL;
+ return 0;
+}
+
+int
+glthread_recursive_lock_destroy (gl_recursive_lock_t *lock)
+{
+ if (lock->init_needed)
+ call_once (&lock->init_once, lock->init_func);
+ mtx_destroy (&lock->mutex);
+ return 0;
+}
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_POSIX_THREADS
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+# if HAVE_PTHREAD_RWLOCK && (HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER || (defined PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP && (__GNU_LIBRARY__ > 1)))
+
+# if defined PTHREAD_RWLOCK_INITIALIZER || defined PTHREAD_RWLOCK_INITIALIZER_NP
+
+# if !HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
+ /* glibc with bug https://sourceware.org/bugzilla/show_bug.cgi?id=13701 */
+
+int
+glthread_rwlock_init_for_glibc (pthread_rwlock_t *lock)
+{
+ pthread_rwlockattr_t attributes;
+ int err;
+
+ err = pthread_rwlockattr_init (&attributes);
+ if (err != 0)
+ return err;
+ /* Note: PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP is the only value that
+ causes the writer to be preferred. PTHREAD_RWLOCK_PREFER_WRITER_NP does not
+ do this; see
+ http://man7.org/linux/man-pages/man3/pthread_rwlockattr_setkind_np.3.html */
+ err = pthread_rwlockattr_setkind_np (&attributes,
+ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
+ if (err == 0)
+ err = pthread_rwlock_init(lock, &attributes);
+ /* pthread_rwlockattr_destroy always returns 0. It cannot influence the
+ return value. */
+ pthread_rwlockattr_destroy (&attributes);
+ return err;
+}
+
+# endif
+# else
+
+int
+glthread_rwlock_init_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ err = pthread_rwlock_init (&lock->rwlock, NULL);
+ if (err != 0)
+ return err;
+ lock->initialized = 1;
+ return 0;
+}
+
+int
+glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock)
+{
+ if (!lock->initialized)
+ {
+ int err;
+
+ err = pthread_mutex_lock (&lock->guard);
+ if (err != 0)
+ return err;
+ if (!lock->initialized)
+ {
+ err = glthread_rwlock_init_multithreaded (lock);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->guard);
+ return err;
+ }
+ }
+ err = pthread_mutex_unlock (&lock->guard);
+ if (err != 0)
+ return err;
+ }
+ return pthread_rwlock_rdlock (&lock->rwlock);
+}
+
+int
+glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock)
+{
+ if (!lock->initialized)
+ {
+ int err;
+
+ err = pthread_mutex_lock (&lock->guard);
+ if (err != 0)
+ return err;
+ if (!lock->initialized)
+ {
+ err = glthread_rwlock_init_multithreaded (lock);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->guard);
+ return err;
+ }
+ }
+ err = pthread_mutex_unlock (&lock->guard);
+ if (err != 0)
+ return err;
+ }
+ return pthread_rwlock_wrlock (&lock->rwlock);
+}
+
+int
+glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock)
+{
+ if (!lock->initialized)
+ return EINVAL;
+ return pthread_rwlock_unlock (&lock->rwlock);
+}
+
+int
+glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ if (!lock->initialized)
+ return EINVAL;
+ err = pthread_rwlock_destroy (&lock->rwlock);
+ if (err != 0)
+ return err;
+ lock->initialized = 0;
+ return 0;
+}
+
+# endif
+
+# else
+
+int
+glthread_rwlock_init_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ err = pthread_mutex_init (&lock->lock, NULL);
+ if (err != 0)
+ return err;
+ err = pthread_cond_init (&lock->waiting_readers, NULL);
+ if (err != 0)
+ return err;
+ err = pthread_cond_init (&lock->waiting_writers, NULL);
+ if (err != 0)
+ return err;
+ lock->waiting_writers_count = 0;
+ lock->runcount = 0;
+ return 0;
+}
+
+int
+glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ err = pthread_mutex_lock (&lock->lock);
+ if (err != 0)
+ return err;
+ /* Test whether only readers are currently running, and whether the runcount
+ field will not overflow, and whether no writer is waiting. The latter
+ condition is because POSIX recommends that "write locks shall take
+ precedence over read locks", to avoid "writer starvation". */
+ while (!(lock->runcount + 1 > 0 && lock->waiting_writers_count == 0))
+ {
+ /* This thread has to wait for a while. Enqueue it among the
+ waiting_readers. */
+ err = pthread_cond_wait (&lock->waiting_readers, &lock->lock);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->lock);
+ return err;
+ }
+ }
+ lock->runcount++;
+ return pthread_mutex_unlock (&lock->lock);
+}
+
+int
+glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ err = pthread_mutex_lock (&lock->lock);
+ if (err != 0)
+ return err;
+ /* Test whether no readers or writers are currently running. */
+ while (!(lock->runcount == 0))
+ {
+ /* This thread has to wait for a while. Enqueue it among the
+ waiting_writers. */
+ lock->waiting_writers_count++;
+ err = pthread_cond_wait (&lock->waiting_writers, &lock->lock);
+ if (err != 0)
+ {
+ lock->waiting_writers_count--;
+ pthread_mutex_unlock (&lock->lock);
+ return err;
+ }
+ lock->waiting_writers_count--;
+ }
+ lock->runcount--; /* runcount becomes -1 */
+ return pthread_mutex_unlock (&lock->lock);
+}
+
+int
+glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ err = pthread_mutex_lock (&lock->lock);
+ if (err != 0)
+ return err;
+ if (lock->runcount < 0)
+ {
+ /* Drop a writer lock. */
+ if (!(lock->runcount == -1))
+ {
+ pthread_mutex_unlock (&lock->lock);
+ return EINVAL;
+ }
+ lock->runcount = 0;
+ }
+ else
+ {
+ /* Drop a reader lock. */
+ if (!(lock->runcount > 0))
+ {
+ pthread_mutex_unlock (&lock->lock);
+ return EINVAL;
+ }
+ lock->runcount--;
+ }
+ if (lock->runcount == 0)
+ {
+ /* POSIX recommends that "write locks shall take precedence over read
+ locks", to avoid "writer starvation". */
+ if (lock->waiting_writers_count > 0)
+ {
+ /* Wake up one of the waiting writers. */
+ err = pthread_cond_signal (&lock->waiting_writers);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->lock);
+ return err;
+ }
+ }
+ else
+ {
+ /* Wake up all waiting readers. */
+ err = pthread_cond_broadcast (&lock->waiting_readers);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->lock);
+ return err;
+ }
+ }
+ }
+ return pthread_mutex_unlock (&lock->lock);
+}
+
+int
+glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ err = pthread_mutex_destroy (&lock->lock);
+ if (err != 0)
+ return err;
+ err = pthread_cond_destroy (&lock->waiting_readers);
+ if (err != 0)
+ return err;
+ err = pthread_cond_destroy (&lock->waiting_writers);
+ if (err != 0)
+ return err;
+ return 0;
+}
+
+# endif
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+# if HAVE_PTHREAD_MUTEX_RECURSIVE
+
+# if defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+
+int
+glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock)
+{
+ pthread_mutexattr_t attributes;
+ int err;
+
+ err = pthread_mutexattr_init (&attributes);
+ if (err != 0)
+ return err;
+ err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE);
+ if (err != 0)
+ {
+ pthread_mutexattr_destroy (&attributes);
+ return err;
+ }
+ err = pthread_mutex_init (lock, &attributes);
+ if (err != 0)
+ {
+ pthread_mutexattr_destroy (&attributes);
+ return err;
+ }
+ err = pthread_mutexattr_destroy (&attributes);
+ if (err != 0)
+ return err;
+ return 0;
+}
+
+# else
+
+int
+glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock)
+{
+ pthread_mutexattr_t attributes;
+ int err;
+
+ err = pthread_mutexattr_init (&attributes);
+ if (err != 0)
+ return err;
+ err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE);
+ if (err != 0)
+ {
+ pthread_mutexattr_destroy (&attributes);
+ return err;
+ }
+ err = pthread_mutex_init (&lock->recmutex, &attributes);
+ if (err != 0)
+ {
+ pthread_mutexattr_destroy (&attributes);
+ return err;
+ }
+ err = pthread_mutexattr_destroy (&attributes);
+ if (err != 0)
+ return err;
+ lock->initialized = 1;
+ return 0;
+}
+
+int
+glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock)
+{
+ if (!lock->initialized)
+ {
+ int err;
+
+ err = pthread_mutex_lock (&lock->guard);
+ if (err != 0)
+ return err;
+ if (!lock->initialized)
+ {
+ err = glthread_recursive_lock_init_multithreaded (lock);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->guard);
+ return err;
+ }
+ }
+ err = pthread_mutex_unlock (&lock->guard);
+ if (err != 0)
+ return err;
+ }
+ return pthread_mutex_lock (&lock->recmutex);
+}
+
+int
+glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock)
+{
+ if (!lock->initialized)
+ return EINVAL;
+ return pthread_mutex_unlock (&lock->recmutex);
+}
+
+int
+glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock)
+{
+ int err;
+
+ if (!lock->initialized)
+ return EINVAL;
+ err = pthread_mutex_destroy (&lock->recmutex);
+ if (err != 0)
+ return err;
+ lock->initialized = 0;
+ return 0;
+}
+
+# endif
+
+# else
+
+int
+glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock)
+{
+ int err;
+
+ err = pthread_mutex_init (&lock->mutex, NULL);
+ if (err != 0)
+ return err;
+ lock->owner = (pthread_t) 0;
+ lock->depth = 0;
+ return 0;
+}
+
+int
+glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock)
+{
+ pthread_t self = pthread_self ();
+ if (lock->owner != self)
+ {
+ int err;
+
+ err = pthread_mutex_lock (&lock->mutex);
+ if (err != 0)
+ return err;
+ lock->owner = self;
+ }
+ if (++(lock->depth) == 0) /* wraparound? */
+ {
+ lock->depth--;
+ return EAGAIN;
+ }
+ return 0;
+}
+
+int
+glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock)
+{
+ if (lock->owner != pthread_self ())
+ return EPERM;
+ if (lock->depth == 0)
+ return EINVAL;
+ if (--(lock->depth) == 0)
+ {
+ lock->owner = (pthread_t) 0;
+ return pthread_mutex_unlock (&lock->mutex);
+ }
+ else
+ return 0;
+}
+
+int
+glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock)
+{
+ if (lock->owner != (pthread_t) 0)
+ return EBUSY;
+ return pthread_mutex_destroy (&lock->mutex);
+}
+
+# endif
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+static const pthread_once_t fresh_once = PTHREAD_ONCE_INIT;
+
+int
+glthread_once_singlethreaded (pthread_once_t *once_control)
+{
+ /* We don't know whether pthread_once_t is an integer type, a floating-point
+ type, a pointer type, or a structure type. */
+ char *firstbyte = (char *)once_control;
+ if (*firstbyte == *(const char *)&fresh_once)
+ {
+ /* First time use of once_control. Invert the first byte. */
+ *firstbyte = ~ *(const char *)&fresh_once;
+ return 1;
+ }
+ else
+ return 0;
+}
+
+# if !(PTHREAD_IN_USE_DETECTION_HARD || USE_POSIX_THREADS_WEAK)
+
+int
+glthread_once_multithreaded (pthread_once_t *once_control,
+ void (*init_function) (void))
+{
+ int err = pthread_once (once_control, init_function);
+ if (err == ENOSYS)
+ {
+ /* This happens on FreeBSD 11: The pthread_once function in libc returns
+ ENOSYS. */
+ if (glthread_once_singlethreaded (once_control))
+ init_function ();
+ return 0;
+ }
+ return err;
+}
+
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_WINDOWS_THREADS
+
+#endif
+
+/* ========================================================================= */
diff --git a/gl/lib/glthread/lock.h b/gl/lib/glthread/lock.h
new file mode 100644
index 0000000..47eed8f
--- /dev/null
+++ b/gl/lib/glthread/lock.h
@@ -0,0 +1,791 @@
+/* Locking in multithreaded situations.
+ Copyright (C) 2005-2022 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 2.1 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>, 2005.
+ Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-win32.h. */
+
+/* This file contains locking primitives for use with a given thread library.
+ It does not contain primitives for creating threads or for other
+ synchronization primitives.
+
+ Normal (non-recursive) locks:
+ Type: gl_lock_t
+ Declaration: gl_lock_define(extern, name)
+ Initializer: gl_lock_define_initialized(, name)
+ Initialization: gl_lock_init (name);
+ Taking the lock: gl_lock_lock (name);
+ Releasing the lock: gl_lock_unlock (name);
+ De-initialization: gl_lock_destroy (name);
+ Equivalent functions with control of error handling:
+ Initialization: err = glthread_lock_init (&name);
+ Taking the lock: err = glthread_lock_lock (&name);
+ Releasing the lock: err = glthread_lock_unlock (&name);
+ De-initialization: err = glthread_lock_destroy (&name);
+
+ Read-Write (non-recursive) locks:
+ Type: gl_rwlock_t
+ Declaration: gl_rwlock_define(extern, name)
+ Initializer: gl_rwlock_define_initialized(, name)
+ Initialization: gl_rwlock_init (name);
+ Taking the lock: gl_rwlock_rdlock (name);
+ gl_rwlock_wrlock (name);
+ Releasing the lock: gl_rwlock_unlock (name);
+ De-initialization: gl_rwlock_destroy (name);
+ Equivalent functions with control of error handling:
+ Initialization: err = glthread_rwlock_init (&name);
+ Taking the lock: err = glthread_rwlock_rdlock (&name);
+ err = glthread_rwlock_wrlock (&name);
+ Releasing the lock: err = glthread_rwlock_unlock (&name);
+ De-initialization: err = glthread_rwlock_destroy (&name);
+
+ Recursive locks:
+ Type: gl_recursive_lock_t
+ Declaration: gl_recursive_lock_define(extern, name)
+ Initializer: gl_recursive_lock_define_initialized(, name)
+ Initialization: gl_recursive_lock_init (name);
+ Taking the lock: gl_recursive_lock_lock (name);
+ Releasing the lock: gl_recursive_lock_unlock (name);
+ De-initialization: gl_recursive_lock_destroy (name);
+ Equivalent functions with control of error handling:
+ Initialization: err = glthread_recursive_lock_init (&name);
+ Taking the lock: err = glthread_recursive_lock_lock (&name);
+ Releasing the lock: err = glthread_recursive_lock_unlock (&name);
+ De-initialization: err = glthread_recursive_lock_destroy (&name);
+
+ Once-only execution:
+ Type: gl_once_t
+ Initializer: gl_once_define(extern, name)
+ Execution: gl_once (name, initfunction);
+ Equivalent functions with control of error handling:
+ Execution: err = glthread_once (&name, initfunction);
+*/
+
+
+#ifndef _LOCK_H
+#define _LOCK_H
+
+#include <errno.h>
+#include <stdlib.h>
+
+#if !defined c11_threads_in_use
+# if HAVE_THREADS_H && USE_POSIX_THREADS_FROM_LIBC
+# define c11_threads_in_use() 1
+# elif HAVE_THREADS_H && USE_POSIX_THREADS_WEAK
+# include <threads.h>
+# pragma weak thrd_exit
+# define c11_threads_in_use() (thrd_exit != NULL)
+# else
+# define c11_threads_in_use() 0
+# endif
+#endif
+
+/* ========================================================================= */
+
+#if USE_ISOC_THREADS || USE_ISOC_AND_POSIX_THREADS
+
+/* Use the ISO C threads library. */
+
+# include <threads.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef struct
+ {
+ int volatile init_needed;
+ once_flag init_once;
+ void (*init_func) (void);
+ mtx_t mutex;
+ }
+ gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_lock_t NAME;
+# define gl_lock_define_initialized(STORAGECLASS, NAME) \
+ static void _atomic_init_##NAME (void); \
+ STORAGECLASS gl_lock_t NAME = \
+ { 1, ONCE_FLAG_INIT, _atomic_init_##NAME }; \
+ static void _atomic_init_##NAME (void) \
+ { \
+ if (glthread_lock_init (&(NAME))) \
+ abort (); \
+ }
+extern int glthread_lock_init (gl_lock_t *lock);
+extern int glthread_lock_lock (gl_lock_t *lock);
+extern int glthread_lock_unlock (gl_lock_t *lock);
+extern int glthread_lock_destroy (gl_lock_t *lock);
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+typedef struct
+ {
+ int volatile init_needed;
+ once_flag init_once;
+ void (*init_func) (void);
+ mtx_t lock; /* protects the remaining fields */
+ cnd_t waiting_readers; /* waiting readers */
+ cnd_t waiting_writers; /* waiting writers */
+ unsigned int waiting_writers_count; /* number of waiting writers */
+ int runcount; /* number of readers running, or -1 when a writer runs */
+ }
+ gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+ static void _atomic_init_##NAME (void); \
+ STORAGECLASS gl_rwlock_t NAME = \
+ { 1, ONCE_FLAG_INIT, _atomic_init_##NAME }; \
+ static void _atomic_init_##NAME (void) \
+ { \
+ if (glthread_rwlock_init (&(NAME))) \
+ abort (); \
+ }
+extern int glthread_rwlock_init (gl_rwlock_t *lock);
+extern int glthread_rwlock_rdlock (gl_rwlock_t *lock);
+extern int glthread_rwlock_wrlock (gl_rwlock_t *lock);
+extern int glthread_rwlock_unlock (gl_rwlock_t *lock);
+extern int glthread_rwlock_destroy (gl_rwlock_t *lock);
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+typedef struct
+ {
+ int volatile init_needed;
+ once_flag init_once;
+ void (*init_func) (void);
+ mtx_t mutex;
+ }
+ gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME;
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+ static void _atomic_init_##NAME (void); \
+ STORAGECLASS gl_recursive_lock_t NAME = \
+ { 1, ONCE_FLAG_INIT, _atomic_init_##NAME }; \
+ static void _atomic_init_##NAME (void) \
+ { \
+ if (glthread_recursive_lock_init (&(NAME))) \
+ abort (); \
+ }
+extern int glthread_recursive_lock_init (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_lock (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_unlock (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_destroy (gl_recursive_lock_t *lock);
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef once_flag gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+ STORAGECLASS once_flag NAME = ONCE_FLAG_INIT;
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (call_once (ONCE_CONTROL, INITFUNCTION), 0)
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_POSIX_THREADS
+
+/* Use the POSIX threads library. */
+
+# include <pthread.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if PTHREAD_IN_USE_DETECTION_HARD
+
+/* The pthread_in_use() detection needs to be done at runtime. */
+# define pthread_in_use() \
+ glthread_in_use ()
+extern int glthread_in_use (void);
+
+# endif
+
+# if USE_POSIX_THREADS_WEAK
+
+/* Use weak references to the POSIX threads library. */
+
+/* Weak references avoid dragging in external libraries if the other parts
+ of the program don't use them. Here we use them, because we don't want
+ every program that uses libintl to depend on libpthread. This assumes
+ that libpthread would not be loaded after libintl; i.e. if libintl is
+ loaded first, by an executable that does not depend on libpthread, and
+ then a module is dynamically loaded that depends on libpthread, libintl
+ will not be multithread-safe. */
+
+/* The way to test at runtime whether libpthread is present is to test
+ whether a function pointer's value, such as &pthread_mutex_init, is
+ non-NULL. However, some versions of GCC have a bug through which, in
+ PIC mode, &foo != NULL always evaluates to true if there is a direct
+ call to foo(...) in the same function. To avoid this, we test the
+ address of a function in libpthread that we don't use. */
+
+# pragma weak pthread_mutex_init
+# pragma weak pthread_mutex_lock
+# pragma weak pthread_mutex_unlock
+# pragma weak pthread_mutex_destroy
+# pragma weak pthread_rwlock_init
+# pragma weak pthread_rwlock_rdlock
+# pragma weak pthread_rwlock_wrlock
+# pragma weak pthread_rwlock_unlock
+# pragma weak pthread_rwlock_destroy
+# pragma weak pthread_once
+# pragma weak pthread_cond_init
+# pragma weak pthread_cond_wait
+# pragma weak pthread_cond_signal
+# pragma weak pthread_cond_broadcast
+# pragma weak pthread_cond_destroy
+# pragma weak pthread_mutexattr_init
+# pragma weak pthread_mutexattr_settype
+# pragma weak pthread_mutexattr_destroy
+# pragma weak pthread_rwlockattr_init
+# if __GNU_LIBRARY__ > 1
+# pragma weak pthread_rwlockattr_setkind_np
+# endif
+# pragma weak pthread_rwlockattr_destroy
+# ifndef pthread_self
+# pragma weak pthread_self
+# endif
+
+# if !PTHREAD_IN_USE_DETECTION_HARD
+ /* Considering all platforms with USE_POSIX_THREADS_WEAK, only few symbols
+ can be used to determine whether libpthread is in use. These are:
+ pthread_mutexattr_gettype
+ pthread_rwlockattr_destroy
+ pthread_rwlockattr_init
+ */
+# pragma weak pthread_mutexattr_gettype
+# define pthread_in_use() \
+ (pthread_mutexattr_gettype != NULL || c11_threads_in_use ())
+# endif
+
+# else
+
+# if !PTHREAD_IN_USE_DETECTION_HARD
+# define pthread_in_use() 1
+# endif
+
+# endif
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef pthread_mutex_t gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_mutex_t NAME;
+# define gl_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_mutex_t NAME = gl_lock_initializer;
+# define gl_lock_initializer \
+ PTHREAD_MUTEX_INITIALIZER
+# define glthread_lock_init(LOCK) \
+ (pthread_in_use () ? pthread_mutex_init (LOCK, NULL) : 0)
+# define glthread_lock_lock(LOCK) \
+ (pthread_in_use () ? pthread_mutex_lock (LOCK) : 0)
+# define glthread_lock_unlock(LOCK) \
+ (pthread_in_use () ? pthread_mutex_unlock (LOCK) : 0)
+# define glthread_lock_destroy(LOCK) \
+ (pthread_in_use () ? pthread_mutex_destroy (LOCK) : 0)
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+# if HAVE_PTHREAD_RWLOCK && (HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER || (defined PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP && (__GNU_LIBRARY__ > 1)))
+
+# if defined PTHREAD_RWLOCK_INITIALIZER || defined PTHREAD_RWLOCK_INITIALIZER_NP
+
+typedef pthread_rwlock_t gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_rwlock_t NAME = gl_rwlock_initializer;
+# if HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
+# if defined PTHREAD_RWLOCK_INITIALIZER
+# define gl_rwlock_initializer \
+ PTHREAD_RWLOCK_INITIALIZER
+# else
+# define gl_rwlock_initializer \
+ PTHREAD_RWLOCK_INITIALIZER_NP
+# endif
+# define glthread_rwlock_init(LOCK) \
+ (pthread_in_use () ? pthread_rwlock_init (LOCK, NULL) : 0)
+# else /* glibc with bug https://sourceware.org/bugzilla/show_bug.cgi?id=13701 */
+# define gl_rwlock_initializer \
+ PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP
+# define glthread_rwlock_init(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_init_for_glibc (LOCK) : 0)
+extern int glthread_rwlock_init_for_glibc (pthread_rwlock_t *lock);
+# endif
+# define glthread_rwlock_rdlock(LOCK) \
+ (pthread_in_use () ? pthread_rwlock_rdlock (LOCK) : 0)
+# define glthread_rwlock_wrlock(LOCK) \
+ (pthread_in_use () ? pthread_rwlock_wrlock (LOCK) : 0)
+# define glthread_rwlock_unlock(LOCK) \
+ (pthread_in_use () ? pthread_rwlock_unlock (LOCK) : 0)
+# define glthread_rwlock_destroy(LOCK) \
+ (pthread_in_use () ? pthread_rwlock_destroy (LOCK) : 0)
+
+# else
+
+typedef struct
+ {
+ int initialized;
+ pthread_mutex_t guard; /* protects the initialization */
+ pthread_rwlock_t rwlock; /* read-write lock */
+ }
+ gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer;
+# define gl_rwlock_initializer \
+ { 0, PTHREAD_MUTEX_INITIALIZER }
+# define glthread_rwlock_init(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_init_multithreaded (LOCK) : 0)
+# define glthread_rwlock_rdlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_rdlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_wrlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_wrlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_unlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_unlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_destroy(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_rwlock_init_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock);
+
+# endif
+
+# else
+
+typedef struct
+ {
+ pthread_mutex_t lock; /* protects the remaining fields */
+ pthread_cond_t waiting_readers; /* waiting readers */
+ pthread_cond_t waiting_writers; /* waiting writers */
+ unsigned int waiting_writers_count; /* number of waiting writers */
+ int runcount; /* number of readers running, or -1 when a writer runs */
+ }
+ gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer;
+# define gl_rwlock_initializer \
+ { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, 0 }
+# define glthread_rwlock_init(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_init_multithreaded (LOCK) : 0)
+# define glthread_rwlock_rdlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_rdlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_wrlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_wrlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_unlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_unlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_destroy(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_rwlock_init_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock);
+
+# endif
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+# if HAVE_PTHREAD_MUTEX_RECURSIVE
+
+# if defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+
+typedef pthread_mutex_t gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_mutex_t NAME;
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_mutex_t NAME = gl_recursive_lock_initializer;
+# ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+# define gl_recursive_lock_initializer \
+ PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+# else
+# define gl_recursive_lock_initializer \
+ PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+# endif
+# define glthread_recursive_lock_init(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_lock(LOCK) \
+ (pthread_in_use () ? pthread_mutex_lock (LOCK) : 0)
+# define glthread_recursive_lock_unlock(LOCK) \
+ (pthread_in_use () ? pthread_mutex_unlock (LOCK) : 0)
+# define glthread_recursive_lock_destroy(LOCK) \
+ (pthread_in_use () ? pthread_mutex_destroy (LOCK) : 0)
+extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
+
+# else
+
+typedef struct
+ {
+ pthread_mutex_t recmutex; /* recursive mutex */
+ pthread_mutex_t guard; /* protects the initialization */
+ int initialized;
+ }
+ gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME;
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
+# define gl_recursive_lock_initializer \
+ { PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, 0 }
+# define glthread_recursive_lock_init(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_lock(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_unlock(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_destroy(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock);
+
+# endif
+
+# else
+
+/* Old versions of POSIX threads on Solaris did not have recursive locks.
+ We have to implement them ourselves. */
+
+typedef struct
+ {
+ pthread_mutex_t mutex;
+ pthread_t owner;
+ unsigned long depth;
+ }
+ gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME;
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
+# define gl_recursive_lock_initializer \
+ { PTHREAD_MUTEX_INITIALIZER, (pthread_t) 0, 0 }
+# define glthread_recursive_lock_init(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_lock(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_unlock(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_destroy(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock);
+
+# endif
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef pthread_once_t gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_once_t NAME = PTHREAD_ONCE_INIT;
+# if PTHREAD_IN_USE_DETECTION_HARD || USE_POSIX_THREADS_WEAK
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (pthread_in_use () \
+ ? pthread_once (ONCE_CONTROL, INITFUNCTION) \
+ : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
+# else
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (pthread_in_use () \
+ ? glthread_once_multithreaded (ONCE_CONTROL, INITFUNCTION) \
+ : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
+extern int glthread_once_multithreaded (pthread_once_t *once_control,
+ void (*init_function) (void));
+# endif
+extern int glthread_once_singlethreaded (pthread_once_t *once_control);
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_WINDOWS_THREADS
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# include "windows-mutex.h"
+# include "windows-rwlock.h"
+# include "windows-recmutex.h"
+# include "windows-once.h"
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+/* We can use CRITICAL_SECTION directly, rather than the native Windows Event,
+ Mutex, Semaphore types, because
+ - we need only to synchronize inside a single process (address space),
+ not inter-process locking,
+ - we don't need to support trylock operations. (TryEnterCriticalSection
+ does not work on Windows 95/98/ME. Packages that need trylock usually
+ define their own mutex type.) */
+
+/* There is no way to statically initialize a CRITICAL_SECTION. It needs
+ to be done lazily, once only. For this we need spinlocks. */
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef glwthread_mutex_t gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_lock_t NAME;
+# define gl_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_lock_t NAME = gl_lock_initializer;
+# define gl_lock_initializer \
+ GLWTHREAD_MUTEX_INIT
+# define glthread_lock_init(LOCK) \
+ (glwthread_mutex_init (LOCK), 0)
+# define glthread_lock_lock(LOCK) \
+ glwthread_mutex_lock (LOCK)
+# define glthread_lock_unlock(LOCK) \
+ glwthread_mutex_unlock (LOCK)
+# define glthread_lock_destroy(LOCK) \
+ glwthread_mutex_destroy (LOCK)
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+typedef glwthread_rwlock_t gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer;
+# define gl_rwlock_initializer \
+ GLWTHREAD_RWLOCK_INIT
+# define glthread_rwlock_init(LOCK) \
+ (glwthread_rwlock_init (LOCK), 0)
+# define glthread_rwlock_rdlock(LOCK) \
+ glwthread_rwlock_rdlock (LOCK)
+# define glthread_rwlock_wrlock(LOCK) \
+ glwthread_rwlock_wrlock (LOCK)
+# define glthread_rwlock_unlock(LOCK) \
+ glwthread_rwlock_unlock (LOCK)
+# define glthread_rwlock_destroy(LOCK) \
+ glwthread_rwlock_destroy (LOCK)
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+typedef glwthread_recmutex_t gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME;
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
+# define gl_recursive_lock_initializer \
+ GLWTHREAD_RECMUTEX_INIT
+# define glthread_recursive_lock_init(LOCK) \
+ (glwthread_recmutex_init (LOCK), 0)
+# define glthread_recursive_lock_lock(LOCK) \
+ glwthread_recmutex_lock (LOCK)
+# define glthread_recursive_lock_unlock(LOCK) \
+ glwthread_recmutex_unlock (LOCK)
+# define glthread_recursive_lock_destroy(LOCK) \
+ glwthread_recmutex_destroy (LOCK)
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef glwthread_once_t gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_once_t NAME = GLWTHREAD_ONCE_INIT;
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (glwthread_once (ONCE_CONTROL, INITFUNCTION), 0)
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if !(USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS)
+
+/* Provide dummy implementation if threads are not supported. */
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef int gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME)
+# define gl_lock_define_initialized(STORAGECLASS, NAME)
+# define glthread_lock_init(NAME) 0
+# define glthread_lock_lock(NAME) 0
+# define glthread_lock_unlock(NAME) 0
+# define glthread_lock_destroy(NAME) 0
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+typedef int gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME)
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME)
+# define glthread_rwlock_init(NAME) 0
+# define glthread_rwlock_rdlock(NAME) 0
+# define glthread_rwlock_wrlock(NAME) 0
+# define glthread_rwlock_unlock(NAME) 0
+# define glthread_rwlock_destroy(NAME) 0
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+typedef int gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME)
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME)
+# define glthread_recursive_lock_init(NAME) 0
+# define glthread_recursive_lock_lock(NAME) 0
+# define glthread_recursive_lock_unlock(NAME) 0
+# define glthread_recursive_lock_destroy(NAME) 0
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef int gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_once_t NAME = 0;
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (*(ONCE_CONTROL) == 0 ? (*(ONCE_CONTROL) = ~ 0, INITFUNCTION (), 0) : 0)
+
+#endif
+
+/* ========================================================================= */
+
+/* Macros with built-in error handling. */
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+#define gl_lock_init(NAME) \
+ do \
+ { \
+ if (glthread_lock_init (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_lock_lock(NAME) \
+ do \
+ { \
+ if (glthread_lock_lock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_lock_unlock(NAME) \
+ do \
+ { \
+ if (glthread_lock_unlock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_lock_destroy(NAME) \
+ do \
+ { \
+ if (glthread_lock_destroy (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+#define gl_rwlock_init(NAME) \
+ do \
+ { \
+ if (glthread_rwlock_init (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_rwlock_rdlock(NAME) \
+ do \
+ { \
+ if (glthread_rwlock_rdlock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_rwlock_wrlock(NAME) \
+ do \
+ { \
+ if (glthread_rwlock_wrlock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_rwlock_unlock(NAME) \
+ do \
+ { \
+ if (glthread_rwlock_unlock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_rwlock_destroy(NAME) \
+ do \
+ { \
+ if (glthread_rwlock_destroy (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+#define gl_recursive_lock_init(NAME) \
+ do \
+ { \
+ if (glthread_recursive_lock_init (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_recursive_lock_lock(NAME) \
+ do \
+ { \
+ if (glthread_recursive_lock_lock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_recursive_lock_unlock(NAME) \
+ do \
+ { \
+ if (glthread_recursive_lock_unlock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_recursive_lock_destroy(NAME) \
+ do \
+ { \
+ if (glthread_recursive_lock_destroy (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+#define gl_once(NAME, INITFUNCTION) \
+ do \
+ { \
+ if (glthread_once (&NAME, INITFUNCTION)) \
+ abort (); \
+ } \
+ while (0)
+
+/* ========================================================================= */
+
+#endif /* _LOCK_H */
diff --git a/gl/lib/glthread/threadlib.c b/gl/lib/glthread/threadlib.c
new file mode 100644
index 0000000..88a76ba
--- /dev/null
+++ b/gl/lib/glthread/threadlib.c
@@ -0,0 +1,108 @@
+/* Multithreading primitives.
+ Copyright (C) 2005-2022 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 2.1 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>, 2005. */
+
+#include <config.h>
+
+/* ========================================================================= */
+
+#if USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS
+
+/* Use the POSIX threads library. */
+
+# include <errno.h>
+# include <pthread.h>
+# include <stdlib.h>
+
+# if PTHREAD_IN_USE_DETECTION_HARD
+
+# if defined __FreeBSD__ || defined __DragonFly__ /* FreeBSD */
+
+/* Test using pthread_key_create. */
+
+int
+glthread_in_use (void)
+{
+ static int tested;
+ static int result; /* 1: linked with -lpthread, 0: only with libc */
+
+ if (!tested)
+ {
+ pthread_key_t key;
+ int err = pthread_key_create (&key, NULL);
+
+ if (err == ENOSYS)
+ result = 0;
+ else
+ {
+ result = 1;
+ if (err == 0)
+ pthread_key_delete (key);
+ }
+ tested = 1;
+ }
+ return result;
+}
+
+# else /* Solaris, HP-UX */
+
+/* Test using pthread_create. */
+
+/* The function to be executed by a dummy thread. */
+static void *
+dummy_thread_func (void *arg)
+{
+ return arg;
+}
+
+int
+glthread_in_use (void)
+{
+ static int tested;
+ static int result; /* 1: linked with -lpthread, 0: only with libc */
+
+ if (!tested)
+ {
+ pthread_t thread;
+
+ if (pthread_create (&thread, NULL, dummy_thread_func, NULL) != 0)
+ /* Thread creation failed. */
+ result = 0;
+ else
+ {
+ /* Thread creation works. */
+ void *retval;
+ if (pthread_join (thread, &retval) != 0)
+ abort ();
+ result = 1;
+ }
+ tested = 1;
+ }
+ return result;
+}
+
+# endif
+
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+/* This declaration is solely to ensure that after preprocessing
+ this file is never empty. */
+typedef int dummy;
diff --git a/gl/lib/hard-locale.c b/gl/lib/hard-locale.c
new file mode 100644
index 0000000..f7fbc47
--- /dev/null
+++ b/gl/lib/hard-locale.c
@@ -0,0 +1,35 @@
+/* hard-locale.c -- Determine whether a locale is hard.
+
+ Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+#include "hard-locale.h"
+
+#include <locale.h>
+#include <string.h>
+
+bool
+hard_locale (int category)
+{
+ char locale[SETLOCALE_NULL_MAX];
+
+ if (setlocale_null_r (category, locale, sizeof (locale)))
+ return false;
+
+ return !(strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0);
+}
diff --git a/gl/lib/hard-locale.h b/gl/lib/hard-locale.h
new file mode 100644
index 0000000..6066f4e
--- /dev/null
+++ b/gl/lib/hard-locale.h
@@ -0,0 +1,28 @@
+/* Determine whether a locale is hard.
+
+ Copyright (C) 1999, 2003-2004, 2009-2022 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 2.1 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/>. */
+
+#ifndef HARD_LOCALE_H_
+# define HARD_LOCALE_H_ 1
+
+# include <stdbool.h>
+
+/* Return true if the specified CATEGORY of the current locale is hard, i.e.
+ different from the C or POSIX locale that has a fixed behavior.
+ CATEGORY must be one of the LC_* values, but not LC_ALL. */
+extern bool hard_locale (int category);
+
+#endif /* HARD_LOCALE_H_ */
diff --git a/gl/lib/hash-pjw-bare.c b/gl/lib/hash-pjw-bare.c
new file mode 100644
index 0000000..31944a1
--- /dev/null
+++ b/gl/lib/hash-pjw-bare.c
@@ -0,0 +1,42 @@
+/* hash-pjw-bare.c -- compute a hash value from a provided buffer.
+
+ Copyright (C) 2012-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+#include "hash-pjw-bare.h"
+
+#include <limits.h>
+
+#define SIZE_BITS (sizeof (size_t) * CHAR_BIT)
+
+/* Return a hash of the N bytes of X using the method described by
+ Bruno Haible in https://www.haible.de/bruno/hashfunc.html.
+ Note that while many hash functions reduce their result via modulo
+ to a 0..table_size-1 range, this function does not do that. */
+
+size_t
+hash_pjw_bare (const void *x, size_t n)
+{
+ const unsigned char *s = x;
+ size_t h = 0;
+ unsigned i;
+
+ for (i = 0; i < n; i++)
+ h = s[i] + ((h << 9) | (h >> (SIZE_BITS - 9)));
+
+ return h;
+}
diff --git a/gl/lib/hash-pjw-bare.h b/gl/lib/hash-pjw-bare.h
new file mode 100644
index 0000000..a18c7f1
--- /dev/null
+++ b/gl/lib/hash-pjw-bare.h
@@ -0,0 +1,24 @@
+/* hash-pjw-bare.h -- declaration for a simple hash function
+ Copyright (C) 2012-2022 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 2.1 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/>. */
+
+#include <stddef.h>
+
+/* Compute a hash code for a buffer starting at X and of size N,
+ and return the hash code. Note that unlike hash_pjw(), it does not
+ return it modulo a table size.
+ The result is platform dependent: it depends on the size of the 'size_t'
+ type. */
+extern size_t hash_pjw_bare (const void *x, size_t n) _GL_ATTRIBUTE_PURE;
diff --git a/gl/lib/hash-pjw.c b/gl/lib/hash-pjw.c
new file mode 100644
index 0000000..8ba139d
--- /dev/null
+++ b/gl/lib/hash-pjw.c
@@ -0,0 +1,40 @@
+/* hash-pjw.c -- compute a hash value from a NUL-terminated string.
+
+ Copyright (C) 2001, 2003, 2006, 2009-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+#include "hash-pjw.h"
+
+#include <limits.h>
+
+#define SIZE_BITS (sizeof (size_t) * CHAR_BIT)
+
+/* A hash function for NUL-terminated char* strings using
+ the method described by Bruno Haible.
+ See https://www.haible.de/bruno/hashfunc.html. */
+
+size_t
+hash_pjw (const void *x, size_t tablesize)
+{
+ const char *s;
+ size_t h = 0;
+
+ for (s = x; *s; s++)
+ h = *s + ((h << 9) | (h >> (SIZE_BITS - 9)));
+
+ return h % tablesize;
+}
diff --git a/gl/lib/hash-pjw.h b/gl/lib/hash-pjw.h
new file mode 100644
index 0000000..cdf4da2
--- /dev/null
+++ b/gl/lib/hash-pjw.h
@@ -0,0 +1,23 @@
+/* hash-pjw.h -- declaration for a simple hash function
+ Copyright (C) 2001, 2003, 2009-2022 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 2.1 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/>. */
+
+#include <stddef.h>
+
+/* Compute a hash code for a NUL-terminated string starting at X,
+ and return the hash code modulo TABLESIZE.
+ The result is platform dependent: it depends on the size of the 'size_t'
+ type and on the signedness of the 'char' type. */
+extern size_t hash_pjw (void const *x, size_t tablesize) _GL_ATTRIBUTE_PURE;
diff --git a/gl/lib/hash-triple-simple.c b/gl/lib/hash-triple-simple.c
new file mode 100644
index 0000000..b021f34
--- /dev/null
+++ b/gl/lib/hash-triple-simple.c
@@ -0,0 +1,59 @@
+/* Hash functions for file-related triples: name, device, inode.
+ Copyright (C) 2007, 2009-2022 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>
+
+/* Specification. */
+#include "hash-triple.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "hash-pjw.h"
+#include "same-inode.h"
+
+#define STREQ(a, b) (strcmp (a, b) == 0)
+
+/* Hash an F_triple, and *do* consider the file name. */
+size_t
+triple_hash (void const *x, size_t table_size)
+{
+ struct F_triple const *p = x;
+ size_t tmp = hash_pjw (p->name, table_size);
+
+ /* Ignoring the device number here should be fine. */
+ return (tmp ^ p->st_ino) % table_size;
+}
+
+/* Compare two F_triple structs. */
+bool
+triple_compare_ino_str (void const *x, void const *y)
+{
+ struct F_triple const *a = x;
+ struct F_triple const *b = y;
+ return (SAME_INODE (*a, *b) && STREQ (a->name, b->name)) ? true : false;
+}
+
+/* Free an F_triple. */
+void
+triple_free (void *x)
+{
+ struct F_triple *a = x;
+ free (a->name);
+ free (a);
+}
diff --git a/gl/lib/hash-triple.h b/gl/lib/hash-triple.h
new file mode 100644
index 0000000..929995f
--- /dev/null
+++ b/gl/lib/hash-triple.h
@@ -0,0 +1,46 @@
+/* Hash functions for file-related (name, device, inode) triples.
+ Copyright (C) 2007-2022 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, 2007. */
+
+#ifndef HASH_TRIPLE_H
+#define HASH_TRIPLE_H
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdbool.h>
+
+/* Describe a just-created or just-renamed destination file. */
+struct F_triple
+{
+ char *name;
+ ino_t st_ino;
+ dev_t st_dev;
+};
+
+/* Defined in module 'hash-triple-simple'. */
+
+extern size_t triple_hash (void const *x, size_t table_size) _GL_ATTRIBUTE_PURE;
+extern bool triple_compare_ino_str (void const *x, void const *y)
+ _GL_ATTRIBUTE_PURE;
+extern void triple_free (void *x);
+
+/* Defined in module 'hash-triple'. */
+extern size_t triple_hash_no_name (void const *x, size_t table_size)
+ _GL_ATTRIBUTE_PURE;
+extern bool triple_compare (void const *x, void const *y);
+
+#endif
diff --git a/gl/lib/hash.c b/gl/lib/hash.c
new file mode 100644
index 0000000..eb72341
--- /dev/null
+++ b/gl/lib/hash.c
@@ -0,0 +1,1106 @@
+/* hash - hashing table processing.
+
+ Copyright (C) 1998-2004, 2006-2007, 2009-2022 Free Software Foundation, Inc.
+
+ Written by Jim Meyering, 1992.
+
+ 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 2.1 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/>. */
+
+/* A generic hash table package. */
+
+/* Define USE_OBSTACK to 1 if you want the allocator to use obstacks instead
+ of malloc. If you change USE_OBSTACK, you have to recompile! */
+
+#include <config.h>
+
+#include "hash.h"
+
+#include "bitrotate.h"
+#include "xalloc-oversized.h"
+
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#if USE_OBSTACK
+# include "obstack.h"
+# ifndef obstack_chunk_alloc
+# define obstack_chunk_alloc malloc
+# endif
+# ifndef obstack_chunk_free
+# define obstack_chunk_free free
+# endif
+#endif
+
+struct hash_entry
+ {
+ void *data;
+ struct hash_entry *next;
+ };
+
+struct hash_table
+ {
+ /* The array of buckets starts at BUCKET and extends to BUCKET_LIMIT-1,
+ for a possibility of N_BUCKETS. Among those, N_BUCKETS_USED buckets
+ are not empty, there are N_ENTRIES active entries in the table. */
+ struct hash_entry *bucket;
+ struct hash_entry const *bucket_limit;
+ size_t n_buckets;
+ size_t n_buckets_used;
+ size_t n_entries;
+
+ /* Tuning arguments, kept in a physically separate structure. */
+ const Hash_tuning *tuning;
+
+ /* Three functions are given to 'hash_initialize', see the documentation
+ block for this function. In a word, HASHER randomizes a user entry
+ into a number up from 0 up to some maximum minus 1; COMPARATOR returns
+ true if two user entries compare equally; and DATA_FREER is the cleanup
+ function for a user entry. */
+ Hash_hasher hasher;
+ Hash_comparator comparator;
+ Hash_data_freer data_freer;
+
+ /* A linked list of freed struct hash_entry structs. */
+ struct hash_entry *free_entry_list;
+
+#if USE_OBSTACK
+ /* Whenever obstacks are used, it is possible to allocate all overflowed
+ entries into a single stack, so they all can be freed in a single
+ operation. It is not clear if the speedup is worth the trouble. */
+ struct obstack entry_stack;
+#endif
+ };
+
+/* A hash table contains many internal entries, each holding a pointer to
+ some user-provided data (also called a user entry). An entry indistinctly
+ refers to both the internal entry and its associated user entry. A user
+ entry contents may be hashed by a randomization function (the hashing
+ function, or just "hasher" for short) into a number (or "slot") between 0
+ and the current table size. At each slot position in the hash table,
+ starts a linked chain of entries for which the user data all hash to this
+ slot. A bucket is the collection of all entries hashing to the same slot.
+
+ A good "hasher" function will distribute entries rather evenly in buckets.
+ In the ideal case, the length of each bucket is roughly the number of
+ entries divided by the table size. Finding the slot for a data is usually
+ done in constant time by the "hasher", and the later finding of a precise
+ entry is linear in time with the size of the bucket. Consequently, a
+ larger hash table size (that is, a larger number of buckets) is prone to
+ yielding shorter chains, *given* the "hasher" function behaves properly.
+
+ Long buckets slow down the lookup algorithm. One might use big hash table
+ sizes in hope to reduce the average length of buckets, but this might
+ become inordinate, as unused slots in the hash table take some space. The
+ best bet is to make sure you are using a good "hasher" function (beware
+ that those are not that easy to write! :-), and to use a table size
+ larger than the actual number of entries. */
+
+/* If an insertion makes the ratio of nonempty buckets to table size larger
+ than the growth threshold (a number between 0.0 and 1.0), then increase
+ the table size by multiplying by the growth factor (a number greater than
+ 1.0). The growth threshold defaults to 0.8, and the growth factor
+ defaults to 1.414, meaning that the table will have doubled its size
+ every second time 80% of the buckets get used. */
+#define DEFAULT_GROWTH_THRESHOLD 0.8f
+#define DEFAULT_GROWTH_FACTOR 1.414f
+
+/* If a deletion empties a bucket and causes the ratio of used buckets to
+ table size to become smaller than the shrink threshold (a number between
+ 0.0 and 1.0), then shrink the table by multiplying by the shrink factor (a
+ number greater than the shrink threshold but smaller than 1.0). The shrink
+ threshold and factor default to 0.0 and 1.0, meaning that the table never
+ shrinks. */
+#define DEFAULT_SHRINK_THRESHOLD 0.0f
+#define DEFAULT_SHRINK_FACTOR 1.0f
+
+/* Use this to initialize or reset a TUNING structure to
+ some sensible values. */
+static const Hash_tuning default_tuning =
+ {
+ DEFAULT_SHRINK_THRESHOLD,
+ DEFAULT_SHRINK_FACTOR,
+ DEFAULT_GROWTH_THRESHOLD,
+ DEFAULT_GROWTH_FACTOR,
+ false
+ };
+
+/* Information and lookup. */
+
+size_t
+hash_get_n_buckets (const Hash_table *table)
+{
+ return table->n_buckets;
+}
+
+size_t
+hash_get_n_buckets_used (const Hash_table *table)
+{
+ return table->n_buckets_used;
+}
+
+size_t
+hash_get_n_entries (const Hash_table *table)
+{
+ return table->n_entries;
+}
+
+size_t
+hash_get_max_bucket_length (const Hash_table *table)
+{
+ struct hash_entry const *bucket;
+ size_t max_bucket_length = 0;
+
+ for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
+ {
+ if (bucket->data)
+ {
+ struct hash_entry const *cursor = bucket;
+ size_t bucket_length = 1;
+
+ while (cursor = cursor->next, cursor)
+ bucket_length++;
+
+ if (bucket_length > max_bucket_length)
+ max_bucket_length = bucket_length;
+ }
+ }
+
+ return max_bucket_length;
+}
+
+bool
+hash_table_ok (const Hash_table *table)
+{
+ struct hash_entry const *bucket;
+ size_t n_buckets_used = 0;
+ size_t n_entries = 0;
+
+ for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
+ {
+ if (bucket->data)
+ {
+ struct hash_entry const *cursor = bucket;
+
+ /* Count bucket head. */
+ n_buckets_used++;
+ n_entries++;
+
+ /* Count bucket overflow. */
+ while (cursor = cursor->next, cursor)
+ n_entries++;
+ }
+ }
+
+ if (n_buckets_used == table->n_buckets_used && n_entries == table->n_entries)
+ return true;
+
+ return false;
+}
+
+void
+hash_print_statistics (const Hash_table *table, FILE *stream)
+{
+ size_t n_entries = hash_get_n_entries (table);
+ size_t n_buckets = hash_get_n_buckets (table);
+ size_t n_buckets_used = hash_get_n_buckets_used (table);
+ size_t max_bucket_length = hash_get_max_bucket_length (table);
+
+ fprintf (stream, "# entries: %lu\n", (unsigned long int) n_entries);
+ fprintf (stream, "# buckets: %lu\n", (unsigned long int) n_buckets);
+ fprintf (stream, "# buckets used: %lu (%.2f%%)\n",
+ (unsigned long int) n_buckets_used,
+ (100.0 * n_buckets_used) / n_buckets);
+ fprintf (stream, "max bucket length: %lu\n",
+ (unsigned long int) max_bucket_length);
+}
+
+/* Hash KEY and return a pointer to the selected bucket.
+ If TABLE->hasher misbehaves, abort. */
+static struct hash_entry *
+safe_hasher (const Hash_table *table, const void *key)
+{
+ size_t n = table->hasher (key, table->n_buckets);
+ if (! (n < table->n_buckets))
+ abort ();
+ return table->bucket + n;
+}
+
+void *
+hash_lookup (const Hash_table *table, const void *entry)
+{
+ struct hash_entry const *bucket = safe_hasher (table, entry);
+ struct hash_entry const *cursor;
+
+ if (bucket->data == NULL)
+ return NULL;
+
+ for (cursor = bucket; cursor; cursor = cursor->next)
+ if (entry == cursor->data || table->comparator (entry, cursor->data))
+ return cursor->data;
+
+ return NULL;
+}
+
+/* Walking. */
+
+void *
+hash_get_first (const Hash_table *table)
+{
+ struct hash_entry const *bucket;
+
+ if (table->n_entries == 0)
+ return NULL;
+
+ for (bucket = table->bucket; ; bucket++)
+ if (! (bucket < table->bucket_limit))
+ abort ();
+ else if (bucket->data)
+ return bucket->data;
+}
+
+void *
+hash_get_next (const Hash_table *table, const void *entry)
+{
+ struct hash_entry const *bucket = safe_hasher (table, entry);
+ struct hash_entry const *cursor;
+
+ /* Find next entry in the same bucket. */
+ cursor = bucket;
+ do
+ {
+ if (cursor->data == entry && cursor->next)
+ return cursor->next->data;
+ cursor = cursor->next;
+ }
+ while (cursor != NULL);
+
+ /* Find first entry in any subsequent bucket. */
+ while (++bucket < table->bucket_limit)
+ if (bucket->data)
+ return bucket->data;
+
+ /* None found. */
+ return NULL;
+}
+
+size_t
+hash_get_entries (const Hash_table *table, void **buffer,
+ size_t buffer_size)
+{
+ size_t counter = 0;
+ struct hash_entry const *bucket;
+ struct hash_entry const *cursor;
+
+ for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
+ {
+ if (bucket->data)
+ {
+ for (cursor = bucket; cursor; cursor = cursor->next)
+ {
+ if (counter >= buffer_size)
+ return counter;
+ buffer[counter++] = cursor->data;
+ }
+ }
+ }
+
+ return counter;
+}
+
+size_t
+hash_do_for_each (const Hash_table *table, Hash_processor processor,
+ void *processor_data)
+{
+ size_t counter = 0;
+ struct hash_entry const *bucket;
+ struct hash_entry const *cursor;
+
+ for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
+ {
+ if (bucket->data)
+ {
+ for (cursor = bucket; cursor; cursor = cursor->next)
+ {
+ if (! processor (cursor->data, processor_data))
+ return counter;
+ counter++;
+ }
+ }
+ }
+
+ return counter;
+}
+
+/* Allocation and clean-up. */
+
+#if USE_DIFF_HASH
+
+/* About hashings, Paul Eggert writes to me (FP), on 1994-01-01: "Please see
+ B. J. McKenzie, R. Harries & T. Bell, Selecting a hashing algorithm,
+ Software--practice & experience 20, 2 (Feb 1990), 209-224. Good hash
+ algorithms tend to be domain-specific, so what's good for [diffutils'] io.c
+ may not be good for your application." */
+
+size_t
+hash_string (const char *string, size_t n_buckets)
+{
+# define HASH_ONE_CHAR(Value, Byte) \
+ ((Byte) + rotl_sz (Value, 7))
+
+ size_t value = 0;
+ unsigned char ch;
+
+ for (; (ch = *string); string++)
+ value = HASH_ONE_CHAR (value, ch);
+ return value % n_buckets;
+
+# undef HASH_ONE_CHAR
+}
+
+#else /* not USE_DIFF_HASH */
+
+/* This one comes from 'recode', and performs a bit better than the above as
+ per a few experiments. It is inspired from a hashing routine found in the
+ very old Cyber 'snoop', itself written in typical Greg Mansfield style.
+ (By the way, what happened to this excellent man? Is he still alive?) */
+
+size_t
+hash_string (const char *string, size_t n_buckets)
+{
+ size_t value = 0;
+ unsigned char ch;
+
+ for (; (ch = *string); string++)
+ value = (value * 31 + ch) % n_buckets;
+ return value;
+}
+
+#endif /* not USE_DIFF_HASH */
+
+/* Return true if CANDIDATE is a prime number. CANDIDATE should be an odd
+ number at least equal to 11. */
+
+static bool _GL_ATTRIBUTE_CONST
+is_prime (size_t candidate)
+{
+ size_t divisor = 3;
+ size_t square = divisor * divisor;
+
+ while (square < candidate && (candidate % divisor))
+ {
+ divisor++;
+ square += 4 * divisor;
+ divisor++;
+ }
+
+ return (candidate % divisor ? true : false);
+}
+
+/* Round a given CANDIDATE number up to the nearest prime, and return that
+ prime. Primes lower than 10 are merely skipped. */
+
+static size_t _GL_ATTRIBUTE_CONST
+next_prime (size_t candidate)
+{
+ /* Skip small primes. */
+ if (candidate < 10)
+ candidate = 10;
+
+ /* Make it definitely odd. */
+ candidate |= 1;
+
+ while (SIZE_MAX != candidate && !is_prime (candidate))
+ candidate += 2;
+
+ return candidate;
+}
+
+void
+hash_reset_tuning (Hash_tuning *tuning)
+{
+ *tuning = default_tuning;
+}
+
+/* If the user passes a NULL hasher, we hash the raw pointer. */
+static size_t
+raw_hasher (const void *data, size_t n)
+{
+ /* When hashing unique pointers, it is often the case that they were
+ generated by malloc and thus have the property that the low-order
+ bits are 0. As this tends to give poorer performance with small
+ tables, we rotate the pointer value before performing division,
+ in an attempt to improve hash quality. */
+ size_t val = rotr_sz ((size_t) data, 3);
+ return val % n;
+}
+
+/* If the user passes a NULL comparator, we use pointer comparison. */
+static bool
+raw_comparator (const void *a, const void *b)
+{
+ return a == b;
+}
+
+
+/* For the given hash TABLE, check the user supplied tuning structure for
+ reasonable values, and return true if there is no gross error with it.
+ Otherwise, definitively reset the TUNING field to some acceptable default
+ in the hash table (that is, the user loses the right of further modifying
+ tuning arguments), and return false. */
+
+static bool
+check_tuning (Hash_table *table)
+{
+ const Hash_tuning *tuning = table->tuning;
+ float epsilon;
+ if (tuning == &default_tuning)
+ return true;
+
+ /* Be a bit stricter than mathematics would require, so that
+ rounding errors in size calculations do not cause allocations to
+ fail to grow or shrink as they should. The smallest allocation
+ is 11 (due to next_prime's algorithm), so an epsilon of 0.1
+ should be good enough. */
+ epsilon = 0.1f;
+
+ if (epsilon < tuning->growth_threshold
+ && tuning->growth_threshold < 1 - epsilon
+ && 1 + epsilon < tuning->growth_factor
+ && 0 <= tuning->shrink_threshold
+ && tuning->shrink_threshold + epsilon < tuning->shrink_factor
+ && tuning->shrink_factor <= 1
+ && tuning->shrink_threshold + epsilon < tuning->growth_threshold)
+ return true;
+
+ table->tuning = &default_tuning;
+ return false;
+}
+
+/* Compute the size of the bucket array for the given CANDIDATE and
+ TUNING, or return 0 if there is no possible way to allocate that
+ many entries. */
+
+static size_t _GL_ATTRIBUTE_PURE
+compute_bucket_size (size_t candidate, const Hash_tuning *tuning)
+{
+ if (!tuning->is_n_buckets)
+ {
+ float new_candidate = candidate / tuning->growth_threshold;
+ if ((float) SIZE_MAX <= new_candidate)
+ return 0;
+ candidate = new_candidate;
+ }
+ candidate = next_prime (candidate);
+ if (xalloc_oversized (candidate, sizeof (struct hash_entry *)))
+ return 0;
+ return candidate;
+}
+
+Hash_table *
+hash_initialize (size_t candidate, const Hash_tuning *tuning,
+ Hash_hasher hasher, Hash_comparator comparator,
+ Hash_data_freer data_freer)
+{
+ Hash_table *table;
+
+ if (hasher == NULL)
+ hasher = raw_hasher;
+ if (comparator == NULL)
+ comparator = raw_comparator;
+
+ table = malloc (sizeof *table);
+ if (table == NULL)
+ return NULL;
+
+ if (!tuning)
+ tuning = &default_tuning;
+ table->tuning = tuning;
+ if (!check_tuning (table))
+ {
+ /* Fail if the tuning options are invalid. This is the only occasion
+ when the user gets some feedback about it. Once the table is created,
+ if the user provides invalid tuning options, we silently revert to
+ using the defaults, and ignore further request to change the tuning
+ options. */
+ goto fail;
+ }
+
+ table->n_buckets = compute_bucket_size (candidate, tuning);
+ if (!table->n_buckets)
+ goto fail;
+
+ table->bucket = calloc (table->n_buckets, sizeof *table->bucket);
+ if (table->bucket == NULL)
+ goto fail;
+ table->bucket_limit = table->bucket + table->n_buckets;
+ table->n_buckets_used = 0;
+ table->n_entries = 0;
+
+ table->hasher = hasher;
+ table->comparator = comparator;
+ table->data_freer = data_freer;
+
+ table->free_entry_list = NULL;
+#if USE_OBSTACK
+ obstack_init (&table->entry_stack);
+#endif
+ return table;
+
+ fail:
+ free (table);
+ return NULL;
+}
+
+void
+hash_clear (Hash_table *table)
+{
+ struct hash_entry *bucket;
+
+ for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
+ {
+ if (bucket->data)
+ {
+ struct hash_entry *cursor;
+ struct hash_entry *next;
+
+ /* Free the bucket overflow. */
+ for (cursor = bucket->next; cursor; cursor = next)
+ {
+ if (table->data_freer)
+ table->data_freer (cursor->data);
+ cursor->data = NULL;
+
+ next = cursor->next;
+ /* Relinking is done one entry at a time, as it is to be expected
+ that overflows are either rare or short. */
+ cursor->next = table->free_entry_list;
+ table->free_entry_list = cursor;
+ }
+
+ /* Free the bucket head. */
+ if (table->data_freer)
+ table->data_freer (bucket->data);
+ bucket->data = NULL;
+ bucket->next = NULL;
+ }
+ }
+
+ table->n_buckets_used = 0;
+ table->n_entries = 0;
+}
+
+void
+hash_free (Hash_table *table)
+{
+ struct hash_entry *bucket;
+ struct hash_entry *cursor;
+ struct hash_entry *next;
+
+ /* Call the user data_freer function. */
+ if (table->data_freer && table->n_entries)
+ {
+ for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
+ {
+ if (bucket->data)
+ {
+ for (cursor = bucket; cursor; cursor = cursor->next)
+ table->data_freer (cursor->data);
+ }
+ }
+ }
+
+#if USE_OBSTACK
+
+ obstack_free (&table->entry_stack, NULL);
+
+#else
+
+ /* Free all bucket overflowed entries. */
+ for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
+ {
+ for (cursor = bucket->next; cursor; cursor = next)
+ {
+ next = cursor->next;
+ free (cursor);
+ }
+ }
+
+ /* Also reclaim the internal list of previously freed entries. */
+ for (cursor = table->free_entry_list; cursor; cursor = next)
+ {
+ next = cursor->next;
+ free (cursor);
+ }
+
+#endif
+
+ /* Free the remainder of the hash table structure. */
+ free (table->bucket);
+ free (table);
+}
+
+/* Insertion and deletion. */
+
+/* Get a new hash entry for a bucket overflow, possibly by recycling a
+ previously freed one. If this is not possible, allocate a new one. */
+
+static struct hash_entry *
+allocate_entry (Hash_table *table)
+{
+ struct hash_entry *new;
+
+ if (table->free_entry_list)
+ {
+ new = table->free_entry_list;
+ table->free_entry_list = new->next;
+ }
+ else
+ {
+#if USE_OBSTACK
+ new = obstack_alloc (&table->entry_stack, sizeof *new);
+#else
+ new = malloc (sizeof *new);
+#endif
+ }
+
+ return new;
+}
+
+/* Free a hash entry which was part of some bucket overflow,
+ saving it for later recycling. */
+
+static void
+free_entry (Hash_table *table, struct hash_entry *entry)
+{
+ entry->data = NULL;
+ entry->next = table->free_entry_list;
+ table->free_entry_list = entry;
+}
+
+/* This private function is used to help with insertion and deletion. When
+ ENTRY matches an entry in the table, return a pointer to the corresponding
+ user data and set *BUCKET_HEAD to the head of the selected bucket.
+ Otherwise, return NULL. When DELETE is true and ENTRY matches an entry in
+ the table, unlink the matching entry. */
+
+static void *
+hash_find_entry (Hash_table *table, const void *entry,
+ struct hash_entry **bucket_head, bool delete)
+{
+ struct hash_entry *bucket = safe_hasher (table, entry);
+ struct hash_entry *cursor;
+
+ *bucket_head = bucket;
+
+ /* Test for empty bucket. */
+ if (bucket->data == NULL)
+ return NULL;
+
+ /* See if the entry is the first in the bucket. */
+ if (entry == bucket->data || table->comparator (entry, bucket->data))
+ {
+ void *data = bucket->data;
+
+ if (delete)
+ {
+ if (bucket->next)
+ {
+ struct hash_entry *next = bucket->next;
+
+ /* Bump the first overflow entry into the bucket head, then save
+ the previous first overflow entry for later recycling. */
+ *bucket = *next;
+ free_entry (table, next);
+ }
+ else
+ {
+ bucket->data = NULL;
+ }
+ }
+
+ return data;
+ }
+
+ /* Scan the bucket overflow. */
+ for (cursor = bucket; cursor->next; cursor = cursor->next)
+ {
+ if (entry == cursor->next->data
+ || table->comparator (entry, cursor->next->data))
+ {
+ void *data = cursor->next->data;
+
+ if (delete)
+ {
+ struct hash_entry *next = cursor->next;
+
+ /* Unlink the entry to delete, then save the freed entry for later
+ recycling. */
+ cursor->next = next->next;
+ free_entry (table, next);
+ }
+
+ return data;
+ }
+ }
+
+ /* No entry found. */
+ return NULL;
+}
+
+/* Internal helper, to move entries from SRC to DST. Both tables must
+ share the same free entry list. If SAFE, only move overflow
+ entries, saving bucket heads for later, so that no allocations will
+ occur. Return false if the free entry list is exhausted and an
+ allocation fails. */
+
+static bool
+transfer_entries (Hash_table *dst, Hash_table *src, bool safe)
+{
+ struct hash_entry *bucket;
+ struct hash_entry *cursor;
+ struct hash_entry *next;
+ for (bucket = src->bucket; bucket < src->bucket_limit; bucket++)
+ if (bucket->data)
+ {
+ void *data;
+ struct hash_entry *new_bucket;
+
+ /* Within each bucket, transfer overflow entries first and
+ then the bucket head, to minimize memory pressure. After
+ all, the only time we might allocate is when moving the
+ bucket head, but moving overflow entries first may create
+ free entries that can be recycled by the time we finally
+ get to the bucket head. */
+ for (cursor = bucket->next; cursor; cursor = next)
+ {
+ data = cursor->data;
+ new_bucket = safe_hasher (dst, data);
+
+ next = cursor->next;
+
+ if (new_bucket->data)
+ {
+ /* Merely relink an existing entry, when moving from a
+ bucket overflow into a bucket overflow. */
+ cursor->next = new_bucket->next;
+ new_bucket->next = cursor;
+ }
+ else
+ {
+ /* Free an existing entry, when moving from a bucket
+ overflow into a bucket header. */
+ new_bucket->data = data;
+ dst->n_buckets_used++;
+ free_entry (dst, cursor);
+ }
+ }
+ /* Now move the bucket head. Be sure that if we fail due to
+ allocation failure that the src table is in a consistent
+ state. */
+ data = bucket->data;
+ bucket->next = NULL;
+ if (safe)
+ continue;
+ new_bucket = safe_hasher (dst, data);
+
+ if (new_bucket->data)
+ {
+ /* Allocate or recycle an entry, when moving from a bucket
+ header into a bucket overflow. */
+ struct hash_entry *new_entry = allocate_entry (dst);
+
+ if (new_entry == NULL)
+ return false;
+
+ new_entry->data = data;
+ new_entry->next = new_bucket->next;
+ new_bucket->next = new_entry;
+ }
+ else
+ {
+ /* Move from one bucket header to another. */
+ new_bucket->data = data;
+ dst->n_buckets_used++;
+ }
+ bucket->data = NULL;
+ src->n_buckets_used--;
+ }
+ return true;
+}
+
+bool
+hash_rehash (Hash_table *table, size_t candidate)
+{
+ Hash_table storage;
+ Hash_table *new_table;
+ size_t new_size = compute_bucket_size (candidate, table->tuning);
+
+ if (!new_size)
+ return false;
+ if (new_size == table->n_buckets)
+ return true;
+ new_table = &storage;
+ new_table->bucket = calloc (new_size, sizeof *new_table->bucket);
+ if (new_table->bucket == NULL)
+ return false;
+ new_table->n_buckets = new_size;
+ new_table->bucket_limit = new_table->bucket + new_size;
+ new_table->n_buckets_used = 0;
+ new_table->n_entries = 0;
+ new_table->tuning = table->tuning;
+ new_table->hasher = table->hasher;
+ new_table->comparator = table->comparator;
+ new_table->data_freer = table->data_freer;
+
+ /* In order for the transfer to successfully complete, we need
+ additional overflow entries when distinct buckets in the old
+ table collide into a common bucket in the new table. The worst
+ case possible is a hasher that gives a good spread with the old
+ size, but returns a constant with the new size; if we were to
+ guarantee table->n_buckets_used-1 free entries in advance, then
+ the transfer would be guaranteed to not allocate memory.
+ However, for large tables, a guarantee of no further allocation
+ introduces a lot of extra memory pressure, all for an unlikely
+ corner case (most rehashes reduce, rather than increase, the
+ number of overflow entries needed). So, we instead ensure that
+ the transfer process can be reversed if we hit a memory
+ allocation failure mid-transfer. */
+
+ /* Merely reuse the extra old space into the new table. */
+#if USE_OBSTACK
+ new_table->entry_stack = table->entry_stack;
+#endif
+ new_table->free_entry_list = table->free_entry_list;
+
+ if (transfer_entries (new_table, table, false))
+ {
+ /* Entries transferred successfully; tie up the loose ends. */
+ free (table->bucket);
+ table->bucket = new_table->bucket;
+ table->bucket_limit = new_table->bucket_limit;
+ table->n_buckets = new_table->n_buckets;
+ table->n_buckets_used = new_table->n_buckets_used;
+ table->free_entry_list = new_table->free_entry_list;
+ /* table->n_entries and table->entry_stack already hold their value. */
+ return true;
+ }
+
+ /* We've allocated new_table->bucket (and possibly some entries),
+ exhausted the free list, and moved some but not all entries into
+ new_table. We must undo the partial move before returning
+ failure. The only way to get into this situation is if new_table
+ uses fewer buckets than the old table, so we will reclaim some
+ free entries as overflows in the new table are put back into
+ distinct buckets in the old table.
+
+ There are some pathological cases where a single pass through the
+ table requires more intermediate overflow entries than using two
+ passes. Two passes give worse cache performance and takes
+ longer, but at this point, we're already out of memory, so slow
+ and safe is better than failure. */
+ table->free_entry_list = new_table->free_entry_list;
+ if (! (transfer_entries (table, new_table, true)
+ && transfer_entries (table, new_table, false)))
+ abort ();
+ /* table->n_entries already holds its value. */
+ free (new_table->bucket);
+ return false;
+}
+
+int
+hash_insert_if_absent (Hash_table *table, void const *entry,
+ void const **matched_ent)
+{
+ void *data;
+ struct hash_entry *bucket;
+
+ /* The caller cannot insert a NULL entry, since hash_lookup returns NULL
+ to indicate "not found", and hash_find_entry uses "bucket->data == NULL"
+ to indicate an empty bucket. */
+ if (! entry)
+ abort ();
+
+ /* If there's a matching entry already in the table, return that. */
+ if ((data = hash_find_entry (table, entry, &bucket, false)) != NULL)
+ {
+ if (matched_ent)
+ *matched_ent = data;
+ return 0;
+ }
+
+ /* If the growth threshold of the buckets in use has been reached, increase
+ the table size and rehash. There's no point in checking the number of
+ entries: if the hashing function is ill-conditioned, rehashing is not
+ likely to improve it. */
+
+ if (table->n_buckets_used
+ > table->tuning->growth_threshold * table->n_buckets)
+ {
+ /* Check more fully, before starting real work. If tuning arguments
+ became invalid, the second check will rely on proper defaults. */
+ check_tuning (table);
+ if (table->n_buckets_used
+ > table->tuning->growth_threshold * table->n_buckets)
+ {
+ const Hash_tuning *tuning = table->tuning;
+ float candidate =
+ (tuning->is_n_buckets
+ ? (table->n_buckets * tuning->growth_factor)
+ : (table->n_buckets * tuning->growth_factor
+ * tuning->growth_threshold));
+
+ if ((float) SIZE_MAX <= candidate)
+ return -1;
+
+ /* If the rehash fails, arrange to return NULL. */
+ if (!hash_rehash (table, candidate))
+ return -1;
+
+ /* Update the bucket we are interested in. */
+ if (hash_find_entry (table, entry, &bucket, false) != NULL)
+ abort ();
+ }
+ }
+
+ /* ENTRY is not matched, it should be inserted. */
+
+ if (bucket->data)
+ {
+ struct hash_entry *new_entry = allocate_entry (table);
+
+ if (new_entry == NULL)
+ return -1;
+
+ /* Add ENTRY in the overflow of the bucket. */
+
+ new_entry->data = (void *) entry;
+ new_entry->next = bucket->next;
+ bucket->next = new_entry;
+ table->n_entries++;
+ return 1;
+ }
+
+ /* Add ENTRY right in the bucket head. */
+
+ bucket->data = (void *) entry;
+ table->n_entries++;
+ table->n_buckets_used++;
+
+ return 1;
+}
+
+void *
+hash_insert (Hash_table *table, void const *entry)
+{
+ void const *matched_ent;
+ int err = hash_insert_if_absent (table, entry, &matched_ent);
+ return (err == -1
+ ? NULL
+ : (void *) (err == 0 ? matched_ent : entry));
+}
+
+void *
+hash_remove (Hash_table *table, const void *entry)
+{
+ void *data;
+ struct hash_entry *bucket;
+
+ data = hash_find_entry (table, entry, &bucket, true);
+ if (!data)
+ return NULL;
+
+ table->n_entries--;
+ if (!bucket->data)
+ {
+ table->n_buckets_used--;
+
+ /* If the shrink threshold of the buckets in use has been reached,
+ rehash into a smaller table. */
+
+ if (table->n_buckets_used
+ < table->tuning->shrink_threshold * table->n_buckets)
+ {
+ /* Check more fully, before starting real work. If tuning arguments
+ became invalid, the second check will rely on proper defaults. */
+ check_tuning (table);
+ if (table->n_buckets_used
+ < table->tuning->shrink_threshold * table->n_buckets)
+ {
+ const Hash_tuning *tuning = table->tuning;
+ size_t candidate =
+ (tuning->is_n_buckets
+ ? table->n_buckets * tuning->shrink_factor
+ : (table->n_buckets * tuning->shrink_factor
+ * tuning->growth_threshold));
+
+ if (!hash_rehash (table, candidate))
+ {
+ /* Failure to allocate memory in an attempt to
+ shrink the table is not fatal. But since memory
+ is low, we can at least be kind and free any
+ spare entries, rather than keeping them tied up
+ in the free entry list. */
+#if ! USE_OBSTACK
+ struct hash_entry *cursor = table->free_entry_list;
+ struct hash_entry *next;
+ while (cursor)
+ {
+ next = cursor->next;
+ free (cursor);
+ cursor = next;
+ }
+ table->free_entry_list = NULL;
+#endif
+ }
+ }
+ }
+ }
+
+ return data;
+}
+
+void *
+hash_delete (Hash_table *table, const void *entry)
+{
+ return hash_remove (table, entry);
+}
+
+/* Testing. */
+
+#if TESTING
+
+void
+hash_print (const Hash_table *table)
+{
+ struct hash_entry *bucket = (struct hash_entry *) table->bucket;
+
+ for ( ; bucket < table->bucket_limit; bucket++)
+ {
+ struct hash_entry *cursor;
+
+ if (bucket)
+ printf ("%lu:\n", (unsigned long int) (bucket - table->bucket));
+
+ for (cursor = bucket; cursor; cursor = cursor->next)
+ {
+ char const *s = cursor->data;
+ /* FIXME */
+ if (s)
+ printf (" %s\n", s);
+ }
+ }
+}
+
+#endif /* TESTING */
diff --git a/gl/lib/hash.h b/gl/lib/hash.h
new file mode 100644
index 0000000..ebfc740
--- /dev/null
+++ b/gl/lib/hash.h
@@ -0,0 +1,264 @@
+/* hash - hashing table processing.
+ Copyright (C) 1998-1999, 2001, 2003, 2009-2022 Free Software Foundation,
+ Inc.
+ Written by Jim Meyering <meyering@ascend.com>, 1998.
+
+ 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 2.1 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/>. */
+
+/* A generic hash table package. */
+
+/* Make sure USE_OBSTACK is defined to 1 if you want the allocator to use
+ obstacks instead of malloc, and recompile 'hash.c' with same setting. */
+
+#ifndef HASH_H_
+# define HASH_H_
+
+# include <stdio.h>
+# include <stdbool.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+struct hash_tuning
+ {
+ /* This structure is mainly used for 'hash_initialize', see the block
+ documentation of 'hash_reset_tuning' for more complete comments. */
+
+ float shrink_threshold; /* ratio of used buckets to trigger a shrink */
+ float shrink_factor; /* ratio of new smaller size to original size */
+ float growth_threshold; /* ratio of used buckets to trigger a growth */
+ float growth_factor; /* ratio of new bigger size to original size */
+ bool is_n_buckets; /* if CANDIDATE really means table size */
+ };
+
+typedef struct hash_tuning Hash_tuning;
+
+struct hash_table;
+
+typedef struct hash_table Hash_table;
+
+/*
+ * Information and lookup.
+ */
+
+/* The following few functions provide information about the overall hash
+ table organization: the number of entries, number of buckets and maximum
+ length of buckets. */
+
+/* Return the number of buckets in the hash table. The table size, the total
+ number of buckets (used plus unused), or the maximum number of slots, are
+ the same quantity. */
+extern size_t hash_get_n_buckets (const Hash_table *table)
+ _GL_ATTRIBUTE_PURE;
+
+/* Return the number of slots in use (non-empty buckets). */
+extern size_t hash_get_n_buckets_used (const Hash_table *table)
+ _GL_ATTRIBUTE_PURE;
+
+/* Return the number of active entries. */
+extern size_t hash_get_n_entries (const Hash_table *table)
+ _GL_ATTRIBUTE_PURE;
+
+/* Return the length of the longest chain (bucket). */
+extern size_t hash_get_max_bucket_length (const Hash_table *table)
+ _GL_ATTRIBUTE_PURE;
+
+/* Do a mild validation of a hash table, by traversing it and checking two
+ statistics. */
+extern bool hash_table_ok (const Hash_table *table)
+ _GL_ATTRIBUTE_PURE;
+
+extern void hash_print_statistics (const Hash_table *table, FILE *stream);
+
+/* If ENTRY matches an entry already in the hash table, return the
+ entry from the table. Otherwise, return NULL. */
+extern void *hash_lookup (const Hash_table *table, const void *entry);
+
+/*
+ * Walking.
+ */
+
+/* The functions in this page traverse the hash table and process the
+ contained entries. For the traversal to work properly, the hash table
+ should not be resized nor modified while any particular entry is being
+ processed. In particular, entries should not be added, and an entry
+ may be removed only if there is no shrink threshold and the entry being
+ removed has already been passed to hash_get_next. */
+
+/* Return the first data in the table, or NULL if the table is empty. */
+extern void *hash_get_first (const Hash_table *table)
+ _GL_ATTRIBUTE_PURE;
+
+/* Return the user data for the entry following ENTRY, where ENTRY has been
+ returned by a previous call to either 'hash_get_first' or 'hash_get_next'.
+ Return NULL if there are no more entries. */
+extern void *hash_get_next (const Hash_table *table, const void *entry);
+
+/* Fill BUFFER with pointers to active user entries in the hash table, then
+ return the number of pointers copied. Do not copy more than BUFFER_SIZE
+ pointers. */
+extern size_t hash_get_entries (const Hash_table *table, void **buffer,
+ size_t buffer_size);
+
+typedef bool (*Hash_processor) (void *entry, void *processor_data);
+
+/* Call a PROCESSOR function for each entry of a hash table, and return the
+ number of entries for which the processor function returned success. A
+ pointer to some PROCESSOR_DATA which will be made available to each call to
+ the processor function. The PROCESSOR accepts two arguments: the first is
+ the user entry being walked into, the second is the value of PROCESSOR_DATA
+ as received. The walking continue for as long as the PROCESSOR function
+ returns nonzero. When it returns zero, the walking is interrupted. */
+extern size_t hash_do_for_each (const Hash_table *table,
+ Hash_processor processor, void *processor_data);
+
+/*
+ * Allocation and clean-up.
+ */
+
+/* Return a hash index for a NUL-terminated STRING between 0 and N_BUCKETS-1.
+ This is a convenience routine for constructing other hashing functions. */
+extern size_t hash_string (const char *string, size_t n_buckets)
+ _GL_ATTRIBUTE_PURE;
+
+extern void hash_reset_tuning (Hash_tuning *tuning);
+
+typedef size_t (*Hash_hasher) (const void *entry, size_t table_size);
+typedef bool (*Hash_comparator) (const void *entry1, const void *entry2);
+typedef void (*Hash_data_freer) (void *entry);
+
+/* Reclaim all storage associated with a hash table. If a data_freer
+ function has been supplied by the user when the hash table was created,
+ this function applies it to the data of each entry before freeing that
+ entry. */
+extern void hash_free (Hash_table *table);
+
+/* Allocate and return a new hash table, or NULL upon failure. The initial
+ number of buckets is automatically selected so as to _guarantee_ that you
+ may insert at least CANDIDATE different user entries before any growth of
+ the hash table size occurs. So, if have a reasonably tight a-priori upper
+ bound on the number of entries you intend to insert in the hash table, you
+ may save some table memory and insertion time, by specifying it here. If
+ the IS_N_BUCKETS field of the TUNING structure is true, the CANDIDATE
+ argument has its meaning changed to the wanted number of buckets.
+
+ TUNING points to a structure of user-supplied values, in case some fine
+ tuning is wanted over the default behavior of the hasher. If TUNING is
+ NULL, the default tuning parameters are used instead. If TUNING is
+ provided but the values requested are out of bounds or might cause
+ rounding errors, return NULL.
+
+ The user-supplied HASHER function, when not NULL, accepts two
+ arguments ENTRY and TABLE_SIZE. It computes, by hashing ENTRY contents, a
+ slot number for that entry which should be in the range 0..TABLE_SIZE-1.
+ This slot number is then returned.
+
+ The user-supplied COMPARATOR function, when not NULL, accepts two
+ arguments pointing to user data, it then returns true for a pair of entries
+ that compare equal, or false otherwise. This function is internally called
+ on entries which are already known to hash to the same bucket index,
+ but which are distinct pointers.
+
+ The user-supplied DATA_FREER function, when not NULL, may be later called
+ with the user data as an argument, just before the entry containing the
+ data gets freed. This happens from within 'hash_free' or 'hash_clear'.
+ You should specify this function only if you want these functions to free
+ all of your 'data' data. This is typically the case when your data is
+ simply an auxiliary struct that you have malloc'd to aggregate several
+ values. */
+_GL_ATTRIBUTE_NODISCARD
+extern Hash_table *hash_initialize (size_t candidate,
+ const Hash_tuning *tuning,
+ Hash_hasher hasher,
+ Hash_comparator comparator,
+ Hash_data_freer data_freer)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (hash_free, 1);
+
+/* Same as hash_initialize, but invokes xalloc_die on memory exhaustion. */
+/* This function is defined by module 'xhash'. */
+_GL_ATTRIBUTE_NODISCARD
+extern Hash_table *hash_xinitialize (size_t candidate,
+ const Hash_tuning *tuning,
+ Hash_hasher hasher,
+ Hash_comparator comparator,
+ Hash_data_freer data_freer)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (hash_free, 1)
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+
+/* Make all buckets empty, placing any chained entries on the free list.
+ Apply the user-specified function data_freer (if any) to the datas of any
+ affected entries. */
+extern void hash_clear (Hash_table *table);
+
+/*
+ * Insertion and deletion.
+ */
+
+/* For an already existing hash table, change the number of buckets through
+ specifying CANDIDATE. The contents of the hash table are preserved. The
+ new number of buckets is automatically selected so as to _guarantee_ that
+ the table may receive at least CANDIDATE different user entries, including
+ those already in the table, before any other growth of the hash table size
+ occurs. If TUNING->IS_N_BUCKETS is true, then CANDIDATE specifies the
+ exact number of buckets desired. Return true iff the rehash succeeded. */
+_GL_ATTRIBUTE_NODISCARD
+extern bool hash_rehash (Hash_table *table, size_t candidate);
+
+/* If ENTRY matches an entry already in the hash table, return the pointer
+ to the entry from the table. Otherwise, insert ENTRY and return ENTRY.
+ Return NULL if the storage required for insertion cannot be allocated.
+ This implementation does not support duplicate entries or insertion of
+ NULL. */
+_GL_ATTRIBUTE_NODISCARD
+extern void *hash_insert (Hash_table *table, const void *entry);
+
+/* Same as hash_insert, but invokes xalloc_die on memory exhaustion. */
+/* This function is defined by module 'xhash'. */
+extern void *hash_xinsert (Hash_table *table, const void *entry);
+
+/* Insert ENTRY into hash TABLE if there is not already a matching entry.
+
+ Return -1 upon memory allocation failure.
+ Return 1 if insertion succeeded.
+ Return 0 if there is already a matching entry in the table,
+ and in that case, if MATCHED_ENT is non-NULL, set *MATCHED_ENT
+ to that entry.
+
+ This interface is easier to use than hash_insert when you must
+ distinguish between the latter two cases. More importantly,
+ hash_insert is unusable for some types of ENTRY values. When using
+ hash_insert, the only way to distinguish those cases is to compare
+ the return value and ENTRY. That works only when you can have two
+ different ENTRY values that point to data that compares "equal". Thus,
+ when the ENTRY value is a simple scalar, you must use
+ hash_insert_if_absent. ENTRY must not be NULL. */
+extern int hash_insert_if_absent (Hash_table *table, const void *entry,
+ const void **matched_ent);
+
+/* If ENTRY is already in the table, remove it and return the just-deleted
+ data (the user may want to deallocate its storage). If ENTRY is not in the
+ table, don't modify the table and return NULL. */
+extern void *hash_remove (Hash_table *table, const void *entry);
+
+/* Same as hash_remove. This interface is deprecated.
+ FIXME: Remove in 2022. */
+_GL_ATTRIBUTE_DEPRECATED
+extern void *hash_delete (Hash_table *table, const void *entry);
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
diff --git a/gl/lib/ialloc.c b/gl/lib/ialloc.c
new file mode 100644
index 0000000..43c1043
--- /dev/null
+++ b/gl/lib/ialloc.c
@@ -0,0 +1,21 @@
+/* malloc with idx_t rather than size_t
+
+ Copyright 2021-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+#define IALLOC_INLINE _GL_EXTERN_INLINE
+#include "ialloc.h"
diff --git a/gl/lib/ialloc.h b/gl/lib/ialloc.h
new file mode 100644
index 0000000..37cf4bf
--- /dev/null
+++ b/gl/lib/ialloc.h
@@ -0,0 +1,100 @@
+/* ialloc.h -- malloc with idx_t rather than size_t
+
+ Copyright 2021-2022 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 2.1 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/>. */
+
+#ifndef IALLOC_H_
+#define IALLOC_H_
+
+#include "idx.h"
+
+#include <errno.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef IALLOC_INLINE
+# define IALLOC_INLINE _GL_INLINE
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+IALLOC_INLINE void * _GL_ATTRIBUTE_COLD
+_gl_alloc_nomem (void)
+{
+ errno = ENOMEM;
+ return NULL;
+}
+
+IALLOC_INLINE
+_GL_ATTRIBUTE_MALLOC /*_GL_ATTRIBUTE_DEALLOC_FREE*/
+void *
+imalloc (idx_t s)
+{
+ return s <= SIZE_MAX ? malloc (s) : _gl_alloc_nomem ();
+}
+
+IALLOC_INLINE
+/*_GL_ATTRIBUTE_DEALLOC_FREE*/
+void *
+irealloc (void *p, idx_t s)
+{
+ /* Work around GNU realloc glitch by treating a zero size as if it
+ were 1, so that returning NULL is equivalent to failing. */
+ return s <= SIZE_MAX ? realloc (p, s | !s) : _gl_alloc_nomem ();
+}
+
+IALLOC_INLINE
+_GL_ATTRIBUTE_MALLOC /*_GL_ATTRIBUTE_DEALLOC_FREE*/
+void *
+icalloc (idx_t n, idx_t s)
+{
+ if (SIZE_MAX < n)
+ {
+ if (s != 0)
+ return _gl_alloc_nomem ();
+ n = 0;
+ }
+ if (SIZE_MAX < s)
+ {
+ if (n != 0)
+ return _gl_alloc_nomem ();
+ s = 0;
+ }
+ return calloc (n, s);
+}
+
+IALLOC_INLINE void *
+ireallocarray (void *p, idx_t n, idx_t s)
+{
+ /* Work around GNU reallocarray glitch by treating a zero size as if
+ it were 1, so that returning NULL is equivalent to failing. */
+ if (n == 0 || s == 0)
+ n = s = 1;
+ return (n <= SIZE_MAX && s <= SIZE_MAX
+ ? reallocarray (p, n, s)
+ : _gl_alloc_nomem ());
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/gl/lib/idpriv-drop.c b/gl/lib/idpriv-drop.c
new file mode 100644
index 0000000..e122cb0
--- /dev/null
+++ b/gl/lib/idpriv-drop.c
@@ -0,0 +1,131 @@
+/* Dropping uid/gid privileges of the current process permanently.
+ Copyright (C) 2009-2022 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 "idpriv.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+int
+idpriv_drop (void)
+{
+#if HAVE_GETUID
+ int uid = getuid ();
+#endif
+#if HAVE_GETGID
+ int gid = getgid ();
+#endif
+
+ /* Drop the gid privilege first, because in some cases the gid privilege
+ cannot be dropped after the uid privilege has been dropped. */
+
+ /* This is for executables that have the setgid bit set. */
+#if HAVE_SETRESGID /* glibc, FreeBSD, OpenBSD, HP-UX */
+ /* This code is needed: In particular, on HP-UX 11.11, setregid (gid, gid)
+ may leave the saved gid as 0. See also the comment below regarding
+ setresuid. */
+ if (setresgid (gid, gid, gid) < 0)
+ return -1;
+#elif HAVE_SETREGID /* Mac OS X, NetBSD, AIX, IRIX, Solaris, OSF/1, Cygwin */
+ if (setregid (gid, gid) < 0)
+ return -1;
+#elif HAVE_SETEGID /* Solaris 2.4 */
+ if (setegid (gid) < 0)
+ return -1;
+#endif
+
+ /* This is for executables that have the setuid bit set. */
+#if HAVE_SETRESUID /* glibc, FreeBSD, OpenBSD, HP-UX */
+ /* On systems which have setresuid(), we use it instead of setreuid(),
+ because
+ Hao Chen, David Wagner, Drew Dean: Setuid Demystified
+ <https://www.usenix.org/legacy/publications/library/proceedings/sec02/full_papers/chen/chen.pdf>
+ says about setreuid(): "The rule by which the saved uid id is modified
+ is complicated." Similarly, <https://unixpapa.com/incnote/setuid.html>
+ says about setreuid(): "What exactly happens to the saved UID when this
+ is used seems to vary a lot." */
+ if (setresuid (uid, uid, uid) < 0)
+ return -1;
+#elif HAVE_SETREUID /* Mac OS X, NetBSD, AIX, IRIX, Solaris, OSF/1, Cygwin */
+ if (setreuid (uid, uid) < 0)
+ return -1;
+#elif HAVE_SETEUID /* Solaris 2.4 */
+ if (seteuid (uid) < 0)
+ return -1;
+#endif
+
+ /* Verify that the privileges have really been dropped.
+ This verification is here for security reasons. Doesn't matter if it
+ takes a couple of system calls.
+ On Solaris (which has saved uids and gids but no getresuid, getresgid
+ functions), we could read /proc/<pid>/cred and verify the saved uid and
+ gid found there. But it's not clear to me when to interpret the file as a
+ 'prcred_t' and when as a 'prcred32_t'.
+ Hao Chen, David Wagner, Drew Dean: Setuid Demystified
+ <https://www.usenix.org/legacy/publications/library/proceedings/sec02/full_papers/chen/chen.pdf>
+ section 8.1.3 also recommends to use a setreuid call as a probe, but
+ this call would unexpectedly succeed (and the verification thus fail)
+ on Linux if the process has the CAP_SETUID capability.
+ When the verification fails, it indicates that we need to use different
+ API in the code above. Therefore 'abort ()', not 'return -1'. */
+#if HAVE_GETRESUID /* glibc, FreeBSD, OpenBSD, HP-UX */
+ {
+ uid_t real;
+ uid_t effective;
+ uid_t saved;
+ if (getresuid (&real, &effective, &saved) < 0
+ || real != uid
+ || effective != uid
+ || saved != uid)
+ abort ();
+ }
+#else
+# if HAVE_GETEUID
+ if (geteuid () != uid)
+ abort ();
+# endif
+# if HAVE_GETUID
+ if (getuid () != uid)
+ abort ();
+# endif
+#endif
+#if HAVE_GETRESGID /* glibc, FreeBSD, OpenBSD, HP-UX */
+ {
+ gid_t real;
+ gid_t effective;
+ gid_t saved;
+ if (getresgid (&real, &effective, &saved) < 0
+ || real != gid
+ || effective != gid
+ || saved != gid)
+ abort ();
+ }
+#else
+# if HAVE_GETEGID
+ if (getegid () != gid)
+ abort ();
+# endif
+# if HAVE_GETGID
+ if (getgid () != gid)
+ abort ();
+# endif
+#endif
+
+ return 0;
+}
diff --git a/gl/lib/idpriv-droptemp.c b/gl/lib/idpriv-droptemp.c
new file mode 100644
index 0000000..f327236
--- /dev/null
+++ b/gl/lib/idpriv-droptemp.c
@@ -0,0 +1,208 @@
+/* Dropping uid/gid privileges of the current process temporarily.
+ Copyright (C) 2009-2022 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 "idpriv.h"
+
+#include <errno.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+/* The privileged uid and gid that the process had earlier. */
+#if HAVE_GETUID
+static int saved_uid = -1;
+#endif
+#if HAVE_GETGID
+static int saved_gid = -1;
+#endif
+
+int
+idpriv_temp_drop (void)
+{
+#if HAVE_GETEUID && HAVE_GETEGID && (HAVE_SETRESUID || HAVE_SETREUID) && (HAVE_SETRESGID || HAVE_SETREGID)
+ int uid = getuid ();
+ int gid = getgid ();
+
+ /* Find out about the privileged uid and gid at the first call. */
+ if (saved_uid == -1)
+ saved_uid = geteuid ();
+ if (saved_gid == -1)
+ saved_gid = getegid ();
+
+ /* Drop the gid privilege first, because in some cases the gid privilege
+ cannot be dropped after the uid privilege has been dropped. */
+
+ /* This is for executables that have the setgid bit set. */
+# if HAVE_SETRESGID /* glibc, FreeBSD, OpenBSD, HP-UX */
+ if (setresgid (-1, gid, saved_gid) < 0)
+ return -1;
+# else /* Mac OS X, NetBSD, AIX, IRIX, Solaris >= 2.5, OSF/1, Cygwin */
+ if (setregid (-1, gid) < 0)
+ return -1;
+# endif
+
+ /* This is for executables that have the setuid bit set. */
+# if HAVE_SETRESUID /* glibc, FreeBSD, OpenBSD, HP-UX */
+ /* See
+ Hao Chen, David Wagner, Drew Dean: Setuid Demystified
+ <https://www.usenix.org/legacy/publications/library/proceedings/sec02/full_papers/chen/chen.pdf>
+ figure 14. */
+ if (setresuid (-1, uid, saved_uid) < 0)
+ return -1;
+# else /* Mac OS X, NetBSD, AIX, IRIX, Solaris >= 2.5, OSF/1, Cygwin */
+ if (setreuid (-1, uid) < 0)
+ return -1;
+# endif
+
+ /* Verify that the privileges have really been dropped.
+ This verification is here for security reasons. Doesn't matter if it
+ takes a couple of system calls.
+ When the verification fails, it indicates that we need to use different
+ API in the code above. Therefore 'abort ()', not 'return -1'. */
+# if HAVE_GETRESUID /* glibc, FreeBSD, OpenBSD, HP-UX */
+ {
+ uid_t real;
+ uid_t effective;
+ uid_t saved;
+ if (getresuid (&real, &effective, &saved) < 0
+ || real != uid
+ || effective != uid
+ || saved != saved_uid)
+ abort ();
+ }
+# else
+# if HAVE_GETEUID
+ if (geteuid () != uid)
+ abort ();
+# endif
+ if (getuid () != uid)
+ abort ();
+# endif
+# if HAVE_GETRESGID /* glibc, FreeBSD, OpenBSD, HP-UX */
+ {
+ uid_t real;
+ uid_t effective;
+ uid_t saved;
+ if (getresgid (&real, &effective, &saved) < 0
+ || real != gid
+ || effective != gid
+ || saved != saved_gid)
+ abort ();
+ }
+# else
+# if HAVE_GETEGID
+ if (getegid () != gid)
+ abort ();
+# endif
+ if (getgid () != gid)
+ abort ();
+# endif
+
+ return 0;
+#else
+ errno = ENOSYS;
+ return -1;
+#endif
+}
+
+int
+idpriv_temp_restore (void)
+{
+#if HAVE_GETEUID && HAVE_GETEGID && (HAVE_SETRESUID || HAVE_SETREUID) && (HAVE_SETRESGID || HAVE_SETREGID)
+ int uid = getuid ();
+ int gid = getgid ();
+
+ if (saved_uid == -1 || saved_gid == -1)
+ /* Caller error: idpriv_temp_drop was never invoked. */
+ abort ();
+
+ /* Acquire the gid privilege last, because in some cases the gid privilege
+ cannot be acquired before the uid privilege has been acquired. */
+
+ /* This is for executables that have the setuid bit set. */
+# if HAVE_SETRESUID /* glibc, FreeBSD, OpenBSD, HP-UX */
+ /* See
+ Hao Chen, David Wagner, Drew Dean: Setuid Demystified
+ <https://www.usenix.org/legacy/publications/library/proceedings/sec02/full_papers/chen/chen.pdf>
+ figure 14. */
+ if (setresuid (-1, saved_uid, -1) < 0)
+ return -1;
+# else /* Mac OS X, NetBSD, AIX, IRIX, Solaris >= 2.5, OSF/1, Cygwin */
+ if (setreuid (-1, saved_uid) < 0)
+ return -1;
+# endif
+
+ /* This is for executables that have the setgid bit set. */
+# if HAVE_SETRESGID /* glibc, FreeBSD, OpenBSD, HP-UX */
+ if (setresgid (-1, saved_gid, -1) < 0)
+ return -1;
+# else /* Mac OS X, NetBSD, AIX, IRIX, Solaris >= 2.5, OSF/1, Cygwin */
+ if (setregid (-1, saved_gid) < 0)
+ return -1;
+# endif
+
+ /* Verify that the privileges have really been acquired.
+ This verification is here for security reasons. Doesn't matter if it
+ takes a couple of system calls.
+ When the verification fails, it indicates that we need to use different
+ API in the code above. Therefore 'abort ()', not 'return -1'. */
+# if HAVE_GETRESUID /* glibc, FreeBSD, OpenBSD, HP-UX */
+ {
+ uid_t real;
+ uid_t effective;
+ uid_t saved;
+ if (getresuid (&real, &effective, &saved) < 0
+ || real != uid
+ || effective != saved_uid
+ || saved != saved_uid)
+ abort ();
+ }
+# else
+# if HAVE_GETEUID
+ if (geteuid () != saved_uid)
+ abort ();
+# endif
+ if (getuid () != uid)
+ abort ();
+# endif
+# if HAVE_GETRESGID /* glibc, FreeBSD, OpenBSD, HP-UX */
+ {
+ uid_t real;
+ uid_t effective;
+ uid_t saved;
+ if (getresgid (&real, &effective, &saved) < 0
+ || real != gid
+ || effective != saved_gid
+ || saved != saved_gid)
+ abort ();
+ }
+# else
+# if HAVE_GETEGID
+ if (getegid () != saved_gid)
+ abort ();
+# endif
+ if (getgid () != gid)
+ abort ();
+# endif
+
+ return 0;
+#else
+ errno = ENOSYS;
+ return -1;
+#endif
+}
diff --git a/gl/lib/idpriv.h b/gl/lib/idpriv.h
new file mode 100644
index 0000000..b97d192
--- /dev/null
+++ b/gl/lib/idpriv.h
@@ -0,0 +1,116 @@
+/* Dropping uid/gid privileges of the current process.
+ Copyright (C) 2009-2022 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 _IDPRIV_H
+#define _IDPRIV_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* This module allows programs which are installed with setuid or setgid bit
+ (and which therefore initially run with an effective user id or group id
+ different from the one of the current user) to drop their uid or gid
+ privilege, either permanently or temporarily.
+
+ It is absolutely necessary to minimize the amount of code that is running
+ with escalated privileges (e.g. with effective uid = root). The reason is
+ that any bug or exploit in a part of a program that is running with
+ escalated privileges is a security vulnerability that - upon discovery -
+ puts the users in danger and requires immediate fixing. Then consider that
+ there's a bug every 10 or 20 lines of code on average...
+
+ For programs that temporarily drop privileges but have the ability to
+ restore them later, there are additionally the dangers that
+ - Any bug in the non-privileged part of the program may be used to
+ create invalid data structures that will trigger security
+ vulnerabilities in the privileged part of the program.
+ - Code execution exploits in the non-privileged part of the program may
+ be used to invoke the function that restores high privileges and then
+ execute additional arbitrary code.
+
+ 1) The usual, and reasonably safe, way to minimize the amount of code
+ running with privileges is to create a separate executable, with setuid
+ or setgid bit, that contains only code for the tasks that require
+ privileges (and,of course, strict checking of the arguments, so that the
+ program cannot be abused). The main program is installed without setuid
+ or setgid bit.
+
+ 2) A less safe way is to do some privileged tasks at the beginning of the
+ program's run, and drop privileges permanently as soon as possible.
+
+ Note: There may still be security issues if the privileged task puts
+ sensitive data into the process memory or opens communication channels
+ to restricted facilities.
+
+ 3) The most unsafe way is to drop privileges temporarily for most of the
+ main program but to re-enable them for the duration of privileged tasks.
+
+ As explained above, this approach has uncontrollable dangers for
+ security.
+
+ This approach is normally not usable in multithreaded programs, because
+ you cannot know what kind of system calls the other threads could be
+ doing during the time the privileges are enabled.
+
+ With approach 1, you don't need gnulib modules.
+ With approach 2, you need the gnulib module 'idpriv-drop'.
+ With approach 3, you need the gnulib module 'idpriv-droptemp'. But really,
+ you should better stay away from this approach.
+ */
+
+/* For more in-depth discussion of these topics, see the papers/articles
+ * Hao Chen, David Wagner, Drew Dean: Setuid Demystified
+ <https://www.usenix.org/legacy/publications/library/proceedings/sec02/full_papers/chen/chen.pdf>
+ * Dan Tsafrir, Dilma da Silva, David Wagner: The Murky Issue of Changing
+ Process Identity: Revising "Setuid Demystified"
+ <https://people.eecs.berkeley.edu/~daw/papers/setuid-login08b.pdf>
+ <https://code.google.com/archive/p/change-process-identity/>
+ * Dhruv Mohindra: Observe correct revocation order while relinquishing
+ privileges
+ <https://www.securecoding.cert.org/confluence/display/seccode/POS36-C.+Observe+correct+revocation+order+while+relinquishing+privileges>
+ */
+
+
+/* For approach 2. */
+
+/* Drop the uid and gid privileges of the current process.
+ Return 0 if successful, or -1 with errno set upon failure. The recommended
+ handling of failure is to terminate the process. */
+extern int idpriv_drop (void);
+
+
+/* For approach 3. */
+
+/* Drop the uid and gid privileges of the current process in a way that allows
+ them to be restored later.
+ Return 0 if successful, or -1 with errno set upon failure. The recommended
+ handling of failure is to terminate the process. */
+extern int idpriv_temp_drop (void);
+
+/* Restore the uid and gid privileges of the current process.
+ Return 0 if successful, or -1 with errno set upon failure. The recommended
+ handling of failure is to not perform the actions that require the escalated
+ privileges. */
+extern int idpriv_temp_restore (void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _IDPRIV_H */
diff --git a/gl/lib/idx.h b/gl/lib/idx.h
new file mode 100644
index 0000000..c3669dd
--- /dev/null
+++ b/gl/lib/idx.h
@@ -0,0 +1,134 @@
+/* A type for indices and sizes.
+ Copyright (C) 2020-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _IDX_H
+#define _IDX_H
+
+/* Get ptrdiff_t. */
+#include <stddef.h>
+
+/* Get PTRDIFF_MAX. */
+#include <stdint.h>
+
+/* The type 'idx_t' holds an (array) index or an (object) size.
+ Its implementation promotes to a signed integer type,
+ which can hold the values
+ 0..2^63-1 (on 64-bit platforms) or
+ 0..2^31-1 (on 32-bit platforms).
+
+ Why a signed integer type?
+
+ * Security: Signed types can be checked for overflow via
+ '-fsanitize=undefined', but unsigned types cannot.
+
+ * Comparisons without surprises: ISO C99 § 6.3.1.8 specifies a few
+ surprising results for comparisons, such as
+
+ (int) -3 < (unsigned long) 7 => false
+ (int) -3 < (unsigned int) 7 => false
+ and on 32-bit machines:
+ (long) -3 < (unsigned int) 7 => false
+
+ This is surprising because the natural comparison order is by
+ value in the realm of infinite-precision signed integers (ℤ).
+
+ The best way to get rid of such surprises is to use signed types
+ for numerical integer values, and use unsigned types only for
+ bit masks and enums.
+
+ Why not use 'size_t' directly?
+
+ * Because 'size_t' is an unsigned type, and a signed type is better.
+ See above.
+
+ Why not use 'ssize_t'?
+
+ * 'ptrdiff_t' is more portable; it is standardized by ISO C
+ whereas 'ssize_t' is standardized only by POSIX.
+
+ * 'ssize_t' is not required to be as wide as 'size_t', and some
+ now-obsolete POSIX platforms had 'size_t' wider than 'ssize_t'.
+
+ * Conversely, some now-obsolete platforms had 'ptrdiff_t' wider
+ than 'size_t', which can be a win and conforms to POSIX.
+
+ Won't this cause a problem with objects larger than PTRDIFF_MAX?
+
+ * Typical modern or large platforms do not allocate such objects,
+ so this is not much of a problem in practice; for example, you
+ can safely write 'idx_t len = strlen (s);'. To port to older
+ small platforms where allocations larger than PTRDIFF_MAX could
+ in theory be a problem, you can use Gnulib's ialloc module, or
+ functions like ximalloc in Gnulib's xalloc module.
+
+ Why not use 'ptrdiff_t' directly?
+
+ * Maintainability: When reading and modifying code, it helps to know that
+ a certain variable cannot have negative values. For example, when you
+ have a loop
+
+ int n = ...;
+ for (int i = 0; i < n; i++) ...
+
+ or
+
+ ptrdiff_t n = ...;
+ for (ptrdiff_t i = 0; i < n; i++) ...
+
+ you have to ask yourself "what if n < 0?". Whereas in
+
+ idx_t n = ...;
+ for (idx_t i = 0; i < n; i++) ...
+
+ you know that this case cannot happen.
+
+ Similarly, when a programmer writes
+
+ idx_t = ptr2 - ptr1;
+
+ there is an implied assertion that ptr1 and ptr2 point into the same
+ object and that ptr1 <= ptr2.
+
+ * Being future-proof: In the future, range types (integers which are
+ constrained to a certain range of values) may be added to C compilers
+ or to the C standard. Several programming languages (Ada, Haskell,
+ Common Lisp, Pascal) already have range types. Such range types may
+ help producing good code and good warnings. The type 'idx_t' could
+ then be typedef'ed to a range type that is signed after promotion. */
+
+/* In the future, idx_t could be typedef'ed to a signed range type.
+ The clang "extended integer types", supported in Clang 11 or newer
+ <https://clang.llvm.org/docs/LanguageExtensions.html#extended-integer-types>,
+ are a special case of range types. However, these types don't support binary
+ operators with plain integer types (e.g. expressions such as x > 1).
+ Therefore, they don't behave like signed types (and not like unsigned types
+ either). So, we cannot use them here. */
+
+/* Use the signed type 'ptrdiff_t'. */
+/* Note: ISO C does not mandate that 'size_t' and 'ptrdiff_t' have the same
+ size, but it is so on all platforms we have seen since 1990. */
+typedef ptrdiff_t idx_t;
+
+/* IDX_MAX is the maximum value of an idx_t. */
+#define IDX_MAX PTRDIFF_MAX
+
+/* So far no need has been found for an IDX_WIDTH macro.
+ Perhaps there should be another macro IDX_VALUE_BITS that does not
+ count the sign bit and is therefore one less than PTRDIFF_WIDTH. */
+
+#endif /* _IDX_H */
diff --git a/gl/lib/intprops.h b/gl/lib/intprops.h
new file mode 100644
index 0000000..d4a917f
--- /dev/null
+++ b/gl/lib/intprops.h
@@ -0,0 +1,642 @@
+/* intprops.h -- properties of integer types
+
+ Copyright (C) 2001-2022 Free Software Foundation, Inc.
+
+ This program 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 2.1 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU 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/>. */
+
+
+#ifndef _GL_INTPROPS_H
+#define _GL_INTPROPS_H
+
+#include <limits.h>
+
+/* Return a value with the common real type of E and V and the value of V.
+ Do not evaluate E. */
+#define _GL_INT_CONVERT(e, v) ((1 ? 0 : (e)) + (v))
+
+/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see
+ <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00406.html>. */
+#define _GL_INT_NEGATE_CONVERT(e, v) ((1 ? 0 : (e)) - (v))
+
+/* The extra casts in the following macros work around compiler bugs,
+ e.g., in Cray C 5.0.3.0. */
+
+/* True if the arithmetic type T is an integer type. bool counts as
+ an integer. */
+#define TYPE_IS_INTEGER(t) ((t) 1.5 == 1)
+
+/* True if the real type T is signed. */
+#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+
+/* Return 1 if the real expression E, after promotion, has a
+ signed or floating type. Do not evaluate E. */
+#define EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
+
+
+/* Minimum and maximum values for integer types and expressions. */
+
+/* The width in bits of the integer type or expression T.
+ Do not evaluate T. T must not be a bit-field expression.
+ Padding bits are not supported; this is checked at compile-time below. */
+#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
+
+/* The maximum and minimum values for the integer type T. */
+#define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
+#define TYPE_MAXIMUM(t) \
+ ((t) (! TYPE_SIGNED (t) \
+ ? (t) -1 \
+ : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
+
+/* The maximum and minimum values for the type of the expression E,
+ after integer promotion. E is not evaluated. */
+#define _GL_INT_MINIMUM(e) \
+ (EXPR_SIGNED (e) \
+ ? ~ _GL_SIGNED_INT_MAXIMUM (e) \
+ : _GL_INT_CONVERT (e, 0))
+#define _GL_INT_MAXIMUM(e) \
+ (EXPR_SIGNED (e) \
+ ? _GL_SIGNED_INT_MAXIMUM (e) \
+ : _GL_INT_NEGATE_CONVERT (e, 1))
+#define _GL_SIGNED_INT_MAXIMUM(e) \
+ (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH (+ (e)) - 2)) - 1) * 2 + 1)
+
+/* Work around OpenVMS incompatibility with C99. */
+#if !defined LLONG_MAX && defined __INT64_MAX
+# define LLONG_MAX __INT64_MAX
+# define LLONG_MIN __INT64_MIN
+#endif
+
+/* This include file assumes that signed types are two's complement without
+ padding bits; the above macros have undefined behavior otherwise.
+ If this is a problem for you, please let us know how to fix it for your host.
+ This assumption is tested by the intprops-tests module. */
+
+/* Does the __typeof__ keyword work? This could be done by
+ 'configure', but for now it's easier to do it by hand. */
+#if (2 <= __GNUC__ \
+ || (4 <= __clang_major__) \
+ || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
+ || (0x5110 <= __SUNPRO_C && !__STDC__))
+# define _GL_HAVE___TYPEOF__ 1
+#else
+# define _GL_HAVE___TYPEOF__ 0
+#endif
+
+/* Return 1 if the integer type or expression T might be signed. Return 0
+ if it is definitely unsigned. T must not be a bit-field expression.
+ This macro does not evaluate its argument, and expands to an
+ integer constant expression. */
+#if _GL_HAVE___TYPEOF__
+# define _GL_SIGNED_TYPE_OR_EXPR(t) TYPE_SIGNED (__typeof__ (t))
+#else
+# define _GL_SIGNED_TYPE_OR_EXPR(t) 1
+#endif
+
+/* Bound on length of the string representing an unsigned integer
+ value representable in B bits. log10 (2.0) < 146/485. The
+ smallest value of B where this bound is not tight is 2621. */
+#define INT_BITS_STRLEN_BOUND(b) (((b) * 146 + 484) / 485)
+
+/* Bound on length of the string representing an integer type or expression T.
+ T must not be a bit-field expression.
+
+ Subtract 1 for the sign bit if T is signed, and then add 1 more for
+ a minus sign if needed.
+
+ Because _GL_SIGNED_TYPE_OR_EXPR sometimes returns 1 when its argument is
+ unsigned, this macro may overestimate the true bound by one byte when
+ applied to unsigned types of size 2, 4, 16, ... bytes. */
+#define INT_STRLEN_BOUND(t) \
+ (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \
+ + _GL_SIGNED_TYPE_OR_EXPR (t))
+
+/* Bound on buffer size needed to represent an integer type or expression T,
+ including the terminating null. T must not be a bit-field expression. */
+#define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1)
+
+
+/* Range overflow checks.
+
+ The INT_<op>_RANGE_OVERFLOW macros return 1 if the corresponding C
+ operators might not yield numerically correct answers due to
+ arithmetic overflow. They do not rely on undefined or
+ implementation-defined behavior. Their implementations are simple
+ and straightforward, but they are harder to use and may be less
+ efficient than the INT_<op>_WRAPV, INT_<op>_OK, and
+ INT_<op>_OVERFLOW macros described below.
+
+ Example usage:
+
+ long int i = ...;
+ long int j = ...;
+ if (INT_MULTIPLY_RANGE_OVERFLOW (i, j, LONG_MIN, LONG_MAX))
+ printf ("multiply would overflow");
+ else
+ printf ("product is %ld", i * j);
+
+ Restrictions on *_RANGE_OVERFLOW macros:
+
+ These macros do not check for all possible numerical problems or
+ undefined or unspecified behavior: they do not check for division
+ by zero, for bad shift counts, or for shifting negative numbers.
+
+ These macros may evaluate their arguments zero or multiple times,
+ so the arguments should not have side effects. The arithmetic
+ arguments (including the MIN and MAX arguments) must be of the same
+ integer type after the usual arithmetic conversions, and the type
+ must have minimum value MIN and maximum MAX. Unsigned types should
+ use a zero MIN of the proper type.
+
+ Because all arguments are subject to integer promotions, these
+ macros typically do not work on types narrower than 'int'.
+
+ These macros are tuned for constant MIN and MAX. For commutative
+ operations such as A + B, they are also tuned for constant B. */
+
+/* Return 1 if A + B would overflow in [MIN,MAX] arithmetic.
+ See above for restrictions. */
+#define INT_ADD_RANGE_OVERFLOW(a, b, min, max) \
+ ((b) < 0 \
+ ? (a) < (min) - (b) \
+ : (max) - (b) < (a))
+
+/* Return 1 if A - B would overflow in [MIN,MAX] arithmetic.
+ See above for restrictions. */
+#define INT_SUBTRACT_RANGE_OVERFLOW(a, b, min, max) \
+ ((b) < 0 \
+ ? (max) + (b) < (a) \
+ : (a) < (min) + (b))
+
+/* Return 1 if - A would overflow in [MIN,MAX] arithmetic.
+ See above for restrictions. */
+#define INT_NEGATE_RANGE_OVERFLOW(a, min, max) \
+ ((min) < 0 \
+ ? (a) < - (max) \
+ : 0 < (a))
+
+/* Return 1 if A * B would overflow in [MIN,MAX] arithmetic.
+ See above for restrictions. Avoid && and || as they tickle
+ bugs in Sun C 5.11 2010/08/13 and other compilers; see
+ <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00401.html>. */
+#define INT_MULTIPLY_RANGE_OVERFLOW(a, b, min, max) \
+ ((b) < 0 \
+ ? ((a) < 0 \
+ ? (a) < (max) / (b) \
+ : (b) == -1 \
+ ? 0 \
+ : (min) / (b) < (a)) \
+ : (b) == 0 \
+ ? 0 \
+ : ((a) < 0 \
+ ? (a) < (min) / (b) \
+ : (max) / (b) < (a)))
+
+/* Return 1 if A / B would overflow in [MIN,MAX] arithmetic.
+ See above for restrictions. Do not check for division by zero. */
+#define INT_DIVIDE_RANGE_OVERFLOW(a, b, min, max) \
+ ((min) < 0 && (b) == -1 && (a) < - (max))
+
+/* Return 1 if A % B would overflow in [MIN,MAX] arithmetic.
+ See above for restrictions. Do not check for division by zero.
+ Mathematically, % should never overflow, but on x86-like hosts
+ INT_MIN % -1 traps, and the C standard permits this, so treat this
+ as an overflow too. */
+#define INT_REMAINDER_RANGE_OVERFLOW(a, b, min, max) \
+ INT_DIVIDE_RANGE_OVERFLOW (a, b, min, max)
+
+/* Return 1 if A << B would overflow in [MIN,MAX] arithmetic.
+ See above for restrictions. Here, MIN and MAX are for A only, and B need
+ not be of the same type as the other arguments. The C standard says that
+ behavior is undefined for shifts unless 0 <= B < wordwidth, and that when
+ A is negative then A << B has undefined behavior and A >> B has
+ implementation-defined behavior, but do not check these other
+ restrictions. */
+#define INT_LEFT_SHIFT_RANGE_OVERFLOW(a, b, min, max) \
+ ((a) < 0 \
+ ? (a) < (min) >> (b) \
+ : (max) >> (b) < (a))
+
+/* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
+ (A, B, P) work when P is non-null. */
+#ifdef __EDG__
+/* EDG-based compilers like nvc 22.1 cannot add 64-bit signed to unsigned
+ <https://bugs.gnu.org/53256>. */
+# define _GL_HAS_BUILTIN_ADD_OVERFLOW 0
+#elif defined __has_builtin
+# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
+/* __builtin_{add,sub}_overflow exists but is not reliable in GCC 5.x and 6.x,
+ see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269>. */
+#elif 7 <= __GNUC__
+# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
+#else
+# define _GL_HAS_BUILTIN_ADD_OVERFLOW 0
+#endif
+
+/* True if __builtin_mul_overflow (A, B, P) works when P is non-null. */
+#if defined __clang_major__ && __clang_major__ < 14
+/* Work around Clang bug <https://bugs.llvm.org/show_bug.cgi?id=16404>. */
+# define _GL_HAS_BUILTIN_MUL_OVERFLOW 0
+#else
+# define _GL_HAS_BUILTIN_MUL_OVERFLOW _GL_HAS_BUILTIN_ADD_OVERFLOW
+#endif
+
+/* True if __builtin_add_overflow_p (A, B, C) works, and similarly for
+ __builtin_sub_overflow_p and __builtin_mul_overflow_p. */
+#ifdef __EDG__
+/* In EDG-based compilers like ICC 2021.3 and earlier,
+ __builtin_add_overflow_p etc. are not treated as integral constant
+ expressions even when all arguments are. */
+# define _GL_HAS_BUILTIN_OVERFLOW_P 0
+#elif defined __has_builtin
+# define _GL_HAS_BUILTIN_OVERFLOW_P __has_builtin (__builtin_mul_overflow_p)
+#else
+# define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
+#endif
+
+/* The _GL*_OVERFLOW macros have the same restrictions as the
+ *_RANGE_OVERFLOW macros, except that they do not assume that operands
+ (e.g., A and B) have the same type as MIN and MAX. Instead, they assume
+ that the result (e.g., A + B) has that type. */
+#if _GL_HAS_BUILTIN_OVERFLOW_P
+# define _GL_ADD_OVERFLOW(a, b, min, max) \
+ __builtin_add_overflow_p (a, b, (__typeof__ ((a) + (b))) 0)
+# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \
+ __builtin_sub_overflow_p (a, b, (__typeof__ ((a) - (b))) 0)
+# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \
+ __builtin_mul_overflow_p (a, b, (__typeof__ ((a) * (b))) 0)
+#else
+# define _GL_ADD_OVERFLOW(a, b, min, max) \
+ ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max) \
+ : (a) < 0 ? (b) <= (a) + (b) \
+ : (b) < 0 ? (a) <= (a) + (b) \
+ : (a) + (b) < (b))
+# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \
+ ((min) < 0 ? INT_SUBTRACT_RANGE_OVERFLOW (a, b, min, max) \
+ : (a) < 0 ? 1 \
+ : (b) < 0 ? (a) - (b) <= (a) \
+ : (a) < (b))
+# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \
+ (((min) == 0 && (((a) < 0 && 0 < (b)) || ((b) < 0 && 0 < (a)))) \
+ || INT_MULTIPLY_RANGE_OVERFLOW (a, b, min, max))
+#endif
+#define _GL_DIVIDE_OVERFLOW(a, b, min, max) \
+ ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max) \
+ : (a) < 0 ? (b) <= (a) + (b) - 1 \
+ : (b) < 0 && (a) + (b) <= (a))
+#define _GL_REMAINDER_OVERFLOW(a, b, min, max) \
+ ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max) \
+ : (a) < 0 ? (a) % (b) != ((max) - (b) + 1) % (b) \
+ : (b) < 0 && ! _GL_UNSIGNED_NEG_MULTIPLE (a, b, max))
+
+/* Return a nonzero value if A is a mathematical multiple of B, where
+ A is unsigned, B is negative, and MAX is the maximum value of A's
+ type. A's type must be the same as (A % B)'s type. Normally (A %
+ -B == 0) suffices, but things get tricky if -B would overflow. */
+#define _GL_UNSIGNED_NEG_MULTIPLE(a, b, max) \
+ (((b) < -_GL_SIGNED_INT_MAXIMUM (b) \
+ ? (_GL_SIGNED_INT_MAXIMUM (b) == (max) \
+ ? (a) \
+ : (a) % (_GL_INT_CONVERT (a, _GL_SIGNED_INT_MAXIMUM (b)) + 1)) \
+ : (a) % - (b)) \
+ == 0)
+
+/* Check for integer overflow, and report low order bits of answer.
+
+ The INT_<op>_OVERFLOW macros return 1 if the corresponding C operators
+ might not yield numerically correct answers due to arithmetic overflow.
+ The INT_<op>_WRAPV macros compute the low-order bits of the sum,
+ difference, and product of two C integers, and return 1 if these
+ low-order bits are not numerically correct.
+ These macros work correctly on all known practical hosts, and do not rely
+ on undefined behavior due to signed arithmetic overflow.
+
+ Example usage, assuming A and B are long int:
+
+ if (INT_MULTIPLY_OVERFLOW (a, b))
+ printf ("result would overflow\n");
+ else
+ printf ("result is %ld (no overflow)\n", a * b);
+
+ Example usage with WRAPV flavor:
+
+ long int result;
+ bool overflow = INT_MULTIPLY_WRAPV (a, b, &result);
+ printf ("result is %ld (%s)\n", result,
+ overflow ? "after overflow" : "no overflow");
+
+ Restrictions on these macros:
+
+ These macros do not check for all possible numerical problems or
+ undefined or unspecified behavior: they do not check for division
+ by zero, for bad shift counts, or for shifting negative numbers.
+
+ These macros may evaluate their arguments zero or multiple times, so the
+ arguments should not have side effects.
+
+ The WRAPV macros are not constant expressions. They support only
+ +, binary -, and *.
+
+ Because the WRAPV macros convert the result, they report overflow
+ in different circumstances than the OVERFLOW macros do. For
+ example, in the typical case with 16-bit 'short' and 32-bit 'int',
+ if A, B and R are all of type 'short' then INT_ADD_OVERFLOW (A, B)
+ returns false because the addition cannot overflow after A and B
+ are converted to 'int', whereas INT_ADD_WRAPV (A, B, &R) returns
+ true or false depending on whether the sum fits into 'short'.
+
+ These macros are tuned for their last input argument being a constant.
+
+ Return 1 if the integer expressions A * B, A - B, -A, A * B, A / B,
+ A % B, and A << B would overflow, respectively. */
+
+#define INT_ADD_OVERFLOW(a, b) \
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
+#define INT_SUBTRACT_OVERFLOW(a, b) \
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
+#if _GL_HAS_BUILTIN_OVERFLOW_P
+# define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a)
+#else
+# define INT_NEGATE_OVERFLOW(a) \
+ INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
+#endif
+#define INT_MULTIPLY_OVERFLOW(a, b) \
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_MULTIPLY_OVERFLOW)
+#define INT_DIVIDE_OVERFLOW(a, b) \
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_DIVIDE_OVERFLOW)
+#define INT_REMAINDER_OVERFLOW(a, b) \
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_REMAINDER_OVERFLOW)
+#define INT_LEFT_SHIFT_OVERFLOW(a, b) \
+ INT_LEFT_SHIFT_RANGE_OVERFLOW (a, b, \
+ _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
+
+/* Return 1 if the expression A <op> B would overflow,
+ where OP_RESULT_OVERFLOW (A, B, MIN, MAX) does the actual test,
+ assuming MIN and MAX are the minimum and maximum for the result type.
+ Arguments should be free of side effects. */
+#define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow) \
+ op_result_overflow (a, b, \
+ _GL_INT_MINIMUM (_GL_INT_CONVERT (a, b)), \
+ _GL_INT_MAXIMUM (_GL_INT_CONVERT (a, b)))
+
+/* Store the low-order bits of A + B, A - B, A * B, respectively, into *R.
+ Return 1 if the result overflows. See above for restrictions. */
+#if _GL_HAS_BUILTIN_ADD_OVERFLOW
+# define INT_ADD_WRAPV(a, b, r) __builtin_add_overflow (a, b, r)
+# define INT_SUBTRACT_WRAPV(a, b, r) __builtin_sub_overflow (a, b, r)
+#else
+# define INT_ADD_WRAPV(a, b, r) \
+ _GL_INT_OP_WRAPV (a, b, r, +, _GL_INT_ADD_RANGE_OVERFLOW)
+# define INT_SUBTRACT_WRAPV(a, b, r) \
+ _GL_INT_OP_WRAPV (a, b, r, -, _GL_INT_SUBTRACT_RANGE_OVERFLOW)
+#endif
+#if _GL_HAS_BUILTIN_MUL_OVERFLOW
+# if ((9 < __GNUC__ + (3 <= __GNUC_MINOR__) \
+ || (__GNUC__ == 8 && 4 <= __GNUC_MINOR__)) \
+ && !defined __EDG__)
+# define INT_MULTIPLY_WRAPV(a, b, r) __builtin_mul_overflow (a, b, r)
+# else
+ /* Work around GCC bug 91450. */
+# define INT_MULTIPLY_WRAPV(a, b, r) \
+ ((!_GL_SIGNED_TYPE_OR_EXPR (*(r)) && EXPR_SIGNED (a) && EXPR_SIGNED (b) \
+ && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1)) \
+ ? ((void) __builtin_mul_overflow (a, b, r), 1) \
+ : __builtin_mul_overflow (a, b, r))
+# endif
+#else
+# define INT_MULTIPLY_WRAPV(a, b, r) \
+ _GL_INT_OP_WRAPV (a, b, r, *, _GL_INT_MULTIPLY_RANGE_OVERFLOW)
+#endif
+
+/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See:
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
+ https://llvm.org/bugs/show_bug.cgi?id=25390
+ For now, assume all versions of GCC-like compilers generate bogus
+ warnings for _Generic. This matters only for compilers that
+ lack relevant builtins. */
+#if __GNUC__ || defined __clang__
+# define _GL__GENERIC_BOGUS 1
+#else
+# define _GL__GENERIC_BOGUS 0
+#endif
+
+/* Store the low-order bits of A <op> B into *R, where OP specifies
+ the operation and OVERFLOW the overflow predicate. Return 1 if the
+ result overflows. See above for restrictions. */
+#if 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
+# define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \
+ (_Generic \
+ (*(r), \
+ signed char: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ signed char, SCHAR_MIN, SCHAR_MAX), \
+ unsigned char: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ unsigned char, 0, UCHAR_MAX), \
+ short int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ short int, SHRT_MIN, SHRT_MAX), \
+ unsigned short int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ unsigned short int, 0, USHRT_MAX), \
+ int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ int, INT_MIN, INT_MAX), \
+ unsigned int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ unsigned int, 0, UINT_MAX), \
+ long int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+ long int, LONG_MIN, LONG_MAX), \
+ unsigned long int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+ unsigned long int, 0, ULONG_MAX), \
+ long long int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
+ long long int, LLONG_MIN, LLONG_MAX), \
+ unsigned long long int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
+ unsigned long long int, 0, ULLONG_MAX)))
+#else
+/* Store the low-order bits of A <op> B into *R, where OP specifies
+ the operation and OVERFLOW the overflow predicate. If *R is
+ signed, its type is ST with bounds SMIN..SMAX; otherwise its type
+ is UT with bounds U..UMAX. ST and UT are narrower than int.
+ Return 1 if the result overflows. See above for restrictions. */
+# if _GL_HAVE___TYPEOF__
+# define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \
+ (TYPE_SIGNED (__typeof__ (*(r))) \
+ ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, st, smin, smax) \
+ : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, ut, 0, umax))
+# else
+# define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \
+ (overflow (a, b, smin, smax) \
+ ? (overflow (a, b, 0, umax) \
+ ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 1) \
+ : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) < 0) \
+ : (overflow (a, b, 0, umax) \
+ ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) >= 0 \
+ : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 0)))
+# endif
+
+# define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \
+ (sizeof *(r) == sizeof (signed char) \
+ ? _GL_INT_OP_WRAPV_SMALLISH (a, b, r, op, overflow, \
+ signed char, SCHAR_MIN, SCHAR_MAX, \
+ unsigned char, UCHAR_MAX) \
+ : sizeof *(r) == sizeof (short int) \
+ ? _GL_INT_OP_WRAPV_SMALLISH (a, b, r, op, overflow, \
+ short int, SHRT_MIN, SHRT_MAX, \
+ unsigned short int, USHRT_MAX) \
+ : sizeof *(r) == sizeof (int) \
+ ? (EXPR_SIGNED (*(r)) \
+ ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ int, INT_MIN, INT_MAX) \
+ : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ unsigned int, 0, UINT_MAX)) \
+ : _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow))
+# ifdef LLONG_MAX
+# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
+ (sizeof *(r) == sizeof (long int) \
+ ? (EXPR_SIGNED (*(r)) \
+ ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+ long int, LONG_MIN, LONG_MAX) \
+ : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+ unsigned long int, 0, ULONG_MAX)) \
+ : (EXPR_SIGNED (*(r)) \
+ ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
+ long long int, LLONG_MIN, LLONG_MAX) \
+ : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
+ unsigned long long int, 0, ULLONG_MAX)))
+# else
+# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
+ (EXPR_SIGNED (*(r)) \
+ ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+ long int, LONG_MIN, LONG_MAX) \
+ : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+ unsigned long int, 0, ULONG_MAX))
+# endif
+#endif
+
+/* Store the low-order bits of A <op> B into *R, where the operation
+ is given by OP. Use the unsigned type UT for calculation to avoid
+ overflow problems. *R's type is T, with extrema TMIN and TMAX.
+ T must be a signed integer type. Return 1 if the result overflows. */
+#define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax) \
+ (overflow (a, b, tmin, tmax) \
+ ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 1) \
+ : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 0))
+
+/* Return the low-order bits of A <op> B, where the operation is given
+ by OP. Use the unsigned type UT for calculation to avoid undefined
+ behavior on signed integer overflow, and convert the result to type T.
+ UT is at least as wide as T and is no narrower than unsigned int,
+ T is two's complement, and there is no padding or trap representations.
+ Assume that converting UT to T yields the low-order bits, as is
+ done in all known two's-complement C compilers. E.g., see:
+ https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html
+
+ According to the C standard, converting UT to T yields an
+ implementation-defined result or signal for values outside T's
+ range. However, code that works around this theoretical problem
+ runs afoul of a compiler bug in Oracle Studio 12.3 x86. See:
+ https://lists.gnu.org/r/bug-gnulib/2017-04/msg00049.html
+ As the compiler bug is real, don't try to work around the
+ theoretical problem. */
+
+#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t) \
+ ((t) ((ut) (a) op (ut) (b)))
+
+/* Return true if the numeric values A + B, A - B, A * B fall outside
+ the range TMIN..TMAX. Arguments should be integer expressions
+ without side effects. TMIN should be signed and nonpositive.
+ TMAX should be positive, and should be signed unless TMIN is zero. */
+#define _GL_INT_ADD_RANGE_OVERFLOW(a, b, tmin, tmax) \
+ ((b) < 0 \
+ ? (((tmin) \
+ ? ((EXPR_SIGNED (_GL_INT_CONVERT (a, (tmin) - (b))) || (b) < (tmin)) \
+ && (a) < (tmin) - (b)) \
+ : (a) <= -1 - (b)) \
+ || ((EXPR_SIGNED (a) ? 0 <= (a) : (tmax) < (a)) && (tmax) < (a) + (b))) \
+ : (a) < 0 \
+ ? (((tmin) \
+ ? ((EXPR_SIGNED (_GL_INT_CONVERT (b, (tmin) - (a))) || (a) < (tmin)) \
+ && (b) < (tmin) - (a)) \
+ : (b) <= -1 - (a)) \
+ || ((EXPR_SIGNED (_GL_INT_CONVERT (a, b)) || (tmax) < (b)) \
+ && (tmax) < (a) + (b))) \
+ : (tmax) < (b) || (tmax) - (b) < (a))
+#define _GL_INT_SUBTRACT_RANGE_OVERFLOW(a, b, tmin, tmax) \
+ (((a) < 0) == ((b) < 0) \
+ ? ((a) < (b) \
+ ? !(tmin) || -1 - (tmin) < (b) - (a) - 1 \
+ : (tmax) < (a) - (b)) \
+ : (a) < 0 \
+ ? ((!EXPR_SIGNED (_GL_INT_CONVERT ((a) - (tmin), b)) && (a) - (tmin) < 0) \
+ || (a) - (tmin) < (b)) \
+ : ((! (EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \
+ && EXPR_SIGNED (_GL_INT_CONVERT ((tmax) + (b), a))) \
+ && (tmax) <= -1 - (b)) \
+ || (tmax) + (b) < (a)))
+#define _GL_INT_MULTIPLY_RANGE_OVERFLOW(a, b, tmin, tmax) \
+ ((b) < 0 \
+ ? ((a) < 0 \
+ ? (EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \
+ ? (a) < (tmax) / (b) \
+ : ((INT_NEGATE_OVERFLOW (b) \
+ ? _GL_INT_CONVERT (b, tmax) >> (TYPE_WIDTH (+ (b)) - 1) \
+ : (tmax) / -(b)) \
+ <= -1 - (a))) \
+ : INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (b, tmin)) && (b) == -1 \
+ ? (EXPR_SIGNED (a) \
+ ? 0 < (a) + (tmin) \
+ : 0 < (a) && -1 - (tmin) < (a) - 1) \
+ : (tmin) / (b) < (a)) \
+ : (b) == 0 \
+ ? 0 \
+ : ((a) < 0 \
+ ? (INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (a, tmin)) && (a) == -1 \
+ ? (EXPR_SIGNED (b) ? 0 < (b) + (tmin) : -1 - (tmin) < (b) - 1) \
+ : (tmin) / (a) < (b)) \
+ : (tmax) / (b) < (a)))
+
+/* The following macros compute A + B, A - B, and A * B, respectively.
+ If no overflow occurs, they set *R to the result and return 1;
+ otherwise, they return 0 and may modify *R.
+
+ Example usage:
+
+ long int result;
+ if (INT_ADD_OK (a, b, &result))
+ printf ("result is %ld\n", result);
+ else
+ printf ("overflow\n");
+
+ A, B, and *R should be integers; they need not be the same type,
+ and they need not be all signed or all unsigned.
+
+ These macros work correctly on all known practical hosts, and do not rely
+ on undefined behavior due to signed arithmetic overflow.
+
+ These macros are not constant expressions.
+
+ These macros may evaluate their arguments zero or multiple times, so the
+ arguments should not have side effects.
+
+ These macros are tuned for B being a constant. */
+
+#define INT_ADD_OK(a, b, r) ! INT_ADD_WRAPV (a, b, r)
+#define INT_SUBTRACT_OK(a, b, r) ! INT_SUBTRACT_WRAPV (a, b, r)
+#define INT_MULTIPLY_OK(a, b, r) ! INT_MULTIPLY_WRAPV (a, b, r)
+
+#endif /* _GL_INTPROPS_H */
diff --git a/gl/lib/inttypes.in.h b/gl/lib/inttypes.in.h
new file mode 100644
index 0000000..853eca0
--- /dev/null
+++ b/gl/lib/inttypes.in.h
@@ -0,0 +1,1002 @@
+/* Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Written by Paul Eggert, Bruno Haible, Derek Price.
+ This file is part of gnulib.
+
+ 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 2.1 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/>. */
+
+/*
+ * ISO C 99 <inttypes.h> for platforms that lack it.
+ * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/inttypes.h.html>
+ */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* Include the original <inttypes.h> if it exists, and if this file
+ has not been included yet or if this file includes gnulib stdint.h
+ which in turn includes this file.
+ The include_next requires a split double-inclusion guard. */
+#if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+# if @HAVE_INTTYPES_H@
+
+ /* Some pre-C++11 <stdint.h> implementations need this. */
+# if defined __cplusplus && ! defined __STDC_FORMAT_MACROS
+# define __STDC_FORMAT_MACROS 1
+# endif
+
+# @INCLUDE_NEXT@ @NEXT_INTTYPES_H@
+
+# define _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H
+# endif
+#endif
+
+#if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+#define INTTYPES_H
+
+/* Include <stdint.h> or the gnulib replacement.
+ But avoid namespace pollution on glibc systems. */
+#ifndef __GLIBC__
+# include <stdint.h>
+#endif
+/* Get CHAR_BIT, INT_MAX, LONG_MAX, etc. */
+#include <limits.h>
+/* On mingw, __USE_MINGW_ANSI_STDIO only works if <stdio.h> is also included */
+#if defined _WIN32 && ! defined __CYGWIN__
+# include <stdio.h>
+#endif
+
+#if !(INT_MAX == 0x7fffffff && INT_MIN + INT_MAX == -1)
+# error "This file assumes that 'int' is 32-bit two's complement. Please report your platform and compiler to <bug-gnulib@gnu.org>."
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* 7.8.1 Macros for format specifiers */
+
+#if defined _TNS_R_TARGET
+ /* Tandem NonStop R series and compatible platforms released before
+ July 2005 support %Ld but not %lld. */
+# define _LONG_LONG_FORMAT_PREFIX "L"
+#else
+# define _LONG_LONG_FORMAT_PREFIX "ll"
+#endif
+
+#if !defined PRId8
+# ifdef INT8_MAX
+# define PRId8 "d"
+# endif
+#endif
+#if !defined PRIi8
+# ifdef INT8_MAX
+# define PRIi8 "i"
+# endif
+#endif
+#if !defined PRIo8
+# ifdef UINT8_MAX
+# define PRIo8 "o"
+# endif
+#endif
+#if !defined PRIu8
+# ifdef UINT8_MAX
+# define PRIu8 "u"
+# endif
+#endif
+#if !defined PRIx8
+# ifdef UINT8_MAX
+# define PRIx8 "x"
+# endif
+#endif
+#if !defined PRIX8
+# ifdef UINT8_MAX
+# define PRIX8 "X"
+# endif
+#endif
+#if !defined PRId16
+# ifdef INT16_MAX
+# define PRId16 "d"
+# endif
+#endif
+#if !defined PRIi16
+# ifdef INT16_MAX
+# define PRIi16 "i"
+# endif
+#endif
+#if !defined PRIo16
+# ifdef UINT16_MAX
+# define PRIo16 "o"
+# endif
+#endif
+#if !defined PRIu16
+# ifdef UINT16_MAX
+# define PRIu16 "u"
+# endif
+#endif
+#if !defined PRIx16
+# ifdef UINT16_MAX
+# define PRIx16 "x"
+# endif
+#endif
+#if !defined PRIX16
+# ifdef UINT16_MAX
+# define PRIX16 "X"
+# endif
+#endif
+#if !defined PRId32
+# ifdef INT32_MAX
+# define PRId32 "d"
+# endif
+#endif
+#if !defined PRIi32
+# ifdef INT32_MAX
+# define PRIi32 "i"
+# endif
+#endif
+#if !defined PRIo32
+# ifdef UINT32_MAX
+# define PRIo32 "o"
+# endif
+#endif
+#if !defined PRIu32
+# ifdef UINT32_MAX
+# define PRIu32 "u"
+# endif
+#endif
+#if !defined PRIx32
+# ifdef UINT32_MAX
+# define PRIx32 "x"
+# endif
+#endif
+#if !defined PRIX32
+# ifdef UINT32_MAX
+# define PRIX32 "X"
+# endif
+#endif
+#ifdef INT64_MAX
+# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@)
+# define _PRI64_PREFIX "l"
+# elif defined _MSC_VER || defined __MINGW32__
+# define _PRI64_PREFIX "I64"
+# elif LONG_MAX >> 30 == 1
+# define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX
+# endif
+# if !defined PRId64
+# define PRId64 _PRI64_PREFIX "d"
+# endif
+# if !defined PRIi64
+# define PRIi64 _PRI64_PREFIX "i"
+# endif
+#endif
+#ifdef UINT64_MAX
+# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@)
+# define _PRIu64_PREFIX "l"
+# elif defined _MSC_VER || defined __MINGW32__
+# define _PRIu64_PREFIX "I64"
+# elif ULONG_MAX >> 31 == 1
+# define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX
+# endif
+# if !defined PRIo64
+# define PRIo64 _PRIu64_PREFIX "o"
+# endif
+# if !defined PRIu64
+# define PRIu64 _PRIu64_PREFIX "u"
+# endif
+# if !defined PRIx64
+# define PRIx64 _PRIu64_PREFIX "x"
+# endif
+# if !defined PRIX64
+# define PRIX64 _PRIu64_PREFIX "X"
+# endif
+#endif
+
+#if !defined PRIdLEAST8
+# define PRIdLEAST8 "d"
+#endif
+#if !defined PRIiLEAST8
+# define PRIiLEAST8 "i"
+#endif
+#if !defined PRIoLEAST8
+# define PRIoLEAST8 "o"
+#endif
+#if !defined PRIuLEAST8
+# define PRIuLEAST8 "u"
+#endif
+#if !defined PRIxLEAST8
+# define PRIxLEAST8 "x"
+#endif
+#if !defined PRIXLEAST8
+# define PRIXLEAST8 "X"
+#endif
+#if !defined PRIdLEAST16
+# define PRIdLEAST16 "d"
+#endif
+#if !defined PRIiLEAST16
+# define PRIiLEAST16 "i"
+#endif
+#if !defined PRIoLEAST16
+# define PRIoLEAST16 "o"
+#endif
+#if !defined PRIuLEAST16
+# define PRIuLEAST16 "u"
+#endif
+#if !defined PRIxLEAST16
+# define PRIxLEAST16 "x"
+#endif
+#if !defined PRIXLEAST16
+# define PRIXLEAST16 "X"
+#endif
+#if !defined PRIdLEAST32
+# define PRIdLEAST32 "d"
+#endif
+#if !defined PRIiLEAST32
+# define PRIiLEAST32 "i"
+#endif
+#if !defined PRIoLEAST32
+# define PRIoLEAST32 "o"
+#endif
+#if !defined PRIuLEAST32
+# define PRIuLEAST32 "u"
+#endif
+#if !defined PRIxLEAST32
+# define PRIxLEAST32 "x"
+#endif
+#if !defined PRIXLEAST32
+# define PRIXLEAST32 "X"
+#endif
+#ifdef INT64_MAX
+# if !defined PRIdLEAST64
+# define PRIdLEAST64 PRId64
+# endif
+# if !defined PRIiLEAST64
+# define PRIiLEAST64 PRIi64
+# endif
+#endif
+#ifdef UINT64_MAX
+# if !defined PRIoLEAST64
+# define PRIoLEAST64 PRIo64
+# endif
+# if !defined PRIuLEAST64
+# define PRIuLEAST64 PRIu64
+# endif
+# if !defined PRIxLEAST64
+# define PRIxLEAST64 PRIx64
+# endif
+# if !defined PRIXLEAST64
+# define PRIXLEAST64 PRIX64
+# endif
+#endif
+
+#if !defined PRIdFAST8
+# if INT_FAST8_MAX > INT32_MAX
+# define PRIdFAST8 PRId64
+# else
+# define PRIdFAST8 "d"
+# endif
+#endif
+#if !defined PRIiFAST8
+# if INT_FAST8_MAX > INT32_MAX
+# define PRIiFAST8 PRIi64
+# else
+# define PRIiFAST8 "i"
+# endif
+#endif
+#if !defined PRIoFAST8
+# if UINT_FAST8_MAX > UINT32_MAX
+# define PRIoFAST8 PRIo64
+# else
+# define PRIoFAST8 "o"
+# endif
+#endif
+#if !defined PRIuFAST8
+# if UINT_FAST8_MAX > UINT32_MAX
+# define PRIuFAST8 PRIu64
+# else
+# define PRIuFAST8 "u"
+# endif
+#endif
+#if !defined PRIxFAST8
+# if UINT_FAST8_MAX > UINT32_MAX
+# define PRIxFAST8 PRIx64
+# else
+# define PRIxFAST8 "x"
+# endif
+#endif
+#if !defined PRIXFAST8
+# if UINT_FAST8_MAX > UINT32_MAX
+# define PRIXFAST8 PRIX64
+# else
+# define PRIXFAST8 "X"
+# endif
+#endif
+#if !defined PRIdFAST16
+# if INT_FAST16_MAX > INT32_MAX
+# define PRIdFAST16 PRId64
+# else
+# define PRIdFAST16 "d"
+# endif
+#endif
+#if !defined PRIiFAST16
+# if INT_FAST16_MAX > INT32_MAX
+# define PRIiFAST16 PRIi64
+# else
+# define PRIiFAST16 "i"
+# endif
+#endif
+#if !defined PRIoFAST16
+# if UINT_FAST16_MAX > UINT32_MAX
+# define PRIoFAST16 PRIo64
+# else
+# define PRIoFAST16 "o"
+# endif
+#endif
+#if !defined PRIuFAST16
+# if UINT_FAST16_MAX > UINT32_MAX
+# define PRIuFAST16 PRIu64
+# else
+# define PRIuFAST16 "u"
+# endif
+#endif
+#if !defined PRIxFAST16
+# if UINT_FAST16_MAX > UINT32_MAX
+# define PRIxFAST16 PRIx64
+# else
+# define PRIxFAST16 "x"
+# endif
+#endif
+#if !defined PRIXFAST16
+# if UINT_FAST16_MAX > UINT32_MAX
+# define PRIXFAST16 PRIX64
+# else
+# define PRIXFAST16 "X"
+# endif
+#endif
+#if !defined PRIdFAST32
+# if INT_FAST32_MAX > INT32_MAX
+# define PRIdFAST32 PRId64
+# else
+# define PRIdFAST32 "d"
+# endif
+#endif
+#if !defined PRIiFAST32
+# if INT_FAST32_MAX > INT32_MAX
+# define PRIiFAST32 PRIi64
+# else
+# define PRIiFAST32 "i"
+# endif
+#endif
+#if !defined PRIoFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+# define PRIoFAST32 PRIo64
+# else
+# define PRIoFAST32 "o"
+# endif
+#endif
+#if !defined PRIuFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+# define PRIuFAST32 PRIu64
+# else
+# define PRIuFAST32 "u"
+# endif
+#endif
+#if !defined PRIxFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+# define PRIxFAST32 PRIx64
+# else
+# define PRIxFAST32 "x"
+# endif
+#endif
+#if !defined PRIXFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+# define PRIXFAST32 PRIX64
+# else
+# define PRIXFAST32 "X"
+# endif
+#endif
+#ifdef INT64_MAX
+# if !defined PRIdFAST64
+# define PRIdFAST64 PRId64
+# endif
+# if !defined PRIiFAST64
+# define PRIiFAST64 PRIi64
+# endif
+#endif
+#ifdef UINT64_MAX
+# if !defined PRIoFAST64
+# define PRIoFAST64 PRIo64
+# endif
+# if !defined PRIuFAST64
+# define PRIuFAST64 PRIu64
+# endif
+# if !defined PRIxFAST64
+# define PRIxFAST64 PRIx64
+# endif
+# if !defined PRIXFAST64
+# define PRIXFAST64 PRIX64
+# endif
+#endif
+
+#if !defined PRIdMAX
+# if @INT32_MAX_LT_INTMAX_MAX@
+# define PRIdMAX PRId64
+# else
+# define PRIdMAX "ld"
+# endif
+#endif
+#if !defined PRIiMAX
+# if @INT32_MAX_LT_INTMAX_MAX@
+# define PRIiMAX PRIi64
+# else
+# define PRIiMAX "li"
+# endif
+#endif
+#if !defined PRIoMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+# define PRIoMAX PRIo64
+# else
+# define PRIoMAX "lo"
+# endif
+#endif
+#if !defined PRIuMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+# define PRIuMAX PRIu64
+# else
+# define PRIuMAX "lu"
+# endif
+#endif
+#if !defined PRIxMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+# define PRIxMAX PRIx64
+# else
+# define PRIxMAX "lx"
+# endif
+#endif
+#if !defined PRIXMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+# define PRIXMAX PRIX64
+# else
+# define PRIXMAX "lX"
+# endif
+#endif
+
+#if !defined PRIdPTR
+# ifdef INTPTR_MAX
+# define PRIdPTR @PRIPTR_PREFIX@ "d"
+# endif
+#endif
+#if !defined PRIiPTR
+# ifdef INTPTR_MAX
+# define PRIiPTR @PRIPTR_PREFIX@ "i"
+# endif
+#endif
+#if !defined PRIoPTR
+# ifdef UINTPTR_MAX
+# define PRIoPTR @PRIPTR_PREFIX@ "o"
+# endif
+#endif
+#if !defined PRIuPTR
+# ifdef UINTPTR_MAX
+# define PRIuPTR @PRIPTR_PREFIX@ "u"
+# endif
+#endif
+#if !defined PRIxPTR
+# ifdef UINTPTR_MAX
+# define PRIxPTR @PRIPTR_PREFIX@ "x"
+# endif
+#endif
+#if !defined PRIXPTR
+# ifdef UINTPTR_MAX
+# define PRIXPTR @PRIPTR_PREFIX@ "X"
+# endif
+#endif
+
+#if !defined SCNd8
+# ifdef INT8_MAX
+# define SCNd8 "hhd"
+# endif
+#endif
+#if !defined SCNi8
+# ifdef INT8_MAX
+# define SCNi8 "hhi"
+# endif
+#endif
+#if !defined SCNo8
+# ifdef UINT8_MAX
+# define SCNo8 "hho"
+# endif
+#endif
+#if !defined SCNu8
+# ifdef UINT8_MAX
+# define SCNu8 "hhu"
+# endif
+#endif
+#if !defined SCNx8
+# ifdef UINT8_MAX
+# define SCNx8 "hhx"
+# endif
+#endif
+#if !defined SCNd16
+# ifdef INT16_MAX
+# define SCNd16 "hd"
+# endif
+#endif
+#if !defined SCNi16
+# ifdef INT16_MAX
+# define SCNi16 "hi"
+# endif
+#endif
+#if !defined SCNo16
+# ifdef UINT16_MAX
+# define SCNo16 "ho"
+# endif
+#endif
+#if !defined SCNu16
+# ifdef UINT16_MAX
+# define SCNu16 "hu"
+# endif
+#endif
+#if !defined SCNx16
+# ifdef UINT16_MAX
+# define SCNx16 "hx"
+# endif
+#endif
+#if !defined SCNd32
+# ifdef INT32_MAX
+# define SCNd32 "d"
+# endif
+#endif
+#if !defined SCNi32
+# ifdef INT32_MAX
+# define SCNi32 "i"
+# endif
+#endif
+#if !defined SCNo32
+# ifdef UINT32_MAX
+# define SCNo32 "o"
+# endif
+#endif
+#if !defined SCNu32
+# ifdef UINT32_MAX
+# define SCNu32 "u"
+# endif
+#endif
+#if !defined SCNx32
+# ifdef UINT32_MAX
+# define SCNx32 "x"
+# endif
+#endif
+#ifdef INT64_MAX
+# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@)
+# define _SCN64_PREFIX "l"
+# elif defined _MSC_VER || defined __MINGW32__
+# define _SCN64_PREFIX "I64"
+# elif LONG_MAX >> 30 == 1
+# define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX
+# endif
+# if !defined SCNd64
+# define SCNd64 _SCN64_PREFIX "d"
+# endif
+# if !defined SCNi64
+# define SCNi64 _SCN64_PREFIX "i"
+# endif
+#endif
+#ifdef UINT64_MAX
+# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@)
+# define _SCNu64_PREFIX "l"
+# elif defined _MSC_VER || defined __MINGW32__
+# define _SCNu64_PREFIX "I64"
+# elif ULONG_MAX >> 31 == 1
+# define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX
+# endif
+# if !defined SCNo64
+# define SCNo64 _SCNu64_PREFIX "o"
+# endif
+# if !defined SCNu64
+# define SCNu64 _SCNu64_PREFIX "u"
+# endif
+# if !defined SCNx64
+# define SCNx64 _SCNu64_PREFIX "x"
+# endif
+#endif
+
+#if !defined SCNdLEAST8
+# define SCNdLEAST8 "hhd"
+#endif
+#if !defined SCNiLEAST8
+# define SCNiLEAST8 "hhi"
+#endif
+#if !defined SCNoLEAST8
+# define SCNoLEAST8 "hho"
+#endif
+#if !defined SCNuLEAST8
+# define SCNuLEAST8 "hhu"
+#endif
+#if !defined SCNxLEAST8
+# define SCNxLEAST8 "hhx"
+#endif
+#if !defined SCNdLEAST16
+# define SCNdLEAST16 "hd"
+#endif
+#if !defined SCNiLEAST16
+# define SCNiLEAST16 "hi"
+#endif
+#if !defined SCNoLEAST16
+# define SCNoLEAST16 "ho"
+#endif
+#if !defined SCNuLEAST16
+# define SCNuLEAST16 "hu"
+#endif
+#if !defined SCNxLEAST16
+# define SCNxLEAST16 "hx"
+#endif
+#if !defined SCNdLEAST32
+# define SCNdLEAST32 "d"
+#endif
+#if !defined SCNiLEAST32
+# define SCNiLEAST32 "i"
+#endif
+#if !defined SCNoLEAST32
+# define SCNoLEAST32 "o"
+#endif
+#if !defined SCNuLEAST32
+# define SCNuLEAST32 "u"
+#endif
+#if !defined SCNxLEAST32
+# define SCNxLEAST32 "x"
+#endif
+#ifdef INT64_MAX
+# if !defined SCNdLEAST64
+# define SCNdLEAST64 SCNd64
+# endif
+# if !defined SCNiLEAST64
+# define SCNiLEAST64 SCNi64
+# endif
+#endif
+#ifdef UINT64_MAX
+# if !defined SCNoLEAST64
+# define SCNoLEAST64 SCNo64
+# endif
+# if !defined SCNuLEAST64
+# define SCNuLEAST64 SCNu64
+# endif
+# if !defined SCNxLEAST64
+# define SCNxLEAST64 SCNx64
+# endif
+#endif
+
+#if !defined SCNdFAST8
+# if INT_FAST8_MAX > INT32_MAX
+# define SCNdFAST8 SCNd64
+# elif INT_FAST8_MAX == 0x7fff
+# define SCNdFAST8 "hd"
+# elif INT_FAST8_MAX == 0x7f
+# define SCNdFAST8 "hhd"
+# else
+# define SCNdFAST8 "d"
+# endif
+#endif
+#if !defined SCNiFAST8
+# if INT_FAST8_MAX > INT32_MAX
+# define SCNiFAST8 SCNi64
+# elif INT_FAST8_MAX == 0x7fff
+# define SCNiFAST8 "hi"
+# elif INT_FAST8_MAX == 0x7f
+# define SCNiFAST8 "hhi"
+# else
+# define SCNiFAST8 "i"
+# endif
+#endif
+#if !defined SCNoFAST8
+# if UINT_FAST8_MAX > UINT32_MAX
+# define SCNoFAST8 SCNo64
+# elif UINT_FAST8_MAX == 0xffff
+# define SCNoFAST8 "ho"
+# elif UINT_FAST8_MAX == 0xff
+# define SCNoFAST8 "hho"
+# else
+# define SCNoFAST8 "o"
+# endif
+#endif
+#if !defined SCNuFAST8
+# if UINT_FAST8_MAX > UINT32_MAX
+# define SCNuFAST8 SCNu64
+# elif UINT_FAST8_MAX == 0xffff
+# define SCNuFAST8 "hu"
+# elif UINT_FAST8_MAX == 0xff
+# define SCNuFAST8 "hhu"
+# else
+# define SCNuFAST8 "u"
+# endif
+#endif
+#if !defined SCNxFAST8
+# if UINT_FAST8_MAX > UINT32_MAX
+# define SCNxFAST8 SCNx64
+# elif UINT_FAST8_MAX == 0xffff
+# define SCNxFAST8 "hx"
+# elif UINT_FAST8_MAX == 0xff
+# define SCNxFAST8 "hhx"
+# else
+# define SCNxFAST8 "x"
+# endif
+#endif
+#if !defined SCNdFAST16
+# if INT_FAST16_MAX > INT32_MAX
+# define SCNdFAST16 SCNd64
+# elif INT_FAST16_MAX == 0x7fff
+# define SCNdFAST16 "hd"
+# else
+# define SCNdFAST16 "d"
+# endif
+#endif
+#if !defined SCNiFAST16
+# if INT_FAST16_MAX > INT32_MAX
+# define SCNiFAST16 SCNi64
+# elif INT_FAST16_MAX == 0x7fff
+# define SCNiFAST16 "hi"
+# else
+# define SCNiFAST16 "i"
+# endif
+#endif
+#if !defined SCNoFAST16
+# if UINT_FAST16_MAX > UINT32_MAX
+# define SCNoFAST16 SCNo64
+# elif UINT_FAST16_MAX == 0xffff
+# define SCNoFAST16 "ho"
+# else
+# define SCNoFAST16 "o"
+# endif
+#endif
+#if !defined SCNuFAST16
+# if UINT_FAST16_MAX > UINT32_MAX
+# define SCNuFAST16 SCNu64
+# elif UINT_FAST16_MAX == 0xffff
+# define SCNuFAST16 "hu"
+# else
+# define SCNuFAST16 "u"
+# endif
+#endif
+#if !defined SCNxFAST16
+# if UINT_FAST16_MAX > UINT32_MAX
+# define SCNxFAST16 SCNx64
+# elif UINT_FAST16_MAX == 0xffff
+# define SCNxFAST16 "hx"
+# else
+# define SCNxFAST16 "x"
+# endif
+#endif
+#if !defined SCNdFAST32
+# if INT_FAST32_MAX > INT32_MAX
+# define SCNdFAST32 SCNd64
+# else
+# define SCNdFAST32 "d"
+# endif
+#endif
+#if !defined SCNiFAST32
+# if INT_FAST32_MAX > INT32_MAX
+# define SCNiFAST32 SCNi64
+# else
+# define SCNiFAST32 "i"
+# endif
+#endif
+#if !defined SCNoFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+# define SCNoFAST32 SCNo64
+# else
+# define SCNoFAST32 "o"
+# endif
+#endif
+#if !defined SCNuFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+# define SCNuFAST32 SCNu64
+# else
+# define SCNuFAST32 "u"
+# endif
+#endif
+#if !defined SCNxFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+# define SCNxFAST32 SCNx64
+# else
+# define SCNxFAST32 "x"
+# endif
+#endif
+#ifdef INT64_MAX
+# if !defined SCNdFAST64
+# define SCNdFAST64 SCNd64
+# endif
+# if !defined SCNiFAST64
+# define SCNiFAST64 SCNi64
+# endif
+#endif
+#ifdef UINT64_MAX
+# if !defined SCNoFAST64
+# define SCNoFAST64 SCNo64
+# endif
+# if !defined SCNuFAST64
+# define SCNuFAST64 SCNu64
+# endif
+# if !defined SCNxFAST64
+# define SCNxFAST64 SCNx64
+# endif
+#endif
+
+#if !defined SCNdMAX
+# if @INT32_MAX_LT_INTMAX_MAX@
+# define SCNdMAX SCNd64
+# else
+# define SCNdMAX "ld"
+# endif
+#endif
+#if !defined SCNiMAX
+# if @INT32_MAX_LT_INTMAX_MAX@
+# define SCNiMAX SCNi64
+# else
+# define SCNiMAX "li"
+# endif
+#endif
+#if !defined SCNoMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+# define SCNoMAX SCNo64
+# else
+# define SCNoMAX "lo"
+# endif
+#endif
+#if !defined SCNuMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+# define SCNuMAX SCNu64
+# else
+# define SCNuMAX "lu"
+# endif
+#endif
+#if !defined SCNxMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+# define SCNxMAX SCNx64
+# else
+# define SCNxMAX "lx"
+# endif
+#endif
+
+#if !defined SCNdPTR
+# ifdef INTPTR_MAX
+# define SCNdPTR @PRIPTR_PREFIX@ "d"
+# endif
+#endif
+#if !defined SCNiPTR
+# ifdef INTPTR_MAX
+# define SCNiPTR @PRIPTR_PREFIX@ "i"
+# endif
+#endif
+#if !defined SCNoPTR
+# ifdef UINTPTR_MAX
+# define SCNoPTR @PRIPTR_PREFIX@ "o"
+# endif
+#endif
+#if !defined SCNuPTR
+# ifdef UINTPTR_MAX
+# define SCNuPTR @PRIPTR_PREFIX@ "u"
+# endif
+#endif
+#if !defined SCNxPTR
+# ifdef UINTPTR_MAX
+# define SCNxPTR @PRIPTR_PREFIX@ "x"
+# endif
+#endif
+
+/* 7.8.2 Functions for greatest-width integer types */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if @GNULIB_IMAXABS@
+# if !@HAVE_DECL_IMAXABS@
+extern intmax_t imaxabs (intmax_t);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef imaxabs
+# if HAVE_RAW_DECL_IMAXABS
+_GL_WARN_ON_USE (imaxabs, "imaxabs is unportable - "
+ "use gnulib module imaxabs for portability");
+# endif
+#endif
+
+#if @GNULIB_IMAXDIV@
+# if !@HAVE_IMAXDIV_T@
+# if !GNULIB_defined_imaxdiv_t
+typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t;
+# define GNULIB_defined_imaxdiv_t 1
+# endif
+# endif
+# if !@HAVE_DECL_IMAXDIV@
+extern imaxdiv_t imaxdiv (intmax_t, intmax_t);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef imaxdiv
+# if HAVE_RAW_DECL_IMAXDIV
+_GL_WARN_ON_USE (imaxdiv, "imaxdiv is unportable - "
+ "use gnulib module imaxdiv for portability");
+# endif
+#endif
+
+#if @GNULIB_STRTOIMAX@
+# if @REPLACE_STRTOIMAX@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strtoimax
+# define strtoimax rpl_strtoimax
+# endif
+_GL_FUNCDECL_RPL (strtoimax, intmax_t,
+ (const char *restrict, char **restrict, int)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtoimax, intmax_t,
+ (const char *restrict, char **restrict, int));
+# else
+# if !@HAVE_DECL_STRTOIMAX@
+# undef strtoimax
+_GL_FUNCDECL_SYS (strtoimax, intmax_t,
+ (const char *restrict, char **restrict, int)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtoimax, intmax_t,
+ (const char *restrict, char **restrict, int));
+# endif
+_GL_CXXALIASWARN (strtoimax);
+#elif defined GNULIB_POSIXCHECK
+# undef strtoimax
+# if HAVE_RAW_DECL_STRTOIMAX
+_GL_WARN_ON_USE (strtoimax, "strtoimax is unportable - "
+ "use gnulib module strtoimax for portability");
+# endif
+#endif
+
+#if @GNULIB_STRTOUMAX@
+# if @REPLACE_STRTOUMAX@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strtoumax
+# define strtoumax rpl_strtoumax
+# endif
+_GL_FUNCDECL_RPL (strtoumax, uintmax_t,
+ (const char *restrict, char **restrict, int)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtoumax, uintmax_t,
+ (const char *restrict, char **restrict, int));
+# else
+# if !@HAVE_DECL_STRTOUMAX@
+# undef strtoumax
+_GL_FUNCDECL_SYS (strtoumax, uintmax_t,
+ (const char *restrict, char **restrict, int)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtoumax, uintmax_t,
+ (const char *restrict, char **restrict, int));
+# endif
+_GL_CXXALIASWARN (strtoumax);
+#elif defined GNULIB_POSIXCHECK
+# undef strtoumax
+# if HAVE_RAW_DECL_STRTOUMAX
+_GL_WARN_ON_USE (strtoumax, "strtoumax is unportable - "
+ "use gnulib module strtoumax for portability");
+# endif
+#endif
+
+/* Don't bother defining or declaring wcstoimax and wcstoumax, since
+ wide-character functions like this are hardly ever useful. */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !defined INTTYPES_H && !defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H */
diff --git a/gl/lib/ioctl.c b/gl/lib/ioctl.c
new file mode 100644
index 0000000..b1c7b2e
--- /dev/null
+++ b/gl/lib/ioctl.c
@@ -0,0 +1,92 @@
+/* ioctl.c --- wrappers for Windows ioctl function
+
+ Copyright (C) 2008-2022 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 2.1 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 Paolo Bonzini */
+
+#include <config.h>
+
+#include <sys/ioctl.h>
+
+#include <stdarg.h>
+
+#if HAVE_IOCTL
+
+/* Provide a wrapper with the POSIX prototype. */
+# undef ioctl
+int
+rpl_ioctl (int fd, int request, ... /* {void *,char *} arg */)
+{
+ void *buf;
+ va_list args;
+
+ va_start (args, request);
+ buf = va_arg (args, void *);
+ va_end (args);
+
+ /* Cast 'request' so that when the system's ioctl function takes a 64-bit
+ request argument, the value gets zero-extended, not sign-extended. */
+ return ioctl (fd, (unsigned int) request, buf);
+}
+
+#else /* mingw */
+
+# include <errno.h>
+
+/* Get HANDLE. */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+
+# include "fd-hook.h"
+/* Get _get_osfhandle. */
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+
+static int
+primary_ioctl (int fd, int request, void *arg)
+{
+ /* We don't support FIONBIO on pipes here. If you want to make pipe
+ fds non-blocking, use the gnulib 'nonblocking' module, until
+ gnulib implements fcntl F_GETFL / F_SETFL with O_NONBLOCK. */
+
+ if ((HANDLE) _get_osfhandle (fd) != INVALID_HANDLE_VALUE)
+ errno = ENOSYS;
+ else
+ errno = EBADF;
+ return -1;
+}
+
+int
+ioctl (int fd, int request, ... /* {void *,char *} arg */)
+{
+ void *arg;
+ va_list args;
+
+ va_start (args, request);
+ arg = va_arg (args, void *);
+ va_end (args);
+
+# if WINDOWS_SOCKETS
+ return execute_all_ioctl_hooks (primary_ioctl, fd, request, arg);
+# else
+ return primary_ioctl (fd, request, arg);
+# endif
+}
+
+#endif
diff --git a/gl/lib/isblank.c b/gl/lib/isblank.c
new file mode 100644
index 0000000..e354559
--- /dev/null
+++ b/gl/lib/isblank.c
@@ -0,0 +1,33 @@
+/* Test whether a character is a blank.
+
+ Copyright (C) 2009-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <ctype.h>
+
+int
+isblank (int c)
+{
+ /* On all known platforms, in all predefined locales, isblank(c) is likely
+ equivalent with (c == ' ' || c == '\t'). Look at the glibc definition
+ (in glibc/localedata/locales/i18n): The "blank" characters are '\t', ' ',
+ U+1680, U+180E, U+2000..U+2006, U+2008..U+200A, U+205F, U+3000, and none
+ except the first two is present in a common 8-bit encoding. Therefore
+ the substitute for other platforms is not more complicated than this. */
+ return (c == ' ' || c == '\t');
+}
diff --git a/gl/lib/itold.c b/gl/lib/itold.c
new file mode 100644
index 0000000..fe4a384
--- /dev/null
+++ b/gl/lib/itold.c
@@ -0,0 +1,28 @@
+/* Replacement for 'int' to 'long double' conversion routine.
+ Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <float.h>
+
+void
+_Qp_itoq (long double *result, int a)
+{
+ /* Convert from 'int' to 'double', then from 'double' to 'long double'. */
+ *result = (double) a;
+}
diff --git a/gl/lib/langinfo.in.h b/gl/lib/langinfo.in.h
new file mode 100644
index 0000000..98aea6a
--- /dev/null
+++ b/gl/lib/langinfo.in.h
@@ -0,0 +1,222 @@
+/* Substitute for and wrapper around <langinfo.h>.
+ Copyright (C) 2009-2022 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 2.1 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/>. */
+
+/*
+ * POSIX <langinfo.h> for platforms that lack it or have an incomplete one.
+ * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/langinfo.h.html>
+ */
+
+#ifndef _@GUARD_PREFIX@_LANGINFO_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_LANGINFO_H@
+# @INCLUDE_NEXT@ @NEXT_LANGINFO_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_LANGINFO_H
+#define _@GUARD_PREFIX@_LANGINFO_H
+
+
+#if !@HAVE_LANGINFO_H@
+
+/* A platform that lacks <langinfo.h>. */
+
+/* Assume that it also lacks <nl_types.h> and the nl_item type. */
+# if !GNULIB_defined_nl_item
+typedef int nl_item;
+# define GNULIB_defined_nl_item 1
+# endif
+
+/* nl_langinfo items of the LC_CTYPE category */
+# define CODESET 10000
+/* nl_langinfo items of the LC_NUMERIC category */
+# define RADIXCHAR 10001
+# define DECIMAL_POINT RADIXCHAR
+# define THOUSEP 10002
+# define THOUSANDS_SEP THOUSEP
+# define GROUPING 10114
+/* nl_langinfo items of the LC_TIME category */
+# define D_T_FMT 10003
+# define D_FMT 10004
+# define T_FMT 10005
+# define T_FMT_AMPM 10006
+# define AM_STR 10007
+# define PM_STR 10008
+# define DAY_1 10009
+# define DAY_2 (DAY_1 + 1)
+# define DAY_3 (DAY_1 + 2)
+# define DAY_4 (DAY_1 + 3)
+# define DAY_5 (DAY_1 + 4)
+# define DAY_6 (DAY_1 + 5)
+# define DAY_7 (DAY_1 + 6)
+# define ABDAY_1 10016
+# define ABDAY_2 (ABDAY_1 + 1)
+# define ABDAY_3 (ABDAY_1 + 2)
+# define ABDAY_4 (ABDAY_1 + 3)
+# define ABDAY_5 (ABDAY_1 + 4)
+# define ABDAY_6 (ABDAY_1 + 5)
+# define ABDAY_7 (ABDAY_1 + 6)
+# define MON_1 10023
+# define MON_2 (MON_1 + 1)
+# define MON_3 (MON_1 + 2)
+# define MON_4 (MON_1 + 3)
+# define MON_5 (MON_1 + 4)
+# define MON_6 (MON_1 + 5)
+# define MON_7 (MON_1 + 6)
+# define MON_8 (MON_1 + 7)
+# define MON_9 (MON_1 + 8)
+# define MON_10 (MON_1 + 9)
+# define MON_11 (MON_1 + 10)
+# define MON_12 (MON_1 + 11)
+# define ALTMON_1 10200
+# define ALTMON_2 (ALTMON_1 + 1)
+# define ALTMON_3 (ALTMON_1 + 2)
+# define ALTMON_4 (ALTMON_1 + 3)
+# define ALTMON_5 (ALTMON_1 + 4)
+# define ALTMON_6 (ALTMON_1 + 5)
+# define ALTMON_7 (ALTMON_1 + 6)
+# define ALTMON_8 (ALTMON_1 + 7)
+# define ALTMON_9 (ALTMON_1 + 8)
+# define ALTMON_10 (ALTMON_1 + 9)
+# define ALTMON_11 (ALTMON_1 + 10)
+# define ALTMON_12 (ALTMON_1 + 11)
+# define ABMON_1 10035
+# define ABMON_2 (ABMON_1 + 1)
+# define ABMON_3 (ABMON_1 + 2)
+# define ABMON_4 (ABMON_1 + 3)
+# define ABMON_5 (ABMON_1 + 4)
+# define ABMON_6 (ABMON_1 + 5)
+# define ABMON_7 (ABMON_1 + 6)
+# define ABMON_8 (ABMON_1 + 7)
+# define ABMON_9 (ABMON_1 + 8)
+# define ABMON_10 (ABMON_1 + 9)
+# define ABMON_11 (ABMON_1 + 10)
+# define ABMON_12 (ABMON_1 + 11)
+# define ERA 10047
+# define ERA_D_FMT 10048
+# define ERA_D_T_FMT 10049
+# define ERA_T_FMT 10050
+# define ALT_DIGITS 10051
+/* nl_langinfo items of the LC_MONETARY category */
+# define CRNCYSTR 10052
+# define CURRENCY_SYMBOL CRNCYSTR
+# define INT_CURR_SYMBOL 10100
+# define MON_DECIMAL_POINT 10101
+# define MON_THOUSANDS_SEP 10102
+# define MON_GROUPING 10103
+# define POSITIVE_SIGN 10104
+# define NEGATIVE_SIGN 10105
+# define FRAC_DIGITS 10106
+# define INT_FRAC_DIGITS 10107
+# define P_CS_PRECEDES 10108
+# define N_CS_PRECEDES 10109
+# define P_SEP_BY_SPACE 10110
+# define N_SEP_BY_SPACE 10111
+# define P_SIGN_POSN 10112
+# define N_SIGN_POSN 10113
+/* nl_langinfo items of the LC_MESSAGES category */
+# define YESEXPR 10053
+# define NOEXPR 10054
+
+#else
+
+/* A platform that has <langinfo.h>. */
+
+# if !@HAVE_LANGINFO_CODESET@
+# define CODESET 10000
+# define GNULIB_defined_CODESET 1
+# endif
+
+# if !@HAVE_LANGINFO_T_FMT_AMPM@
+# define T_FMT_AMPM 10006
+# define GNULIB_defined_T_FMT_AMPM 1
+# endif
+
+# if !@HAVE_LANGINFO_ALTMON@
+# define ALTMON_1 10200
+# define ALTMON_2 (ALTMON_1 + 1)
+# define ALTMON_3 (ALTMON_1 + 2)
+# define ALTMON_4 (ALTMON_1 + 3)
+# define ALTMON_5 (ALTMON_1 + 4)
+# define ALTMON_6 (ALTMON_1 + 5)
+# define ALTMON_7 (ALTMON_1 + 6)
+# define ALTMON_8 (ALTMON_1 + 7)
+# define ALTMON_9 (ALTMON_1 + 8)
+# define ALTMON_10 (ALTMON_1 + 9)
+# define ALTMON_11 (ALTMON_1 + 10)
+# define ALTMON_12 (ALTMON_1 + 11)
+# define GNULIB_defined_ALTMON 1
+# endif
+
+# if !@HAVE_LANGINFO_ERA@
+# define ERA 10047
+# define ERA_D_FMT 10048
+# define ERA_D_T_FMT 10049
+# define ERA_T_FMT 10050
+# define ALT_DIGITS 10051
+# define GNULIB_defined_ERA 1
+# endif
+
+# if !@HAVE_LANGINFO_YESEXPR@
+# define YESEXPR 10053
+# define NOEXPR 10054
+# define GNULIB_defined_YESEXPR 1
+# endif
+
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* Declare overridden functions. */
+
+
+/* Return a piece of locale dependent information.
+ Note: The difference between nl_langinfo (CODESET) and locale_charset ()
+ is that the latter normalizes the encoding names to GNU conventions. */
+
+#if @GNULIB_NL_LANGINFO@
+# if @REPLACE_NL_LANGINFO@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef nl_langinfo
+# define nl_langinfo rpl_nl_langinfo
+# endif
+_GL_FUNCDECL_RPL (nl_langinfo, char *, (nl_item item));
+_GL_CXXALIAS_RPL (nl_langinfo, char *, (nl_item item));
+# else
+# if !@HAVE_NL_LANGINFO@
+_GL_FUNCDECL_SYS (nl_langinfo, char *, (nl_item item));
+# endif
+_GL_CXXALIAS_SYS (nl_langinfo, char *, (nl_item item));
+# endif
+_GL_CXXALIASWARN (nl_langinfo);
+#elif defined GNULIB_POSIXCHECK
+# undef nl_langinfo
+# if HAVE_RAW_DECL_NL_LANGINFO
+_GL_WARN_ON_USE (nl_langinfo, "nl_langinfo is not portable - "
+ "use gnulib module nl_langinfo for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_LANGINFO_H */
+#endif /* _@GUARD_PREFIX@_LANGINFO_H */
diff --git a/gl/lib/lc-charset-dispatch.c b/gl/lib/lc-charset-dispatch.c
new file mode 100644
index 0000000..66d78fd
--- /dev/null
+++ b/gl/lib/lc-charset-dispatch.c
@@ -0,0 +1,82 @@
+/* Dispatching based on the current locale's character encoding.
+ Copyright (C) 2018-2022 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 2.1 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>, 2018. */
+
+#include <config.h>
+
+/* Specification. */
+#include "lc-charset-dispatch.h"
+
+#if GNULIB_defined_mbstate_t
+
+# include "localcharset.h"
+# include "streq.h"
+
+# if GNULIB_WCHAR_SINGLE_LOCALE
+/* When we know that the locale does not change, provide a speedup by
+ caching the value of locale_encoding_classification. */
+# define locale_encoding_classification_cached locale_encoding_classification
+# else
+/* By default, don't make assumptions, hence no caching. */
+# define locale_encoding_classification_uncached locale_encoding_classification
+# endif
+
+# if GNULIB_WCHAR_SINGLE_LOCALE
+static inline
+# endif
+enc_t
+locale_encoding_classification_uncached (void)
+{
+ const char *encoding = locale_charset ();
+ if (STREQ_OPT (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0))
+ return enc_utf8;
+ if (STREQ_OPT (encoding, "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0))
+ return enc_eucjp;
+ if (STREQ_OPT (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
+ || STREQ_OPT (encoding, "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0)
+ || STREQ_OPT (encoding, "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0))
+ return enc_94;
+ if (STREQ_OPT (encoding, "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0))
+ return enc_euctw;
+ if (STREQ_OPT (encoding, "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0))
+ return enc_gb18030;
+ if (STREQ_OPT (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0))
+ return enc_sjis;
+ return enc_other;
+}
+
+# if GNULIB_WCHAR_SINGLE_LOCALE
+
+static int cached_locale_enc = -1;
+
+enc_t
+locale_encoding_classification_cached (void)
+{
+ if (cached_locale_enc < 0)
+ cached_locale_enc = locale_encoding_classification_uncached ();
+ return cached_locale_enc;
+}
+
+# endif
+
+#else
+
+/* This declaration is solely to ensure that after preprocessing
+ this file is never empty. */
+typedef int dummy;
+
+#endif
diff --git a/gl/lib/lc-charset-dispatch.h b/gl/lib/lc-charset-dispatch.h
new file mode 100644
index 0000000..3867c32
--- /dev/null
+++ b/gl/lib/lc-charset-dispatch.h
@@ -0,0 +1,40 @@
+/* Dispatching based on the current locale's character encoding.
+ Copyright (C) 2018-2022 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 2.1 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>, 2018. */
+
+#include <wchar.h>
+
+#if GNULIB_defined_mbstate_t
+
+/* A classification of special values of the encoding of the current locale. */
+typedef enum
+ {
+ enc_other, /* other */
+ enc_utf8, /* UTF-8 */
+ enc_eucjp, /* EUC-JP */
+ enc_94, /* EUC-KR, GB2312, BIG5 */
+ enc_euctw, /* EUC-TW */
+ enc_gb18030, /* GB18030 */
+ enc_sjis /* SJIS */
+ }
+ enc_t;
+
+/* Returns a classification of special values of the encoding of the current
+ locale. */
+extern enc_t locale_encoding_classification (void);
+
+#endif
diff --git a/gl/lib/lchown.c b/gl/lib/lchown.c
new file mode 100644
index 0000000..8b0d871
--- /dev/null
+++ b/gl/lib/lchown.c
@@ -0,0 +1,117 @@
+/* Provide a stub lchown function for systems that lack it.
+
+ Copyright (C) 1998-1999, 2002, 2004, 2006-2007, 2009-2022 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 2.1 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 Jim Meyering */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include <errno.h>
+#include <stdbool.h>
+#include <string.h>
+#include <sys/stat.h>
+
+#if !HAVE_LCHOWN
+
+/* If the system chown does not follow symlinks, we don't want it
+ replaced by gnulib's chown, which does follow symlinks. */
+# if CHOWN_MODIFIES_SYMLINK
+# undef chown
+# endif
+
+/* Work just like chown, except when FILE is a symbolic link.
+ In that case, set errno to EOPNOTSUPP and return -1.
+ But if autoconf tests determined that chown modifies
+ symlinks, then just call chown. */
+
+int
+lchown (const char *file, uid_t uid, gid_t gid)
+{
+# if HAVE_CHOWN
+# if ! CHOWN_MODIFIES_SYMLINK
+ char readlink_buf[1];
+
+ if (0 <= readlink (file, readlink_buf, sizeof readlink_buf))
+ {
+ errno = EOPNOTSUPP;
+ return -1;
+ }
+# endif
+
+ return chown (file, uid, gid);
+
+# else /* !HAVE_CHOWN */
+ errno = ENOSYS;
+ return -1;
+# endif
+}
+
+#else /* HAVE_LCHOWN */
+
+# undef lchown
+
+/* Work around trailing slash bugs in lchown. */
+int
+rpl_lchown (const char *file, uid_t uid, gid_t gid)
+{
+ bool stat_valid = false;
+ int result;
+
+# if CHOWN_CHANGE_TIME_BUG
+ struct stat st;
+
+ if (gid != (gid_t) -1 || uid != (uid_t) -1)
+ {
+ if (lstat (file, &st))
+ return -1;
+ stat_valid = true;
+ if (!S_ISLNK (st.st_mode))
+ return chown (file, uid, gid);
+ }
+# endif
+
+# if CHOWN_TRAILING_SLASH_BUG
+ if (!stat_valid)
+ {
+ size_t len = strlen (file);
+ if (len && file[len - 1] == '/')
+ return chown (file, uid, gid);
+ }
+# endif
+
+ result = lchown (file, uid, gid);
+
+# if CHOWN_CHANGE_TIME_BUG && HAVE_LCHMOD
+ if (result == 0 && stat_valid
+ && (uid == st.st_uid || uid == (uid_t) -1)
+ && (gid == st.st_gid || gid == (gid_t) -1))
+ {
+ /* No change in ownership, but at least one argument was not -1,
+ so we are required to update ctime. Since lchown succeeded,
+ we assume that lchmod will do likewise. But if the system
+ lacks lchmod and lutimes, we are out of luck. Oh well. */
+ result = lchmod (file, st.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO
+ | S_ISUID | S_ISGID | S_ISVTX));
+ }
+# endif
+
+ return result;
+}
+
+#endif /* HAVE_LCHOWN */
diff --git a/gl/lib/libc-config.h b/gl/lib/libc-config.h
new file mode 100644
index 0000000..a56665b
--- /dev/null
+++ b/gl/lib/libc-config.h
@@ -0,0 +1,202 @@
+/* System definitions for code taken from the GNU C Library
+
+ Copyright 2017-2022 Free Software Foundation, Inc.
+
+ This program 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 2.1 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ 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 Paul Eggert. */
+
+/* This is intended to be a good-enough substitute for glibc system
+ macros like those defined in <sys/cdefs.h>, so that Gnulib code
+ shared with glibc can do this as the first #include:
+
+ #ifndef _LIBC
+ # include <libc-config.h>
+ #endif
+
+ When compiled as part of glibc this is a no-op; when compiled as
+ part of Gnulib this includes Gnulib's <config.h> and defines macros
+ that glibc library code would normally assume.
+
+ Note: This header file MUST NOT be included by public header files
+ of Gnulib. */
+
+#include <config.h>
+
+/* On glibc this includes <features.h> and <sys/cdefs.h> and #defines
+ _FEATURES_H, __WORDSIZE, and __set_errno. On FreeBSD 11 and
+ DragonFlyBSD 5.9 it includes <sys/cdefs.h> which defines __nonnull.
+ Elsewhere it is harmless. */
+#include <errno.h>
+
+/* From glibc <errno.h>. */
+#ifndef __set_errno
+# define __set_errno(val) (errno = (val))
+#endif
+
+/* From glibc <features.h>. */
+
+#ifndef __GNUC_PREREQ
+# if defined __GNUC__ && defined __GNUC_MINOR__
+# define __GNUC_PREREQ(maj, min) ((maj) < __GNUC__ + ((min) <= __GNUC_MINOR__))
+# else
+# define __GNUC_PREREQ(maj, min) 0
+# endif
+#endif
+
+#ifndef __glibc_clang_prereq
+# if defined __clang_major__ && defined __clang_minor__
+# ifdef __apple_build_version__
+/* Apple for some reason renumbers __clang_major__ and __clang_minor__.
+ Gnulib code uses only __glibc_clang_prereq (3, 5); map it to
+ 6000000 <= __apple_build_version__. Support for other calls to
+ __glibc_clang_prereq can be added here as needed. */
+# define __glibc_clang_prereq(maj, min) \
+ ((maj) == 3 && (min) == 5 ? 6000000 <= __apple_build_version__ : 0)
+# else
+# define __glibc_clang_prereq(maj, min) \
+ ((maj) < __clang_major__ + ((min) <= __clang_minor__))
+# endif
+# else
+# define __glibc_clang_prereq(maj, min) 0
+# endif
+#endif
+
+#ifndef __attribute_nonnull__
+/* <sys/cdefs.h> either does not exist, or is too old for Gnulib.
+ Prepare to include <cdefs.h>, which is Gnulib's version of a
+ more-recent glibc <sys/cdefs.h>. */
+
+/* Define _FEATURES_H so that <cdefs.h> does not include <features.h>. */
+# ifndef _FEATURES_H
+# define _FEATURES_H 1
+# endif
+/* Define __GNULIB_CDEFS so that <cdefs.h> does not attempt to include
+ nonexistent files. */
+# define __GNULIB_CDEFS
+/* Undef the macros unconditionally defined by our copy of glibc
+ <sys/cdefs.h>, so that they do not clash with any system-defined
+ versions. */
+# undef _SYS_CDEFS_H
+# undef __ASMNAME
+# undef __ASMNAME2
+# undef __BEGIN_DECLS
+# undef __CONCAT
+# undef __END_DECLS
+# undef __HAVE_GENERIC_SELECTION
+# undef __LDBL_COMPAT
+# undef __LDBL_REDIR
+# undef __LDBL_REDIR1
+# undef __LDBL_REDIR1_DECL
+# undef __LDBL_REDIR1_NTH
+# undef __LDBL_REDIR2_DECL
+# undef __LDBL_REDIR_DECL
+# undef __LDBL_REDIR_NTH
+# undef __LEAF
+# undef __LEAF_ATTR
+# undef __NTH
+# undef __NTHNL
+# undef __REDIRECT
+# undef __REDIRECT_LDBL
+# undef __REDIRECT_NTH
+# undef __REDIRECT_NTHNL
+# undef __REDIRECT_NTH_LDBL
+# undef __STRING
+# undef __THROW
+# undef __THROWNL
+# undef __attr_access
+# undef __attr_access_none
+# undef __attr_dealloc
+# undef __attr_dealloc_free
+# undef __attribute__
+# undef __attribute_alloc_align__
+# undef __attribute_alloc_size__
+# undef __attribute_artificial__
+# undef __attribute_const__
+# undef __attribute_deprecated__
+# undef __attribute_deprecated_msg__
+# undef __attribute_format_arg__
+# undef __attribute_format_strfmon__
+# undef __attribute_malloc__
+# undef __attribute_maybe_unused__
+# undef __attribute_noinline__
+# undef __attribute_nonstring__
+# undef __attribute_pure__
+# undef __attribute_returns_twice__
+# undef __attribute_used__
+# undef __attribute_warn_unused_result__
+# undef __bos
+# undef __bos0
+# undef __errordecl
+# undef __extension__
+# undef __extern_always_inline
+# undef __extern_inline
+# undef __flexarr
+# undef __fortified_attr_access
+# undef __fortify_function
+# undef __glibc_c99_flexarr_available
+# undef __glibc_fortify
+# undef __glibc_fortify_n
+# undef __glibc_has_attribute
+# undef __glibc_has_builtin
+# undef __glibc_has_extension
+# undef __glibc_likely
+# undef __glibc_macro_warning
+# undef __glibc_macro_warning1
+# undef __glibc_objsize
+# undef __glibc_objsize0
+# undef __glibc_safe_len_cond
+# undef __glibc_safe_or_unknown_len
+# undef __glibc_unlikely
+# undef __glibc_unsafe_len
+# undef __glibc_unsigned_or_positive
+# undef __inline
+# undef __ptr_t
+# undef __restrict
+# undef __restrict_arr
+# undef __va_arg_pack
+# undef __va_arg_pack_len
+# undef __warnattr
+# undef __wur
+
+/* Include our copy of glibc <sys/cdefs.h>. */
+# include <cdefs.h>
+
+/* <cdefs.h> __inline is too pessimistic for non-GCC. */
+# undef __inline
+# ifndef HAVE___INLINE
+# if 199901 <= __STDC_VERSION__ || defined inline
+# define __inline inline
+# else
+# define __inline
+# endif
+# endif
+
+#endif /* defined __glibc_likely */
+
+
+/* A substitute for glibc <libc-symbols.h>, good enough for Gnulib. */
+#define attribute_hidden
+#define libc_hidden_proto(name)
+#define libc_hidden_def(name)
+#define libc_hidden_weak(name)
+#define libc_hidden_ver(local, name)
+#define strong_alias(name, aliasname)
+#define weak_alias(name, aliasname)
+
+/* A substitute for glibc <shlib-compat.h>, good enough for Gnulib. */
+#define SHLIB_COMPAT(lib, introduced, obsoleted) 0
+#define compat_symbol(lib, local, symbol, version) extern int dummy
+#define versioned_symbol(lib, local, symbol, version) extern int dummy
diff --git a/gl/lib/limits.in.h b/gl/lib/limits.in.h
new file mode 100644
index 0000000..b77bf75
--- /dev/null
+++ b/gl/lib/limits.in.h
@@ -0,0 +1,131 @@
+/* A GNU-like <limits.h>.
+
+ Copyright 2016-2022 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 2.1 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 __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined _GL_ALREADY_INCLUDING_LIMITS_H
+/* Special invocation convention:
+ On Haiku/x86_64, we have a sequence of nested includes
+ <limits.h> -> <syslimits.h> -> <limits.h>.
+ In this situation, LONG_MAX and INT_MAX are not yet defined,
+ therefore we should not attempt to define LONG_BIT. */
+
+#@INCLUDE_NEXT@ @NEXT_LIMITS_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_LIMITS_H
+
+# define _GL_ALREADY_INCLUDING_LIMITS_H
+
+/* The include_next requires a split double-inclusion guard. */
+# @INCLUDE_NEXT@ @NEXT_LIMITS_H@
+
+# undef _GL_ALREADY_INCLUDING_LIMITS_H
+
+#ifndef _@GUARD_PREFIX@_LIMITS_H
+#define _@GUARD_PREFIX@_LIMITS_H
+
+#ifndef LLONG_MIN
+# if defined LONG_LONG_MIN /* HP-UX 11.31 */
+# define LLONG_MIN LONG_LONG_MIN
+# elif defined LONGLONG_MIN /* IRIX 6.5 */
+# define LLONG_MIN LONGLONG_MIN
+# elif defined __GNUC__
+# define LLONG_MIN (- __LONG_LONG_MAX__ - 1LL)
+# endif
+#endif
+#ifndef LLONG_MAX
+# if defined LONG_LONG_MAX /* HP-UX 11.31 */
+# define LLONG_MAX LONG_LONG_MAX
+# elif defined LONGLONG_MAX /* IRIX 6.5 */
+# define LLONG_MAX LONGLONG_MAX
+# elif defined __GNUC__
+# define LLONG_MAX __LONG_LONG_MAX__
+# endif
+#endif
+#ifndef ULLONG_MAX
+# if defined ULONG_LONG_MAX /* HP-UX 11.31 */
+# define ULLONG_MAX ULONG_LONG_MAX
+# elif defined ULONGLONG_MAX /* IRIX 6.5 */
+# define ULLONG_MAX ULONGLONG_MAX
+# elif defined __GNUC__
+# define ULLONG_MAX (__LONG_LONG_MAX__ * 2ULL + 1ULL)
+# endif
+#endif
+
+/* The number of usable bits in an unsigned or signed integer type
+ with minimum value MIN and maximum value MAX, as an int expression
+ suitable in #if. Cover all known practical hosts. This
+ implementation exploits the fact that MAX is 1 less than a power of
+ 2, and merely counts the number of 1 bits in MAX; "COBn" means
+ "count the number of 1 bits in the low-order n bits"). */
+#define _GL_INTEGER_WIDTH(min, max) (((min) < 0) + _GL_COB128 (max))
+#define _GL_COB128(n) (_GL_COB64 ((n) >> 31 >> 31 >> 2) + _GL_COB64 (n))
+#define _GL_COB64(n) (_GL_COB32 ((n) >> 31 >> 1) + _GL_COB32 (n))
+#define _GL_COB32(n) (_GL_COB16 ((n) >> 16) + _GL_COB16 (n))
+#define _GL_COB16(n) (_GL_COB8 ((n) >> 8) + _GL_COB8 (n))
+#define _GL_COB8(n) (_GL_COB4 ((n) >> 4) + _GL_COB4 (n))
+#define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1))
+
+#ifndef WORD_BIT
+/* Assume 'int' is 32 bits wide. */
+# define WORD_BIT 32
+#endif
+#ifndef LONG_BIT
+/* Assume 'long' is 32 or 64 bits wide. */
+# if LONG_MAX == INT_MAX
+# define LONG_BIT 32
+# else
+# define LONG_BIT 64
+# endif
+#endif
+
+/* Macros specified by C2x and by ISO/IEC TS 18661-1:2014. */
+
+#if (! defined ULLONG_WIDTH \
+ && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__ \
+ || (defined __STDC_VERSION__ && 201710 < __STDC_VERSION__)))
+# define CHAR_WIDTH _GL_INTEGER_WIDTH (CHAR_MIN, CHAR_MAX)
+# define SCHAR_WIDTH _GL_INTEGER_WIDTH (SCHAR_MIN, SCHAR_MAX)
+# define UCHAR_WIDTH _GL_INTEGER_WIDTH (0, UCHAR_MAX)
+# define SHRT_WIDTH _GL_INTEGER_WIDTH (SHRT_MIN, SHRT_MAX)
+# define USHRT_WIDTH _GL_INTEGER_WIDTH (0, USHRT_MAX)
+# define INT_WIDTH _GL_INTEGER_WIDTH (INT_MIN, INT_MAX)
+# define UINT_WIDTH _GL_INTEGER_WIDTH (0, UINT_MAX)
+# define LONG_WIDTH _GL_INTEGER_WIDTH (LONG_MIN, LONG_MAX)
+# define ULONG_WIDTH _GL_INTEGER_WIDTH (0, ULONG_MAX)
+# define LLONG_WIDTH _GL_INTEGER_WIDTH (LLONG_MIN, LLONG_MAX)
+# define ULLONG_WIDTH _GL_INTEGER_WIDTH (0, ULLONG_MAX)
+#endif
+
+/* Macros specified by C2x. */
+
+#if (! defined BOOL_WIDTH \
+ && (defined _GNU_SOURCE \
+ || (defined __STDC_VERSION__ && 201710 < __STDC_VERSION__)))
+# define BOOL_MAX 1
+# define BOOL_WIDTH 1
+#endif
+
+#endif /* _@GUARD_PREFIX@_LIMITS_H */
+#endif /* _@GUARD_PREFIX@_LIMITS_H */
+#endif
diff --git a/gl/lib/localcharset.c b/gl/lib/localcharset.c
new file mode 100644
index 0000000..17a4a1e
--- /dev/null
+++ b/gl/lib/localcharset.c
@@ -0,0 +1,1159 @@
+/* Determine a canonical name for the current locale's character encoding.
+
+ Copyright (C) 2000-2006, 2008-2022 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 2.1 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>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "localcharset.h"
+
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET
+# define DARWIN7 /* Darwin 7 or newer, i.e. Mac OS X 10.3 or newer */
+#endif
+
+#if defined _WIN32 && !defined __CYGWIN__
+# define WINDOWS_NATIVE
+# include <locale.h>
+#endif
+
+#if defined __EMX__
+/* Assume EMX program runs on OS/2, even if compiled under DOS. */
+# ifndef OS2
+# define OS2
+# endif
+#endif
+
+#if !defined WINDOWS_NATIVE
+# if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+# else
+# if 0 /* see comment regarding use of setlocale(), below */
+# include <locale.h>
+# endif
+# endif
+# ifdef __CYGWIN__
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# endif
+#elif defined WINDOWS_NATIVE
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+ /* For the use of setlocale() below, the Gnulib override in setlocale.c is
+ not needed; see the platform lists in setlocale_null.m4. */
+# undef setlocale
+#endif
+#if defined OS2
+# define INCL_DOS
+# include <os2.h>
+#endif
+
+/* For MB_CUR_MAX_L */
+#if defined DARWIN7
+# include <xlocale.h>
+#endif
+
+
+#if HAVE_LANGINFO_CODESET || defined WINDOWS_NATIVE || defined OS2
+
+/* On these platforms, we use a mapping from non-canonical encoding name
+ to GNU canonical encoding name. */
+
+/* With glibc-2.1 or newer, we don't need any canonicalization,
+ because glibc has iconv and both glibc and libiconv support all
+ GNU canonical names directly. */
+# if !((defined __GNU_LIBRARY__ && __GLIBC__ >= 2) || defined __UCLIBC__)
+
+struct table_entry
+{
+ const char alias[11+1];
+ const char canonical[11+1];
+};
+
+/* Table of platform-dependent mappings, sorted in ascending order. */
+static const struct table_entry alias_table[] =
+ {
+# if defined __FreeBSD__ /* FreeBSD */
+ /*{ "ARMSCII-8", "ARMSCII-8" },*/
+ { "Big5", "BIG5" },
+ { "C", "ASCII" },
+ /*{ "CP1131", "CP1131" },*/
+ /*{ "CP1251", "CP1251" },*/
+ /*{ "CP866", "CP866" },*/
+ /*{ "GB18030", "GB18030" },*/
+ /*{ "GB2312", "GB2312" },*/
+ /*{ "GBK", "GBK" },*/
+ /*{ "ISCII-DEV", "?" },*/
+ { "ISO8859-1", "ISO-8859-1" },
+ { "ISO8859-13", "ISO-8859-13" },
+ { "ISO8859-15", "ISO-8859-15" },
+ { "ISO8859-2", "ISO-8859-2" },
+ { "ISO8859-5", "ISO-8859-5" },
+ { "ISO8859-7", "ISO-8859-7" },
+ { "ISO8859-9", "ISO-8859-9" },
+ /*{ "KOI8-R", "KOI8-R" },*/
+ /*{ "KOI8-U", "KOI8-U" },*/
+ { "SJIS", "SHIFT_JIS" },
+ { "US-ASCII", "ASCII" },
+ { "eucCN", "GB2312" },
+ { "eucJP", "EUC-JP" },
+ { "eucKR", "EUC-KR" }
+# define alias_table_defined
+# endif
+# if defined __NetBSD__ /* NetBSD */
+ { "646", "ASCII" },
+ /*{ "ARMSCII-8", "ARMSCII-8" },*/
+ /*{ "BIG5", "BIG5" },*/
+ { "Big5-HKSCS", "BIG5-HKSCS" },
+ /*{ "CP1251", "CP1251" },*/
+ /*{ "CP866", "CP866" },*/
+ /*{ "GB18030", "GB18030" },*/
+ /*{ "GB2312", "GB2312" },*/
+ { "ISO8859-1", "ISO-8859-1" },
+ { "ISO8859-13", "ISO-8859-13" },
+ { "ISO8859-15", "ISO-8859-15" },
+ { "ISO8859-2", "ISO-8859-2" },
+ { "ISO8859-4", "ISO-8859-4" },
+ { "ISO8859-5", "ISO-8859-5" },
+ { "ISO8859-7", "ISO-8859-7" },
+ /*{ "KOI8-R", "KOI8-R" },*/
+ /*{ "KOI8-U", "KOI8-U" },*/
+ /*{ "PT154", "PT154" },*/
+ { "SJIS", "SHIFT_JIS" },
+ { "eucCN", "GB2312" },
+ { "eucJP", "EUC-JP" },
+ { "eucKR", "EUC-KR" },
+ { "eucTW", "EUC-TW" }
+# define alias_table_defined
+# endif
+# if defined __OpenBSD__ /* OpenBSD */
+ { "646", "ASCII" },
+ { "ISO8859-1", "ISO-8859-1" },
+ { "ISO8859-13", "ISO-8859-13" },
+ { "ISO8859-15", "ISO-8859-15" },
+ { "ISO8859-2", "ISO-8859-2" },
+ { "ISO8859-4", "ISO-8859-4" },
+ { "ISO8859-5", "ISO-8859-5" },
+ { "ISO8859-7", "ISO-8859-7" },
+ { "US-ASCII", "ASCII" }
+# define alias_table_defined
+# endif
+# if defined __APPLE__ && defined __MACH__ /* Mac OS X */
+ /* Darwin 7.5 has nl_langinfo(CODESET), but sometimes its value is
+ useless:
+ - It returns the empty string when LANG is set to a locale of the
+ form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8
+ LC_CTYPE file.
+ - The environment variables LANG, LC_CTYPE, LC_ALL are not set by
+ the system; nl_langinfo(CODESET) returns "US-ASCII" in this case.
+ - The documentation says:
+ "... all code that calls BSD system routines should ensure
+ that the const *char parameters of these routines are in UTF-8
+ encoding. All BSD system functions expect their string
+ parameters to be in UTF-8 encoding and nothing else."
+ It also says
+ "An additional caveat is that string parameters for files,
+ paths, and other file-system entities must be in canonical
+ UTF-8. In a canonical UTF-8 Unicode string, all decomposable
+ characters are decomposed ..."
+ but this is not true: You can pass non-decomposed UTF-8 strings
+ to file system functions, and it is the OS which will convert
+ them to decomposed UTF-8 before accessing the file system.
+ - The Apple Terminal application displays UTF-8 by default.
+ - However, other applications are free to use different encodings:
+ - xterm uses ISO-8859-1 by default.
+ - TextEdit uses MacRoman by default.
+ We prefer UTF-8 over decomposed UTF-8-MAC because one should
+ minimize the use of decomposed Unicode. Unfortunately, through the
+ Darwin file system, decomposed UTF-8 strings are leaked into user
+ space nevertheless.
+ Then there are also the locales with encodings other than US-ASCII
+ and UTF-8. These locales can be occasionally useful to users (e.g.
+ when grepping through ISO-8859-1 encoded text files), when all their
+ file names are in US-ASCII.
+ */
+ { "ARMSCII-8", "ARMSCII-8" },
+ { "Big5", "BIG5" },
+ { "Big5HKSCS", "BIG5-HKSCS" },
+ { "CP1131", "CP1131" },
+ { "CP1251", "CP1251" },
+ { "CP866", "CP866" },
+ { "CP949", "CP949" },
+ { "GB18030", "GB18030" },
+ { "GB2312", "GB2312" },
+ { "GBK", "GBK" },
+ /*{ "ISCII-DEV", "?" },*/
+ { "ISO8859-1", "ISO-8859-1" },
+ { "ISO8859-13", "ISO-8859-13" },
+ { "ISO8859-15", "ISO-8859-15" },
+ { "ISO8859-2", "ISO-8859-2" },
+ { "ISO8859-4", "ISO-8859-4" },
+ { "ISO8859-5", "ISO-8859-5" },
+ { "ISO8859-7", "ISO-8859-7" },
+ { "ISO8859-9", "ISO-8859-9" },
+ { "KOI8-R", "KOI8-R" },
+ { "KOI8-U", "KOI8-U" },
+ { "PT154", "PT154" },
+ { "SJIS", "SHIFT_JIS" },
+ { "eucCN", "GB2312" },
+ { "eucJP", "EUC-JP" },
+ { "eucKR", "EUC-KR" }
+# define alias_table_defined
+# endif
+# if defined _AIX /* AIX */
+ /*{ "GBK", "GBK" },*/
+ { "IBM-1046", "CP1046" },
+ { "IBM-1124", "CP1124" },
+ { "IBM-1129", "CP1129" },
+ { "IBM-1252", "CP1252" },
+ { "IBM-850", "CP850" },
+ { "IBM-856", "CP856" },
+ { "IBM-921", "ISO-8859-13" },
+ { "IBM-922", "CP922" },
+ { "IBM-932", "CP932" },
+ { "IBM-943", "CP943" },
+ { "IBM-eucCN", "GB2312" },
+ { "IBM-eucJP", "EUC-JP" },
+ { "IBM-eucKR", "EUC-KR" },
+ { "IBM-eucTW", "EUC-TW" },
+ { "ISO8859-1", "ISO-8859-1" },
+ { "ISO8859-15", "ISO-8859-15" },
+ { "ISO8859-2", "ISO-8859-2" },
+ { "ISO8859-5", "ISO-8859-5" },
+ { "ISO8859-6", "ISO-8859-6" },
+ { "ISO8859-7", "ISO-8859-7" },
+ { "ISO8859-8", "ISO-8859-8" },
+ { "ISO8859-9", "ISO-8859-9" },
+ { "TIS-620", "TIS-620" },
+ /*{ "UTF-8", "UTF-8" },*/
+ { "big5", "BIG5" }
+# define alias_table_defined
+# endif
+# if defined __hpux /* HP-UX */
+ { "SJIS", "SHIFT_JIS" },
+ { "arabic8", "HP-ARABIC8" },
+ { "big5", "BIG5" },
+ { "cp1251", "CP1251" },
+ { "eucJP", "EUC-JP" },
+ { "eucKR", "EUC-KR" },
+ { "eucTW", "EUC-TW" },
+ { "gb18030", "GB18030" },
+ { "greek8", "HP-GREEK8" },
+ { "hebrew8", "HP-HEBREW8" },
+ { "hkbig5", "BIG5-HKSCS" },
+ { "hp15CN", "GB2312" },
+ { "iso88591", "ISO-8859-1" },
+ { "iso885913", "ISO-8859-13" },
+ { "iso885915", "ISO-8859-15" },
+ { "iso88592", "ISO-8859-2" },
+ { "iso88594", "ISO-8859-4" },
+ { "iso88595", "ISO-8859-5" },
+ { "iso88596", "ISO-8859-6" },
+ { "iso88597", "ISO-8859-7" },
+ { "iso88598", "ISO-8859-8" },
+ { "iso88599", "ISO-8859-9" },
+ { "kana8", "HP-KANA8" },
+ { "koi8r", "KOI8-R" },
+ { "roman8", "HP-ROMAN8" },
+ { "tis620", "TIS-620" },
+ { "turkish8", "HP-TURKISH8" },
+ { "utf8", "UTF-8" }
+# define alias_table_defined
+# endif
+# if defined __sgi /* IRIX */
+ { "ISO8859-1", "ISO-8859-1" },
+ { "ISO8859-15", "ISO-8859-15" },
+ { "ISO8859-2", "ISO-8859-2" },
+ { "ISO8859-5", "ISO-8859-5" },
+ { "ISO8859-7", "ISO-8859-7" },
+ { "ISO8859-9", "ISO-8859-9" },
+ { "eucCN", "GB2312" },
+ { "eucJP", "EUC-JP" },
+ { "eucKR", "EUC-KR" },
+ { "eucTW", "EUC-TW" }
+# define alias_table_defined
+# endif
+# if defined __osf__ /* OSF/1 */
+ /*{ "GBK", "GBK" },*/
+ { "ISO8859-1", "ISO-8859-1" },
+ { "ISO8859-15", "ISO-8859-15" },
+ { "ISO8859-2", "ISO-8859-2" },
+ { "ISO8859-4", "ISO-8859-4" },
+ { "ISO8859-5", "ISO-8859-5" },
+ { "ISO8859-7", "ISO-8859-7" },
+ { "ISO8859-8", "ISO-8859-8" },
+ { "ISO8859-9", "ISO-8859-9" },
+ { "KSC5601", "CP949" },
+ { "SJIS", "SHIFT_JIS" },
+ { "TACTIS", "TIS-620" },
+ /*{ "UTF-8", "UTF-8" },*/
+ { "big5", "BIG5" },
+ { "cp850", "CP850" },
+ { "dechanyu", "DEC-HANYU" },
+ { "dechanzi", "GB2312" },
+ { "deckanji", "DEC-KANJI" },
+ { "deckorean", "EUC-KR" },
+ { "eucJP", "EUC-JP" },
+ { "eucKR", "EUC-KR" },
+ { "eucTW", "EUC-TW" },
+ { "sdeckanji", "EUC-JP" }
+# define alias_table_defined
+# endif
+# if defined __sun /* Solaris */
+ { "5601", "EUC-KR" },
+ { "646", "ASCII" },
+ /*{ "BIG5", "BIG5" },*/
+ { "Big5-HKSCS", "BIG5-HKSCS" },
+ { "GB18030", "GB18030" },
+ /*{ "GBK", "GBK" },*/
+ { "ISO8859-1", "ISO-8859-1" },
+ { "ISO8859-11", "TIS-620" },
+ { "ISO8859-13", "ISO-8859-13" },
+ { "ISO8859-15", "ISO-8859-15" },
+ { "ISO8859-2", "ISO-8859-2" },
+ { "ISO8859-3", "ISO-8859-3" },
+ { "ISO8859-4", "ISO-8859-4" },
+ { "ISO8859-5", "ISO-8859-5" },
+ { "ISO8859-6", "ISO-8859-6" },
+ { "ISO8859-7", "ISO-8859-7" },
+ { "ISO8859-8", "ISO-8859-8" },
+ { "ISO8859-9", "ISO-8859-9" },
+ { "PCK", "SHIFT_JIS" },
+ { "TIS620.2533", "TIS-620" },
+ /*{ "UTF-8", "UTF-8" },*/
+ { "ansi-1251", "CP1251" },
+ { "cns11643", "EUC-TW" },
+ { "eucJP", "EUC-JP" },
+ { "gb2312", "GB2312" },
+ { "koi8-r", "KOI8-R" }
+# define alias_table_defined
+# endif
+# if defined __minix /* Minix */
+ { "646", "ASCII" }
+# define alias_table_defined
+# endif
+# if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Windows */
+ { "CP1361", "JOHAB" },
+ { "CP20127", "ASCII" },
+ { "CP20866", "KOI8-R" },
+ { "CP20936", "GB2312" },
+ { "CP21866", "KOI8-RU" },
+ { "CP28591", "ISO-8859-1" },
+ { "CP28592", "ISO-8859-2" },
+ { "CP28593", "ISO-8859-3" },
+ { "CP28594", "ISO-8859-4" },
+ { "CP28595", "ISO-8859-5" },
+ { "CP28596", "ISO-8859-6" },
+ { "CP28597", "ISO-8859-7" },
+ { "CP28598", "ISO-8859-8" },
+ { "CP28599", "ISO-8859-9" },
+ { "CP28605", "ISO-8859-15" },
+ { "CP38598", "ISO-8859-8" },
+ { "CP51932", "EUC-JP" },
+ { "CP51936", "GB2312" },
+ { "CP51949", "EUC-KR" },
+ { "CP51950", "EUC-TW" },
+ { "CP54936", "GB18030" },
+ { "CP65001", "UTF-8" },
+ { "CP936", "GBK" }
+# define alias_table_defined
+# endif
+# if defined OS2 /* OS/2 */
+ /* The list of encodings is taken from "List of OS/2 Codepages"
+ by Alex Taylor:
+ <http://altsan.org/os2/toolkits/uls/index.html#codepages>.
+ See also "__convcp() of kLIBC":
+ <https://github.com/bitwiseworks/libc/blob/master/src/emx/src/lib/locale/__convcp.c>. */
+ { "CP1004", "CP1252" },
+ /*{ "CP1041", "CP943" },*/
+ /*{ "CP1088", "CP949" },*/
+ { "CP1089", "ISO-8859-6" },
+ /*{ "CP1114", "CP950" },*/
+ /*{ "CP1115", "GB2312" },*/
+ { "CP1208", "UTF-8" },
+ /*{ "CP1380", "GB2312" },*/
+ { "CP1381", "GB2312" },
+ { "CP1383", "GB2312" },
+ { "CP1386", "GBK" },
+ /*{ "CP301", "CP943" },*/
+ { "CP3372", "EUC-JP" },
+ { "CP4946", "CP850" },
+ /*{ "CP5048", "JIS_X0208-1990" },*/
+ /*{ "CP5049", "JIS_X0212-1990" },*/
+ /*{ "CP5067", "KS_C_5601-1987" },*/
+ { "CP813", "ISO-8859-7" },
+ { "CP819", "ISO-8859-1" },
+ { "CP878", "KOI8-R" },
+ /*{ "CP897", "CP943" },*/
+ { "CP912", "ISO-8859-2" },
+ { "CP913", "ISO-8859-3" },
+ { "CP914", "ISO-8859-4" },
+ { "CP915", "ISO-8859-5" },
+ { "CP916", "ISO-8859-8" },
+ { "CP920", "ISO-8859-9" },
+ { "CP921", "ISO-8859-13" },
+ { "CP923", "ISO-8859-15" },
+ /*{ "CP941", "CP943" },*/
+ /*{ "CP947", "CP950" },*/
+ /*{ "CP951", "CP949" },*/
+ /*{ "CP952", "JIS_X0208-1990" },*/
+ /*{ "CP953", "JIS_X0212-1990" },*/
+ { "CP954", "EUC-JP" },
+ { "CP964", "EUC-TW" },
+ { "CP970", "EUC-KR" },
+ /*{ "CP971", "KS_C_5601-1987" },*/
+ { "IBM-1004", "CP1252" },
+ /*{ "IBM-1006", "?" },*/
+ /*{ "IBM-1008", "?" },*/
+ /*{ "IBM-1041", "CP943" },*/
+ /*{ "IBM-1051", "?" },*/
+ /*{ "IBM-1088", "CP949" },*/
+ { "IBM-1089", "ISO-8859-6" },
+ /*{ "IBM-1098", "?" },*/
+ /*{ "IBM-1114", "CP950" },*/
+ /*{ "IBM-1115", "GB2312" },*/
+ /*{ "IBM-1116", "?" },*/
+ /*{ "IBM-1117", "?" },*/
+ /*{ "IBM-1118", "?" },*/
+ /*{ "IBM-1119", "?" },*/
+ { "IBM-1124", "CP1124" },
+ { "IBM-1125", "CP1125" },
+ { "IBM-1131", "CP1131" },
+ { "IBM-1208", "UTF-8" },
+ { "IBM-1250", "CP1250" },
+ { "IBM-1251", "CP1251" },
+ { "IBM-1252", "CP1252" },
+ { "IBM-1253", "CP1253" },
+ { "IBM-1254", "CP1254" },
+ { "IBM-1255", "CP1255" },
+ { "IBM-1256", "CP1256" },
+ { "IBM-1257", "CP1257" },
+ /*{ "IBM-1275", "?" },*/
+ /*{ "IBM-1276", "?" },*/
+ /*{ "IBM-1277", "?" },*/
+ /*{ "IBM-1280", "?" },*/
+ /*{ "IBM-1281", "?" },*/
+ /*{ "IBM-1282", "?" },*/
+ /*{ "IBM-1283", "?" },*/
+ /*{ "IBM-1380", "GB2312" },*/
+ { "IBM-1381", "GB2312" },
+ { "IBM-1383", "GB2312" },
+ { "IBM-1386", "GBK" },
+ /*{ "IBM-301", "CP943" },*/
+ { "IBM-3372", "EUC-JP" },
+ { "IBM-367", "ASCII" },
+ { "IBM-437", "CP437" },
+ { "IBM-4946", "CP850" },
+ /*{ "IBM-5048", "JIS_X0208-1990" },*/
+ /*{ "IBM-5049", "JIS_X0212-1990" },*/
+ /*{ "IBM-5067", "KS_C_5601-1987" },*/
+ { "IBM-813", "ISO-8859-7" },
+ { "IBM-819", "ISO-8859-1" },
+ { "IBM-850", "CP850" },
+ /*{ "IBM-851", "?" },*/
+ { "IBM-852", "CP852" },
+ { "IBM-855", "CP855" },
+ { "IBM-856", "CP856" },
+ { "IBM-857", "CP857" },
+ /*{ "IBM-859", "?" },*/
+ { "IBM-860", "CP860" },
+ { "IBM-861", "CP861" },
+ { "IBM-862", "CP862" },
+ { "IBM-863", "CP863" },
+ { "IBM-864", "CP864" },
+ { "IBM-865", "CP865" },
+ { "IBM-866", "CP866" },
+ /*{ "IBM-868", "?" },*/
+ { "IBM-869", "CP869" },
+ { "IBM-874", "CP874" },
+ { "IBM-878", "KOI8-R" },
+ /*{ "IBM-895", "?" },*/
+ /*{ "IBM-897", "CP943" },*/
+ /*{ "IBM-907", "?" },*/
+ /*{ "IBM-909", "?" },*/
+ { "IBM-912", "ISO-8859-2" },
+ { "IBM-913", "ISO-8859-3" },
+ { "IBM-914", "ISO-8859-4" },
+ { "IBM-915", "ISO-8859-5" },
+ { "IBM-916", "ISO-8859-8" },
+ { "IBM-920", "ISO-8859-9" },
+ { "IBM-921", "ISO-8859-13" },
+ { "IBM-922", "CP922" },
+ { "IBM-923", "ISO-8859-15" },
+ { "IBM-932", "CP932" },
+ /*{ "IBM-941", "CP943" },*/
+ /*{ "IBM-942", "?" },*/
+ { "IBM-943", "CP943" },
+ /*{ "IBM-947", "CP950" },*/
+ { "IBM-949", "CP949" },
+ { "IBM-950", "CP950" },
+ /*{ "IBM-951", "CP949" },*/
+ /*{ "IBM-952", "JIS_X0208-1990" },*/
+ /*{ "IBM-953", "JIS_X0212-1990" },*/
+ { "IBM-954", "EUC-JP" },
+ /*{ "IBM-955", "?" },*/
+ { "IBM-964", "EUC-TW" },
+ { "IBM-970", "EUC-KR" },
+ /*{ "IBM-971", "KS_C_5601-1987" },*/
+ { "IBM-eucCN", "GB2312" },
+ { "IBM-eucJP", "EUC-JP" },
+ { "IBM-eucKR", "EUC-KR" },
+ { "IBM-eucTW", "EUC-TW" },
+ { "IBM33722", "EUC-JP" },
+ { "ISO8859-1", "ISO-8859-1" },
+ { "ISO8859-2", "ISO-8859-2" },
+ { "ISO8859-3", "ISO-8859-3" },
+ { "ISO8859-4", "ISO-8859-4" },
+ { "ISO8859-5", "ISO-8859-5" },
+ { "ISO8859-6", "ISO-8859-6" },
+ { "ISO8859-7", "ISO-8859-7" },
+ { "ISO8859-8", "ISO-8859-8" },
+ { "ISO8859-9", "ISO-8859-9" },
+ /*{ "JISX0201-1976", "JISX0201-1976" },*/
+ /*{ "JISX0208-1978", "?" },*/
+ /*{ "JISX0208-1983", "JIS_X0208-1983" },*/
+ /*{ "JISX0208-1990", "JIS_X0208-1990" },*/
+ /*{ "JISX0212-1990", "JIS_X0212-1990" },*/
+ /*{ "KSC5601-1987", "KS_C_5601-1987" },*/
+ { "SJIS-1", "CP943" },
+ { "SJIS-2", "CP943" },
+ { "eucJP", "EUC-JP" },
+ { "eucKR", "EUC-KR" },
+ { "eucTW-1993", "EUC-TW" }
+# define alias_table_defined
+# endif
+# if defined VMS /* OpenVMS */
+ /* The list of encodings is taken from the OpenVMS 7.3-1 documentation
+ "Compaq C Run-Time Library Reference Manual for OpenVMS systems"
+ section 10.7 "Handling Different Character Sets". */
+ { "DECHANYU", "DEC-HANYU" },
+ { "DECHANZI", "GB2312" },
+ { "DECKANJI", "DEC-KANJI" },
+ { "DECKOREAN", "EUC-KR" },
+ { "ISO8859-1", "ISO-8859-1" },
+ { "ISO8859-2", "ISO-8859-2" },
+ { "ISO8859-5", "ISO-8859-5" },
+ { "ISO8859-7", "ISO-8859-7" },
+ { "ISO8859-8", "ISO-8859-8" },
+ { "ISO8859-9", "ISO-8859-9" },
+ { "SDECKANJI", "EUC-JP" },
+ { "SJIS", "SHIFT_JIS" },
+ { "eucJP", "EUC-JP" },
+ { "eucTW", "EUC-TW" }
+# define alias_table_defined
+# endif
+# ifndef alias_table_defined
+ /* Just a dummy entry, to avoid a C syntax error. */
+ { "", "" }
+# endif
+ };
+
+# endif
+
+#else
+
+/* On these platforms, we use a mapping from locale name to GNU canonical
+ encoding name. */
+
+struct table_entry
+{
+ const char locale[17+1];
+ const char canonical[11+1];
+};
+
+/* Table of platform-dependent mappings, sorted in ascending order. */
+static const struct table_entry locale_table[] =
+ {
+# if defined __FreeBSD__ /* FreeBSD 4.2 */
+ { "cs_CZ.ISO_8859-2", "ISO-8859-2" },
+ { "da_DK.DIS_8859-15", "ISO-8859-15" },
+ { "da_DK.ISO_8859-1", "ISO-8859-1" },
+ { "de_AT.DIS_8859-15", "ISO-8859-15" },
+ { "de_AT.ISO_8859-1", "ISO-8859-1" },
+ { "de_CH.DIS_8859-15", "ISO-8859-15" },
+ { "de_CH.ISO_8859-1", "ISO-8859-1" },
+ { "de_DE.DIS_8859-15", "ISO-8859-15" },
+ { "de_DE.ISO_8859-1", "ISO-8859-1" },
+ { "en_AU.DIS_8859-15", "ISO-8859-15" },
+ { "en_AU.ISO_8859-1", "ISO-8859-1" },
+ { "en_CA.DIS_8859-15", "ISO-8859-15" },
+ { "en_CA.ISO_8859-1", "ISO-8859-1" },
+ { "en_GB.DIS_8859-15", "ISO-8859-15" },
+ { "en_GB.ISO_8859-1", "ISO-8859-1" },
+ { "en_US.DIS_8859-15", "ISO-8859-15" },
+ { "en_US.ISO_8859-1", "ISO-8859-1" },
+ { "es_ES.DIS_8859-15", "ISO-8859-15" },
+ { "es_ES.ISO_8859-1", "ISO-8859-1" },
+ { "fi_FI.DIS_8859-15", "ISO-8859-15" },
+ { "fi_FI.ISO_8859-1", "ISO-8859-1" },
+ { "fr_BE.DIS_8859-15", "ISO-8859-15" },
+ { "fr_BE.ISO_8859-1", "ISO-8859-1" },
+ { "fr_CA.DIS_8859-15", "ISO-8859-15" },
+ { "fr_CA.ISO_8859-1", "ISO-8859-1" },
+ { "fr_CH.DIS_8859-15", "ISO-8859-15" },
+ { "fr_CH.ISO_8859-1", "ISO-8859-1" },
+ { "fr_FR.DIS_8859-15", "ISO-8859-15" },
+ { "fr_FR.ISO_8859-1", "ISO-8859-1" },
+ { "hr_HR.ISO_8859-2", "ISO-8859-2" },
+ { "hu_HU.ISO_8859-2", "ISO-8859-2" },
+ { "is_IS.DIS_8859-15", "ISO-8859-15" },
+ { "is_IS.ISO_8859-1", "ISO-8859-1" },
+ { "it_CH.DIS_8859-15", "ISO-8859-15" },
+ { "it_CH.ISO_8859-1", "ISO-8859-1" },
+ { "it_IT.DIS_8859-15", "ISO-8859-15" },
+ { "it_IT.ISO_8859-1", "ISO-8859-1" },
+ { "ja_JP.EUC", "EUC-JP" },
+ { "ja_JP.SJIS", "SHIFT_JIS" },
+ { "ja_JP.Shift_JIS", "SHIFT_JIS" },
+ { "ko_KR.EUC", "EUC-KR" },
+ { "la_LN.ASCII", "ASCII" },
+ { "la_LN.DIS_8859-15", "ISO-8859-15" },
+ { "la_LN.ISO_8859-1", "ISO-8859-1" },
+ { "la_LN.ISO_8859-2", "ISO-8859-2" },
+ { "la_LN.ISO_8859-4", "ISO-8859-4" },
+ { "lt_LN.ASCII", "ASCII" },
+ { "lt_LN.DIS_8859-15", "ISO-8859-15" },
+ { "lt_LN.ISO_8859-1", "ISO-8859-1" },
+ { "lt_LN.ISO_8859-2", "ISO-8859-2" },
+ { "lt_LT.ISO_8859-4", "ISO-8859-4" },
+ { "nl_BE.DIS_8859-15", "ISO-8859-15" },
+ { "nl_BE.ISO_8859-1", "ISO-8859-1" },
+ { "nl_NL.DIS_8859-15", "ISO-8859-15" },
+ { "nl_NL.ISO_8859-1", "ISO-8859-1" },
+ { "no_NO.DIS_8859-15", "ISO-8859-15" },
+ { "no_NO.ISO_8859-1", "ISO-8859-1" },
+ { "pl_PL.ISO_8859-2", "ISO-8859-2" },
+ { "pt_PT.DIS_8859-15", "ISO-8859-15" },
+ { "pt_PT.ISO_8859-1", "ISO-8859-1" },
+ { "ru_RU.CP866", "CP866" },
+ { "ru_RU.ISO_8859-5", "ISO-8859-5" },
+ { "ru_RU.KOI8-R", "KOI8-R" },
+ { "ru_SU.CP866", "CP866" },
+ { "ru_SU.ISO_8859-5", "ISO-8859-5" },
+ { "ru_SU.KOI8-R", "KOI8-R" },
+ { "sl_SI.ISO_8859-2", "ISO-8859-2" },
+ { "sv_SE.DIS_8859-15", "ISO-8859-15" },
+ { "sv_SE.ISO_8859-1", "ISO-8859-1" },
+ { "uk_UA.KOI8-U", "KOI8-U" },
+ { "zh_CN.EUC", "GB2312" },
+ { "zh_TW.BIG5", "BIG5" },
+ { "zh_TW.Big5", "BIG5" }
+# define locale_table_defined
+# endif
+# if defined __DJGPP__ /* DOS / DJGPP 2.03 */
+ /* The encodings given here may not all be correct.
+ If you find that the encoding given for your language and
+ country is not the one your DOS machine actually uses, just
+ correct it in this file, and send a mail to
+ Juan Manuel Guerrero <juan.guerrero@gmx.de>
+ and <bug-gnulib@gnu.org>. */
+ { "C", "ASCII" },
+ { "ar", "CP864" },
+ { "ar_AE", "CP864" },
+ { "ar_DZ", "CP864" },
+ { "ar_EG", "CP864" },
+ { "ar_IQ", "CP864" },
+ { "ar_IR", "CP864" },
+ { "ar_JO", "CP864" },
+ { "ar_KW", "CP864" },
+ { "ar_MA", "CP864" },
+ { "ar_OM", "CP864" },
+ { "ar_QA", "CP864" },
+ { "ar_SA", "CP864" },
+ { "ar_SY", "CP864" },
+ { "be", "CP866" },
+ { "be_BE", "CP866" },
+ { "bg", "CP866" }, /* not CP855 ?? */
+ { "bg_BG", "CP866" }, /* not CP855 ?? */
+ { "ca", "CP850" },
+ { "ca_ES", "CP850" },
+ { "cs", "CP852" },
+ { "cs_CZ", "CP852" },
+ { "da", "CP865" }, /* not CP850 ?? */
+ { "da_DK", "CP865" }, /* not CP850 ?? */
+ { "de", "CP850" },
+ { "de_AT", "CP850" },
+ { "de_CH", "CP850" },
+ { "de_DE", "CP850" },
+ { "el", "CP869" },
+ { "el_GR", "CP869" },
+ { "en", "CP850" },
+ { "en_AU", "CP850" }, /* not CP437 ?? */
+ { "en_CA", "CP850" },
+ { "en_GB", "CP850" },
+ { "en_NZ", "CP437" },
+ { "en_US", "CP437" },
+ { "en_ZA", "CP850" }, /* not CP437 ?? */
+ { "eo", "CP850" },
+ { "eo_EO", "CP850" },
+ { "es", "CP850" },
+ { "es_AR", "CP850" },
+ { "es_BO", "CP850" },
+ { "es_CL", "CP850" },
+ { "es_CO", "CP850" },
+ { "es_CR", "CP850" },
+ { "es_CU", "CP850" },
+ { "es_DO", "CP850" },
+ { "es_EC", "CP850" },
+ { "es_ES", "CP850" },
+ { "es_GT", "CP850" },
+ { "es_HN", "CP850" },
+ { "es_MX", "CP850" },
+ { "es_NI", "CP850" },
+ { "es_PA", "CP850" },
+ { "es_PE", "CP850" },
+ { "es_PY", "CP850" },
+ { "es_SV", "CP850" },
+ { "es_UY", "CP850" },
+ { "es_VE", "CP850" },
+ { "et", "CP850" },
+ { "et_EE", "CP850" },
+ { "eu", "CP850" },
+ { "eu_ES", "CP850" },
+ { "fi", "CP850" },
+ { "fi_FI", "CP850" },
+ { "fr", "CP850" },
+ { "fr_BE", "CP850" },
+ { "fr_CA", "CP850" },
+ { "fr_CH", "CP850" },
+ { "fr_FR", "CP850" },
+ { "ga", "CP850" },
+ { "ga_IE", "CP850" },
+ { "gd", "CP850" },
+ { "gd_GB", "CP850" },
+ { "gl", "CP850" },
+ { "gl_ES", "CP850" },
+ { "he", "CP862" },
+ { "he_IL", "CP862" },
+ { "hr", "CP852" },
+ { "hr_HR", "CP852" },
+ { "hu", "CP852" },
+ { "hu_HU", "CP852" },
+ { "id", "CP850" }, /* not CP437 ?? */
+ { "id_ID", "CP850" }, /* not CP437 ?? */
+ { "is", "CP861" }, /* not CP850 ?? */
+ { "is_IS", "CP861" }, /* not CP850 ?? */
+ { "it", "CP850" },
+ { "it_CH", "CP850" },
+ { "it_IT", "CP850" },
+ { "ja", "CP932" },
+ { "ja_JP", "CP932" },
+ { "kr", "CP949" }, /* not CP934 ?? */
+ { "kr_KR", "CP949" }, /* not CP934 ?? */
+ { "lt", "CP775" },
+ { "lt_LT", "CP775" },
+ { "lv", "CP775" },
+ { "lv_LV", "CP775" },
+ { "mk", "CP866" }, /* not CP855 ?? */
+ { "mk_MK", "CP866" }, /* not CP855 ?? */
+ { "mt", "CP850" },
+ { "mt_MT", "CP850" },
+ { "nb", "CP865" }, /* not CP850 ?? */
+ { "nb_NO", "CP865" }, /* not CP850 ?? */
+ { "nl", "CP850" },
+ { "nl_BE", "CP850" },
+ { "nl_NL", "CP850" },
+ { "nn", "CP865" }, /* not CP850 ?? */
+ { "nn_NO", "CP865" }, /* not CP850 ?? */
+ { "no", "CP865" }, /* not CP850 ?? */
+ { "no_NO", "CP865" }, /* not CP850 ?? */
+ { "pl", "CP852" },
+ { "pl_PL", "CP852" },
+ { "pt", "CP850" },
+ { "pt_BR", "CP850" },
+ { "pt_PT", "CP850" },
+ { "ro", "CP852" },
+ { "ro_RO", "CP852" },
+ { "ru", "CP866" },
+ { "ru_RU", "CP866" },
+ { "sk", "CP852" },
+ { "sk_SK", "CP852" },
+ { "sl", "CP852" },
+ { "sl_SI", "CP852" },
+ { "sq", "CP852" },
+ { "sq_AL", "CP852" },
+ { "sr", "CP852" }, /* CP852 or CP866 or CP855 ?? */
+ { "sr_CS", "CP852" }, /* CP852 or CP866 or CP855 ?? */
+ { "sr_YU", "CP852" }, /* CP852 or CP866 or CP855 ?? */
+ { "sv", "CP850" },
+ { "sv_SE", "CP850" },
+ { "th", "CP874" },
+ { "th_TH", "CP874" },
+ { "tr", "CP857" },
+ { "tr_TR", "CP857" },
+ { "uk", "CP1125" },
+ { "uk_UA", "CP1125" },
+ { "zh_CN", "GBK" },
+ { "zh_TW", "CP950" } /* not CP938 ?? */
+# define locale_table_defined
+# endif
+# ifndef locale_table_defined
+ /* Just a dummy entry, to avoid a C syntax error. */
+ { "", "" }
+# endif
+ };
+
+#endif
+
+
+/* Determine the current locale's character encoding, and canonicalize it
+ into one of the canonical names listed below.
+ The result must not be freed; it is statically allocated. The result
+ becomes invalid when setlocale() is used to change the global locale, or
+ when the value of one of the environment variables LC_ALL, LC_CTYPE, LANG
+ is changed; threads in multithreaded programs should not do this.
+ If the canonical name cannot be determined, the result is a non-canonical
+ name. */
+
+#ifdef STATIC
+STATIC
+#endif
+const char *
+locale_charset (void)
+{
+ const char *codeset;
+
+ /* This function must be multithread-safe. To achieve this without using
+ thread-local storage, we use a simple strcpy or memcpy to fill this static
+ buffer. Filling it through, for example, strcpy + strcat would not be
+ guaranteed to leave the buffer's contents intact if another thread is
+ currently accessing it. If necessary, the contents is first assembled in
+ a stack-allocated buffer. */
+
+#if HAVE_LANGINFO_CODESET || defined WINDOWS_NATIVE || defined OS2
+
+# if HAVE_LANGINFO_CODESET
+
+ /* Most systems support nl_langinfo (CODESET) nowadays. */
+ codeset = nl_langinfo (CODESET);
+
+# ifdef __CYGWIN__
+ /* Cygwin < 1.7 does not have locales. nl_langinfo (CODESET) always
+ returns "US-ASCII". Return the suffix of the locale name from the
+ environment variables (if present) or the codepage as a number. */
+ if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0)
+ {
+ const char *locale;
+ static char resultbuf[2 + 10 + 1];
+
+ locale = getenv ("LC_ALL");
+ if (locale == NULL || locale[0] == '\0')
+ {
+ locale = getenv ("LC_CTYPE");
+ if (locale == NULL || locale[0] == '\0')
+ locale = getenv ("LANG");
+ }
+ if (locale != NULL && locale[0] != '\0')
+ {
+ /* If the locale name contains an encoding after the dot, return
+ it. */
+ const char *dot = strchr (locale, '.');
+
+ if (dot != NULL)
+ {
+ const char *modifier;
+
+ dot++;
+ /* Look for the possible @... trailer and remove it, if any. */
+ modifier = strchr (dot, '@');
+ if (modifier == NULL)
+ return dot;
+ if (modifier - dot < sizeof (resultbuf))
+ {
+ /* This way of filling resultbuf is multithread-safe. */
+ memcpy (resultbuf, dot, modifier - dot);
+ resultbuf [modifier - dot] = '\0';
+ return resultbuf;
+ }
+ }
+ }
+
+ /* The Windows API has a function returning the locale's codepage as a
+ number: GetACP(). This encoding is used by Cygwin, unless the user
+ has set the environment variable CYGWIN=codepage:oem (which very few
+ people do).
+ Output directed to console windows needs to be converted (to
+ GetOEMCP() if the console is using a raster font, or to
+ GetConsoleOutputCP() if it is using a TrueType font). Cygwin does
+ this conversion transparently (see winsup/cygwin/fhandler_console.cc),
+ converting to GetConsoleOutputCP(). This leads to correct results,
+ except when SetConsoleOutputCP has been called and a raster font is
+ in use. */
+ {
+ char buf[2 + 10 + 1];
+
+ sprintf (buf, "CP%u", GetACP ());
+ strcpy (resultbuf, buf);
+ codeset = resultbuf;
+ }
+ }
+# endif
+
+ if (codeset == NULL)
+ /* The canonical name cannot be determined. */
+ codeset = "";
+
+# elif defined WINDOWS_NATIVE
+
+ char buf[2 + 10 + 1];
+ static char resultbuf[2 + 10 + 1];
+
+ /* The Windows API has a function returning the locale's codepage as
+ a number, but the value doesn't change according to what the
+ 'setlocale' call specified. So we use it as a last resort, in
+ case the string returned by 'setlocale' doesn't specify the
+ codepage. */
+ char *current_locale = setlocale (LC_CTYPE, NULL);
+ char *pdot = strrchr (current_locale, '.');
+
+ if (pdot && 2 + strlen (pdot + 1) + 1 <= sizeof (buf))
+ sprintf (buf, "CP%s", pdot + 1);
+ else
+ {
+ /* The Windows API has a function returning the locale's codepage as a
+ number: GetACP().
+ When the output goes to a console window, it needs to be provided in
+ GetOEMCP() encoding if the console is using a raster font, or in
+ GetConsoleOutputCP() encoding if it is using a TrueType font.
+ But in GUI programs and for output sent to files and pipes, GetACP()
+ encoding is the best bet. */
+ sprintf (buf, "CP%u", GetACP ());
+ }
+ /* For a locale name such as "French_France.65001", in Windows 10,
+ setlocale now returns "French_France.utf8" instead. */
+ if (strcmp (buf + 2, "65001") == 0 || strcmp (buf + 2, "utf8") == 0)
+ codeset = "UTF-8";
+ else
+ {
+ strcpy (resultbuf, buf);
+ codeset = resultbuf;
+ }
+
+# elif defined OS2
+
+ const char *locale;
+ static char resultbuf[2 + 10 + 1];
+ ULONG cp[3];
+ ULONG cplen;
+
+ codeset = NULL;
+
+ /* Allow user to override the codeset, as set in the operating system,
+ with standard language environment variables. */
+ locale = getenv ("LC_ALL");
+ if (locale == NULL || locale[0] == '\0')
+ {
+ locale = getenv ("LC_CTYPE");
+ if (locale == NULL || locale[0] == '\0')
+ locale = getenv ("LANG");
+ }
+ if (locale != NULL && locale[0] != '\0')
+ {
+ /* If the locale name contains an encoding after the dot, return it. */
+ const char *dot = strchr (locale, '.');
+
+ if (dot != NULL)
+ {
+ const char *modifier;
+
+ dot++;
+ /* Look for the possible @... trailer and remove it, if any. */
+ modifier = strchr (dot, '@');
+ if (modifier == NULL)
+ return dot;
+ if (modifier - dot < sizeof (resultbuf))
+ {
+ /* This way of filling resultbuf is multithread-safe. */
+ memcpy (resultbuf, dot, modifier - dot);
+ resultbuf [modifier - dot] = '\0';
+ return resultbuf;
+ }
+ }
+
+ /* For the POSIX locale, don't use the system's codepage. */
+ if (strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0)
+ codeset = "";
+ }
+
+ if (codeset == NULL)
+ {
+ /* OS/2 has a function returning the locale's codepage as a number. */
+ if (DosQueryCp (sizeof (cp), cp, &cplen))
+ codeset = "";
+ else
+ {
+ char buf[2 + 10 + 1];
+
+ sprintf (buf, "CP%u", cp[0]);
+ strcpy (resultbuf, buf);
+ codeset = resultbuf;
+ }
+ }
+
+# else
+
+# error "Add code for other platforms here."
+
+# endif
+
+ /* Resolve alias. */
+ {
+# ifdef alias_table_defined
+ /* On some platforms, UTF-8 locales are the most frequently used ones.
+ Speed up the common case and slow down the less common cases by
+ testing for this case first. */
+# if defined __OpenBSD__ || (defined __APPLE__ && defined __MACH__) || defined __sun || defined __CYGWIN__
+ if (strcmp (codeset, "UTF-8") == 0)
+ goto done_table_lookup;
+ else
+# endif
+ {
+ const struct table_entry * const table = alias_table;
+ size_t const table_size =
+ sizeof (alias_table) / sizeof (struct table_entry);
+ /* The table is sorted. Perform a binary search. */
+ size_t hi = table_size;
+ size_t lo = 0;
+ while (lo < hi)
+ {
+ /* Invariant:
+ for i < lo, strcmp (table[i].alias, codeset) < 0,
+ for i >= hi, strcmp (table[i].alias, codeset) > 0. */
+ size_t mid = (hi + lo) >> 1; /* >= lo, < hi */
+ int cmp = strcmp (table[mid].alias, codeset);
+ if (cmp < 0)
+ lo = mid + 1;
+ else if (cmp > 0)
+ hi = mid;
+ else
+ {
+ /* Found an i with
+ strcmp (table[i].alias, codeset) == 0. */
+ codeset = table[mid].canonical;
+ goto done_table_lookup;
+ }
+ }
+ }
+ if (0)
+ done_table_lookup: ;
+ else
+# endif
+ {
+ /* Did not find it in the table. */
+ /* On Mac OS X, all modern locales use the UTF-8 encoding.
+ BeOS and Haiku have a single locale, and it has UTF-8 encoding. */
+# if (defined __APPLE__ && defined __MACH__) || defined __BEOS__ || defined __HAIKU__
+ codeset = "UTF-8";
+# else
+ /* Don't return an empty string. GNU libc and GNU libiconv interpret
+ the empty string as denoting "the locale's character encoding",
+ thus GNU libiconv would call this function a second time. */
+ if (codeset[0] == '\0')
+ codeset = "ASCII";
+# endif
+ }
+ }
+
+#else
+
+ /* On old systems which lack it, use setlocale or getenv. */
+ const char *locale = NULL;
+
+ /* But most old systems don't have a complete set of locales. Some
+ (like DJGPP) have only the C locale. Therefore we don't use setlocale
+ here; it would return "C" when it doesn't support the locale name the
+ user has set. */
+# if 0
+ locale = setlocale (LC_CTYPE, NULL);
+# endif
+ if (locale == NULL || locale[0] == '\0')
+ {
+ locale = getenv ("LC_ALL");
+ if (locale == NULL || locale[0] == '\0')
+ {
+ locale = getenv ("LC_CTYPE");
+ if (locale == NULL || locale[0] == '\0')
+ locale = getenv ("LANG");
+ if (locale == NULL)
+ locale = "";
+ }
+ }
+
+ /* Map locale name to canonical encoding name. */
+ {
+# ifdef locale_table_defined
+ const struct table_entry * const table = locale_table;
+ size_t const table_size =
+ sizeof (locale_table) / sizeof (struct table_entry);
+ /* The table is sorted. Perform a binary search. */
+ size_t hi = table_size;
+ size_t lo = 0;
+ while (lo < hi)
+ {
+ /* Invariant:
+ for i < lo, strcmp (table[i].locale, locale) < 0,
+ for i >= hi, strcmp (table[i].locale, locale) > 0. */
+ size_t mid = (hi + lo) >> 1; /* >= lo, < hi */
+ int cmp = strcmp (table[mid].locale, locale);
+ if (cmp < 0)
+ lo = mid + 1;
+ else if (cmp > 0)
+ hi = mid;
+ else
+ {
+ /* Found an i with
+ strcmp (table[i].locale, locale) == 0. */
+ codeset = table[mid].canonical;
+ goto done_table_lookup;
+ }
+ }
+ if (0)
+ done_table_lookup: ;
+ else
+# endif
+ {
+ /* Did not find it in the table. */
+ /* On Mac OS X, all modern locales use the UTF-8 encoding.
+ BeOS and Haiku have a single locale, and it has UTF-8 encoding. */
+# if (defined __APPLE__ && defined __MACH__) || defined __BEOS__ || defined __HAIKU__
+ codeset = "UTF-8";
+# else
+ /* The canonical name cannot be determined. */
+ /* Don't return an empty string. GNU libc and GNU libiconv interpret
+ the empty string as denoting "the locale's character encoding",
+ thus GNU libiconv would call this function a second time. */
+ codeset = "ASCII";
+# endif
+ }
+ }
+
+#endif
+
+#ifdef DARWIN7
+ /* Mac OS X sets MB_CUR_MAX to 1 when LC_ALL=C, and "UTF-8"
+ (the default codeset) does not work when MB_CUR_MAX is 1. */
+ if (strcmp (codeset, "UTF-8") == 0 && MB_CUR_MAX_L (uselocale (NULL)) <= 1)
+ codeset = "ASCII";
+#endif
+
+ return codeset;
+}
diff --git a/gl/lib/localcharset.h b/gl/lib/localcharset.h
new file mode 100644
index 0000000..62efbf3
--- /dev/null
+++ b/gl/lib/localcharset.h
@@ -0,0 +1,137 @@
+/* Determine a canonical name for the current locale's character encoding.
+ Copyright (C) 2000-2003, 2009-2022 Free Software Foundation, Inc.
+ This file is part of the GNU CHARSET Library.
+
+ 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 2.1 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/>. */
+
+#ifndef _LOCALCHARSET_H
+#define _LOCALCHARSET_H
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Determine the current locale's character encoding, and canonicalize it
+ into one of the canonical names listed below.
+ The result must not be freed; it is statically allocated. The result
+ becomes invalid when setlocale() is used to change the global locale, or
+ when the value of one of the environment variables LC_ALL, LC_CTYPE, LANG
+ is changed; threads in multithreaded programs should not do this.
+ If the canonical name cannot be determined, the result is a non-canonical
+ name. */
+extern const char * locale_charset (void);
+
+/* About GNU canonical names for character encodings:
+
+ Every canonical name must be supported by GNU libiconv. Support by GNU libc
+ is also desirable.
+
+ The name is case insensitive. Usually an upper case MIME charset name is
+ preferred.
+
+ The current list of these GNU canonical names is:
+
+ name MIME? used by which systems
+ (darwin = Mac OS X, windows = native Windows)
+
+ ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin minix cygwin
+ ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
+ ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
+ ISO-8859-3 Y glibc solaris cygwin
+ ISO-8859-4 Y hpux osf solaris freebsd netbsd openbsd darwin
+ ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
+ ISO-8859-6 Y glibc aix hpux solaris cygwin
+ ISO-8859-7 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
+ ISO-8859-8 Y glibc aix hpux osf solaris cygwin zos
+ ISO-8859-9 Y glibc aix hpux irix osf solaris freebsd darwin cygwin zos
+ ISO-8859-13 glibc hpux solaris freebsd netbsd openbsd darwin cygwin
+ ISO-8859-14 glibc cygwin
+ ISO-8859-15 glibc aix irix osf solaris freebsd netbsd openbsd darwin cygwin
+ KOI8-R Y glibc hpux solaris freebsd netbsd openbsd darwin
+ KOI8-U Y glibc freebsd netbsd openbsd darwin cygwin
+ KOI8-T glibc
+ CP437 dos
+ CP775 dos
+ CP850 aix osf dos
+ CP852 dos
+ CP855 dos
+ CP856 aix
+ CP857 dos
+ CP861 dos
+ CP862 dos
+ CP864 dos
+ CP865 dos
+ CP866 freebsd netbsd openbsd darwin dos
+ CP869 dos
+ CP874 windows dos
+ CP922 aix
+ CP932 aix cygwin windows dos
+ CP943 aix zos
+ CP949 osf darwin windows dos
+ CP950 windows dos
+ CP1046 aix
+ CP1124 aix
+ CP1125 dos
+ CP1129 aix
+ CP1131 freebsd darwin
+ CP1250 windows
+ CP1251 glibc hpux solaris freebsd netbsd openbsd darwin cygwin windows
+ CP1252 aix windows
+ CP1253 windows
+ CP1254 windows
+ CP1255 glibc windows
+ CP1256 windows
+ CP1257 windows
+ GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin cygwin zos
+ EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin
+ EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin zos
+ EUC-TW glibc aix hpux irix osf solaris netbsd
+ BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin cygwin zos
+ BIG5-HKSCS glibc hpux solaris netbsd darwin
+ GBK glibc aix osf solaris freebsd darwin cygwin windows dos
+ GB18030 glibc hpux solaris freebsd netbsd darwin
+ SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin
+ JOHAB glibc solaris windows
+ TIS-620 glibc aix hpux osf solaris cygwin zos
+ VISCII Y glibc
+ TCVN5712-1 glibc
+ ARMSCII-8 glibc freebsd netbsd darwin
+ GEORGIAN-PS glibc cygwin
+ PT154 glibc netbsd cygwin
+ HP-ROMAN8 hpux
+ HP-ARABIC8 hpux
+ HP-GREEK8 hpux
+ HP-HEBREW8 hpux
+ HP-TURKISH8 hpux
+ HP-KANA8 hpux
+ DEC-KANJI osf
+ DEC-HANYU osf
+ UTF-8 Y glibc aix hpux osf solaris netbsd darwin cygwin zos
+
+ Note: Names which are not marked as being a MIME name should not be used in
+ Internet protocols for information interchange (mail, news, etc.).
+
+ Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications
+ must understand both names and treat them as equivalent.
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _LOCALCHARSET_H */
diff --git a/gl/lib/locale.in.h b/gl/lib/locale.in.h
new file mode 100644
index 0000000..4aef74d
--- /dev/null
+++ b/gl/lib/locale.in.h
@@ -0,0 +1,305 @@
+/* A POSIX <locale.h>.
+ Copyright (C) 2007-2022 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 2.1 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 __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if (defined _WIN32 && !defined __CYGWIN__ && defined __need_locale_t) \
+ || defined _GL_ALREADY_INCLUDING_LOCALE_H
+
+/* Special invocation convention:
+ - Inside mingw header files,
+ - To handle Solaris header files (through Solaris 10) when combined
+ with gettext's libintl.h. */
+
+#@INCLUDE_NEXT@ @NEXT_LOCALE_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_LOCALE_H
+
+#define _GL_ALREADY_INCLUDING_LOCALE_H
+
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_LOCALE_H@
+
+#undef _GL_ALREADY_INCLUDING_LOCALE_H
+
+#ifndef _@GUARD_PREFIX@_LOCALE_H
+#define _@GUARD_PREFIX@_LOCALE_H
+
+/* NetBSD 5.0 mis-defines NULL. */
+#include <stddef.h>
+
+/* Mac OS X 10.5 defines the locale_t type in <xlocale.h>. */
+#if @HAVE_XLOCALE_H@
+# include <xlocale.h>
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* The LC_MESSAGES locale category is specified in POSIX, but not in ISO C.
+ On systems that don't define it, use the same value as GNU libintl. */
+#if !defined LC_MESSAGES
+# define LC_MESSAGES 1729
+#endif
+
+/* On native Windows with MSVC, 'struct lconv' lacks the members int_p_* and
+ int_n_*. Instead of overriding 'struct lconv', merely define these member
+ names as macros. This avoids trouble in C++ mode. */
+#if defined _MSC_VER
+# define int_p_cs_precedes p_cs_precedes
+# define int_p_sign_posn p_sign_posn
+# define int_p_sep_by_space p_sep_by_space
+# define int_n_cs_precedes n_cs_precedes
+# define int_n_sign_posn n_sign_posn
+# define int_n_sep_by_space n_sep_by_space
+#endif
+
+/* Bionic libc's 'struct lconv' is just a dummy. */
+#if @REPLACE_STRUCT_LCONV@
+# define lconv rpl_lconv
+struct lconv
+{
+ /* All 'char *' are actually 'const char *'. */
+
+ /* Members that depend on the LC_NUMERIC category of the locale. See
+ <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_04> */
+
+ /* Symbol used as decimal point. */
+ char *decimal_point;
+ /* Symbol used to separate groups of digits to the left of the decimal
+ point. */
+ char *thousands_sep;
+ /* Definition of the size of groups of digits to the left of the decimal
+ point. */
+ char *grouping;
+
+ /* Members that depend on the LC_MONETARY category of the locale. See
+ <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_03> */
+
+ /* Symbol used as decimal point. */
+ char *mon_decimal_point;
+ /* Symbol used to separate groups of digits to the left of the decimal
+ point. */
+ char *mon_thousands_sep;
+ /* Definition of the size of groups of digits to the left of the decimal
+ point. */
+ char *mon_grouping;
+ /* Sign used to indicate a value >= 0. */
+ char *positive_sign;
+ /* Sign used to indicate a value < 0. */
+ char *negative_sign;
+
+ /* For formatting local currency. */
+ /* Currency symbol (3 characters) followed by separator (1 character). */
+ char *currency_symbol;
+ /* Number of digits after the decimal point. */
+ char frac_digits;
+ /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it
+ comes after the number. */
+ char p_cs_precedes;
+ /* For values >= 0: Position of the sign. */
+ char p_sign_posn;
+ /* For values >= 0: Placement of spaces between currency symbol, sign, and
+ number. */
+ char p_sep_by_space;
+ /* For values < 0: 1 if the currency symbol precedes the number, 0 if it
+ comes after the number. */
+ char n_cs_precedes;
+ /* For values < 0: Position of the sign. */
+ char n_sign_posn;
+ /* For values < 0: Placement of spaces between currency symbol, sign, and
+ number. */
+ char n_sep_by_space;
+
+ /* For formatting international currency. */
+ /* Currency symbol (3 characters) followed by separator (1 character). */
+ char *int_curr_symbol;
+ /* Number of digits after the decimal point. */
+ char int_frac_digits;
+ /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it
+ comes after the number. */
+ char int_p_cs_precedes;
+ /* For values >= 0: Position of the sign. */
+ char int_p_sign_posn;
+ /* For values >= 0: Placement of spaces between currency symbol, sign, and
+ number. */
+ char int_p_sep_by_space;
+ /* For values < 0: 1 if the currency symbol precedes the number, 0 if it
+ comes after the number. */
+ char int_n_cs_precedes;
+ /* For values < 0: Position of the sign. */
+ char int_n_sign_posn;
+ /* For values < 0: Placement of spaces between currency symbol, sign, and
+ number. */
+ char int_n_sep_by_space;
+};
+#endif
+
+#if @GNULIB_LOCALECONV@
+# if @REPLACE_LOCALECONV@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef localeconv
+# define localeconv rpl_localeconv
+# endif
+_GL_FUNCDECL_RPL (localeconv, struct lconv *, (void));
+_GL_CXXALIAS_RPL (localeconv, struct lconv *, (void));
+# else
+_GL_CXXALIAS_SYS (localeconv, struct lconv *, (void));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (localeconv);
+# endif
+#elif @REPLACE_STRUCT_LCONV@
+# undef localeconv
+# define localeconv localeconv_used_without_requesting_gnulib_module_localeconv
+#elif defined GNULIB_POSIXCHECK
+# undef localeconv
+# if HAVE_RAW_DECL_LOCALECONV
+_GL_WARN_ON_USE (localeconv,
+ "localeconv returns too few information on some platforms - "
+ "use gnulib module localeconv for portability");
+# endif
+#endif
+
+#if @GNULIB_SETLOCALE@
+# if @REPLACE_SETLOCALE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef setlocale
+# define setlocale rpl_setlocale
+# define GNULIB_defined_setlocale 1
+# endif
+_GL_FUNCDECL_RPL (setlocale, char *, (int category, const char *locale));
+_GL_CXXALIAS_RPL (setlocale, char *, (int category, const char *locale));
+# else
+_GL_CXXALIAS_SYS (setlocale, char *, (int category, const char *locale));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (setlocale);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef setlocale
+# if HAVE_RAW_DECL_SETLOCALE
+_GL_WARN_ON_USE (setlocale, "setlocale works differently on native Windows - "
+ "use gnulib module setlocale for portability");
+# endif
+#endif
+
+#if @GNULIB_SETLOCALE_NULL@
+/* Included here for convenience. */
+# include "setlocale_null.h"
+#endif
+
+#if /*@GNULIB_NEWLOCALE@ ||*/ (@GNULIB_LOCALENAME@ && @LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_NEWLOCALE@)
+# if @REPLACE_NEWLOCALE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef newlocale
+# define newlocale rpl_newlocale
+# define GNULIB_defined_newlocale 1
+# endif
+_GL_FUNCDECL_RPL (newlocale, locale_t,
+ (int category_mask, const char *name, locale_t base)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (newlocale, locale_t,
+ (int category_mask, const char *name, locale_t base));
+# else
+# if @HAVE_NEWLOCALE@
+_GL_CXXALIAS_SYS (newlocale, locale_t,
+ (int category_mask, const char *name, locale_t base));
+# endif
+# endif
+# if @HAVE_NEWLOCALE@
+_GL_CXXALIASWARN (newlocale);
+# endif
+# if @HAVE_NEWLOCALE@ || @REPLACE_NEWLOCALE@
+# ifndef HAVE_WORKING_NEWLOCALE
+# define HAVE_WORKING_NEWLOCALE 1
+# endif
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef newlocale
+# if HAVE_RAW_DECL_NEWLOCALE
+_GL_WARN_ON_USE (newlocale, "newlocale is not portable");
+# endif
+#endif
+
+#if @GNULIB_DUPLOCALE@ || (@GNULIB_LOCALENAME@ && @LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_DUPLOCALE@)
+# if @REPLACE_DUPLOCALE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef duplocale
+# define duplocale rpl_duplocale
+# define GNULIB_defined_duplocale 1
+# endif
+_GL_FUNCDECL_RPL (duplocale, locale_t, (locale_t locale) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (duplocale, locale_t, (locale_t locale));
+# else
+# if @HAVE_DUPLOCALE@
+_GL_CXXALIAS_SYS (duplocale, locale_t, (locale_t locale));
+# endif
+# endif
+# if @HAVE_DUPLOCALE@
+_GL_CXXALIASWARN (duplocale);
+# endif
+# if @HAVE_DUPLOCALE@ || @REPLACE_DUPLOCALE@
+# ifndef HAVE_WORKING_DUPLOCALE
+# define HAVE_WORKING_DUPLOCALE 1
+# endif
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef duplocale
+# if HAVE_RAW_DECL_DUPLOCALE
+_GL_WARN_ON_USE (duplocale, "duplocale is buggy on some glibc systems - "
+ "use gnulib module duplocale for portability");
+# endif
+#endif
+
+#if /*@GNULIB_FREELOCALE@ ||*/ (@GNULIB_LOCALENAME@ && @LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_FREELOCALE@)
+# if @REPLACE_FREELOCALE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef freelocale
+# define freelocale rpl_freelocale
+# define GNULIB_defined_freelocale 1
+# endif
+_GL_FUNCDECL_RPL (freelocale, void, (locale_t locale) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (freelocale, void, (locale_t locale));
+# else
+# if @HAVE_FREELOCALE@
+/* Need to cast, because on FreeBSD and Mac OS X 10.13, the return type is
+ int. */
+_GL_CXXALIAS_SYS_CAST (freelocale, void, (locale_t locale));
+# endif
+# endif
+# if @HAVE_FREELOCALE@
+_GL_CXXALIASWARN (freelocale);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef freelocale
+# if HAVE_RAW_DECL_FREELOCALE
+_GL_WARN_ON_USE (freelocale, "freelocale is not portable");
+# endif
+#endif
+
+#endif /* _@GUARD_PREFIX@_LOCALE_H */
+#endif /* _@GUARD_PREFIX@_LOCALE_H */
+#endif /* !(__need_locale_t || _GL_ALREADY_INCLUDING_LOCALE_H) */
diff --git a/gl/lib/localeconv.c b/gl/lib/localeconv.c
new file mode 100644
index 0000000..ef26120
--- /dev/null
+++ b/gl/lib/localeconv.c
@@ -0,0 +1,103 @@
+/* Query locale dependent information for formatting numbers.
+ Copyright (C) 2012-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <locale.h>
+
+#if HAVE_STRUCT_LCONV_DECIMAL_POINT
+
+/* Override for platforms where 'struct lconv' lacks the int_p_*, int_n_*
+ members. */
+
+struct lconv *
+localeconv (void)
+{
+ static struct lconv result;
+# undef lconv
+# undef localeconv
+ struct lconv *sys_result = localeconv ();
+
+ result.decimal_point = sys_result->decimal_point;
+ result.thousands_sep = sys_result->thousands_sep;
+ result.grouping = sys_result->grouping;
+ result.mon_decimal_point = sys_result->mon_decimal_point;
+ result.mon_thousands_sep = sys_result->mon_thousands_sep;
+ result.mon_grouping = sys_result->mon_grouping;
+ result.positive_sign = sys_result->positive_sign;
+ result.negative_sign = sys_result->negative_sign;
+ result.currency_symbol = sys_result->currency_symbol;
+ result.frac_digits = sys_result->frac_digits;
+ result.p_cs_precedes = sys_result->p_cs_precedes;
+ result.p_sign_posn = sys_result->p_sign_posn;
+ result.p_sep_by_space = sys_result->p_sep_by_space;
+ result.n_cs_precedes = sys_result->n_cs_precedes;
+ result.n_sign_posn = sys_result->n_sign_posn;
+ result.n_sep_by_space = sys_result->n_sep_by_space;
+ result.int_curr_symbol = sys_result->int_curr_symbol;
+ result.int_frac_digits = sys_result->int_frac_digits;
+ result.int_p_cs_precedes = sys_result->p_cs_precedes;
+ result.int_p_sign_posn = sys_result->p_sign_posn;
+ result.int_p_sep_by_space = sys_result->p_sep_by_space;
+ result.int_n_cs_precedes = sys_result->n_cs_precedes;
+ result.int_n_sign_posn = sys_result->n_sign_posn;
+ result.int_n_sep_by_space = sys_result->n_sep_by_space;
+
+ return &result;
+}
+
+#else
+
+/* Override for platforms where 'struct lconv' is a dummy. */
+
+# include <limits.h>
+
+struct lconv *
+localeconv (void)
+{
+ static /*const*/ struct lconv result =
+ {
+ /* decimal_point */ ".",
+ /* thousands_sep */ "",
+ /* grouping */ "",
+ /* mon_decimal_point */ "",
+ /* mon_thousands_sep */ "",
+ /* mon_grouping */ "",
+ /* positive_sign */ "",
+ /* negative_sign */ "",
+ /* currency_symbol */ "",
+ /* frac_digits */ CHAR_MAX,
+ /* p_cs_precedes */ CHAR_MAX,
+ /* p_sign_posn */ CHAR_MAX,
+ /* p_sep_by_space */ CHAR_MAX,
+ /* n_cs_precedes */ CHAR_MAX,
+ /* n_sign_posn */ CHAR_MAX,
+ /* n_sep_by_space */ CHAR_MAX,
+ /* int_curr_symbol */ "",
+ /* int_frac_digits */ CHAR_MAX,
+ /* int_p_cs_precedes */ CHAR_MAX,
+ /* int_p_sign_posn */ CHAR_MAX,
+ /* int_p_sep_by_space */ CHAR_MAX,
+ /* int_n_cs_precedes */ CHAR_MAX,
+ /* int_n_sign_posn */ CHAR_MAX,
+ /* int_n_sep_by_space */ CHAR_MAX
+ };
+
+ return &result;
+}
+
+#endif
diff --git a/gl/lib/lstat.c b/gl/lib/lstat.c
new file mode 100644
index 0000000..472bfbc
--- /dev/null
+++ b/gl/lib/lstat.c
@@ -0,0 +1,104 @@
+/* Work around a bug of lstat on some systems
+
+ Copyright (C) 1997-2006, 2008-2022 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 2.1 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 Jim Meyering */
+
+/* If the user's config.h happens to include <sys/stat.h>, let it include only
+ the system's <sys/stat.h> here, so that orig_lstat doesn't recurse to
+ rpl_lstat. */
+#define __need_system_sys_stat_h
+#include <config.h>
+
+#if !HAVE_LSTAT
+/* On systems that lack symlinks, our replacement <sys/stat.h> already
+ defined lstat as stat, so there is nothing further to do other than
+ avoid an empty file. */
+typedef int dummy;
+#else /* HAVE_LSTAT */
+
+/* Get the original definition of lstat. It might be defined as a macro. */
+# include <sys/types.h>
+# include <sys/stat.h>
+# undef __need_system_sys_stat_h
+
+static int
+orig_lstat (const char *filename, struct stat *buf)
+{
+ return lstat (filename, buf);
+}
+
+/* Specification. */
+# ifdef __osf__
+/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc
+ eliminates this include because of the preliminary #include <sys/stat.h>
+ above. */
+# include "sys/stat.h"
+# else
+# include <sys/stat.h>
+# endif
+
+# include "stat-time.h"
+
+# include <string.h>
+# include <errno.h>
+
+/* lstat works differently on Linux and Solaris systems. POSIX (see
+ "pathname resolution" in the glossary) requires that programs like
+ 'ls' take into consideration the fact that FILE has a trailing slash
+ when FILE is a symbolic link. On Linux and Solaris 10 systems, the
+ lstat function already has the desired semantics (in treating
+ 'lstat ("symlink/", sbuf)' just like 'lstat ("symlink/.", sbuf)',
+ but on Solaris 9 and earlier it does not.
+
+ If FILE has a trailing slash and specifies a symbolic link,
+ then use stat() to get more info on the referent of FILE.
+ If the referent is a non-directory, then set errno to ENOTDIR
+ and return -1. Otherwise, return stat's result. */
+
+int
+rpl_lstat (const char *file, struct stat *sbuf)
+{
+ int result = orig_lstat (file, sbuf);
+
+ /* This replacement file can blindly check against '/' rather than
+ using the ISSLASH macro, because all platforms with '\\' either
+ lack symlinks (mingw) or have working lstat (cygwin) and thus do
+ not compile this file. 0 len should have already been filtered
+ out above, with a failure return of ENOENT. */
+ if (result == 0)
+ {
+ if (S_ISDIR (sbuf->st_mode) || file[strlen (file) - 1] != '/')
+ result = stat_time_normalize (result, sbuf);
+ else
+ {
+ /* At this point, a trailing slash is permitted only on
+ symlink-to-dir; but it should have found information on the
+ directory, not the symlink. Call 'stat' to get info about the
+ link's referent. Our replacement stat guarantees valid results,
+ even if the symlink is not pointing to a directory. */
+ if (!S_ISLNK (sbuf->st_mode))
+ {
+ errno = ENOTDIR;
+ return -1;
+ }
+ result = stat (file, sbuf);
+ }
+ }
+ return result;
+}
+
+#endif /* HAVE_LSTAT */
diff --git a/gl/lib/malloc.c b/gl/lib/malloc.c
new file mode 100644
index 0000000..f334dd6
--- /dev/null
+++ b/gl/lib/malloc.c
@@ -0,0 +1,51 @@
+/* malloc() function that is glibc compatible.
+
+ Copyright (C) 1997-1998, 2006-2007, 2009-2022 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 2.1 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 Jim Meyering and Bruno Haible */
+
+#define _GL_USE_STDLIB_ALLOC 1
+#include <config.h>
+
+#include <stdlib.h>
+
+#include <errno.h>
+
+#include "xalloc-oversized.h"
+
+/* Allocate an N-byte block of memory from the heap, even if N is 0. */
+
+void *
+rpl_malloc (size_t n)
+{
+ if (n == 0)
+ n = 1;
+
+ if (xalloc_oversized (n, 1))
+ {
+ errno = ENOMEM;
+ return NULL;
+ }
+
+ void *result = malloc (n);
+
+#if !HAVE_MALLOC_POSIX
+ if (result == NULL)
+ errno = ENOMEM;
+#endif
+
+ return result;
+}
diff --git a/gl/lib/malloc/dynarray-skeleton.c b/gl/lib/malloc/dynarray-skeleton.c
new file mode 100644
index 0000000..bad548a
--- /dev/null
+++ b/gl/lib/malloc/dynarray-skeleton.c
@@ -0,0 +1,528 @@
+/* Type-safe arrays which grow dynamically.
+ Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+/* Pre-processor macros which act as parameters:
+
+ DYNARRAY_STRUCT
+ The struct tag of dynamic array to be defined.
+ DYNARRAY_ELEMENT
+ The type name of the element type. Elements are copied
+ as if by memcpy, and can change address as the dynamic
+ array grows.
+ DYNARRAY_PREFIX
+ The prefix of the functions which are defined.
+
+ The following parameters are optional:
+
+ DYNARRAY_ELEMENT_FREE
+ DYNARRAY_ELEMENT_FREE (E) is evaluated to deallocate the
+ contents of elements. E is of type DYNARRAY_ELEMENT *.
+ DYNARRAY_ELEMENT_INIT
+ DYNARRAY_ELEMENT_INIT (E) is evaluated to initialize a new
+ element. E is of type DYNARRAY_ELEMENT *.
+ If DYNARRAY_ELEMENT_FREE but not DYNARRAY_ELEMENT_INIT is
+ defined, new elements are automatically zero-initialized.
+ Otherwise, new elements have undefined contents.
+ DYNARRAY_INITIAL_SIZE
+ The size of the statically allocated array (default:
+ at least 2, more elements if they fit into 128 bytes).
+ Must be a preprocessor constant. If DYNARRAY_INITIAL_SIZE is 0,
+ there is no statically allocated array at, and all non-empty
+ arrays are heap-allocated.
+ DYNARRAY_FINAL_TYPE
+ The name of the type which holds the final array. If not
+ defined, is PREFIX##finalize not provided. DYNARRAY_FINAL_TYPE
+ must be a struct type, with members of type DYNARRAY_ELEMENT and
+ size_t at the start (in this order).
+
+ These macros are undefined after this header file has been
+ included.
+
+ The following types are provided (their members are private to the
+ dynarray implementation):
+
+ struct DYNARRAY_STRUCT
+
+ The following functions are provided:
+
+ void DYNARRAY_PREFIX##init (struct DYNARRAY_STRUCT *);
+ void DYNARRAY_PREFIX##free (struct DYNARRAY_STRUCT *);
+ bool DYNARRAY_PREFIX##has_failed (const struct DYNARRAY_STRUCT *);
+ void DYNARRAY_PREFIX##mark_failed (struct DYNARRAY_STRUCT *);
+ size_t DYNARRAY_PREFIX##size (const struct DYNARRAY_STRUCT *);
+ DYNARRAY_ELEMENT *DYNARRAY_PREFIX##begin (const struct DYNARRAY_STRUCT *);
+ DYNARRAY_ELEMENT *DYNARRAY_PREFIX##end (const struct DYNARRAY_STRUCT *);
+ DYNARRAY_ELEMENT *DYNARRAY_PREFIX##at (struct DYNARRAY_STRUCT *, size_t);
+ void DYNARRAY_PREFIX##add (struct DYNARRAY_STRUCT *, DYNARRAY_ELEMENT);
+ DYNARRAY_ELEMENT *DYNARRAY_PREFIX##emplace (struct DYNARRAY_STRUCT *);
+ bool DYNARRAY_PREFIX##resize (struct DYNARRAY_STRUCT *, size_t);
+ void DYNARRAY_PREFIX##remove_last (struct DYNARRAY_STRUCT *);
+ void DYNARRAY_PREFIX##clear (struct DYNARRAY_STRUCT *);
+
+ The following functions are provided are provided if the
+ prerequisites are met:
+
+ bool DYNARRAY_PREFIX##finalize (struct DYNARRAY_STRUCT *,
+ DYNARRAY_FINAL_TYPE *);
+ (if DYNARRAY_FINAL_TYPE is defined)
+ DYNARRAY_ELEMENT *DYNARRAY_PREFIX##finalize (struct DYNARRAY_STRUCT *,
+ size_t *);
+ (if DYNARRAY_FINAL_TYPE is not defined)
+*/
+
+#include <malloc/dynarray.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifndef DYNARRAY_STRUCT
+# error "DYNARRAY_STRUCT must be defined"
+#endif
+
+#ifndef DYNARRAY_ELEMENT
+# error "DYNARRAY_ELEMENT must be defined"
+#endif
+
+#ifndef DYNARRAY_PREFIX
+# error "DYNARRAY_PREFIX must be defined"
+#endif
+
+#ifdef DYNARRAY_INITIAL_SIZE
+# if DYNARRAY_INITIAL_SIZE < 0
+# error "DYNARRAY_INITIAL_SIZE must be non-negative"
+# endif
+# if DYNARRAY_INITIAL_SIZE > 0
+# define DYNARRAY_HAVE_SCRATCH 1
+# else
+# define DYNARRAY_HAVE_SCRATCH 0
+# endif
+#else
+/* Provide a reasonable default which limits the size of
+ DYNARRAY_STRUCT. */
+# define DYNARRAY_INITIAL_SIZE \
+ (sizeof (DYNARRAY_ELEMENT) > 64 ? 2 : 128 / sizeof (DYNARRAY_ELEMENT))
+# define DYNARRAY_HAVE_SCRATCH 1
+#endif
+
+/* Public type definitions. */
+
+/* All fields of this struct are private to the implementation. */
+struct DYNARRAY_STRUCT
+{
+ union
+ {
+ struct dynarray_header dynarray_abstract;
+ struct
+ {
+ /* These fields must match struct dynarray_header. */
+ size_t used;
+ size_t allocated;
+ DYNARRAY_ELEMENT *array;
+ } dynarray_header;
+ } u;
+
+#if DYNARRAY_HAVE_SCRATCH
+ /* Initial inline allocation. */
+ DYNARRAY_ELEMENT scratch[DYNARRAY_INITIAL_SIZE];
+#endif
+};
+
+/* Internal use only: Helper macros. */
+
+/* Ensure macro-expansion of DYNARRAY_PREFIX. */
+#define DYNARRAY_CONCAT0(prefix, name) prefix##name
+#define DYNARRAY_CONCAT1(prefix, name) DYNARRAY_CONCAT0(prefix, name)
+#define DYNARRAY_NAME(name) DYNARRAY_CONCAT1(DYNARRAY_PREFIX, name)
+
+/* Use DYNARRAY_FREE instead of DYNARRAY_NAME (free),
+ so that Gnulib does not change 'free' to 'rpl_free'. */
+#define DYNARRAY_FREE DYNARRAY_CONCAT1 (DYNARRAY_NAME (f), ree)
+
+/* Address of the scratch buffer if any. */
+#if DYNARRAY_HAVE_SCRATCH
+# define DYNARRAY_SCRATCH(list) (list)->scratch
+#else
+# define DYNARRAY_SCRATCH(list) NULL
+#endif
+
+/* Internal use only: Helper functions. */
+
+/* Internal function. Call DYNARRAY_ELEMENT_FREE with the array
+ elements. Name mangling needed due to the DYNARRAY_ELEMENT_FREE
+ macro expansion. */
+static inline void
+DYNARRAY_NAME (free__elements__) (DYNARRAY_ELEMENT *__dynarray_array,
+ size_t __dynarray_used)
+{
+#ifdef DYNARRAY_ELEMENT_FREE
+ for (size_t __dynarray_i = 0; __dynarray_i < __dynarray_used; ++__dynarray_i)
+ DYNARRAY_ELEMENT_FREE (&__dynarray_array[__dynarray_i]);
+#endif /* DYNARRAY_ELEMENT_FREE */
+}
+
+/* Internal function. Free the non-scratch array allocation. */
+static inline void
+DYNARRAY_NAME (free__array__) (struct DYNARRAY_STRUCT *list)
+{
+#if DYNARRAY_HAVE_SCRATCH
+ if (list->u.dynarray_header.array != list->scratch)
+ free (list->u.dynarray_header.array);
+#else
+ free (list->u.dynarray_header.array);
+#endif
+}
+
+/* Public functions. */
+
+/* Initialize a dynamic array object. This must be called before any
+ use of the object. */
+__attribute_nonnull__ ((1))
+static void
+DYNARRAY_NAME (init) (struct DYNARRAY_STRUCT *list)
+{
+ list->u.dynarray_header.used = 0;
+ list->u.dynarray_header.allocated = DYNARRAY_INITIAL_SIZE;
+ list->u.dynarray_header.array = DYNARRAY_SCRATCH (list);
+}
+
+/* Deallocate the dynamic array and its elements. */
+__attribute_maybe_unused__ __attribute_nonnull__ ((1))
+static void
+DYNARRAY_FREE (struct DYNARRAY_STRUCT *list)
+{
+ DYNARRAY_NAME (free__elements__)
+ (list->u.dynarray_header.array, list->u.dynarray_header.used);
+ DYNARRAY_NAME (free__array__) (list);
+ DYNARRAY_NAME (init) (list);
+}
+
+/* Return true if the dynamic array is in an error state. */
+__attribute_nonnull__ ((1))
+static inline bool
+DYNARRAY_NAME (has_failed) (const struct DYNARRAY_STRUCT *list)
+{
+ return list->u.dynarray_header.allocated == __dynarray_error_marker ();
+}
+
+/* Mark the dynamic array as failed. All elements are deallocated as
+ a side effect. */
+__attribute_nonnull__ ((1))
+static void
+DYNARRAY_NAME (mark_failed) (struct DYNARRAY_STRUCT *list)
+{
+ DYNARRAY_NAME (free__elements__)
+ (list->u.dynarray_header.array, list->u.dynarray_header.used);
+ DYNARRAY_NAME (free__array__) (list);
+ list->u.dynarray_header.array = DYNARRAY_SCRATCH (list);
+ list->u.dynarray_header.used = 0;
+ list->u.dynarray_header.allocated = __dynarray_error_marker ();
+}
+
+/* Return the number of elements which have been added to the dynamic
+ array. */
+__attribute_nonnull__ ((1))
+static inline size_t
+DYNARRAY_NAME (size) (const struct DYNARRAY_STRUCT *list)
+{
+ return list->u.dynarray_header.used;
+}
+
+/* Return a pointer to the array element at INDEX. Terminate the
+ process if INDEX is out of bounds. */
+__attribute_nonnull__ ((1))
+static inline DYNARRAY_ELEMENT *
+DYNARRAY_NAME (at) (struct DYNARRAY_STRUCT *list, size_t index)
+{
+ if (__glibc_unlikely (index >= DYNARRAY_NAME (size) (list)))
+ __libc_dynarray_at_failure (DYNARRAY_NAME (size) (list), index);
+ return list->u.dynarray_header.array + index;
+}
+
+/* Return a pointer to the first array element, if any. For a
+ zero-length array, the pointer can be NULL even though the dynamic
+ array has not entered the failure state. */
+__attribute_nonnull__ ((1))
+static inline DYNARRAY_ELEMENT *
+DYNARRAY_NAME (begin) (struct DYNARRAY_STRUCT *list)
+{
+ return list->u.dynarray_header.array;
+}
+
+/* Return a pointer one element past the last array element. For a
+ zero-length array, the pointer can be NULL even though the dynamic
+ array has not entered the failure state. */
+__attribute_nonnull__ ((1))
+static inline DYNARRAY_ELEMENT *
+DYNARRAY_NAME (end) (struct DYNARRAY_STRUCT *list)
+{
+ return list->u.dynarray_header.array + list->u.dynarray_header.used;
+}
+
+/* Internal function. Slow path for the add function below. */
+static void
+DYNARRAY_NAME (add__) (struct DYNARRAY_STRUCT *list, DYNARRAY_ELEMENT item)
+{
+ if (__glibc_unlikely
+ (!__libc_dynarray_emplace_enlarge (&list->u.dynarray_abstract,
+ DYNARRAY_SCRATCH (list),
+ sizeof (DYNARRAY_ELEMENT))))
+ {
+ DYNARRAY_NAME (mark_failed) (list);
+ return;
+ }
+
+ /* Copy the new element and increase the array length. */
+ list->u.dynarray_header.array[list->u.dynarray_header.used++] = item;
+}
+
+/* Add ITEM at the end of the array, enlarging it by one element.
+ Mark *LIST as failed if the dynamic array allocation size cannot be
+ increased. */
+__attribute_nonnull__ ((1))
+static inline void
+DYNARRAY_NAME (add) (struct DYNARRAY_STRUCT *list, DYNARRAY_ELEMENT item)
+{
+ /* Do nothing in case of previous error. */
+ if (DYNARRAY_NAME (has_failed) (list))
+ return;
+
+ /* Enlarge the array if necessary. */
+ if (__glibc_unlikely (list->u.dynarray_header.used
+ == list->u.dynarray_header.allocated))
+ {
+ DYNARRAY_NAME (add__) (list, item);
+ return;
+ }
+
+ /* Copy the new element and increase the array length. */
+ list->u.dynarray_header.array[list->u.dynarray_header.used++] = item;
+}
+
+/* Internal function. Building block for the emplace functions below.
+ Assumes space for one more element in *LIST. */
+static inline DYNARRAY_ELEMENT *
+DYNARRAY_NAME (emplace__tail__) (struct DYNARRAY_STRUCT *list)
+{
+ DYNARRAY_ELEMENT *result
+ = &list->u.dynarray_header.array[list->u.dynarray_header.used];
+ ++list->u.dynarray_header.used;
+#if defined (DYNARRAY_ELEMENT_INIT)
+ DYNARRAY_ELEMENT_INIT (result);
+#elif defined (DYNARRAY_ELEMENT_FREE)
+ memset (result, 0, sizeof (*result));
+#endif
+ return result;
+}
+
+/* Internal function. Slow path for the emplace function below. */
+static DYNARRAY_ELEMENT *
+DYNARRAY_NAME (emplace__) (struct DYNARRAY_STRUCT *list)
+{
+ if (__glibc_unlikely
+ (!__libc_dynarray_emplace_enlarge (&list->u.dynarray_abstract,
+ DYNARRAY_SCRATCH (list),
+ sizeof (DYNARRAY_ELEMENT))))
+ {
+ DYNARRAY_NAME (mark_failed) (list);
+ return NULL;
+ }
+ return DYNARRAY_NAME (emplace__tail__) (list);
+}
+
+/* Allocate a place for a new element in *LIST and return a pointer to
+ it. The pointer can be NULL if the dynamic array cannot be
+ enlarged due to a memory allocation failure. */
+__attribute_maybe_unused__ __attribute_warn_unused_result__
+__attribute_nonnull__ ((1))
+static
+/* Avoid inlining with the larger initialization code. */
+#if !(defined (DYNARRAY_ELEMENT_INIT) || defined (DYNARRAY_ELEMENT_FREE))
+inline
+#endif
+DYNARRAY_ELEMENT *
+DYNARRAY_NAME (emplace) (struct DYNARRAY_STRUCT *list)
+{
+ /* Do nothing in case of previous error. */
+ if (DYNARRAY_NAME (has_failed) (list))
+ return NULL;
+
+ /* Enlarge the array if necessary. */
+ if (__glibc_unlikely (list->u.dynarray_header.used
+ == list->u.dynarray_header.allocated))
+ return (DYNARRAY_NAME (emplace__) (list));
+ return DYNARRAY_NAME (emplace__tail__) (list);
+}
+
+/* Change the size of *LIST to SIZE. If SIZE is larger than the
+ existing size, new elements are added (which can be initialized).
+ Otherwise, the list is truncated, and elements are freed. Return
+ false on memory allocation failure (and mark *LIST as failed). */
+__attribute_maybe_unused__ __attribute_nonnull__ ((1))
+static bool
+DYNARRAY_NAME (resize) (struct DYNARRAY_STRUCT *list, size_t size)
+{
+ if (size > list->u.dynarray_header.used)
+ {
+ bool ok;
+#if defined (DYNARRAY_ELEMENT_INIT)
+ /* The new elements have to be initialized. */
+ size_t old_size = list->u.dynarray_header.used;
+ ok = __libc_dynarray_resize (&list->u.dynarray_abstract,
+ size, DYNARRAY_SCRATCH (list),
+ sizeof (DYNARRAY_ELEMENT));
+ if (ok)
+ for (size_t i = old_size; i < size; ++i)
+ {
+ DYNARRAY_ELEMENT_INIT (&list->u.dynarray_header.array[i]);
+ }
+#elif defined (DYNARRAY_ELEMENT_FREE)
+ /* Zero initialization is needed so that the elements can be
+ safely freed. */
+ ok = __libc_dynarray_resize_clear
+ (&list->u.dynarray_abstract, size,
+ DYNARRAY_SCRATCH (list), sizeof (DYNARRAY_ELEMENT));
+#else
+ ok = __libc_dynarray_resize (&list->u.dynarray_abstract,
+ size, DYNARRAY_SCRATCH (list),
+ sizeof (DYNARRAY_ELEMENT));
+#endif
+ if (__glibc_unlikely (!ok))
+ DYNARRAY_NAME (mark_failed) (list);
+ return ok;
+ }
+ else
+ {
+ /* The list has shrunk in size. Free the removed elements. */
+ DYNARRAY_NAME (free__elements__)
+ (list->u.dynarray_header.array + size,
+ list->u.dynarray_header.used - size);
+ list->u.dynarray_header.used = size;
+ return true;
+ }
+}
+
+/* Remove the last element of LIST if it is present. */
+__attribute_maybe_unused__ __attribute_nonnull__ ((1))
+static void
+DYNARRAY_NAME (remove_last) (struct DYNARRAY_STRUCT *list)
+{
+ /* used > 0 implies that the array is the non-failed state. */
+ if (list->u.dynarray_header.used > 0)
+ {
+ size_t new_length = list->u.dynarray_header.used - 1;
+#ifdef DYNARRAY_ELEMENT_FREE
+ DYNARRAY_ELEMENT_FREE (&list->u.dynarray_header.array[new_length]);
+#endif
+ list->u.dynarray_header.used = new_length;
+ }
+}
+
+/* Remove all elements from the list. The elements are freed, but the
+ list itself is not. */
+__attribute_maybe_unused__ __attribute_nonnull__ ((1))
+static void
+DYNARRAY_NAME (clear) (struct DYNARRAY_STRUCT *list)
+{
+ /* free__elements__ does nothing if the list is in the failed
+ state. */
+ DYNARRAY_NAME (free__elements__)
+ (list->u.dynarray_header.array, list->u.dynarray_header.used);
+ list->u.dynarray_header.used = 0;
+}
+
+#ifdef DYNARRAY_FINAL_TYPE
+/* Transfer the dynamic array to a permanent location at *RESULT.
+ Returns true on success on false on allocation failure. In either
+ case, *LIST is re-initialized and can be reused. A NULL pointer is
+ stored in *RESULT if LIST refers to an empty list. On success, the
+ pointer in *RESULT is heap-allocated and must be deallocated using
+ free. */
+__attribute_maybe_unused__ __attribute_warn_unused_result__
+__attribute_nonnull__ ((1, 2))
+static bool
+DYNARRAY_NAME (finalize) (struct DYNARRAY_STRUCT *list,
+ DYNARRAY_FINAL_TYPE *result)
+{
+ struct dynarray_finalize_result res;
+ if (__libc_dynarray_finalize (&list->u.dynarray_abstract,
+ DYNARRAY_SCRATCH (list),
+ sizeof (DYNARRAY_ELEMENT), &res))
+ {
+ /* On success, the result owns all the data. */
+ DYNARRAY_NAME (init) (list);
+ *result = (DYNARRAY_FINAL_TYPE) { res.array, res.length };
+ return true;
+ }
+ else
+ {
+ /* On error, we need to free all data. */
+ DYNARRAY_FREE (list);
+ errno = ENOMEM;
+ return false;
+ }
+}
+#else /* !DYNARRAY_FINAL_TYPE */
+/* Transfer the dynamic array to a heap-allocated array and return a
+ pointer to it. The pointer is NULL if memory allocation fails, or
+ if the array is empty, so this function should be used only for
+ arrays which are known not be empty (usually because they always
+ have a sentinel at the end). If LENGTHP is not NULL, the array
+ length is written to *LENGTHP. *LIST is re-initialized and can be
+ reused. */
+__attribute_maybe_unused__ __attribute_warn_unused_result__
+__attribute_nonnull__ ((1))
+static DYNARRAY_ELEMENT *
+DYNARRAY_NAME (finalize) (struct DYNARRAY_STRUCT *list, size_t *lengthp)
+{
+ struct dynarray_finalize_result res;
+ if (__libc_dynarray_finalize (&list->u.dynarray_abstract,
+ DYNARRAY_SCRATCH (list),
+ sizeof (DYNARRAY_ELEMENT), &res))
+ {
+ /* On success, the result owns all the data. */
+ DYNARRAY_NAME (init) (list);
+ if (lengthp != NULL)
+ *lengthp = res.length;
+ return res.array;
+ }
+ else
+ {
+ /* On error, we need to free all data. */
+ DYNARRAY_FREE (list);
+ errno = ENOMEM;
+ return NULL;
+ }
+}
+#endif /* !DYNARRAY_FINAL_TYPE */
+
+/* Undo macro definitions. */
+
+#undef DYNARRAY_CONCAT0
+#undef DYNARRAY_CONCAT1
+#undef DYNARRAY_NAME
+#undef DYNARRAY_SCRATCH
+#undef DYNARRAY_HAVE_SCRATCH
+
+#undef DYNARRAY_STRUCT
+#undef DYNARRAY_ELEMENT
+#undef DYNARRAY_PREFIX
+#undef DYNARRAY_ELEMENT_FREE
+#undef DYNARRAY_ELEMENT_INIT
+#undef DYNARRAY_INITIAL_SIZE
+#undef DYNARRAY_FINAL_TYPE
diff --git a/gl/lib/malloc/dynarray.h b/gl/lib/malloc/dynarray.h
new file mode 100644
index 0000000..f16fd95
--- /dev/null
+++ b/gl/lib/malloc/dynarray.h
@@ -0,0 +1,178 @@
+/* Type-safe arrays which grow dynamically. Shared definitions.
+ Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+/* To use the dynarray facility, you need to include
+ <malloc/dynarray-skeleton.c> and define the parameter macros
+ documented in that file.
+
+ A minimal example which provides a growing list of integers can be
+ defined like this:
+
+ struct int_array
+ {
+ // Pointer to result array followed by its length,
+ // as required by DYNARRAY_FINAL_TYPE.
+ int *array;
+ size_t length;
+ };
+
+ #define DYNARRAY_STRUCT dynarray_int
+ #define DYNARRAY_ELEMENT int
+ #define DYNARRAY_PREFIX dynarray_int_
+ #define DYNARRAY_FINAL_TYPE struct int_array
+ #include <malloc/dynarray-skeleton.c>
+
+ To create a three-element array with elements 1, 2, 3, use this
+ code:
+
+ struct dynarray_int dyn;
+ dynarray_int_init (&dyn);
+ for (int i = 1; i <= 3; ++i)
+ {
+ int *place = dynarray_int_emplace (&dyn);
+ assert (place != NULL);
+ *place = i;
+ }
+ struct int_array result;
+ bool ok = dynarray_int_finalize (&dyn, &result);
+ assert (ok);
+ assert (result.length == 3);
+ assert (result.array[0] == 1);
+ assert (result.array[1] == 2);
+ assert (result.array[2] == 3);
+ free (result.array);
+
+ If the elements contain resources which must be freed, define
+ DYNARRAY_ELEMENT_FREE appropriately, like this:
+
+ struct str_array
+ {
+ char **array;
+ size_t length;
+ };
+
+ #define DYNARRAY_STRUCT dynarray_str
+ #define DYNARRAY_ELEMENT char *
+ #define DYNARRAY_ELEMENT_FREE(ptr) free (*ptr)
+ #define DYNARRAY_PREFIX dynarray_str_
+ #define DYNARRAY_FINAL_TYPE struct str_array
+ #include <malloc/dynarray-skeleton.c>
+
+ Compared to scratch buffers, dynamic arrays have the following
+ features:
+
+ - They have an element type, and are not just an untyped buffer of
+ bytes.
+
+ - When growing, previously stored elements are preserved. (It is
+ expected that scratch_buffer_grow_preserve and
+ scratch_buffer_set_array_size eventually go away because all
+ current users are moved to dynamic arrays.)
+
+ - Scratch buffers have a more aggressive growth policy because
+ growing them typically means a retry of an operation (across an
+ NSS service module boundary), which is expensive.
+
+ - For the same reason, scratch buffers have a much larger initial
+ stack allocation. */
+
+#ifndef _DYNARRAY_H
+#define _DYNARRAY_H
+
+#include <stdbool.h>
+#include <stddef.h>
+#include <string.h>
+
+struct dynarray_header
+{
+ size_t used;
+ size_t allocated;
+ void *array;
+};
+
+/* Marker used in the allocated member to indicate that an error was
+ encountered. */
+static inline size_t
+__dynarray_error_marker (void)
+{
+ return -1;
+}
+
+/* Internal function. See the has_failed function in
+ dynarray-skeleton.c. */
+static inline bool
+__dynarray_error (struct dynarray_header *list)
+{
+ return list->allocated == __dynarray_error_marker ();
+}
+
+/* Internal function. Enlarge the dynamically allocated area of the
+ array to make room for one more element. SCRATCH is a pointer to
+ the scratch area (which is not heap-allocated and must not be
+ freed). ELEMENT_SIZE is the size, in bytes, of one element.
+ Return false on failure, true on success. */
+bool __libc_dynarray_emplace_enlarge (struct dynarray_header *,
+ void *scratch, size_t element_size);
+
+/* Internal function. Enlarge the dynamically allocated area of the
+ array to make room for at least SIZE elements (which must be larger
+ than the existing used part of the dynamic array). SCRATCH is a
+ pointer to the scratch area (which is not heap-allocated and must
+ not be freed). ELEMENT_SIZE is the size, in bytes, of one element.
+ Return false on failure, true on success. */
+bool __libc_dynarray_resize (struct dynarray_header *, size_t size,
+ void *scratch, size_t element_size);
+
+/* Internal function. Like __libc_dynarray_resize, but clear the new
+ part of the dynamic array. */
+bool __libc_dynarray_resize_clear (struct dynarray_header *, size_t size,
+ void *scratch, size_t element_size);
+
+/* Internal type. */
+struct dynarray_finalize_result
+{
+ void *array;
+ size_t length;
+};
+
+/* Internal function. Copy the dynamically-allocated area to an
+ explicitly-sized heap allocation. SCRATCH is a pointer to the
+ embedded scratch space. ELEMENT_SIZE is the size, in bytes, of the
+ element type. On success, true is returned, and pointer and length
+ are written to *RESULT. On failure, false is returned. The caller
+ has to take care of some of the memory management; this function is
+ expected to be called from dynarray-skeleton.c. */
+bool __libc_dynarray_finalize (struct dynarray_header *list, void *scratch,
+ size_t element_size,
+ struct dynarray_finalize_result *result);
+
+
+/* Internal function. Terminate the process after an index error.
+ SIZE is the number of elements of the dynamic array. INDEX is the
+ lookup index which triggered the failure. */
+_Noreturn void __libc_dynarray_at_failure (size_t size, size_t index);
+
+#ifndef _ISOMAC
+libc_hidden_proto (__libc_dynarray_emplace_enlarge)
+libc_hidden_proto (__libc_dynarray_resize)
+libc_hidden_proto (__libc_dynarray_resize_clear)
+libc_hidden_proto (__libc_dynarray_finalize)
+libc_hidden_proto (__libc_dynarray_at_failure)
+#endif
+
+#endif /* _DYNARRAY_H */
diff --git a/gl/lib/malloc/dynarray_at_failure.c b/gl/lib/malloc/dynarray_at_failure.c
new file mode 100644
index 0000000..062ab70
--- /dev/null
+++ b/gl/lib/malloc/dynarray_at_failure.c
@@ -0,0 +1,40 @@
+/* Report an dynamic array index out of bounds condition.
+ Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <libc-config.h>
+# include <stdlib.h>
+#endif
+
+#include <dynarray.h>
+#include <stdio.h>
+
+void
+__libc_dynarray_at_failure (size_t size, size_t index)
+{
+#ifdef _LIBC
+ char buf[200];
+ __snprintf (buf, sizeof (buf), "Fatal glibc error: "
+ "array index %zu not less than array length %zu\n",
+ index, size);
+ __libc_fatal (buf);
+#else
+ abort ();
+#endif
+}
+libc_hidden_def (__libc_dynarray_at_failure)
diff --git a/gl/lib/malloc/dynarray_emplace_enlarge.c b/gl/lib/malloc/dynarray_emplace_enlarge.c
new file mode 100644
index 0000000..0cff2e7
--- /dev/null
+++ b/gl/lib/malloc/dynarray_emplace_enlarge.c
@@ -0,0 +1,77 @@
+/* Increase the size of a dynamic array in preparation of an emplace operation.
+ Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <dynarray.h>
+#include <errno.h>
+#include <intprops.h>
+#include <stdlib.h>
+#include <string.h>
+
+bool
+__libc_dynarray_emplace_enlarge (struct dynarray_header *list,
+ void *scratch, size_t element_size)
+{
+ size_t new_allocated;
+ if (list->allocated == 0)
+ {
+ /* No scratch buffer provided. Choose a reasonable default
+ size. */
+ if (element_size < 4)
+ new_allocated = 16;
+ else if (element_size < 8)
+ new_allocated = 8;
+ else
+ new_allocated = 4;
+ }
+ else
+ /* Increase the allocated size, using an exponential growth
+ policy. */
+ {
+ new_allocated = list->allocated + list->allocated / 2 + 1;
+ if (new_allocated <= list->allocated)
+ {
+ /* Overflow. */
+ __set_errno (ENOMEM);
+ return false;
+ }
+ }
+
+ size_t new_size;
+ if (INT_MULTIPLY_WRAPV (new_allocated, element_size, &new_size))
+ return false;
+ void *new_array;
+ if (list->array == scratch)
+ {
+ /* The previous array was not heap-allocated. */
+ new_array = malloc (new_size);
+ if (new_array != NULL && list->array != NULL)
+ memcpy (new_array, list->array, list->used * element_size);
+ }
+ else
+ new_array = realloc (list->array, new_size);
+ if (new_array == NULL)
+ return false;
+ list->array = new_array;
+ list->allocated = new_allocated;
+ return true;
+}
+libc_hidden_def (__libc_dynarray_emplace_enlarge)
diff --git a/gl/lib/malloc/dynarray_finalize.c b/gl/lib/malloc/dynarray_finalize.c
new file mode 100644
index 0000000..3f360c3
--- /dev/null
+++ b/gl/lib/malloc/dynarray_finalize.c
@@ -0,0 +1,66 @@
+/* Copy the dynamically-allocated area to an explicitly-sized heap allocation.
+ Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <dynarray.h>
+#include <stdlib.h>
+#include <string.h>
+
+bool
+__libc_dynarray_finalize (struct dynarray_header *list,
+ void *scratch, size_t element_size,
+ struct dynarray_finalize_result *result)
+{
+ if (__dynarray_error (list))
+ /* The caller will reported the deferred error. */
+ return false;
+
+ size_t used = list->used;
+
+ /* Empty list. */
+ if (used == 0)
+ {
+ /* An empty list could still be backed by a heap-allocated
+ array. Free it if necessary. */
+ if (list->array != scratch)
+ free (list->array);
+ *result = (struct dynarray_finalize_result) { NULL, 0 };
+ return true;
+ }
+
+ size_t allocation_size = used * element_size;
+ void *heap_array = malloc (allocation_size);
+ if (heap_array != NULL)
+ {
+ /* The new array takes ownership of the strings. */
+ if (list->array != NULL)
+ memcpy (heap_array, list->array, allocation_size);
+ if (list->array != scratch)
+ free (list->array);
+ *result = (struct dynarray_finalize_result)
+ { .array = heap_array, .length = used };
+ return true;
+ }
+ else
+ /* The caller will perform the freeing operation. */
+ return false;
+}
+libc_hidden_def (__libc_dynarray_finalize)
diff --git a/gl/lib/malloc/dynarray_resize.c b/gl/lib/malloc/dynarray_resize.c
new file mode 100644
index 0000000..8d1922e
--- /dev/null
+++ b/gl/lib/malloc/dynarray_resize.c
@@ -0,0 +1,68 @@
+/* Increase the size of a dynamic array.
+ Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <dynarray.h>
+#include <errno.h>
+#include <intprops.h>
+#include <stdlib.h>
+#include <string.h>
+
+bool
+__libc_dynarray_resize (struct dynarray_header *list, size_t size,
+ void *scratch, size_t element_size)
+{
+ /* The existing allocation provides sufficient room. */
+ if (size <= list->allocated)
+ {
+ list->used = size;
+ return true;
+ }
+
+ /* Otherwise, use size as the new allocation size. The caller is
+ expected to provide the final size of the array, so there is no
+ over-allocation here. */
+
+ size_t new_size_bytes;
+ if (INT_MULTIPLY_WRAPV (size, element_size, &new_size_bytes))
+ {
+ /* Overflow. */
+ __set_errno (ENOMEM);
+ return false;
+ }
+ void *new_array;
+ if (list->array == scratch)
+ {
+ /* The previous array was not heap-allocated. */
+ new_array = malloc (new_size_bytes);
+ if (new_array != NULL && list->array != NULL)
+ memcpy (new_array, list->array, list->used * element_size);
+ }
+ else
+ new_array = realloc (list->array, new_size_bytes);
+ if (new_array == NULL)
+ return false;
+ list->array = new_array;
+ list->allocated = size;
+ list->used = size;
+ return true;
+}
+libc_hidden_def (__libc_dynarray_resize)
diff --git a/gl/lib/malloc/dynarray_resize_clear.c b/gl/lib/malloc/dynarray_resize_clear.c
new file mode 100644
index 0000000..8cf1b0d
--- /dev/null
+++ b/gl/lib/malloc/dynarray_resize_clear.c
@@ -0,0 +1,39 @@
+/* Increase the size of a dynamic array and clear the new part.
+ Copyright (C) 2017-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <dynarray.h>
+#include <string.h>
+
+bool
+__libc_dynarray_resize_clear (struct dynarray_header *list, size_t size,
+ void *scratch, size_t element_size)
+{
+ size_t old_size = list->used;
+ if (!__libc_dynarray_resize (list, size, scratch, element_size))
+ return false;
+ /* __libc_dynarray_resize already checked for overflow. */
+ char *array = list->array;
+ memset (array + (old_size * element_size), 0,
+ (size - old_size) * element_size);
+ return true;
+}
+libc_hidden_def (__libc_dynarray_resize_clear)
diff --git a/gl/lib/malloc/scratch_buffer.h b/gl/lib/malloc/scratch_buffer.h
new file mode 100644
index 0000000..e4c5c8a
--- /dev/null
+++ b/gl/lib/malloc/scratch_buffer.h
@@ -0,0 +1,151 @@
+/* Variable-sized buffer with on-stack default allocation.
+ Copyright (C) 2015-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _SCRATCH_BUFFER_H
+#define _SCRATCH_BUFFER_H
+
+/* Scratch buffers with a default stack allocation and fallback to
+ heap allocation. It is expected that this function is used in this
+ way:
+
+ struct scratch_buffer tmpbuf;
+ scratch_buffer_init (&tmpbuf);
+
+ while (!function_that_uses_buffer (tmpbuf.data, tmpbuf.length))
+ if (!scratch_buffer_grow (&tmpbuf))
+ return -1;
+
+ scratch_buffer_free (&tmpbuf);
+ return 0;
+
+ The allocation functions (scratch_buffer_grow,
+ scratch_buffer_grow_preserve, scratch_buffer_set_array_size) make
+ sure that the heap allocation, if any, is freed, so that the code
+ above does not have a memory leak. The buffer still remains in a
+ state that can be deallocated using scratch_buffer_free, so a loop
+ like this is valid as well:
+
+ struct scratch_buffer tmpbuf;
+ scratch_buffer_init (&tmpbuf);
+
+ while (!function_that_uses_buffer (tmpbuf.data, tmpbuf.length))
+ if (!scratch_buffer_grow (&tmpbuf))
+ break;
+
+ scratch_buffer_free (&tmpbuf);
+
+ scratch_buffer_grow and scratch_buffer_grow_preserve are guaranteed
+ to grow the buffer by at least 512 bytes. This means that when
+ using the scratch buffer as a backing store for a non-character
+ array whose element size, in bytes, is 512 or smaller, the scratch
+ buffer only has to grow once to make room for at least one more
+ element.
+*/
+
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdlib.h>
+
+/* Scratch buffer. Must be initialized with scratch_buffer_init
+ before its use. */
+struct scratch_buffer {
+ void *data; /* Pointer to the beginning of the scratch area. */
+ size_t length; /* Allocated space at the data pointer, in bytes. */
+ union { max_align_t __align; char __c[1024]; } __space;
+};
+
+/* Initializes *BUFFER so that BUFFER->data points to BUFFER->__space
+ and BUFFER->length reflects the available space. */
+static inline void
+scratch_buffer_init (struct scratch_buffer *buffer)
+{
+ buffer->data = buffer->__space.__c;
+ buffer->length = sizeof (buffer->__space);
+}
+
+/* Deallocates *BUFFER (if it was heap-allocated). */
+static inline void
+scratch_buffer_free (struct scratch_buffer *buffer)
+{
+ if (buffer->data != buffer->__space.__c)
+ free (buffer->data);
+}
+
+/* Grow *BUFFER by some arbitrary amount. The buffer contents is NOT
+ preserved. Return true on success, false on allocation failure (in
+ which case the old buffer is freed). On success, the new buffer is
+ larger than the previous size. On failure, *BUFFER is deallocated,
+ but remains in a free-able state, and errno is set. */
+bool __libc_scratch_buffer_grow (struct scratch_buffer *buffer);
+libc_hidden_proto (__libc_scratch_buffer_grow)
+
+/* Alias for __libc_scratch_buffer_grow. */
+static __always_inline bool
+scratch_buffer_grow (struct scratch_buffer *buffer)
+{
+ return __glibc_likely (__libc_scratch_buffer_grow (buffer));
+}
+
+/* Like __libc_scratch_buffer_grow, but preserve the old buffer
+ contents on success, as a prefix of the new buffer. */
+bool __libc_scratch_buffer_grow_preserve (struct scratch_buffer *buffer);
+libc_hidden_proto (__libc_scratch_buffer_grow_preserve)
+
+/* Alias for __libc_scratch_buffer_grow_preserve. */
+static __always_inline bool
+scratch_buffer_grow_preserve (struct scratch_buffer *buffer)
+{
+ return __glibc_likely (__libc_scratch_buffer_grow_preserve (buffer));
+}
+
+/* Grow *BUFFER so that it can store at least NELEM elements of SIZE
+ bytes. The buffer contents are NOT preserved. Both NELEM and SIZE
+ can be zero. Return true on success, false on allocation failure
+ (in which case the old buffer is freed, but *BUFFER remains in a
+ free-able state, and errno is set). It is unspecified whether this
+ function can reduce the array size. */
+bool __libc_scratch_buffer_set_array_size (struct scratch_buffer *buffer,
+ size_t nelem, size_t size);
+libc_hidden_proto (__libc_scratch_buffer_set_array_size)
+
+/* Alias for __libc_scratch_set_array_size. */
+static __always_inline bool
+scratch_buffer_set_array_size (struct scratch_buffer *buffer,
+ size_t nelem, size_t size)
+{
+ return __glibc_likely (__libc_scratch_buffer_set_array_size
+ (buffer, nelem, size));
+}
+
+/* Return a copy of *BUFFER's first SIZE bytes as a heap-allocated block,
+ deallocating *BUFFER if it was heap-allocated. SIZE must be at
+ most *BUFFER's size. Return NULL (setting errno) on memory
+ exhaustion. */
+void *__libc_scratch_buffer_dupfree (struct scratch_buffer *buffer,
+ size_t size);
+libc_hidden_proto (__libc_scratch_buffer_dupfree)
+
+/* Alias for __libc_scratch_dupfree. */
+static __always_inline void *
+scratch_buffer_dupfree (struct scratch_buffer *buffer, size_t size)
+{
+ void *r = __libc_scratch_buffer_dupfree (buffer, size);
+ return __glibc_likely (r != NULL) ? r : NULL;
+}
+
+#endif /* _SCRATCH_BUFFER_H */
diff --git a/gl/lib/malloc/scratch_buffer_dupfree.c b/gl/lib/malloc/scratch_buffer_dupfree.c
new file mode 100644
index 0000000..eb3b95c
--- /dev/null
+++ b/gl/lib/malloc/scratch_buffer_dupfree.c
@@ -0,0 +1,41 @@
+/* Variable-sized buffer with on-stack default allocation.
+ Copyright (C) 2020-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <scratch_buffer.h>
+#include <string.h>
+
+void *
+__libc_scratch_buffer_dupfree (struct scratch_buffer *buffer, size_t size)
+{
+ void *data = buffer->data;
+ if (data == buffer->__space.__c)
+ {
+ void *copy = malloc (size);
+ return copy != NULL ? memcpy (copy, data, size) : NULL;
+ }
+ else
+ {
+ void *copy = realloc (data, size);
+ return copy != NULL ? copy : data;
+ }
+}
+libc_hidden_def (__libc_scratch_buffer_dupfree)
diff --git a/gl/lib/malloc/scratch_buffer_grow.c b/gl/lib/malloc/scratch_buffer_grow.c
new file mode 100644
index 0000000..9a5e4db
--- /dev/null
+++ b/gl/lib/malloc/scratch_buffer_grow.c
@@ -0,0 +1,56 @@
+/* Variable-sized buffer with on-stack default allocation.
+ Copyright (C) 2015-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <scratch_buffer.h>
+#include <errno.h>
+
+bool
+__libc_scratch_buffer_grow (struct scratch_buffer *buffer)
+{
+ void *new_ptr;
+ size_t new_length = buffer->length * 2;
+
+ /* Discard old buffer. */
+ scratch_buffer_free (buffer);
+
+ /* Check for overflow. */
+ if (__glibc_likely (new_length >= buffer->length))
+ new_ptr = malloc (new_length);
+ else
+ {
+ __set_errno (ENOMEM);
+ new_ptr = NULL;
+ }
+
+ if (__glibc_unlikely (new_ptr == NULL))
+ {
+ /* Buffer must remain valid to free. */
+ scratch_buffer_init (buffer);
+ return false;
+ }
+
+ /* Install new heap-based buffer. */
+ buffer->data = new_ptr;
+ buffer->length = new_length;
+ return true;
+}
+libc_hidden_def (__libc_scratch_buffer_grow)
diff --git a/gl/lib/malloc/scratch_buffer_grow_preserve.c b/gl/lib/malloc/scratch_buffer_grow_preserve.c
new file mode 100644
index 0000000..3fe5a07
--- /dev/null
+++ b/gl/lib/malloc/scratch_buffer_grow_preserve.c
@@ -0,0 +1,67 @@
+/* Variable-sized buffer with on-stack default allocation.
+ Copyright (C) 2015-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <scratch_buffer.h>
+#include <errno.h>
+#include <string.h>
+
+bool
+__libc_scratch_buffer_grow_preserve (struct scratch_buffer *buffer)
+{
+ size_t new_length = 2 * buffer->length;
+ void *new_ptr;
+
+ if (buffer->data == buffer->__space.__c)
+ {
+ /* Move buffer to the heap. No overflow is possible because
+ buffer->length describes a small buffer on the stack. */
+ new_ptr = malloc (new_length);
+ if (new_ptr == NULL)
+ return false;
+ memcpy (new_ptr, buffer->__space.__c, buffer->length);
+ }
+ else
+ {
+ /* Buffer was already on the heap. Check for overflow. */
+ if (__glibc_likely (new_length >= buffer->length))
+ new_ptr = realloc (buffer->data, new_length);
+ else
+ {
+ __set_errno (ENOMEM);
+ new_ptr = NULL;
+ }
+
+ if (__glibc_unlikely (new_ptr == NULL))
+ {
+ /* Deallocate, but buffer must remain valid to free. */
+ free (buffer->data);
+ scratch_buffer_init (buffer);
+ return false;
+ }
+ }
+
+ /* Install new heap-based buffer. */
+ buffer->data = new_ptr;
+ buffer->length = new_length;
+ return true;
+}
+libc_hidden_def (__libc_scratch_buffer_grow_preserve)
diff --git a/gl/lib/malloc/scratch_buffer_set_array_size.c b/gl/lib/malloc/scratch_buffer_set_array_size.c
new file mode 100644
index 0000000..89c37a9
--- /dev/null
+++ b/gl/lib/malloc/scratch_buffer_set_array_size.c
@@ -0,0 +1,64 @@
+/* Variable-sized buffer with on-stack default allocation.
+ Copyright (C) 2015-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <scratch_buffer.h>
+#include <errno.h>
+#include <limits.h>
+
+bool
+__libc_scratch_buffer_set_array_size (struct scratch_buffer *buffer,
+ size_t nelem, size_t size)
+{
+ size_t new_length = nelem * size;
+
+ /* Avoid overflow check if both values are small. */
+ if ((nelem | size) >> (sizeof (size_t) * CHAR_BIT / 2) != 0
+ && nelem != 0 && size != new_length / nelem)
+ {
+ /* Overflow. Discard the old buffer, but it must remain valid
+ to free. */
+ scratch_buffer_free (buffer);
+ scratch_buffer_init (buffer);
+ __set_errno (ENOMEM);
+ return false;
+ }
+
+ if (new_length <= buffer->length)
+ return true;
+
+ /* Discard old buffer. */
+ scratch_buffer_free (buffer);
+
+ char *new_ptr = malloc (new_length);
+ if (new_ptr == NULL)
+ {
+ /* Buffer must remain valid to free. */
+ scratch_buffer_init (buffer);
+ return false;
+ }
+
+ /* Install new heap-based buffer. */
+ buffer->data = new_ptr;
+ buffer->length = new_length;
+ return true;
+}
+libc_hidden_def (__libc_scratch_buffer_set_array_size)
diff --git a/gl/lib/malloca.c b/gl/lib/malloca.c
new file mode 100644
index 0000000..e7beaaf
--- /dev/null
+++ b/gl/lib/malloca.c
@@ -0,0 +1,113 @@
+/* Safe automatic memory allocation.
+ Copyright (C) 2003, 2006-2007, 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2003, 2018.
+
+ 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 2.1 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/>. */
+
+#define _GL_USE_STDLIB_ALLOC 1
+#include <config.h>
+
+/* Specification. */
+#include "malloca.h"
+
+#include "idx.h"
+#include "intprops.h"
+#include "verify.h"
+
+/* The speed critical point in this file is freea() applied to an alloca()
+ result: it must be fast, to match the speed of alloca(). The speed of
+ mmalloca() and freea() in the other case are not critical, because they
+ are only invoked for big memory sizes.
+ Here we use a bit in the address as an indicator, an idea by Ondřej Bílka.
+ malloca() can return three types of pointers:
+ - Pointers ≡ 0 mod 2*sa_alignment_max come from stack allocation.
+ - Pointers ≡ sa_alignment_max mod 2*sa_alignment_max come from heap
+ allocation.
+ - NULL comes from a failed heap allocation. */
+
+/* Type for holding very small pointer differences. */
+typedef unsigned char small_t;
+/* Verify that it is wide enough. */
+verify (2 * sa_alignment_max - 1 <= (small_t) -1);
+
+void *
+mmalloca (size_t n)
+{
+#if HAVE_ALLOCA
+ /* Allocate one more word, used to determine the address to pass to freea(),
+ and room for the alignment ≡ sa_alignment_max mod 2*sa_alignment_max. */
+ uintptr_t alignment2_mask = 2 * sa_alignment_max - 1;
+ int plus = sizeof (small_t) + alignment2_mask;
+ idx_t nplus;
+ if (!INT_ADD_WRAPV (n, plus, &nplus) && !xalloc_oversized (nplus, 1))
+ {
+ char *mem = (char *) malloc (nplus);
+
+ if (mem != NULL)
+ {
+ uintptr_t umem = (uintptr_t)mem, umemplus;
+ /* The INT_ADD_WRAPV avoids signed integer overflow on
+ theoretical platforms where UINTPTR_MAX <= INT_MAX. */
+ INT_ADD_WRAPV (umem, sizeof (small_t) + sa_alignment_max - 1,
+ &umemplus);
+ idx_t offset = ((umemplus & ~alignment2_mask)
+ + sa_alignment_max - umem);
+ void *vp = mem + offset;
+ small_t *p = vp;
+ /* Here p >= mem + sizeof (small_t),
+ and p <= mem + sizeof (small_t) + 2 * sa_alignment_max - 1
+ hence p + n <= mem + nplus.
+ So, the memory range [p, p+n) lies in the allocated memory range
+ [mem, mem + nplus). */
+ p[-1] = offset;
+ /* p ≡ sa_alignment_max mod 2*sa_alignment_max. */
+ return p;
+ }
+ }
+ /* Out of memory. */
+ return NULL;
+#else
+# if !MALLOC_0_IS_NONNULL
+ if (n == 0)
+ n = 1;
+# endif
+ return malloc (n);
+#endif
+}
+
+#if HAVE_ALLOCA
+void
+freea (void *p)
+{
+ /* Check argument. */
+ if ((uintptr_t) p & (sa_alignment_max - 1))
+ {
+ /* p was not the result of a malloca() call. Invalid argument. */
+ abort ();
+ }
+ /* Determine whether p was a non-NULL pointer returned by mmalloca(). */
+ if ((uintptr_t) p & sa_alignment_max)
+ {
+ void *mem = (char *) p - ((small_t *) p)[-1];
+ free (mem);
+ }
+}
+#endif
+
+/*
+ * Hey Emacs!
+ * Local Variables:
+ * coding: utf-8
+ * End:
+ */
diff --git a/gl/lib/malloca.h b/gl/lib/malloca.h
new file mode 100644
index 0000000..7ec235f
--- /dev/null
+++ b/gl/lib/malloca.h
@@ -0,0 +1,126 @@
+/* Safe automatic memory allocation.
+ Copyright (C) 2003-2007, 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2003.
+
+ 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 2.1 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/>. */
+
+#ifndef _MALLOCA_H
+#define _MALLOCA_H
+
+#include <alloca.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdint.h>
+
+#include "xalloc-oversized.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* safe_alloca(N) is equivalent to alloca(N) when it is safe to call
+ alloca(N); otherwise it returns NULL. It either returns N bytes of
+ memory allocated on the stack, that lasts until the function returns,
+ or NULL.
+ Use of safe_alloca should be avoided:
+ - inside arguments of function calls - undefined behaviour,
+ - in inline functions - the allocation may actually last until the
+ calling function returns.
+*/
+#if HAVE_ALLOCA
+/* The OS usually guarantees only one guard page at the bottom of the stack,
+ and a page size can be as small as 4096 bytes. So we cannot safely
+ allocate anything larger than 4096 bytes. Also care for the possibility
+ of a few compiler-allocated temporary stack slots.
+ This must be a macro, not a function. */
+# define safe_alloca(N) ((N) < 4032 ? alloca (N) : NULL)
+#else
+# define safe_alloca(N) ((void) (N), NULL)
+#endif
+
+/* Free a block of memory allocated through malloca(). */
+#if HAVE_ALLOCA
+extern void freea (void *p);
+#else
+# define freea free
+#endif
+
+/* malloca(N) is a safe variant of alloca(N). It allocates N bytes of
+ memory allocated on the stack, that must be freed using freea() before
+ the function returns. Upon failure, it returns NULL. */
+#if HAVE_ALLOCA
+# define malloca(N) \
+ ((N) < 4032 - (2 * sa_alignment_max - 1) \
+ ? (void *) (((uintptr_t) (char *) alloca ((N) + 2 * sa_alignment_max - 1) \
+ + (2 * sa_alignment_max - 1)) \
+ & ~(uintptr_t)(2 * sa_alignment_max - 1)) \
+ : mmalloca (N))
+#else
+# define malloca(N) \
+ mmalloca (N)
+#endif
+extern void *mmalloca (size_t n)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (freea, 1)
+ _GL_ATTRIBUTE_ALLOC_SIZE ((1));
+
+/* nmalloca(N,S) is an overflow-safe variant of malloca (N * S).
+ It allocates an array of N objects, each with S bytes of memory,
+ on the stack. N and S should be nonnegative and free of side effects.
+ The array must be freed using freea() before the function returns. */
+#define nmalloca(n, s) \
+ (xalloc_oversized (n, s) ? NULL : malloca ((n) * (size_t) (s)))
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* ------------------- Auxiliary, non-public definitions ------------------- */
+
+/* Determine the alignment of a type at compile time. */
+#if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
+# define sa_alignof __alignof__
+#elif defined __cplusplus
+ template <class type> struct sa_alignof_helper { char __slot1; type __slot2; };
+# define sa_alignof(type) offsetof (sa_alignof_helper<type>, __slot2)
+#elif defined __hpux
+ /* Work around a HP-UX 10.20 cc bug with enums constants defined as offsetof
+ values. */
+# define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8)
+#elif defined _AIX
+ /* Work around an AIX 3.2.5 xlc bug with enums constants defined as offsetof
+ values. */
+# define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8)
+#else
+# define sa_alignof(type) offsetof (struct { char __slot1; type __slot2; }, __slot2)
+#endif
+
+enum
+{
+/* The desired alignment of memory allocations is the maximum alignment
+ among all elementary types. */
+ sa_alignment_long = sa_alignof (long),
+ sa_alignment_double = sa_alignof (double),
+ sa_alignment_longlong = sa_alignof (long long),
+ sa_alignment_longdouble = sa_alignof (long double),
+ sa_alignment_max = ((sa_alignment_long - 1) | (sa_alignment_double - 1)
+ | (sa_alignment_longlong - 1)
+ | (sa_alignment_longdouble - 1)
+ ) + 1
+};
+
+#endif /* _MALLOCA_H */
diff --git a/gl/lib/mbrtowc-impl-utf8.h b/gl/lib/mbrtowc-impl-utf8.h
new file mode 100644
index 0000000..8e5ac14
--- /dev/null
+++ b/gl/lib/mbrtowc-impl-utf8.h
@@ -0,0 +1,138 @@
+/* Convert multibyte character to wide character.
+ Copyright (C) 1999-2002, 2005-2022 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 2.1 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>, 2008. */
+
+/* This file contains the part of the body of the mbrtowc and mbrtoc32 functions
+ that handles the special case of the UTF-8 encoding. */
+
+ /* Cf. unistr/u8-mbtouc.c. */
+ unsigned char c = (unsigned char) p[0];
+
+ if (c < 0x80)
+ {
+ if (pwc != NULL)
+ *pwc = c;
+ res = (c == 0 ? 0 : 1);
+ goto success;
+ }
+ if (c >= 0xc2)
+ {
+ if (c < 0xe0)
+ {
+ if (m == 1)
+ goto incomplete;
+ else /* m >= 2 */
+ {
+ unsigned char c2 = (unsigned char) p[1];
+
+ if ((c2 ^ 0x80) < 0x40)
+ {
+ if (pwc != NULL)
+ *pwc = ((unsigned int) (c & 0x1f) << 6)
+ | (unsigned int) (c2 ^ 0x80);
+ res = 2;
+ goto success;
+ }
+ }
+ }
+ else if (c < 0xf0)
+ {
+ if (m == 1)
+ goto incomplete;
+ else
+ {
+ unsigned char c2 = (unsigned char) p[1];
+
+ if ((c2 ^ 0x80) < 0x40
+ && (c >= 0xe1 || c2 >= 0xa0)
+ && (c != 0xed || c2 < 0xa0))
+ {
+ if (m == 2)
+ goto incomplete;
+ else /* m >= 3 */
+ {
+ unsigned char c3 = (unsigned char) p[2];
+
+ if ((c3 ^ 0x80) < 0x40)
+ {
+ unsigned int wc =
+ (((unsigned int) (c & 0x0f) << 12)
+ | ((unsigned int) (c2 ^ 0x80) << 6)
+ | (unsigned int) (c3 ^ 0x80));
+
+ if (FITS_IN_CHAR_TYPE (wc))
+ {
+ if (pwc != NULL)
+ *pwc = wc;
+ res = 3;
+ goto success;
+ }
+ }
+ }
+ }
+ }
+ }
+ else if (c <= 0xf4)
+ {
+ if (m == 1)
+ goto incomplete;
+ else
+ {
+ unsigned char c2 = (unsigned char) p[1];
+
+ if ((c2 ^ 0x80) < 0x40
+ && (c >= 0xf1 || c2 >= 0x90)
+ && (c < 0xf4 || (/* c == 0xf4 && */ c2 < 0x90)))
+ {
+ if (m == 2)
+ goto incomplete;
+ else
+ {
+ unsigned char c3 = (unsigned char) p[2];
+
+ if ((c3 ^ 0x80) < 0x40)
+ {
+ if (m == 3)
+ goto incomplete;
+ else /* m >= 4 */
+ {
+ unsigned char c4 = (unsigned char) p[3];
+
+ if ((c4 ^ 0x80) < 0x40)
+ {
+ unsigned int wc =
+ (((unsigned int) (c & 0x07) << 18)
+ | ((unsigned int) (c2 ^ 0x80) << 12)
+ | ((unsigned int) (c3 ^ 0x80) << 6)
+ | (unsigned int) (c4 ^ 0x80));
+
+ if (FITS_IN_CHAR_TYPE (wc))
+ {
+ if (pwc != NULL)
+ *pwc = wc;
+ res = 4;
+ goto success;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ goto invalid;
diff --git a/gl/lib/mbrtowc-impl.h b/gl/lib/mbrtowc-impl.h
new file mode 100644
index 0000000..65538e7
--- /dev/null
+++ b/gl/lib/mbrtowc-impl.h
@@ -0,0 +1,262 @@
+/* Convert multibyte character to wide character.
+ Copyright (C) 1999-2002, 2005-2022 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 2.1 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>, 2008. */
+
+/* This file contains the body of the mbrtowc and mbrtoc32 functions,
+ when GNULIB_defined_mbstate_t is defined. */
+
+ char *pstate = (char *)ps;
+
+ if (s == NULL)
+ {
+ pwc = NULL;
+ s = "";
+ n = 1;
+ }
+
+ if (n == 0)
+ return (size_t)(-2);
+
+ /* Here n > 0. */
+
+ if (pstate == NULL)
+ pstate = internal_state;
+
+ {
+ size_t nstate = pstate[0];
+ char buf[4];
+ const char *p;
+ size_t m;
+ enc_t enc;
+ int res;
+
+ switch (nstate)
+ {
+ case 0:
+ p = s;
+ m = n;
+ break;
+ case 3:
+ buf[2] = pstate[3];
+ FALLTHROUGH;
+ case 2:
+ buf[1] = pstate[2];
+ FALLTHROUGH;
+ case 1:
+ buf[0] = pstate[1];
+ p = buf;
+ m = nstate;
+ buf[m++] = s[0];
+ if (n >= 2 && m < 4)
+ {
+ buf[m++] = s[1];
+ if (n >= 3 && m < 4)
+ buf[m++] = s[2];
+ }
+ break;
+ default:
+ errno = EINVAL;
+ return (size_t)(-1);
+ }
+
+ /* Here m > 0. */
+
+ enc = locale_encoding_classification ();
+
+ if (enc == enc_utf8) /* UTF-8 */
+ {
+ /* Achieve
+ - multi-thread safety and
+ - the ability to produce wide character values > WCHAR_MAX
+ by not calling mbtowc() at all. */
+#include "mbrtowc-impl-utf8.h"
+ }
+ else
+ {
+ /* The hidden internal state of mbtowc would make this function not
+ multi-thread safe. Achieve multi-thread safety through a lock. */
+ wchar_t wc;
+ res = mbtowc_with_lock (&wc, p, m);
+
+ if (res >= 0)
+ {
+ if ((wc == 0) != (res == 0))
+ abort ();
+ if (pwc != NULL)
+ *pwc = wc;
+ goto success;
+ }
+
+ /* mbtowc does not distinguish between invalid and incomplete multibyte
+ sequences. But mbrtowc needs to make this distinction.
+ There are two possible approaches:
+ - Use iconv() and its return value.
+ - Use built-in knowledge about the possible encodings.
+ Given the low quality of implementation of iconv() on the systems
+ that lack mbrtowc(), we use the second approach.
+ The possible encodings are:
+ - 8-bit encodings,
+ - EUC-JP, EUC-KR, GB2312, EUC-TW, BIG5, GB18030, SJIS,
+ - UTF-8 (already handled above).
+ Use specialized code for each. */
+ if (m >= 4 || m >= MB_CUR_MAX)
+ goto invalid;
+ /* Here MB_CUR_MAX > 1 and 0 < m < 4. */
+ switch (enc)
+ {
+ /* As a reference for this code, you can use the GNU libiconv
+ implementation. Look for uses of the RET_TOOFEW macro. */
+
+ case enc_eucjp: /* EUC-JP */
+ {
+ if (m == 1)
+ {
+ unsigned char c = (unsigned char) p[0];
+
+ if ((c >= 0xa1 && c < 0xff) || c == 0x8e || c == 0x8f)
+ goto incomplete;
+ }
+ if (m == 2)
+ {
+ unsigned char c = (unsigned char) p[0];
+
+ if (c == 0x8f)
+ {
+ unsigned char c2 = (unsigned char) p[1];
+
+ if (c2 >= 0xa1 && c2 < 0xff)
+ goto incomplete;
+ }
+ }
+ goto invalid;
+ }
+
+ case enc_94: /* EUC-KR, GB2312, BIG5 */
+ {
+ if (m == 1)
+ {
+ unsigned char c = (unsigned char) p[0];
+
+ if (c >= 0xa1 && c < 0xff)
+ goto incomplete;
+ }
+ goto invalid;
+ }
+
+ case enc_euctw: /* EUC-TW */
+ {
+ if (m == 1)
+ {
+ unsigned char c = (unsigned char) p[0];
+
+ if ((c >= 0xa1 && c < 0xff) || c == 0x8e)
+ goto incomplete;
+ }
+ else /* m == 2 || m == 3 */
+ {
+ unsigned char c = (unsigned char) p[0];
+
+ if (c == 0x8e)
+ goto incomplete;
+ }
+ goto invalid;
+ }
+
+ case enc_gb18030: /* GB18030 */
+ {
+ if (m == 1)
+ {
+ unsigned char c = (unsigned char) p[0];
+
+ if ((c >= 0x90 && c <= 0xe3) || (c >= 0xf8 && c <= 0xfe))
+ goto incomplete;
+ }
+ else /* m == 2 || m == 3 */
+ {
+ unsigned char c = (unsigned char) p[0];
+
+ if (c >= 0x90 && c <= 0xe3)
+ {
+ unsigned char c2 = (unsigned char) p[1];
+
+ if (c2 >= 0x30 && c2 <= 0x39)
+ {
+ if (m == 2)
+ goto incomplete;
+ else /* m == 3 */
+ {
+ unsigned char c3 = (unsigned char) p[2];
+
+ if (c3 >= 0x81 && c3 <= 0xfe)
+ goto incomplete;
+ }
+ }
+ }
+ }
+ goto invalid;
+ }
+
+ case enc_sjis: /* SJIS */
+ {
+ if (m == 1)
+ {
+ unsigned char c = (unsigned char) p[0];
+
+ if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xea)
+ || (c >= 0xf0 && c <= 0xf9))
+ goto incomplete;
+ }
+ goto invalid;
+ }
+
+ default:
+ /* An unknown multibyte encoding. */
+ goto incomplete;
+ }
+ }
+
+ success:
+ /* res >= 0 is the corrected return value of
+ mbtowc_with_lock (&wc, p, m). */
+ if (nstate >= (res > 0 ? res : 1))
+ abort ();
+ res -= nstate;
+ pstate[0] = 0;
+ return res;
+
+ incomplete:
+ {
+ size_t k = nstate;
+ /* Here 0 <= k < m < 4. */
+ pstate[++k] = s[0];
+ if (k < m)
+ {
+ pstate[++k] = s[1];
+ if (k < m)
+ pstate[++k] = s[2];
+ }
+ if (k != m)
+ abort ();
+ }
+ pstate[0] = m;
+ return (size_t)(-2);
+
+ invalid:
+ errno = EILSEQ;
+ /* The conversion state is undefined, says POSIX. */
+ return (size_t)(-1);
+ }
diff --git a/gl/lib/mbrtowc.c b/gl/lib/mbrtowc.c
new file mode 100644
index 0000000..4b164ed
--- /dev/null
+++ b/gl/lib/mbrtowc.c
@@ -0,0 +1,158 @@
+/* Convert multibyte character to wide character.
+ Copyright (C) 1999-2002, 2005-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#if GNULIB_defined_mbstate_t
+/* Implement mbrtowc() on top of mbtowc() for the non-UTF-8 locales
+ and directly for the UTF-8 locales. */
+
+# include <errno.h>
+# include <stdint.h>
+# include <stdlib.h>
+
+# if defined _WIN32 && !defined __CYGWIN__
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# elif HAVE_PTHREAD_API
+
+# include <pthread.h>
+# if HAVE_THREADS_H && HAVE_WEAK_SYMBOLS
+# include <threads.h>
+# pragma weak thrd_exit
+# define c11_threads_in_use() (thrd_exit != NULL)
+# else
+# define c11_threads_in_use() 0
+# endif
+
+# elif HAVE_THREADS_H
+
+# include <threads.h>
+
+# endif
+
+# include "attribute.h"
+# include "verify.h"
+# include "lc-charset-dispatch.h"
+# include "mbtowc-lock.h"
+
+verify (sizeof (mbstate_t) >= 4);
+static char internal_state[4];
+
+size_t
+mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
+{
+# define FITS_IN_CHAR_TYPE(wc) ((wc) <= WCHAR_MAX)
+# include "mbrtowc-impl.h"
+}
+
+#else
+/* Override the system's mbrtowc() function. */
+
+# if MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ
+# include "hard-locale.h"
+# include <locale.h>
+# endif
+
+# undef mbrtowc
+
+size_t
+rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
+{
+ size_t ret;
+ wchar_t wc;
+
+# if MBRTOWC_NULL_ARG2_BUG || MBRTOWC_RETVAL_BUG || MBRTOWC_EMPTY_INPUT_BUG
+ if (s == NULL)
+ {
+ pwc = NULL;
+ s = "";
+ n = 1;
+ }
+# endif
+
+# if MBRTOWC_EMPTY_INPUT_BUG
+ if (n == 0)
+ return (size_t) -2;
+# endif
+
+ if (! pwc)
+ pwc = &wc;
+
+# if MBRTOWC_RETVAL_BUG
+ {
+ static mbstate_t internal_state;
+
+ /* Override mbrtowc's internal state. We cannot call mbsinit() on the
+ hidden internal state, but we can call it on our variable. */
+ if (ps == NULL)
+ ps = &internal_state;
+
+ if (!mbsinit (ps))
+ {
+ /* Parse the rest of the multibyte character byte for byte. */
+ size_t count = 0;
+ for (; n > 0; s++, n--)
+ {
+ ret = mbrtowc (&wc, s, 1, ps);
+
+ if (ret == (size_t)(-1))
+ return (size_t)(-1);
+ count++;
+ if (ret != (size_t)(-2))
+ {
+ /* The multibyte character has been completed. */
+ *pwc = wc;
+ return (wc == 0 ? 0 : count);
+ }
+ }
+ return (size_t)(-2);
+ }
+ }
+# endif
+
+# if MBRTOWC_STORES_INCOMPLETE_BUG
+ ret = mbrtowc (&wc, s, n, ps);
+ if (ret < (size_t) -2 && pwc != NULL)
+ *pwc = wc;
+# else
+ ret = mbrtowc (pwc, s, n, ps);
+# endif
+
+# if MBRTOWC_NUL_RETVAL_BUG
+ if (ret < (size_t) -2 && !*pwc)
+ return 0;
+# endif
+
+# if MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ
+ if ((size_t) -2 <= ret && n != 0 && ! hard_locale (LC_CTYPE))
+ {
+ unsigned char uc = *s;
+ *pwc = uc;
+ return 1;
+ }
+# endif
+
+ return ret;
+}
+
+#endif
diff --git a/gl/lib/mbsinit.c b/gl/lib/mbsinit.c
new file mode 100644
index 0000000..9621def
--- /dev/null
+++ b/gl/lib/mbsinit.c
@@ -0,0 +1,70 @@
+/* Test for initial conversion state.
+ Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "verify.h"
+
+#if GNULIB_defined_mbstate_t
+
+/* Platforms that lack mbsinit() also lack mbrlen(), mbrtowc(), mbsrtowcs()
+ and wcrtomb(), wcsrtombs().
+ We assume that
+ - sizeof (mbstate_t) >= 4,
+ - only stateless encodings are supported (such as UTF-8 and EUC-JP, but
+ not ISO-2022 variants),
+ - for each encoding, the number of bytes for a wide character is <= 4.
+ (This maximum is attained for UTF-8, GB18030, EUC-TW.)
+ We define the meaning of mbstate_t as follows:
+ - In mb -> wc direction, mbstate_t's first byte contains the number of
+ buffered bytes (in the range 0..3), followed by up to 3 buffered bytes.
+ See mbrtowc.c.
+ - In wc -> mb direction, mbstate_t contains no information. In other
+ words, it is always in the initial state. */
+
+verify (sizeof (mbstate_t) >= 4);
+
+int
+mbsinit (const mbstate_t *ps)
+{
+ const char *pstate = (const char *)ps;
+
+ return pstate == NULL || pstate[0] == 0;
+}
+
+#else
+
+int
+mbsinit (const mbstate_t *ps)
+{
+# if defined _WIN32 && !defined __CYGWIN__
+ /* Native Windows. */
+ /* MSVC defines 'mbstate_t' as an 8-byte struct; the first 4 bytes matter.
+ On mingw, 'mbstate_t' is sometimes defined as 'int', sometimes defined as
+ an 8-byte struct, of which the first 4 bytes matter. */
+ return ps == NULL || *(const unsigned int *)ps == 0;
+# else
+ /* Minix, HP-UX 11.00, Solaris 2.6, Interix, ... */
+ /* Maybe this definition works, maybe not... */
+ return ps == NULL || *(const char *)ps == 0;
+# endif
+}
+
+#endif
diff --git a/gl/lib/mbsrtowcs-impl.h b/gl/lib/mbsrtowcs-impl.h
new file mode 100644
index 0000000..55dafe3
--- /dev/null
+++ b/gl/lib/mbsrtowcs-impl.h
@@ -0,0 +1,122 @@
+/* Convert string to wide string.
+ Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ 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 2.1 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/>. */
+
+size_t
+FUNC (DCHAR_T *dest, const char **srcp, size_t len, mbstate_t *ps)
+{
+ if (ps == NULL)
+ ps = &INTERNAL_STATE;
+ {
+ const char *src = *srcp;
+
+ if (dest != NULL)
+ {
+ DCHAR_T *destptr = dest;
+
+ for (; len > 0; destptr++, len--)
+ {
+ size_t src_avail;
+ size_t ret;
+
+ /* An optimized variant of
+ src_avail = strnlen1 (src, MB_LEN_MAX); */
+ if (src[0] == '\0')
+ src_avail = 1;
+ else if (src[1] == '\0')
+ src_avail = 2;
+ else if (src[2] == '\0')
+ src_avail = 3;
+ else if (MB_LEN_MAX <= 4 || src[3] == '\0')
+ src_avail = 4;
+ else
+ src_avail = 4 + strnlen1 (src + 4, MB_LEN_MAX - 4);
+
+ /* Parse the next multibyte character. */
+ ret = MBRTOWC (destptr, src, src_avail, ps);
+
+ if (ret == (size_t)(-2))
+ /* Encountered a multibyte character that extends past a '\0' byte
+ or that is longer than MB_LEN_MAX bytes. Cannot happen. */
+ abort ();
+
+ if (ret == (size_t)(-1))
+ goto bad_input;
+ if (ret == 0)
+ {
+ src = NULL;
+ /* Here mbsinit (ps). */
+ break;
+ }
+ src += ret;
+ }
+
+ *srcp = src;
+ return destptr - dest;
+ }
+ else
+ {
+ /* Ignore dest and len, don't store *srcp at the end, and
+ don't clobber *ps. */
+ mbstate_t state = *ps;
+ size_t totalcount = 0;
+
+ for (;; totalcount++)
+ {
+ size_t src_avail;
+ size_t ret;
+
+ /* An optimized variant of
+ src_avail = strnlen1 (src, MB_LEN_MAX); */
+ if (src[0] == '\0')
+ src_avail = 1;
+ else if (src[1] == '\0')
+ src_avail = 2;
+ else if (src[2] == '\0')
+ src_avail = 3;
+ else if (MB_LEN_MAX <= 4 || src[3] == '\0')
+ src_avail = 4;
+ else
+ src_avail = 4 + strnlen1 (src + 4, MB_LEN_MAX - 4);
+
+ /* Parse the next multibyte character. */
+ ret = MBRTOWC (NULL, src, src_avail, &state);
+
+ if (ret == (size_t)(-2))
+ /* Encountered a multibyte character that extends past a '\0' byte
+ or that is longer than MB_LEN_MAX bytes. Cannot happen. */
+ abort ();
+
+ if (ret == (size_t)(-1))
+ goto bad_input2;
+ if (ret == 0)
+ {
+ /* Here mbsinit (&state). */
+ break;
+ }
+ src += ret;
+ }
+
+ return totalcount;
+ }
+
+ bad_input:
+ *srcp = src;
+ bad_input2:
+ errno = EILSEQ;
+ return (size_t)(-1);
+ }
+}
diff --git a/gl/lib/mbsrtowcs-state.c b/gl/lib/mbsrtowcs-state.c
new file mode 100644
index 0000000..55160a2
--- /dev/null
+++ b/gl/lib/mbsrtowcs-state.c
@@ -0,0 +1,37 @@
+/* Convert string to wide string.
+ Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+#include <wchar.h>
+
+/* Internal state used by the functions mbsrtowcs() and mbsnrtowcs(). */
+mbstate_t _gl_mbsrtowcs_state
+/* The state must initially be in the "initial state"; so, zero-initialize it.
+ On most systems, putting it into BSS is sufficient. Not so on Mac OS X 10.3,
+ see <https://lists.gnu.org/r/bug-gnulib/2009-01/msg00329.html>.
+ When it needs an initializer, use 0 or {0} as initializer? 0 only works
+ when mbstate_t is a scalar type (such as when gnulib defines it, or on
+ AIX, IRIX, mingw). {0} works as an initializer in all cases: for a struct
+ or union type, but also for a scalar type (ISO C 99, 6.7.8.(11)). */
+#if defined __ELF__
+ /* On ELF systems, variables in BSS behave well. */
+#else
+ /* Use braces, to be on the safe side. */
+ = { 0 }
+#endif
+ ;
diff --git a/gl/lib/mbsrtowcs.c b/gl/lib/mbsrtowcs.c
new file mode 100644
index 0000000..66019b0
--- /dev/null
+++ b/gl/lib/mbsrtowcs.c
@@ -0,0 +1,36 @@
+/* Convert string to wide string.
+ Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+
+#include "strnlen1.h"
+
+
+extern mbstate_t _gl_mbsrtowcs_state;
+
+#define FUNC mbsrtowcs
+#define DCHAR_T wchar_t
+#define INTERNAL_STATE _gl_mbsrtowcs_state
+#define MBRTOWC mbrtowc
+#include "mbsrtowcs-impl.h"
diff --git a/gl/lib/mbtowc-impl.h b/gl/lib/mbtowc-impl.h
new file mode 100644
index 0000000..2b27baf
--- /dev/null
+++ b/gl/lib/mbtowc-impl.h
@@ -0,0 +1,44 @@
+/* Convert multibyte character to wide character.
+ Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ 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 2.1 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/>. */
+
+/* We don't need a static internal state, because the encoding is not state
+ dependent, and when mbrtowc returns (size_t)(-2). we throw the result
+ away. */
+
+int
+mbtowc (wchar_t *pwc, const char *s, size_t n)
+{
+ if (s == NULL)
+ return 0;
+ else
+ {
+ mbstate_t state;
+ wchar_t wc;
+ size_t result;
+
+ memset (&state, 0, sizeof (mbstate_t));
+ result = mbrtowc (&wc, s, n, &state);
+ if (result == (size_t)-1 || result == (size_t)-2)
+ {
+ errno = EILSEQ;
+ return -1;
+ }
+ if (pwc != NULL)
+ *pwc = wc;
+ return (wc == 0 ? 0 : result);
+ }
+}
diff --git a/gl/lib/mbtowc-lock.c b/gl/lib/mbtowc-lock.c
new file mode 100644
index 0000000..06d3224
--- /dev/null
+++ b/gl/lib/mbtowc-lock.c
@@ -0,0 +1,150 @@
+/* Return the internal lock used by mbrtowc and mbrtoc32.
+ Copyright (C) 2019-2022 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 2.1 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-2020. */
+
+#include <config.h>
+
+/* When it is known that the gl_get_mbtowc_lock function is defined
+ by a dependency library, it should not be defined here. */
+#if OMIT_MBTOWC_LOCK
+
+/* This declaration is solely to ensure that after preprocessing
+ this file is never empty. */
+typedef int dummy;
+
+#else
+
+/* This file defines the internal lock used by mbrtowc and mbrtoc32.
+ It is a separate compilation unit, so that only one copy of it is
+ present when linking statically. */
+
+/* Prohibit renaming this symbol. */
+# undef gl_get_mbtowc_lock
+
+/* Macro for exporting a symbol (function, not variable) defined in this file,
+ when compiled into a shared library. */
+# ifndef DLL_EXPORTED
+# if HAVE_VISIBILITY
+ /* Override the effect of the compiler option '-fvisibility=hidden'. */
+# define DLL_EXPORTED __attribute__((__visibility__("default")))
+# elif defined _WIN32 || defined __CYGWIN__
+# define DLL_EXPORTED __declspec(dllexport)
+# else
+# define DLL_EXPORTED
+# endif
+# endif
+
+# if defined _WIN32 && !defined __CYGWIN__
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# include "windows-initguard.h"
+
+/* The return type is a 'CRITICAL_SECTION *', not a 'glwthread_mutex_t *',
+ because the latter is not guaranteed to be a stable ABI in the future. */
+
+/* Make sure the function gets exported from DLLs. */
+DLL_EXPORTED CRITICAL_SECTION *gl_get_mbtowc_lock (void);
+
+static glwthread_initguard_t guard = GLWTHREAD_INITGUARD_INIT;
+static CRITICAL_SECTION lock;
+
+/* Returns the internal lock used by mbrtowc and mbrtoc32. */
+CRITICAL_SECTION *
+gl_get_mbtowc_lock (void)
+{
+ if (!guard.done)
+ {
+ if (InterlockedIncrement (&guard.started) == 0)
+ {
+ /* This thread is the first one to need the lock. Initialize it. */
+ InitializeCriticalSection (&lock);
+ guard.done = 1;
+ }
+ else
+ {
+ /* Don't let guard.started grow and wrap around. */
+ InterlockedDecrement (&guard.started);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this mutex. */
+ while (!guard.done)
+ Sleep (0);
+ }
+ }
+ return &lock;
+}
+
+# elif HAVE_PTHREAD_API
+
+# include <pthread.h>
+
+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+
+/* Make sure the function gets exported from shared libraries. */
+DLL_EXPORTED pthread_mutex_t *gl_get_mbtowc_lock (void);
+
+/* Returns the internal lock used by mbrtowc and mbrtoc32. */
+pthread_mutex_t *
+gl_get_mbtowc_lock (void)
+{
+ return &mutex;
+}
+
+# elif HAVE_THREADS_H
+
+# include <threads.h>
+# include <stdlib.h>
+
+static int volatile init_needed = 1;
+static once_flag init_once = ONCE_FLAG_INIT;
+static mtx_t mutex;
+
+static void
+atomic_init (void)
+{
+ if (mtx_init (&mutex, mtx_plain) != thrd_success)
+ abort ();
+ init_needed = 0;
+}
+
+/* Make sure the function gets exported from shared libraries. */
+DLL_EXPORTED mtx_t *gl_get_mbtowc_lock (void);
+
+/* Returns the internal lock used by mbrtowc and mbrtoc32. */
+mtx_t *
+gl_get_mbtowc_lock (void)
+{
+ if (init_needed)
+ call_once (&init_once, atomic_init);
+ return &mutex;
+}
+
+# endif
+
+# if (defined _WIN32 || defined __CYGWIN__) && !defined _MSC_VER
+/* Make sure the '__declspec(dllimport)' in mbrtowc.c and mbrtoc32.c does not
+ cause a link failure when no DLLs are involved. */
+# if defined _WIN64 || defined _LP64
+# define IMP(x) __imp_##x
+# else
+# define IMP(x) _imp__##x
+# endif
+void * IMP(gl_get_mbtowc_lock) = &gl_get_mbtowc_lock;
+# endif
+
+#endif
diff --git a/gl/lib/mbtowc-lock.h b/gl/lib/mbtowc-lock.h
new file mode 100644
index 0000000..ecfd44e
--- /dev/null
+++ b/gl/lib/mbtowc-lock.h
@@ -0,0 +1,125 @@
+/* Use the internal lock used by mbrtowc and mbrtoc32.
+ Copyright (C) 2019-2022 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 2.1 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-2020. */
+
+/* Use a lock, so that no two threads can invoke mbtowc at the same time. */
+
+static inline int
+mbtowc_unlocked (wchar_t *pwc, const char *p, size_t m)
+{
+ /* Put the hidden internal state of mbtowc into its initial state.
+ This is needed at least with glibc, uClibc, and MSVC CRT.
+ See <https://sourceware.org/bugzilla/show_bug.cgi?id=9674>. */
+ mbtowc (NULL, NULL, 0);
+
+ return mbtowc (pwc, p, m);
+}
+
+/* Prohibit renaming this symbol. */
+#undef gl_get_mbtowc_lock
+
+#if GNULIB_MBRTOWC_SINGLE_THREAD
+
+/* All uses of this function are in a single thread. No locking needed. */
+
+static int
+mbtowc_with_lock (wchar_t *pwc, const char *p, size_t m)
+{
+ return mbtowc_unlocked (pwc, p, m);
+}
+
+#elif defined _WIN32 && !defined __CYGWIN__
+
+extern __declspec(dllimport) CRITICAL_SECTION *gl_get_mbtowc_lock (void);
+
+static int
+mbtowc_with_lock (wchar_t *pwc, const char *p, size_t m)
+{
+ CRITICAL_SECTION *lock = gl_get_mbtowc_lock ();
+ int ret;
+
+ EnterCriticalSection (lock);
+ ret = mbtowc_unlocked (pwc, p, m);
+ LeaveCriticalSection (lock);
+
+ return ret;
+}
+
+#elif HAVE_PTHREAD_API /* AIX, IRIX, Cygwin */
+
+extern
+# if defined _WIN32 || defined __CYGWIN__
+ __declspec(dllimport)
+# endif
+ pthread_mutex_t *gl_get_mbtowc_lock (void);
+
+# if HAVE_WEAK_SYMBOLS /* IRIX */
+
+ /* Avoid the need to link with '-lpthread'. */
+# pragma weak pthread_mutex_lock
+# pragma weak pthread_mutex_unlock
+
+ /* Determine whether libpthread is in use. */
+# pragma weak pthread_mutexattr_gettype
+ /* See the comments in lock.h. */
+# define pthread_in_use() \
+ (pthread_mutexattr_gettype != NULL || c11_threads_in_use ())
+
+# else
+# define pthread_in_use() 1
+# endif
+
+static int
+mbtowc_with_lock (wchar_t *pwc, const char *p, size_t m)
+{
+ if (pthread_in_use())
+ {
+ pthread_mutex_t *lock = gl_get_mbtowc_lock ();
+ int ret;
+
+ if (pthread_mutex_lock (lock))
+ abort ();
+ ret = mbtowc_unlocked (pwc, p, m);
+ if (pthread_mutex_unlock (lock))
+ abort ();
+
+ return ret;
+ }
+ else
+ return mbtowc_unlocked (pwc, p, m);
+}
+
+#elif HAVE_THREADS_H
+
+extern mtx_t *gl_get_mbtowc_lock (void);
+
+static int
+mbtowc_with_lock (wchar_t *pwc, const char *p, size_t m)
+{
+ mtx_t *lock = gl_get_mbtowc_lock ();
+ int ret;
+
+ if (mtx_lock (lock) != thrd_success)
+ abort ();
+ ret = mbtowc_unlocked (pwc, p, m);
+ if (mtx_unlock (lock) != thrd_success)
+ abort ();
+
+ return ret;
+}
+
+#endif
diff --git a/gl/lib/mbtowc.c b/gl/lib/mbtowc.c
new file mode 100644
index 0000000..a9a7995
--- /dev/null
+++ b/gl/lib/mbtowc.c
@@ -0,0 +1,26 @@
+/* Convert multibyte character to wide character.
+ Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+#include <stdlib.h>
+
+#include <errno.h>
+#include <string.h>
+#include <wchar.h>
+
+#include "mbtowc-impl.h"
diff --git a/gl/lib/memchr.c b/gl/lib/memchr.c
new file mode 100644
index 0000000..0ca7b30
--- /dev/null
+++ b/gl/lib/memchr.c
@@ -0,0 +1,172 @@
+/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2022
+ Free Software Foundation, Inc.
+
+ Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
+ with help from Dan Sahlin (dan@sics.se) and
+ commentary by Jim Blandy (jimb@ai.mit.edu);
+ adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu),
+ and implemented by Roland McGrath (roland@ai.mit.edu).
+
+ NOTE: The canonical source of this file is maintained with the GNU C Library.
+ Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+
+ This 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 2.1 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/>. */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+#include <string.h>
+
+#include <stddef.h>
+
+#if defined _LIBC
+# include <memcopy.h>
+#else
+# define reg_char char
+#endif
+
+#include <limits.h>
+
+#if HAVE_BP_SYM_H || defined _LIBC
+# include <bp-sym.h>
+#else
+# define BP_SYM(sym) sym
+#endif
+
+#undef __memchr
+#ifdef _LIBC
+# undef memchr
+#endif
+
+#ifndef weak_alias
+# define __memchr memchr
+#endif
+
+/* Search no more than N bytes of S for C. */
+void *
+__memchr (void const *s, int c_in, size_t n)
+{
+ /* On 32-bit hardware, choosing longword to be a 32-bit unsigned
+ long instead of a 64-bit uintmax_t tends to give better
+ performance. On 64-bit hardware, unsigned long is generally 64
+ bits already. Change this typedef to experiment with
+ performance. */
+ typedef unsigned long int longword;
+
+ const unsigned char *char_ptr;
+ const longword *longword_ptr;
+ longword repeated_one;
+ longword repeated_c;
+ unsigned reg_char c;
+
+ c = (unsigned char) c_in;
+
+ /* Handle the first few bytes by reading one byte at a time.
+ Do this until CHAR_PTR is aligned on a longword boundary. */
+ for (char_ptr = (const unsigned char *) s;
+ n > 0 && (size_t) char_ptr % sizeof (longword) != 0;
+ --n, ++char_ptr)
+ if (*char_ptr == c)
+ return (void *) char_ptr;
+
+ longword_ptr = (const longword *) char_ptr;
+
+ /* All these elucidatory comments refer to 4-byte longwords,
+ but the theory applies equally well to any size longwords. */
+
+ /* Compute auxiliary longword values:
+ repeated_one is a value which has a 1 in every byte.
+ repeated_c has c in every byte. */
+ repeated_one = 0x01010101;
+ repeated_c = c | (c << 8);
+ repeated_c |= repeated_c << 16;
+ if (0xffffffffU < (longword) -1)
+ {
+ repeated_one |= repeated_one << 31 << 1;
+ repeated_c |= repeated_c << 31 << 1;
+ if (8 < sizeof (longword))
+ {
+ size_t i;
+
+ for (i = 64; i < sizeof (longword) * 8; i *= 2)
+ {
+ repeated_one |= repeated_one << i;
+ repeated_c |= repeated_c << i;
+ }
+ }
+ }
+
+ /* Instead of the traditional loop which tests each byte, we will test a
+ longword at a time. The tricky part is testing if *any of the four*
+ bytes in the longword in question are equal to c. We first use an xor
+ with repeated_c. This reduces the task to testing whether *any of the
+ four* bytes in longword1 is zero.
+
+ We compute tmp =
+ ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7).
+ That is, we perform the following operations:
+ 1. Subtract repeated_one.
+ 2. & ~longword1.
+ 3. & a mask consisting of 0x80 in every byte.
+ Consider what happens in each byte:
+ - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff,
+ and step 3 transforms it into 0x80. A carry can also be propagated
+ to more significant bytes.
+ - If a byte of longword1 is nonzero, let its lowest 1 bit be at
+ position k (0 <= k <= 7); so the lowest k bits are 0. After step 1,
+ the byte ends in a single bit of value 0 and k bits of value 1.
+ After step 2, the result is just k bits of value 1: 2^k - 1. After
+ step 3, the result is 0. And no carry is produced.
+ So, if longword1 has only non-zero bytes, tmp is zero.
+ Whereas if longword1 has a zero byte, call j the position of the least
+ significant zero byte. Then the result has a zero at positions 0, ...,
+ j-1 and a 0x80 at position j. We cannot predict the result at the more
+ significant bytes (positions j+1..3), but it does not matter since we
+ already have a non-zero bit at position 8*j+7.
+
+ So, the test whether any byte in longword1 is zero is equivalent to
+ testing whether tmp is nonzero. */
+
+ while (n >= sizeof (longword))
+ {
+ longword longword1 = *longword_ptr ^ repeated_c;
+
+ if ((((longword1 - repeated_one) & ~longword1)
+ & (repeated_one << 7)) != 0)
+ break;
+ longword_ptr++;
+ n -= sizeof (longword);
+ }
+
+ char_ptr = (const unsigned char *) longword_ptr;
+
+ /* At this point, we know that either n < sizeof (longword), or one of the
+ sizeof (longword) bytes starting at char_ptr is == c. On little-endian
+ machines, we could determine the first such byte without any further
+ memory accesses, just by looking at the tmp result from the last loop
+ iteration. But this does not work on big-endian machines. Choose code
+ that works in both cases. */
+
+ for (; n > 0; --n, ++char_ptr)
+ {
+ if (*char_ptr == c)
+ return (void *) char_ptr;
+ }
+
+ return NULL;
+}
+#ifdef weak_alias
+weak_alias (__memchr, BP_SYM (memchr))
+#endif
diff --git a/gl/lib/memchr.valgrind b/gl/lib/memchr.valgrind
new file mode 100644
index 0000000..cb0f351
--- /dev/null
+++ b/gl/lib/memchr.valgrind
@@ -0,0 +1,30 @@
+# Suppress a valgrind message about use of uninitialized memory in memchr().
+
+# Copyright (C) 2009-2022 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 2.1 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/>.
+
+# POSIX states that when the character is found, memchr must not read extra
+# bytes in an overestimated length (for example, where memchr is used to
+# implement strnlen). However, we use a safe word read to provide a speedup.
+{
+ memchr-value4
+ Memcheck:Value4
+ fun:rpl_memchr
+}
+{
+ memchr-value8
+ Memcheck:Value8
+ fun:rpl_memchr
+}
diff --git a/gl/lib/memmem.c b/gl/lib/memmem.c
new file mode 100644
index 0000000..5701052
--- /dev/null
+++ b/gl/lib/memmem.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2022 Free Software
+ Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ 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 2.1 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/>. */
+
+/* This particular implementation was written by Eric Blake, 2008. */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+/* Specification of memmem. */
+#include <string.h>
+
+#define RETURN_TYPE void *
+#define AVAILABLE(h, h_l, j, n_l) ((j) <= (h_l) - (n_l))
+#include "str-two-way.h"
+
+/* Return the first occurrence of NEEDLE in HAYSTACK. Return HAYSTACK
+ if NEEDLE_LEN is 0, otherwise NULL if NEEDLE is not found in
+ HAYSTACK. */
+void *
+memmem (const void *haystack_start, size_t haystack_len,
+ const void *needle_start, size_t needle_len)
+{
+ /* Abstract memory is considered to be an array of 'unsigned char' values,
+ not an array of 'char' values. See ISO C 99 section 6.2.6.1. */
+ const unsigned char *haystack = (const unsigned char *) haystack_start;
+ const unsigned char *needle = (const unsigned char *) needle_start;
+
+ if (needle_len == 0)
+ /* The first occurrence of the empty string is deemed to occur at
+ the beginning of the string. */
+ return (void *) haystack;
+
+ /* Sanity check, otherwise the loop might search through the whole
+ memory. */
+ if (__builtin_expect (haystack_len < needle_len, 0))
+ return NULL;
+
+ /* Use optimizations in memchr when possible, to reduce the search
+ size of haystack using a linear algorithm with a smaller
+ coefficient. However, avoid memchr for long needles, since we
+ can often achieve sublinear performance. */
+ if (needle_len < LONG_NEEDLE_THRESHOLD)
+ {
+ haystack = memchr (haystack, *needle, haystack_len);
+ if (!haystack || __builtin_expect (needle_len == 1, 0))
+ return (void *) haystack;
+ haystack_len -= haystack - (const unsigned char *) haystack_start;
+ if (haystack_len < needle_len)
+ return NULL;
+ return two_way_short_needle (haystack, haystack_len, needle, needle_len);
+ }
+ else
+ return two_way_long_needle (haystack, haystack_len, needle, needle_len);
+}
+
+#undef LONG_NEEDLE_THRESHOLD
diff --git a/gl/lib/mempcpy.c b/gl/lib/mempcpy.c
new file mode 100644
index 0000000..9aae418
--- /dev/null
+++ b/gl/lib/mempcpy.c
@@ -0,0 +1,33 @@
+/* Copy memory area and return pointer after last written byte.
+ Copyright (C) 2003, 2007, 2009-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <string.h>
+
+/* A function definition is only needed if HAVE_MEMPCPY is not defined. */
+#if !HAVE_MEMPCPY
+
+/* Copy N bytes of SRC to DEST, return pointer to bytes after the
+ last written byte. */
+void *
+mempcpy (void *dest, const void *src, size_t n)
+{
+ return (char *) memcpy (dest, src, n) + n;
+}
+
+#endif
diff --git a/gl/lib/memrchr.c b/gl/lib/memrchr.c
new file mode 100644
index 0000000..90fdb86
--- /dev/null
+++ b/gl/lib/memrchr.c
@@ -0,0 +1,161 @@
+/* memrchr -- find the last occurrence of a byte in a memory block
+
+ Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2022 Free Software
+ Foundation, Inc.
+
+ Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
+ with help from Dan Sahlin (dan@sics.se) and
+ commentary by Jim Blandy (jimb@ai.mit.edu);
+ adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu),
+ and implemented by Roland McGrath (roland@ai.mit.edu).
+
+ 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 _LIBC
+# include <memcopy.h>
+#else
+# include <config.h>
+# define reg_char char
+#endif
+
+#include <string.h>
+#include <limits.h>
+
+#undef __memrchr
+#ifdef _LIBC
+# undef memrchr
+#endif
+
+#ifndef weak_alias
+# define __memrchr memrchr
+#endif
+
+/* Search no more than N bytes of S for C. */
+void *
+__memrchr (void const *s, int c_in, size_t n)
+{
+ /* On 32-bit hardware, choosing longword to be a 32-bit unsigned
+ long instead of a 64-bit uintmax_t tends to give better
+ performance. On 64-bit hardware, unsigned long is generally 64
+ bits already. Change this typedef to experiment with
+ performance. */
+ typedef unsigned long int longword;
+
+ const unsigned char *char_ptr;
+ const longword *longword_ptr;
+ longword repeated_one;
+ longword repeated_c;
+ unsigned reg_char c;
+
+ c = (unsigned char) c_in;
+
+ /* Handle the last few bytes by reading one byte at a time.
+ Do this until CHAR_PTR is aligned on a longword boundary. */
+ for (char_ptr = (const unsigned char *) s + n;
+ n > 0 && (size_t) char_ptr % sizeof (longword) != 0;
+ --n)
+ if (*--char_ptr == c)
+ return (void *) char_ptr;
+
+ longword_ptr = (const void *) char_ptr;
+
+ /* All these elucidatory comments refer to 4-byte longwords,
+ but the theory applies equally well to any size longwords. */
+
+ /* Compute auxiliary longword values:
+ repeated_one is a value which has a 1 in every byte.
+ repeated_c has c in every byte. */
+ repeated_one = 0x01010101;
+ repeated_c = c | (c << 8);
+ repeated_c |= repeated_c << 16;
+ if (0xffffffffU < (longword) -1)
+ {
+ repeated_one |= repeated_one << 31 << 1;
+ repeated_c |= repeated_c << 31 << 1;
+ if (8 < sizeof (longword))
+ {
+ size_t i;
+
+ for (i = 64; i < sizeof (longword) * 8; i *= 2)
+ {
+ repeated_one |= repeated_one << i;
+ repeated_c |= repeated_c << i;
+ }
+ }
+ }
+
+ /* Instead of the traditional loop which tests each byte, we will test a
+ longword at a time. The tricky part is testing if *any of the four*
+ bytes in the longword in question are equal to c. We first use an xor
+ with repeated_c. This reduces the task to testing whether *any of the
+ four* bytes in longword1 is zero.
+
+ We compute tmp =
+ ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7).
+ That is, we perform the following operations:
+ 1. Subtract repeated_one.
+ 2. & ~longword1.
+ 3. & a mask consisting of 0x80 in every byte.
+ Consider what happens in each byte:
+ - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff,
+ and step 3 transforms it into 0x80. A carry can also be propagated
+ to more significant bytes.
+ - If a byte of longword1 is nonzero, let its lowest 1 bit be at
+ position k (0 <= k <= 7); so the lowest k bits are 0. After step 1,
+ the byte ends in a single bit of value 0 and k bits of value 1.
+ After step 2, the result is just k bits of value 1: 2^k - 1. After
+ step 3, the result is 0. And no carry is produced.
+ So, if longword1 has only non-zero bytes, tmp is zero.
+ Whereas if longword1 has a zero byte, call j the position of the least
+ significant zero byte. Then the result has a zero at positions 0, ...,
+ j-1 and a 0x80 at position j. We cannot predict the result at the more
+ significant bytes (positions j+1..3), but it does not matter since we
+ already have a non-zero bit at position 8*j+7.
+
+ So, the test whether any byte in longword1 is zero is equivalent to
+ testing whether tmp is nonzero. */
+
+ while (n >= sizeof (longword))
+ {
+ longword longword1 = *--longword_ptr ^ repeated_c;
+
+ if ((((longword1 - repeated_one) & ~longword1)
+ & (repeated_one << 7)) != 0)
+ {
+ longword_ptr++;
+ break;
+ }
+ n -= sizeof (longword);
+ }
+
+ char_ptr = (const unsigned char *) longword_ptr;
+
+ /* At this point, we know that either n < sizeof (longword), or one of the
+ sizeof (longword) bytes starting at char_ptr is == c. On little-endian
+ machines, we could determine the first such byte without any further
+ memory accesses, just by looking at the tmp result from the last loop
+ iteration. But this does not work on big-endian machines. Choose code
+ that works in both cases. */
+
+ while (n-- > 0)
+ {
+ if (*--char_ptr == c)
+ return (void *) char_ptr;
+ }
+
+ return NULL;
+}
+#ifdef weak_alias
+weak_alias (__memrchr, memrchr)
+#endif
diff --git a/gl/lib/minmax.h b/gl/lib/minmax.h
new file mode 100644
index 0000000..b4b1345
--- /dev/null
+++ b/gl/lib/minmax.h
@@ -0,0 +1,60 @@
+/* MIN, MAX macros.
+ Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2022 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 2.1 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/>. */
+
+#ifndef _MINMAX_H
+#define _MINMAX_H
+
+/* Note: MIN, MAX are also defined in <sys/param.h> on some systems
+ (glibc, IRIX, HP-UX, OSF/1). Therefore you might get warnings about
+ MIN, MAX macro redefinitions on some systems; the workaround is to
+ #include this file as the last one among the #include list. */
+
+/* Before we define the following symbols we get the <limits.h> file
+ since otherwise we get redefinitions on some systems if <limits.h> is
+ included after this file. Likewise for <sys/param.h>.
+ If more than one of these system headers define MIN and MAX, pick just
+ one of the headers (because the definitions most likely are the same). */
+#if HAVE_MINMAX_IN_LIMITS_H
+# include <limits.h>
+#elif HAVE_MINMAX_IN_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+
+/* Note: MIN and MAX should be used with two arguments of the
+ same type. They might not return the minimum and maximum of their two
+ arguments, if the arguments have different types or have unusual
+ floating-point values. For example, on a typical host with 32-bit 'int',
+ 64-bit 'long long', and 64-bit IEEE 754 'double' types:
+
+ MAX (-1, 2147483648) returns 4294967295.
+ MAX (9007199254740992.0, 9007199254740993) returns 9007199254740992.0.
+ MAX (NaN, 0.0) returns 0.0.
+ MAX (+0.0, -0.0) returns -0.0.
+
+ and in each case the answer is in some sense bogus. */
+
+/* MAX(a,b) returns the maximum of A and B. */
+#ifndef MAX
+# define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
+
+/* MIN(a,b) returns the minimum of A and B. */
+#ifndef MIN
+# define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
+
+#endif /* _MINMAX_H */
diff --git a/gl/lib/mkdir.c b/gl/lib/mkdir.c
new file mode 100644
index 0000000..4901701
--- /dev/null
+++ b/gl/lib/mkdir.c
@@ -0,0 +1,93 @@
+/* On some systems, mkdir ("foo/", 0700) fails because of the trailing
+ slash. On those systems, this wrapper removes the trailing slash.
+
+ Copyright (C) 2001, 2003, 2006, 2008-2022 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 2.1 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 Jim Meyering */
+
+#include <config.h>
+
+/* Specification. */
+#include <sys/stat.h>
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "dirname.h"
+
+/* Disable the definition of mkdir to rpl_mkdir (from the <sys/stat.h>
+ substitute) in this file. Otherwise, we'd get an endless recursion. */
+#undef mkdir
+
+/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
+ Additionally, it declares _mkdir (and depending on compile flags, an
+ alias mkdir), only in the nonstandard includes <direct.h> and <io.h>,
+ which are included in the <sys/stat.h> override. */
+#if defined _WIN32 && ! defined __CYGWIN__
+# define mkdir(name,mode) _mkdir (name)
+# define maybe_unused _GL_UNUSED
+#else
+# define maybe_unused /* empty */
+#endif
+
+/* This function is required at least for NetBSD 1.5.2. */
+
+int
+rpl_mkdir (char const *dir, maybe_unused mode_t mode)
+{
+ int ret_val;
+ char *tmp_dir;
+ size_t len = strlen (dir);
+
+ if (len && dir[len - 1] == '/')
+ {
+ tmp_dir = strdup (dir);
+ if (!tmp_dir)
+ {
+ /* Rather than rely on strdup-posix, we set errno ourselves. */
+ errno = ENOMEM;
+ return -1;
+ }
+ strip_trailing_slashes (tmp_dir);
+ }
+ else
+ {
+ tmp_dir = (char *) dir;
+ }
+#if FUNC_MKDIR_DOT_BUG
+ /* Additionally, cygwin 1.5 mistakenly creates a directory "d/./". */
+ {
+ char *last = last_component (tmp_dir);
+ if (*last == '.' && (last[1] == '\0'
+ || (last[1] == '.' && last[2] == '\0')))
+ {
+ struct stat st;
+ if (stat (tmp_dir, &st) == 0 || errno == EOVERFLOW)
+ errno = EEXIST;
+ return -1;
+ }
+ }
+#endif /* FUNC_MKDIR_DOT_BUG */
+
+ ret_val = mkdir (tmp_dir, mode);
+
+ if (tmp_dir != dir)
+ free (tmp_dir);
+
+ return ret_val;
+}
diff --git a/gl/lib/mkdtemp.c b/gl/lib/mkdtemp.c
new file mode 100644
index 0000000..0577870
--- /dev/null
+++ b/gl/lib/mkdtemp.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 1999, 2001-2003, 2006-2007, 2009-2022 Free Software
+ Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ 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 2.1 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/>. */
+
+/* Extracted from misc/mkdtemp.c. */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdlib.h>
+
+#include "tempname.h"
+
+/* Generate a unique temporary directory from XTEMPLATE.
+ The last six characters of XTEMPLATE must be "XXXXXX";
+ they are replaced with a string that makes the filename unique.
+ The directory is created, mode 700, and its name is returned.
+ (This function comes from OpenBSD.) */
+char *
+mkdtemp (char *xtemplate)
+{
+ if (gen_tempname (xtemplate, 0, 0, GT_DIR))
+ return NULL;
+ else
+ return xtemplate;
+}
diff --git a/gl/lib/mkstemp.c b/gl/lib/mkstemp.c
new file mode 100644
index 0000000..7e0a214
--- /dev/null
+++ b/gl/lib/mkstemp.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2022 Free Software
+ Foundation, Inc.
+ This file is derived from the one in the GNU C Library.
+
+ 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 2.1 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 !_LIBC
+# include <config.h>
+#endif
+
+#include <stdlib.h>
+
+#if !_LIBC
+# include "tempname.h"
+# define __gen_tempname gen_tempname
+# ifndef __GT_FILE
+# define __GT_FILE GT_FILE
+# endif
+#endif
+
+#include <stdio.h>
+
+#ifndef __GT_FILE
+# define __GT_FILE 0
+#endif
+
+/* Generate a unique temporary file name from XTEMPLATE.
+ The last six characters of XTEMPLATE must be "XXXXXX";
+ they are replaced with a string that makes the file name unique.
+ Then open the file and return a fd.
+
+ If you are creating temporary files which will later be removed,
+ consider using the clean-temp module, which avoids several pitfalls
+ of using mkstemp directly. */
+int
+mkstemp (char *xtemplate)
+{
+ return __gen_tempname (xtemplate, 0, 0, __GT_FILE);
+}
diff --git a/gl/lib/msvc-inval.c b/gl/lib/msvc-inval.c
new file mode 100644
index 0000000..d6651ca
--- /dev/null
+++ b/gl/lib/msvc-inval.c
@@ -0,0 +1,129 @@
+/* Invalid parameter handler for MSVC runtime libraries.
+ Copyright (C) 2011-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "msvc-inval.h"
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \
+ && !(MSVC_INVALID_PARAMETER_HANDLING == SANE_LIBRARY_HANDLING)
+
+/* Get _invalid_parameter_handler type and _set_invalid_parameter_handler
+ declaration. */
+# include <stdlib.h>
+
+# if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
+
+static void __cdecl
+gl_msvc_invalid_parameter_handler (const wchar_t *expression,
+ const wchar_t *function,
+ const wchar_t *file,
+ unsigned int line,
+ uintptr_t dummy)
+{
+}
+
+# else
+
+/* Get declarations of the native Windows API functions. */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+
+# if defined _MSC_VER
+
+static void __cdecl
+gl_msvc_invalid_parameter_handler (const wchar_t *expression,
+ const wchar_t *function,
+ const wchar_t *file,
+ unsigned int line,
+ uintptr_t dummy)
+{
+ RaiseException (STATUS_GNULIB_INVALID_PARAMETER, 0, 0, NULL);
+}
+
+# else
+
+/* An index to thread-local storage. */
+static DWORD tls_index;
+static int tls_initialized /* = 0 */;
+
+/* Used as a fallback only. */
+static struct gl_msvc_inval_per_thread not_per_thread;
+
+struct gl_msvc_inval_per_thread *
+gl_msvc_inval_current (void)
+{
+ if (!tls_initialized)
+ {
+ tls_index = TlsAlloc ();
+ tls_initialized = 1;
+ }
+ if (tls_index == TLS_OUT_OF_INDEXES)
+ /* TlsAlloc had failed. */
+ return &not_per_thread;
+ else
+ {
+ struct gl_msvc_inval_per_thread *pointer =
+ (struct gl_msvc_inval_per_thread *) TlsGetValue (tls_index);
+ if (pointer == NULL)
+ {
+ /* First call. Allocate a new 'struct gl_msvc_inval_per_thread'. */
+ pointer =
+ (struct gl_msvc_inval_per_thread *)
+ malloc (sizeof (struct gl_msvc_inval_per_thread));
+ if (pointer == NULL)
+ /* Could not allocate memory. Use the global storage. */
+ pointer = &not_per_thread;
+ TlsSetValue (tls_index, pointer);
+ }
+ return pointer;
+ }
+}
+
+static void __cdecl
+gl_msvc_invalid_parameter_handler (const wchar_t *expression,
+ const wchar_t *function,
+ const wchar_t *file,
+ unsigned int line,
+ uintptr_t dummy)
+{
+ struct gl_msvc_inval_per_thread *current = gl_msvc_inval_current ();
+ if (current->restart_valid)
+ longjmp (current->restart, 1);
+ else
+ /* An invalid parameter notification from outside the gnulib code.
+ Give the caller a chance to intervene. */
+ RaiseException (STATUS_GNULIB_INVALID_PARAMETER, 0, 0, NULL);
+}
+
+# endif
+
+# endif
+
+static int gl_msvc_inval_initialized /* = 0 */;
+
+void
+gl_msvc_inval_ensure_handler (void)
+{
+ if (gl_msvc_inval_initialized == 0)
+ {
+ _set_invalid_parameter_handler (gl_msvc_invalid_parameter_handler);
+ gl_msvc_inval_initialized = 1;
+ }
+}
+
+#endif
diff --git a/gl/lib/msvc-inval.h b/gl/lib/msvc-inval.h
new file mode 100644
index 0000000..1230b89
--- /dev/null
+++ b/gl/lib/msvc-inval.h
@@ -0,0 +1,222 @@
+/* Invalid parameter handler for MSVC runtime libraries.
+ Copyright (C) 2011-2022 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 2.1 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/>. */
+
+#ifndef _MSVC_INVAL_H
+#define _MSVC_INVAL_H
+
+/* With MSVC runtime libraries with the "invalid parameter handler" concept,
+ functions like fprintf(), dup2(), or close() crash when the caller passes
+ an invalid argument. But POSIX wants error codes (such as EINVAL or EBADF)
+ instead.
+ This file defines macros that turn such an invalid parameter notification
+ into a non-local exit. An error code can then be produced at the target
+ of this exit. You can thus write code like
+
+ TRY_MSVC_INVAL
+ {
+ <Code that can trigger an invalid parameter notification
+ but does not do 'return', 'break', 'continue', nor 'goto'.>
+ }
+ CATCH_MSVC_INVAL
+ {
+ <Code that handles an invalid parameter notification
+ but does not do 'return', 'break', 'continue', nor 'goto'.>
+ }
+ DONE_MSVC_INVAL;
+
+ This entire block expands to a single statement.
+
+ The handling of invalid parameters can be done in three ways:
+
+ * The default way, which is reasonable for programs (not libraries):
+ AC_DEFINE([MSVC_INVALID_PARAMETER_HANDLING], [DEFAULT_HANDLING])
+
+ * The way for libraries that make "hairy" calls (like close(-1), or
+ fclose(fp) where fileno(fp) is closed, or simply getdtablesize()):
+ AC_DEFINE([MSVC_INVALID_PARAMETER_HANDLING], [HAIRY_LIBRARY_HANDLING])
+
+ * The way for libraries that make no "hairy" calls:
+ AC_DEFINE([MSVC_INVALID_PARAMETER_HANDLING], [SANE_LIBRARY_HANDLING])
+ */
+
+#define DEFAULT_HANDLING 0
+#define HAIRY_LIBRARY_HANDLING 1
+#define SANE_LIBRARY_HANDLING 2
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \
+ && !(MSVC_INVALID_PARAMETER_HANDLING == SANE_LIBRARY_HANDLING)
+/* A native Windows platform with the "invalid parameter handler" concept,
+ and either DEFAULT_HANDLING or HAIRY_LIBRARY_HANDLING. */
+
+# if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
+/* Default handling. */
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+/* Ensure that the invalid parameter handler in installed that just returns.
+ Because we assume no other part of the program installs a different
+ invalid parameter handler, this solution is multithread-safe. */
+extern void gl_msvc_inval_ensure_handler (void);
+
+# ifdef __cplusplus
+}
+# endif
+
+# define TRY_MSVC_INVAL \
+ do \
+ { \
+ gl_msvc_inval_ensure_handler (); \
+ if (1)
+# define CATCH_MSVC_INVAL \
+ else
+# define DONE_MSVC_INVAL \
+ } \
+ while (0)
+
+# else
+/* Handling for hairy libraries. */
+
+# include <excpt.h>
+
+/* Gnulib can define its own status codes, as described in the page
+ "Raising Software Exceptions" on microsoft.com
+ <https://docs.microsoft.com/en-us/cpp/cpp/raising-software-exceptions>.
+ Our status codes are composed of
+ - 0xE0000000, mandatory for all user-defined status codes,
+ - 0x474E550, a API identifier ("GNU"),
+ - 0, 1, 2, ..., used to distinguish different status codes from the
+ same API. */
+# define STATUS_GNULIB_INVALID_PARAMETER (0xE0000000 + 0x474E550 + 0)
+
+# if defined _MSC_VER
+/* A compiler that supports __try/__except, as described in the page
+ "try-except statement" on microsoft.com
+ <https://docs.microsoft.com/en-us/cpp/cpp/try-except-statement>.
+ With __try/__except, we can use the multithread-safe exception handling. */
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+/* Ensure that the invalid parameter handler in installed that raises a
+ software exception with code STATUS_GNULIB_INVALID_PARAMETER.
+ Because we assume no other part of the program installs a different
+ invalid parameter handler, this solution is multithread-safe. */
+extern void gl_msvc_inval_ensure_handler (void);
+
+# ifdef __cplusplus
+}
+# endif
+
+# define TRY_MSVC_INVAL \
+ do \
+ { \
+ gl_msvc_inval_ensure_handler (); \
+ __try
+# define CATCH_MSVC_INVAL \
+ __except (GetExceptionCode () == STATUS_GNULIB_INVALID_PARAMETER \
+ ? EXCEPTION_EXECUTE_HANDLER \
+ : EXCEPTION_CONTINUE_SEARCH)
+# define DONE_MSVC_INVAL \
+ } \
+ while (0)
+
+# else
+/* Any compiler.
+ We can only use setjmp/longjmp. */
+
+# include <setjmp.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+struct gl_msvc_inval_per_thread
+{
+ /* The restart that will resume execution at the code between
+ CATCH_MSVC_INVAL and DONE_MSVC_INVAL. It is enabled only between
+ TRY_MSVC_INVAL and CATCH_MSVC_INVAL. */
+ jmp_buf restart;
+
+ /* Tells whether the contents of restart is valid. */
+ int restart_valid;
+};
+
+/* Ensure that the invalid parameter handler in installed that passes
+ control to the gl_msvc_inval_restart if it is valid, or raises a
+ software exception with code STATUS_GNULIB_INVALID_PARAMETER otherwise.
+ Because we assume no other part of the program installs a different
+ invalid parameter handler, this solution is multithread-safe. */
+extern void gl_msvc_inval_ensure_handler (void);
+
+/* Return a pointer to the per-thread data for the current thread. */
+extern struct gl_msvc_inval_per_thread *gl_msvc_inval_current (void);
+
+# ifdef __cplusplus
+}
+# endif
+
+# define TRY_MSVC_INVAL \
+ do \
+ { \
+ struct gl_msvc_inval_per_thread *msvc_inval_current; \
+ gl_msvc_inval_ensure_handler (); \
+ msvc_inval_current = gl_msvc_inval_current (); \
+ /* First, initialize gl_msvc_inval_restart. */ \
+ if (setjmp (msvc_inval_current->restart) == 0) \
+ { \
+ /* Then, mark it as valid. */ \
+ msvc_inval_current->restart_valid = 1;
+# define CATCH_MSVC_INVAL \
+ /* Execution completed. \
+ Mark gl_msvc_inval_restart as invalid. */ \
+ msvc_inval_current->restart_valid = 0; \
+ } \
+ else \
+ { \
+ /* Execution triggered an invalid parameter notification. \
+ Mark gl_msvc_inval_restart as invalid. */ \
+ msvc_inval_current->restart_valid = 0;
+# define DONE_MSVC_INVAL \
+ } \
+ } \
+ while (0)
+
+# endif
+
+# endif
+
+#else
+/* A platform that does not need to the invalid parameter handler,
+ or when SANE_LIBRARY_HANDLING is desired. */
+
+/* The braces here avoid GCC warnings like
+ "warning: suggest explicit braces to avoid ambiguous 'else'". */
+# define TRY_MSVC_INVAL \
+ do \
+ { \
+ if (1)
+# define CATCH_MSVC_INVAL \
+ else
+# define DONE_MSVC_INVAL \
+ } \
+ while (0)
+
+#endif
+
+#endif /* _MSVC_INVAL_H */
diff --git a/gl/lib/msvc-nothrow.c b/gl/lib/msvc-nothrow.c
new file mode 100644
index 0000000..aa06964
--- /dev/null
+++ b/gl/lib/msvc-nothrow.c
@@ -0,0 +1,51 @@
+/* Wrappers that don't throw invalid parameter notifications
+ with MSVC runtime libraries.
+ Copyright (C) 2011-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "msvc-nothrow.h"
+
+/* Get declarations of the native Windows API functions. */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+#endif
+
+#undef _get_osfhandle
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+intptr_t
+_gl_nothrow_get_osfhandle (int fd)
+{
+ intptr_t result;
+
+ TRY_MSVC_INVAL
+ {
+ result = _get_osfhandle (fd);
+ }
+ CATCH_MSVC_INVAL
+ {
+ result = (intptr_t) INVALID_HANDLE_VALUE;
+ }
+ DONE_MSVC_INVAL;
+
+ return result;
+}
+#endif
diff --git a/gl/lib/msvc-nothrow.h b/gl/lib/msvc-nothrow.h
new file mode 100644
index 0000000..5345155
--- /dev/null
+++ b/gl/lib/msvc-nothrow.h
@@ -0,0 +1,43 @@
+/* Wrappers that don't throw invalid parameter notifications
+ with MSVC runtime libraries.
+ Copyright (C) 2011-2022 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 2.1 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/>. */
+
+#ifndef _MSVC_NOTHROW_H
+#define _MSVC_NOTHROW_H
+
+/* With MSVC runtime libraries with the "invalid parameter handler" concept,
+ functions like fprintf(), dup2(), or close() crash when the caller passes
+ an invalid argument. But POSIX wants error codes (such as EINVAL or EBADF)
+ instead.
+ This file defines wrappers that turn such an invalid parameter notification
+ into an error code. */
+
+#if defined _WIN32 && ! defined __CYGWIN__
+
+/* Get original declaration of _get_osfhandle. */
+# include <io.h>
+
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+
+/* Override _get_osfhandle. */
+extern intptr_t _gl_nothrow_get_osfhandle (int fd);
+# define _get_osfhandle _gl_nothrow_get_osfhandle
+
+# endif
+
+#endif
+
+#endif /* _MSVC_NOTHROW_H */
diff --git a/gl/lib/nanosleep.c b/gl/lib/nanosleep.c
new file mode 100644
index 0000000..446794e
--- /dev/null
+++ b/gl/lib/nanosleep.c
@@ -0,0 +1,195 @@
+/* Provide a replacement for the POSIX nanosleep function.
+
+ Copyright (C) 1999-2000, 2002, 2004-2022 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 2.1 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 Jim Meyering
+ and Bruno Haible for the native Windows part */
+
+#include <config.h>
+
+#include <time.h>
+
+#include "intprops.h"
+#include "verify.h"
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/select.h>
+#include <signal.h>
+
+#include <errno.h>
+
+#include <unistd.h>
+
+
+enum { BILLION = 1000 * 1000 * 1000 };
+
+#if HAVE_BUG_BIG_NANOSLEEP
+
+int
+nanosleep (const struct timespec *requested_delay,
+ struct timespec *remaining_delay)
+# undef nanosleep
+{
+ /* nanosleep mishandles large sleeps due to internal overflow problems.
+ The worst known case of this is Linux 2.6.9 with glibc 2.3.4, which
+ can't sleep more than 24.85 days (2^31 milliseconds). Similarly,
+ cygwin 1.5.x, which can't sleep more than 49.7 days (2^32 milliseconds).
+ Solve this by breaking the sleep up into smaller chunks. */
+
+ if (requested_delay->tv_nsec < 0 || BILLION <= requested_delay->tv_nsec)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
+ {
+ /* Verify that time_t is large enough. */
+ verify (TYPE_MAXIMUM (time_t) / 24 / 24 / 60 / 60);
+ const time_t limit = 24 * 24 * 60 * 60;
+ time_t seconds = requested_delay->tv_sec;
+ struct timespec intermediate;
+ intermediate.tv_nsec = requested_delay->tv_nsec;
+
+ while (limit < seconds)
+ {
+ int result;
+ intermediate.tv_sec = limit;
+ result = nanosleep (&intermediate, remaining_delay);
+ seconds -= limit;
+ if (result)
+ {
+ if (remaining_delay)
+ remaining_delay->tv_sec += seconds;
+ return result;
+ }
+ intermediate.tv_nsec = 0;
+ }
+ intermediate.tv_sec = seconds;
+ return nanosleep (&intermediate, remaining_delay);
+ }
+}
+
+#elif defined _WIN32 && ! defined __CYGWIN__
+/* Native Windows platforms. */
+
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+
+/* The Windows API function Sleep() has a resolution of about 15 ms and takes
+ at least 5 ms to execute. We use this function for longer time periods.
+ Additionally, we use busy-looping over short time periods, to get a
+ resolution of about 0.01 ms. In order to measure such short timespans,
+ we use the QueryPerformanceCounter() function. */
+
+int
+nanosleep (const struct timespec *requested_delay,
+ struct timespec *remaining_delay)
+{
+ static bool initialized;
+ /* Number of performance counter increments per nanosecond,
+ or zero if it could not be determined. */
+ static double ticks_per_nanosecond;
+
+ if (requested_delay->tv_nsec < 0 || BILLION <= requested_delay->tv_nsec)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
+ /* For requested delays of one second or more, 15ms resolution is
+ sufficient. */
+ if (requested_delay->tv_sec == 0)
+ {
+ if (!initialized)
+ {
+ /* Initialize ticks_per_nanosecond. */
+ LARGE_INTEGER ticks_per_second;
+
+ if (QueryPerformanceFrequency (&ticks_per_second))
+ ticks_per_nanosecond =
+ (double) ticks_per_second.QuadPart / 1000000000.0;
+
+ initialized = true;
+ }
+ if (ticks_per_nanosecond)
+ {
+ /* QueryPerformanceFrequency worked. We can use
+ QueryPerformanceCounter. Use a combination of Sleep and
+ busy-looping. */
+ /* Number of milliseconds to pass to the Sleep function.
+ Since Sleep can take up to 8 ms less or 8 ms more than requested
+ (or maybe more if the system is loaded), we subtract 10 ms. */
+ int sleep_millis = (int) requested_delay->tv_nsec / 1000000 - 10;
+ /* Determine how many ticks to delay. */
+ LONGLONG wait_ticks = requested_delay->tv_nsec * ticks_per_nanosecond;
+ /* Start. */
+ LARGE_INTEGER counter_before;
+ if (QueryPerformanceCounter (&counter_before))
+ {
+ /* Wait until the performance counter has reached this value.
+ We don't need to worry about overflow, because the performance
+ counter is reset at reboot, and with a frequency of 3.6E6
+ ticks per second 63 bits suffice for over 80000 years. */
+ LONGLONG wait_until = counter_before.QuadPart + wait_ticks;
+ /* Use Sleep for the longest part. */
+ if (sleep_millis > 0)
+ Sleep (sleep_millis);
+ /* Busy-loop for the rest. */
+ for (;;)
+ {
+ LARGE_INTEGER counter_after;
+ if (!QueryPerformanceCounter (&counter_after))
+ /* QueryPerformanceCounter failed, but succeeded earlier.
+ Should not happen. */
+ break;
+ if (counter_after.QuadPart >= wait_until)
+ /* The requested time has elapsed. */
+ break;
+ }
+ goto done;
+ }
+ }
+ }
+ /* Implementation for long delays and as fallback. */
+ Sleep (requested_delay->tv_sec * 1000 + requested_delay->tv_nsec / 1000000);
+
+ done:
+ /* Sleep is not interruptible. So there is no remaining delay. */
+ if (remaining_delay != NULL)
+ {
+ remaining_delay->tv_sec = 0;
+ remaining_delay->tv_nsec = 0;
+ }
+ return 0;
+}
+
+#else
+/* Other platforms lacking nanosleep.
+ It's not clear whether these are still practical porting targets.
+ For now, just fall back on pselect. */
+
+/* Suspend execution for at least *REQUESTED_DELAY seconds. The
+ *REMAINING_DELAY part isn't implemented yet. */
+
+int
+nanosleep (const struct timespec *requested_delay,
+ struct timespec *remaining_delay)
+{
+ return pselect (0, NULL, NULL, NULL, requested_delay, NULL);
+}
+#endif
diff --git a/gl/lib/nl_langinfo-lock.c b/gl/lib/nl_langinfo-lock.c
new file mode 100644
index 0000000..c36882d
--- /dev/null
+++ b/gl/lib/nl_langinfo-lock.c
@@ -0,0 +1,150 @@
+/* Return the internal lock used by nl_langinfo.
+ Copyright (C) 2019-2022 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 2.1 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-2020. */
+
+#include <config.h>
+
+/* When it is known that the gl_get_nl_langinfo_lock function is defined
+ by a dependency library, it should not be defined here. */
+#if OMIT_NL_LANGINFO_LOCK
+
+/* This declaration is solely to ensure that after preprocessing
+ this file is never empty. */
+typedef int dummy;
+
+#else
+
+/* This file defines the internal lock used by nl_langinfo.
+ It is a separate compilation unit, so that only one copy of it is
+ present when linking statically. */
+
+/* Prohibit renaming this symbol. */
+# undef gl_get_nl_langinfo_lock
+
+/* Macro for exporting a symbol (function, not variable) defined in this file,
+ when compiled into a shared library. */
+# ifndef DLL_EXPORTED
+# if HAVE_VISIBILITY
+ /* Override the effect of the compiler option '-fvisibility=hidden'. */
+# define DLL_EXPORTED __attribute__((__visibility__("default")))
+# elif defined _WIN32 || defined __CYGWIN__
+# define DLL_EXPORTED __declspec(dllexport)
+# else
+# define DLL_EXPORTED
+# endif
+# endif
+
+# if defined _WIN32 && !defined __CYGWIN__
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# include "windows-initguard.h"
+
+/* The return type is a 'CRITICAL_SECTION *', not a 'glwthread_mutex_t *',
+ because the latter is not guaranteed to be a stable ABI in the future. */
+
+/* Make sure the function gets exported from DLLs. */
+DLL_EXPORTED CRITICAL_SECTION *gl_get_nl_langinfo_lock (void);
+
+static glwthread_initguard_t guard = GLWTHREAD_INITGUARD_INIT;
+static CRITICAL_SECTION lock;
+
+/* Returns the internal lock used by nl_langinfo. */
+CRITICAL_SECTION *
+gl_get_nl_langinfo_lock (void)
+{
+ if (!guard.done)
+ {
+ if (InterlockedIncrement (&guard.started) == 0)
+ {
+ /* This thread is the first one to need the lock. Initialize it. */
+ InitializeCriticalSection (&lock);
+ guard.done = 1;
+ }
+ else
+ {
+ /* Don't let guard.started grow and wrap around. */
+ InterlockedDecrement (&guard.started);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this mutex. */
+ while (!guard.done)
+ Sleep (0);
+ }
+ }
+ return &lock;
+}
+
+# elif HAVE_PTHREAD_API
+
+# include <pthread.h>
+
+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+
+/* Make sure the function gets exported from shared libraries. */
+DLL_EXPORTED pthread_mutex_t *gl_get_nl_langinfo_lock (void);
+
+/* Returns the internal lock used by nl_langinfo. */
+pthread_mutex_t *
+gl_get_nl_langinfo_lock (void)
+{
+ return &mutex;
+}
+
+# elif HAVE_THREADS_H
+
+# include <threads.h>
+# include <stdlib.h>
+
+static int volatile init_needed = 1;
+static once_flag init_once = ONCE_FLAG_INIT;
+static mtx_t mutex;
+
+static void
+atomic_init (void)
+{
+ if (mtx_init (&mutex, mtx_plain) != thrd_success)
+ abort ();
+ init_needed = 0;
+}
+
+/* Make sure the function gets exported from shared libraries. */
+DLL_EXPORTED mtx_t *gl_get_nl_langinfo_lock (void);
+
+/* Returns the internal lock used by nl_langinfo. */
+mtx_t *
+gl_get_nl_langinfo_lock (void)
+{
+ if (init_needed)
+ call_once (&init_once, atomic_init);
+ return &mutex;
+}
+
+# endif
+
+# if (defined _WIN32 || defined __CYGWIN__) && !defined _MSC_VER
+/* Make sure the '__declspec(dllimport)' in nl_langinfo.c does not cause
+ a link failure when no DLLs are involved. */
+# if defined _WIN64 || defined _LP64
+# define IMP(x) __imp_##x
+# else
+# define IMP(x) _imp__##x
+# endif
+void * IMP(gl_get_nl_langinfo_lock) = &gl_get_nl_langinfo_lock;
+# endif
+
+#endif
diff --git a/gl/lib/nl_langinfo.c b/gl/lib/nl_langinfo.c
new file mode 100644
index 0000000..3fa4782
--- /dev/null
+++ b/gl/lib/nl_langinfo.c
@@ -0,0 +1,572 @@
+/* nl_langinfo() replacement: query locale dependent information.
+
+ Copyright (C) 2007-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <langinfo.h>
+
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#if defined _WIN32 && ! defined __CYGWIN__
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+# include <stdio.h>
+#endif
+
+#if REPLACE_NL_LANGINFO && !NL_LANGINFO_MTSAFE
+# if defined _WIN32 && !defined __CYGWIN__
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# elif HAVE_PTHREAD_API
+
+# include <pthread.h>
+# if HAVE_THREADS_H && HAVE_WEAK_SYMBOLS
+# include <threads.h>
+# pragma weak thrd_exit
+# define c11_threads_in_use() (thrd_exit != NULL)
+# else
+# define c11_threads_in_use() 0
+# endif
+
+# elif HAVE_THREADS_H
+
+# include <threads.h>
+
+# endif
+#endif
+
+/* nl_langinfo() must be multithread-safe. To achieve this without using
+ thread-local storage:
+ 1. We use a specific static buffer for each possible argument.
+ So that different threads can call nl_langinfo with different arguments,
+ without interfering.
+ 2. We use a simple strcpy or memcpy to fill this static buffer. Filling it
+ through, for example, strcpy + strcat would not be guaranteed to leave
+ the buffer's contents intact if another thread is currently accessing
+ it. If necessary, the contents is first assembled in a stack-allocated
+ buffer. */
+
+#if !REPLACE_NL_LANGINFO || GNULIB_defined_CODESET
+/* Return the codeset of the current locale, if this is easily deducible.
+ Otherwise, return "". */
+static char *
+ctype_codeset (void)
+{
+ static char result[2 + 10 + 1];
+ char buf[2 + 10 + 1];
+ char locale[SETLOCALE_NULL_MAX];
+ char *codeset;
+ size_t codesetlen;
+
+ if (setlocale_null_r (LC_CTYPE, locale, sizeof (locale)))
+ locale[0] = '\0';
+
+ codeset = buf;
+ codeset[0] = '\0';
+
+ if (locale[0])
+ {
+ /* If the locale name contains an encoding after the dot, return it. */
+ char *dot = strchr (locale, '.');
+
+ if (dot)
+ {
+ /* Look for the possible @... trailer and remove it, if any. */
+ char *codeset_start = dot + 1;
+ char const *modifier = strchr (codeset_start, '@');
+
+ if (! modifier)
+ codeset = codeset_start;
+ else
+ {
+ codesetlen = modifier - codeset_start;
+ if (codesetlen < sizeof buf)
+ {
+ codeset = memcpy (buf, codeset_start, codesetlen);
+ codeset[codesetlen] = '\0';
+ }
+ }
+ }
+ }
+
+# if defined _WIN32 && ! defined __CYGWIN__
+ /* If setlocale is successful, it returns the number of the
+ codepage, as a string. Otherwise, fall back on Windows API
+ GetACP, which returns the locale's codepage as a number (although
+ this doesn't change according to what the 'setlocale' call specified).
+ Either way, prepend "CP" to make it a valid codeset name. */
+ codesetlen = strlen (codeset);
+ if (0 < codesetlen && codesetlen < sizeof buf - 2)
+ memmove (buf + 2, codeset, codesetlen + 1);
+ else
+ sprintf (buf + 2, "%u", GetACP ());
+ /* For a locale name such as "French_France.65001", in Windows 10,
+ setlocale now returns "French_France.utf8" instead. */
+ if (strcmp (buf + 2, "65001") == 0 || strcmp (buf + 2, "utf8") == 0)
+ return (char *) "UTF-8";
+ else
+ {
+ memcpy (buf, "CP", 2);
+ strcpy (result, buf);
+ return result;
+ }
+# else
+ strcpy (result, codeset);
+ return result;
+#endif
+}
+#endif
+
+
+#if REPLACE_NL_LANGINFO
+
+/* Override nl_langinfo with support for added nl_item values. */
+
+# undef nl_langinfo
+
+/* Without locking, on Solaris 11.3, test-nl_langinfo-mt fails, with message
+ "thread5 disturbed by threadN!", even when threadN invokes only
+ nl_langinfo (CODESET);
+ nl_langinfo (CRNCYSTR);
+ Similarly on Solaris 10. */
+
+# if !NL_LANGINFO_MTSAFE /* Solaris */
+
+# define ITEMS (MAXSTRMSG + 1)
+# define MAX_RESULT_LEN 80
+
+static char *
+nl_langinfo_unlocked (nl_item item)
+{
+ static char result[ITEMS][MAX_RESULT_LEN];
+
+ /* The result of nl_langinfo is in storage that can be overwritten by
+ other calls to nl_langinfo. */
+ char *tmp = nl_langinfo (item);
+ if (item >= 0 && item < ITEMS && tmp != NULL)
+ {
+ size_t tmp_len = strlen (tmp);
+ if (tmp_len < MAX_RESULT_LEN)
+ strcpy (result[item], tmp);
+ else
+ {
+ /* Produce a truncated result. Oh well... */
+ result[item][MAX_RESULT_LEN - 1] = '\0';
+ memcpy (result[item], tmp, MAX_RESULT_LEN - 1);
+ }
+ return result[item];
+ }
+ else
+ return tmp;
+}
+
+/* Use a lock, so that no two threads can invoke nl_langinfo_unlocked
+ at the same time. */
+
+/* Prohibit renaming this symbol. */
+# undef gl_get_nl_langinfo_lock
+
+# if defined _WIN32 && !defined __CYGWIN__
+
+extern __declspec(dllimport) CRITICAL_SECTION *gl_get_nl_langinfo_lock (void);
+
+static char *
+nl_langinfo_with_lock (nl_item item)
+{
+ CRITICAL_SECTION *lock = gl_get_nl_langinfo_lock ();
+ char *ret;
+
+ EnterCriticalSection (lock);
+ ret = nl_langinfo_unlocked (item);
+ LeaveCriticalSection (lock);
+
+ return ret;
+}
+
+# elif HAVE_PTHREAD_API
+
+extern
+# if defined _WIN32 || defined __CYGWIN__
+ __declspec(dllimport)
+# endif
+ pthread_mutex_t *gl_get_nl_langinfo_lock (void);
+
+# if HAVE_WEAK_SYMBOLS /* musl libc, FreeBSD, NetBSD, OpenBSD, Haiku */
+
+ /* Avoid the need to link with '-lpthread'. */
+# pragma weak pthread_mutex_lock
+# pragma weak pthread_mutex_unlock
+
+ /* Determine whether libpthread is in use. */
+# pragma weak pthread_mutexattr_gettype
+ /* See the comments in lock.h. */
+# define pthread_in_use() \
+ (pthread_mutexattr_gettype != NULL || c11_threads_in_use ())
+
+# else
+# define pthread_in_use() 1
+# endif
+
+static char *
+nl_langinfo_with_lock (nl_item item)
+{
+ if (pthread_in_use())
+ {
+ pthread_mutex_t *lock = gl_get_nl_langinfo_lock ();
+ char *ret;
+
+ if (pthread_mutex_lock (lock))
+ abort ();
+ ret = nl_langinfo_unlocked (item);
+ if (pthread_mutex_unlock (lock))
+ abort ();
+
+ return ret;
+ }
+ else
+ return nl_langinfo_unlocked (item);
+}
+
+# elif HAVE_THREADS_H
+
+extern mtx_t *gl_get_nl_langinfo_lock (void);
+
+static char *
+nl_langinfo_with_lock (nl_item item)
+{
+ mtx_t *lock = gl_get_nl_langinfo_lock ();
+ char *ret;
+
+ if (mtx_lock (lock) != thrd_success)
+ abort ();
+ ret = nl_langinfo_unlocked (item);
+ if (mtx_unlock (lock) != thrd_success)
+ abort ();
+
+ return ret;
+}
+
+# endif
+
+# else
+
+/* On other platforms, no lock is needed. */
+# define nl_langinfo_with_lock nl_langinfo
+
+# endif
+
+char *
+rpl_nl_langinfo (nl_item item)
+{
+ switch (item)
+ {
+# if GNULIB_defined_CODESET
+ case CODESET:
+ return ctype_codeset ();
+# endif
+# if GNULIB_defined_T_FMT_AMPM
+ case T_FMT_AMPM:
+ return (char *) "%I:%M:%S %p";
+# endif
+# if GNULIB_defined_ALTMON
+ case ALTMON_1:
+ case ALTMON_2:
+ case ALTMON_3:
+ case ALTMON_4:
+ case ALTMON_5:
+ case ALTMON_6:
+ case ALTMON_7:
+ case ALTMON_8:
+ case ALTMON_9:
+ case ALTMON_10:
+ case ALTMON_11:
+ case ALTMON_12:
+ /* We don't ship the appropriate localizations with gnulib. Therefore,
+ treat ALTMON_i like MON_i. */
+ item = item - ALTMON_1 + MON_1;
+ break;
+# endif
+# if GNULIB_defined_ERA
+ case ERA:
+ /* The format is not standardized. In glibc it is a sequence of strings
+ of the form "direction:offset:start_date:end_date:era_name:era_format"
+ with an empty string at the end. */
+ return (char *) "";
+ case ERA_D_FMT:
+ /* The %Ex conversion in strftime behaves like %x if the locale does not
+ have an alternative time format. */
+ item = D_FMT;
+ break;
+ case ERA_D_T_FMT:
+ /* The %Ec conversion in strftime behaves like %c if the locale does not
+ have an alternative time format. */
+ item = D_T_FMT;
+ break;
+ case ERA_T_FMT:
+ /* The %EX conversion in strftime behaves like %X if the locale does not
+ have an alternative time format. */
+ item = T_FMT;
+ break;
+ case ALT_DIGITS:
+ /* The format is not standardized. In glibc it is a sequence of 10
+ strings, appended in memory. */
+ return (char *) "\0\0\0\0\0\0\0\0\0\0";
+# endif
+# if GNULIB_defined_YESEXPR || !FUNC_NL_LANGINFO_YESEXPR_WORKS
+ case YESEXPR:
+ return (char *) "^[yY]";
+ case NOEXPR:
+ return (char *) "^[nN]";
+# endif
+ default:
+ break;
+ }
+ return nl_langinfo_with_lock (item);
+}
+
+#else
+
+/* Provide nl_langinfo from scratch, either for native MS-Windows, or
+ for old Unix platforms without locales, such as Linux libc5 or
+ BeOS. */
+
+# include <time.h>
+
+char *
+nl_langinfo (nl_item item)
+{
+ char buf[100];
+ struct tm tmm = { 0 };
+
+ switch (item)
+ {
+ /* nl_langinfo items of the LC_CTYPE category */
+ case CODESET:
+ {
+ char *codeset = ctype_codeset ();
+ if (*codeset)
+ return codeset;
+ }
+# ifdef __BEOS__
+ return (char *) "UTF-8";
+# else
+ return (char *) "ISO-8859-1";
+# endif
+ /* nl_langinfo items of the LC_NUMERIC category */
+ case RADIXCHAR:
+ return localeconv () ->decimal_point;
+ case THOUSEP:
+ return localeconv () ->thousands_sep;
+# ifdef GROUPING
+ case GROUPING:
+ return localeconv () ->grouping;
+# endif
+ /* nl_langinfo items of the LC_TIME category.
+ TODO: Really use the locale. */
+ case D_T_FMT:
+ case ERA_D_T_FMT:
+ return (char *) "%a %b %e %H:%M:%S %Y";
+ case D_FMT:
+ case ERA_D_FMT:
+ return (char *) "%m/%d/%y";
+ case T_FMT:
+ case ERA_T_FMT:
+ return (char *) "%H:%M:%S";
+ case T_FMT_AMPM:
+ return (char *) "%I:%M:%S %p";
+ case AM_STR:
+ {
+ static char result[80];
+ if (!strftime (buf, sizeof result, "%p", &tmm))
+ return (char *) "AM";
+ strcpy (result, buf);
+ return result;
+ }
+ case PM_STR:
+ {
+ static char result[80];
+ tmm.tm_hour = 12;
+ if (!strftime (buf, sizeof result, "%p", &tmm))
+ return (char *) "PM";
+ strcpy (result, buf);
+ return result;
+ }
+ case DAY_1:
+ case DAY_2:
+ case DAY_3:
+ case DAY_4:
+ case DAY_5:
+ case DAY_6:
+ case DAY_7:
+ {
+ static char result[7][50];
+ static char const days[][sizeof "Wednesday"] = {
+ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
+ "Friday", "Saturday"
+ };
+ tmm.tm_wday = item - DAY_1;
+ if (!strftime (buf, sizeof result[0], "%A", &tmm))
+ return (char *) days[item - DAY_1];
+ strcpy (result[item - DAY_1], buf);
+ return result[item - DAY_1];
+ }
+ case ABDAY_1:
+ case ABDAY_2:
+ case ABDAY_3:
+ case ABDAY_4:
+ case ABDAY_5:
+ case ABDAY_6:
+ case ABDAY_7:
+ {
+ static char result[7][30];
+ static char const abdays[][sizeof "Sun"] = {
+ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+ };
+ tmm.tm_wday = item - ABDAY_1;
+ if (!strftime (buf, sizeof result[0], "%a", &tmm))
+ return (char *) abdays[item - ABDAY_1];
+ strcpy (result[item - ABDAY_1], buf);
+ return result[item - ABDAY_1];
+ }
+ {
+ static char const months[][sizeof "September"] = {
+ "January", "February", "March", "April", "May", "June", "July",
+ "September", "October", "November", "December"
+ };
+ case MON_1:
+ case MON_2:
+ case MON_3:
+ case MON_4:
+ case MON_5:
+ case MON_6:
+ case MON_7:
+ case MON_8:
+ case MON_9:
+ case MON_10:
+ case MON_11:
+ case MON_12:
+ {
+ static char result[12][50];
+ tmm.tm_mon = item - MON_1;
+ if (!strftime (buf, sizeof result[0], "%B", &tmm))
+ return (char *) months[item - MON_1];
+ strcpy (result[item - MON_1], buf);
+ return result[item - MON_1];
+ }
+ case ALTMON_1:
+ case ALTMON_2:
+ case ALTMON_3:
+ case ALTMON_4:
+ case ALTMON_5:
+ case ALTMON_6:
+ case ALTMON_7:
+ case ALTMON_8:
+ case ALTMON_9:
+ case ALTMON_10:
+ case ALTMON_11:
+ case ALTMON_12:
+ {
+ static char result[12][50];
+ tmm.tm_mon = item - ALTMON_1;
+ /* The platforms without nl_langinfo() don't support strftime with
+ %OB. We don't even need to try. */
+ #if 0
+ if (!strftime (buf, sizeof result[0], "%OB", &tmm))
+ #endif
+ if (!strftime (buf, sizeof result[0], "%B", &tmm))
+ return (char *) months[item - ALTMON_1];
+ strcpy (result[item - ALTMON_1], buf);
+ return result[item - ALTMON_1];
+ }
+ }
+ case ABMON_1:
+ case ABMON_2:
+ case ABMON_3:
+ case ABMON_4:
+ case ABMON_5:
+ case ABMON_6:
+ case ABMON_7:
+ case ABMON_8:
+ case ABMON_9:
+ case ABMON_10:
+ case ABMON_11:
+ case ABMON_12:
+ {
+ static char result[12][30];
+ static char const abmonths[][sizeof "Jan"] = {
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
+ "Sep", "Oct", "Nov", "Dec"
+ };
+ tmm.tm_mon = item - ABMON_1;
+ if (!strftime (buf, sizeof result[0], "%b", &tmm))
+ return (char *) abmonths[item - ABMON_1];
+ strcpy (result[item - ABMON_1], buf);
+ return result[item - ABMON_1];
+ }
+ case ERA:
+ return (char *) "";
+ case ALT_DIGITS:
+ return (char *) "\0\0\0\0\0\0\0\0\0\0";
+ /* nl_langinfo items of the LC_MONETARY category. */
+ case CRNCYSTR:
+ return localeconv () ->currency_symbol;
+# ifdef INT_CURR_SYMBOL
+ case INT_CURR_SYMBOL:
+ return localeconv () ->int_curr_symbol;
+ case MON_DECIMAL_POINT:
+ return localeconv () ->mon_decimal_point;
+ case MON_THOUSANDS_SEP:
+ return localeconv () ->mon_thousands_sep;
+ case MON_GROUPING:
+ return localeconv () ->mon_grouping;
+ case POSITIVE_SIGN:
+ return localeconv () ->positive_sign;
+ case NEGATIVE_SIGN:
+ return localeconv () ->negative_sign;
+ case FRAC_DIGITS:
+ return & localeconv () ->frac_digits;
+ case INT_FRAC_DIGITS:
+ return & localeconv () ->int_frac_digits;
+ case P_CS_PRECEDES:
+ return & localeconv () ->p_cs_precedes;
+ case N_CS_PRECEDES:
+ return & localeconv () ->n_cs_precedes;
+ case P_SEP_BY_SPACE:
+ return & localeconv () ->p_sep_by_space;
+ case N_SEP_BY_SPACE:
+ return & localeconv () ->n_sep_by_space;
+ case P_SIGN_POSN:
+ return & localeconv () ->p_sign_posn;
+ case N_SIGN_POSN:
+ return & localeconv () ->n_sign_posn;
+# endif
+ /* nl_langinfo items of the LC_MESSAGES category
+ TODO: Really use the locale. */
+ case YESEXPR:
+ return (char *) "^[yY]";
+ case NOEXPR:
+ return (char *) "^[nN]";
+ default:
+ return (char *) "";
+ }
+}
+
+#endif
diff --git a/gl/lib/nonblocking.c b/gl/lib/nonblocking.c
new file mode 100644
index 0000000..9ea31f7
--- /dev/null
+++ b/gl/lib/nonblocking.c
@@ -0,0 +1,163 @@
+/* Non-blocking I/O for pipe or socket descriptors.
+ Copyright (C) 2011-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "nonblocking.h"
+
+#include <errno.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+/* Native Windows API. */
+
+# include <sys/ioctl.h>
+# include <sys/socket.h>
+# include <unistd.h>
+
+/* Get declarations of the native Windows API functions. */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+
+/* Don't assume that UNICODE is not defined. */
+# undef GetNamedPipeHandleState
+# define GetNamedPipeHandleState GetNamedPipeHandleStateA
+
+int
+get_nonblocking_flag (int desc)
+{
+ HANDLE h = (HANDLE) _get_osfhandle (desc);
+ if (h == INVALID_HANDLE_VALUE)
+ {
+ errno = EBADF;
+ return -1;
+ }
+ if (GetFileType (h) == FILE_TYPE_PIPE)
+ {
+ /* h is a pipe or socket. */
+ DWORD state;
+ if (GetNamedPipeHandleState (h, &state, NULL, NULL, NULL, NULL, 0))
+ /* h is a pipe. */
+ return (state & PIPE_NOWAIT) != 0;
+ else
+ /* h is a socket. */
+ errno = ENOSYS;
+ return -1;
+ }
+ else
+ /* The native Windows API does not support non-blocking on regular
+ files. */
+ return 0;
+}
+
+int
+set_nonblocking_flag (int desc, bool value)
+{
+ HANDLE h = (HANDLE) _get_osfhandle (desc);
+ if (h == INVALID_HANDLE_VALUE)
+ {
+ errno = EBADF;
+ return -1;
+ }
+ if (GetFileType (h) == FILE_TYPE_PIPE)
+ {
+ /* h is a pipe or socket. */
+ DWORD state;
+ if (GetNamedPipeHandleState (h, &state, NULL, NULL, NULL, NULL, 0))
+ {
+ /* h is a pipe. */
+ if ((state & PIPE_NOWAIT) != 0)
+ {
+ if (value)
+ return 0;
+ state &= ~PIPE_NOWAIT;
+ }
+ else
+ {
+ if (!value)
+ return 0;
+ state |= PIPE_NOWAIT;
+ }
+ if (SetNamedPipeHandleState (h, &state, NULL, NULL))
+ return 0;
+ errno = EINVAL;
+ return -1;
+ }
+ else
+ {
+ /* h is a socket. */
+ int v = value;
+ return ioctl (desc, FIONBIO, &v);
+ }
+ }
+ else
+ {
+ /* The native Windows API does not support non-blocking on regular
+ files. */
+ if (!value)
+ return 0;
+ errno = ENOTSUP;
+ return -1;
+ }
+}
+
+#else
+/* Unix API. */
+
+# include <fcntl.h>
+
+# if GNULIB_defined_O_NONBLOCK
+# error Please port nonblocking to your platform
+# endif
+
+/* We don't need the gnulib replacement of fcntl() here. */
+# undef fcntl
+
+int
+get_nonblocking_flag (int desc)
+{
+ int fcntl_flags;
+
+ fcntl_flags = fcntl (desc, F_GETFL, 0);
+ if (fcntl_flags < 0)
+ return -1;
+ return (fcntl_flags & O_NONBLOCK) != 0;
+}
+
+int
+set_nonblocking_flag (int desc, bool value)
+{
+ int fcntl_flags;
+
+ fcntl_flags = fcntl (desc, F_GETFL, 0);
+ if (fcntl_flags < 0)
+ return -1;
+ if (((fcntl_flags & O_NONBLOCK) != 0) == value)
+ return 0;
+ if (value)
+ fcntl_flags |= O_NONBLOCK;
+ else
+ fcntl_flags &= ~O_NONBLOCK;
+ return fcntl (desc, F_SETFL, fcntl_flags);
+}
+
+#endif
diff --git a/gl/lib/nonblocking.h b/gl/lib/nonblocking.h
new file mode 100644
index 0000000..8e00fd7
--- /dev/null
+++ b/gl/lib/nonblocking.h
@@ -0,0 +1,62 @@
+/* Non-blocking I/O for pipe or socket descriptors.
+ Copyright (C) 2011-2022 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 2.1 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/>. */
+
+#ifndef _NONBLOCKING_H
+#define _NONBLOCKING_H
+
+#include <stdbool.h>
+
+/* Non-blocking I/O is an I/O mode by which read(), write() calls avoid
+ blocking the current thread. When non-blocking is enabled:
+ - A read() call returns -1 with errno set to EAGAIN when no data or EOF
+ information is immediately available.
+ - A write() call returns -1 with errno set to EAGAIN when it cannot
+ transport the requested amount of data (but at most one pipe buffer)
+ without blocking.
+ Non-blocking I/O is most useful for character devices, pipes, and sockets.
+ Whether it also works on regular files and block devices is platform
+ dependent.
+
+ There are three modern alternatives to non-blocking I/O:
+ - use select() or poll() followed by read() or write() if the descriptor
+ is ready,
+ - call read() or write() in separate threads,
+ - use <aio.h> interfaces. */
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Return 1 if I/O to the descriptor DESC is currently non-blocking, 0
+ it is blocking, or -1 with errno set if fd is invalid or blocking
+ status cannot be determined (such as with sockets on mingw). */
+extern int get_nonblocking_flag (int desc);
+
+/* Specify the non-blocking flag for the descriptor DESC.
+ Return 0 upon success, or -1 with errno set upon failure.
+ The default depends on the presence of the O_NONBLOCK flag for files
+ or pipes opened with open() or on the presence of the SOCK_NONBLOCK
+ flag for sockets. */
+extern int set_nonblocking_flag (int desc, bool value);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _NONBLOCKING_H */
diff --git a/gl/lib/open.c b/gl/lib/open.c
new file mode 100644
index 0000000..170bff1
--- /dev/null
+++ b/gl/lib/open.c
@@ -0,0 +1,209 @@
+/* Open a descriptor to a file.
+ Copyright (C) 2007-2022 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 2.1 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>, 2007. */
+
+/* If the user's config.h happens to include <fcntl.h>, let it include only
+ the system's <fcntl.h> here, so that orig_open doesn't recurse to
+ rpl_open. */
+#define __need_system_fcntl_h
+#include <config.h>
+
+/* Get the original definition of open. It might be defined as a macro. */
+#include <fcntl.h>
+#include <sys/types.h>
+#undef __need_system_fcntl_h
+
+static int
+orig_open (const char *filename, int flags, mode_t mode)
+{
+#if defined _WIN32 && !defined __CYGWIN__
+ return _open (filename, flags, mode);
+#else
+ return open (filename, flags, mode);
+#endif
+}
+
+/* Specification. */
+/* Write "fcntl.h" here, not <fcntl.h>, otherwise OSF/1 5.1 DTK cc eliminates
+ this include because of the preliminary #include <fcntl.h> above. */
+#include "fcntl.h"
+
+#include "cloexec.h"
+
+#include <errno.h>
+#include <stdarg.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#ifndef REPLACE_OPEN_DIRECTORY
+# define REPLACE_OPEN_DIRECTORY 0
+#endif
+
+int
+open (const char *filename, int flags, ...)
+{
+ /* 0 = unknown, 1 = yes, -1 = no. */
+#if GNULIB_defined_O_CLOEXEC
+ int have_cloexec = -1;
+#else
+ static int have_cloexec;
+#endif
+
+ mode_t mode;
+ int fd;
+
+ mode = 0;
+ if (flags & O_CREAT)
+ {
+ va_list arg;
+ va_start (arg, flags);
+
+ /* We have to use PROMOTED_MODE_T instead of mode_t, otherwise GCC 4
+ creates crashing code when 'mode_t' is smaller than 'int'. */
+ mode = va_arg (arg, PROMOTED_MODE_T);
+
+ va_end (arg);
+ }
+
+#if GNULIB_defined_O_NONBLOCK
+ /* The only known platform that lacks O_NONBLOCK is mingw, but it
+ also lacks named pipes and Unix sockets, which are the only two
+ file types that require non-blocking handling in open().
+ Therefore, it is safe to ignore O_NONBLOCK here. It is handy
+ that mingw also lacks openat(), so that is also covered here. */
+ flags &= ~O_NONBLOCK;
+#endif
+
+#if defined _WIN32 && ! defined __CYGWIN__
+ if (strcmp (filename, "/dev/null") == 0)
+ filename = "NUL";
+#endif
+
+#if OPEN_TRAILING_SLASH_BUG
+ /* Fail if one of O_CREAT, O_WRONLY, O_RDWR is specified and the filename
+ ends in a slash, as POSIX says such a filename must name a directory
+ <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>:
+ "A pathname that contains at least one non-<slash> character and that
+ ends with one or more trailing <slash> characters shall not be resolved
+ successfully unless the last pathname component before the trailing
+ <slash> characters names an existing directory"
+ If the named file already exists as a directory, then
+ - if O_CREAT is specified, open() must fail because of the semantics
+ of O_CREAT,
+ - if O_WRONLY or O_RDWR is specified, open() must fail because POSIX
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html>
+ says that it fails with errno = EISDIR in this case.
+ If the named file does not exist or does not name a directory, then
+ - if O_CREAT is specified, open() must fail since open() cannot create
+ directories,
+ - if O_WRONLY or O_RDWR is specified, open() must fail because the
+ file does not contain a '.' directory. */
+ if ((flags & O_CREAT)
+ || (flags & O_ACCMODE) == O_RDWR
+ || (flags & O_ACCMODE) == O_WRONLY)
+ {
+ size_t len = strlen (filename);
+ if (len > 0 && filename[len - 1] == '/')
+ {
+ errno = EISDIR;
+ return -1;
+ }
+ }
+#endif
+
+ fd = orig_open (filename,
+ flags & ~(have_cloexec < 0 ? O_CLOEXEC : 0), mode);
+
+ if (flags & O_CLOEXEC)
+ {
+ if (! have_cloexec)
+ {
+ if (0 <= fd)
+ have_cloexec = 1;
+ else if (errno == EINVAL)
+ {
+ fd = orig_open (filename, flags & ~O_CLOEXEC, mode);
+ have_cloexec = -1;
+ }
+ }
+ if (have_cloexec < 0 && 0 <= fd)
+ set_cloexec_flag (fd, true);
+ }
+
+
+#if REPLACE_FCHDIR
+ /* Implementing fchdir and fdopendir requires the ability to open a
+ directory file descriptor. If open doesn't support that (as on
+ mingw), we use a dummy file that behaves the same as directories
+ on Linux (ie. always reports EOF on attempts to read()), and
+ override fstat() in fchdir.c to hide the fact that we have a
+ dummy. */
+ if (REPLACE_OPEN_DIRECTORY && fd < 0 && errno == EACCES
+ && ((flags & O_ACCMODE) == O_RDONLY
+ || (O_SEARCH != O_RDONLY && (flags & O_ACCMODE) == O_SEARCH)))
+ {
+ struct stat statbuf;
+ if (stat (filename, &statbuf) == 0 && S_ISDIR (statbuf.st_mode))
+ {
+ /* Maximum recursion depth of 1. */
+ fd = open ("/dev/null", flags, mode);
+ if (0 <= fd)
+ fd = _gl_register_fd (fd, filename);
+ }
+ else
+ errno = EACCES;
+ }
+#endif
+
+#if OPEN_TRAILING_SLASH_BUG
+ /* If the filename ends in a slash and fd does not refer to a directory,
+ then fail.
+ Rationale: POSIX says such a filename must name a directory
+ <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>:
+ "A pathname that contains at least one non-<slash> character and that
+ ends with one or more trailing <slash> characters shall not be resolved
+ successfully unless the last pathname component before the trailing
+ <slash> characters names an existing directory"
+ If the named file without the slash is not a directory, open() must fail
+ with ENOTDIR. */
+ if (fd >= 0)
+ {
+ /* We know len is positive, since open did not fail with ENOENT. */
+ size_t len = strlen (filename);
+ if (filename[len - 1] == '/')
+ {
+ struct stat statbuf;
+
+ if (fstat (fd, &statbuf) >= 0 && !S_ISDIR (statbuf.st_mode))
+ {
+ close (fd);
+ errno = ENOTDIR;
+ return -1;
+ }
+ }
+ }
+#endif
+
+#if REPLACE_FCHDIR
+ if (!REPLACE_OPEN_DIRECTORY && 0 <= fd)
+ fd = _gl_register_fd (fd, filename);
+#endif
+
+ return fd;
+}
diff --git a/gl/lib/openat-die.c b/gl/lib/openat-die.c
new file mode 100644
index 0000000..486d06c
--- /dev/null
+++ b/gl/lib/openat-die.c
@@ -0,0 +1,62 @@
+/* Report a save- or restore-cwd failure in our openat replacement and then exit.
+
+ Copyright (C) 2005-2006, 2008-2022 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 "openat.h"
+
+#include <stdlib.h>
+
+#ifndef GNULIB_LIBPOSIX
+# include "error.h"
+#endif
+
+#include "exitfail.h"
+
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
+_Noreturn void
+openat_save_fail (int errnum)
+{
+#ifndef GNULIB_LIBPOSIX
+ error (exit_failure, errnum,
+ _("unable to record current working directory"));
+#endif
+ /* _Noreturn cannot be applied to error, since it returns
+ when its first argument is 0. To help compilers understand that this
+ function does not return, call abort. Also, the abort is a
+ safety feature if exit_failure is 0 (which shouldn't happen). */
+ abort ();
+}
+
+
+/* Exit with an error about failure to restore the working directory
+ during an openat emulation. The caller must ensure that fd 2 is
+ not a just-opened fd, even when openat_safer is not in use. */
+
+_Noreturn void
+openat_restore_fail (int errnum)
+{
+#ifndef GNULIB_LIBPOSIX
+ error (exit_failure, errnum,
+ _("failed to return to initial working directory"));
+#endif
+
+ /* As above. */
+ abort ();
+}
diff --git a/gl/lib/openat-priv.h b/gl/lib/openat-priv.h
new file mode 100644
index 0000000..5d60810
--- /dev/null
+++ b/gl/lib/openat-priv.h
@@ -0,0 +1,64 @@
+/* Internals for openat-like functions.
+
+ Copyright (C) 2005-2006, 2009-2022 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 */
+
+#ifndef _GL_HEADER_OPENAT_PRIV
+#define _GL_HEADER_OPENAT_PRIV
+
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+
+/* Maximum number of bytes that it is safe to allocate as a single
+ array on the stack, and that is known as a compile-time constant.
+ The assumption is that we'll touch the array very quickly, or a
+ temporary very near the array, provoking an out-of-memory trap. On
+ some operating systems, there is only one guard page for the stack,
+ and a page size can be as small as 4096 bytes. Subtract 64 in the
+ hope that this will let the compiler touch a nearby temporary and
+ provoke a trap. */
+#define SAFER_ALLOCA_MAX (4096 - 64)
+
+#define SAFER_ALLOCA(m) ((m) < SAFER_ALLOCA_MAX ? (m) : SAFER_ALLOCA_MAX)
+
+#if defined PATH_MAX
+# define OPENAT_BUFFER_SIZE SAFER_ALLOCA (PATH_MAX)
+#elif defined _XOPEN_PATH_MAX
+# define OPENAT_BUFFER_SIZE SAFER_ALLOCA (_XOPEN_PATH_MAX)
+#else
+# define OPENAT_BUFFER_SIZE SAFER_ALLOCA (1024)
+#endif
+
+char *openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file);
+
+/* Trying to access a BUILD_PROC_NAME file will fail on systems without
+ /proc support, and even on systems *with* ProcFS support. Return
+ nonzero if the failure may be legitimate, e.g., because /proc is not
+ readable, or the particular .../fd/N directory is not present. */
+#define EXPECTED_ERRNO(Errno) \
+ ((Errno) == ENOTDIR || (Errno) == ENOENT \
+ || (Errno) == EPERM || (Errno) == EACCES \
+ || (Errno) == ENOSYS /* Solaris 8 */ \
+ || (Errno) == EOPNOTSUPP /* FreeBSD */)
+
+/* Wrapper function shared among linkat and renameat. */
+int at_func2 (int fd1, char const *file1,
+ int fd2, char const *file2,
+ int (*func) (char const *file1, char const *file2));
+
+#endif /* _GL_HEADER_OPENAT_PRIV */
diff --git a/gl/lib/openat-proc.c b/gl/lib/openat-proc.c
new file mode 100644
index 0000000..3bacf7d
--- /dev/null
+++ b/gl/lib/openat-proc.c
@@ -0,0 +1,135 @@
+/* Create /proc/self/fd-related names for subfiles of open directories.
+
+ Copyright (C) 2006, 2009-2022 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 "openat-priv.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#ifdef __KLIBC__
+# include <InnoTekLIBC/backend.h>
+#endif
+
+#include "intprops.h"
+
+/* Set BUF to the name of the subfile of the directory identified by
+ FD, where the subfile is named FILE. If successful, return BUF if
+ the result fits in BUF, dynamically allocated memory otherwise.
+ Return NULL (setting errno) on error. */
+char *
+openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file)
+{
+ char *result = buf;
+ int dirlen;
+
+ /* Make sure the caller gets ENOENT when appropriate. */
+ if (!*file)
+ {
+ buf[0] = '\0';
+ return buf;
+ }
+
+#ifndef __KLIBC__
+# define PROC_SELF_FD_FORMAT "/proc/self/fd/%d/"
+ {
+ enum {
+ PROC_SELF_FD_DIR_SIZE_BOUND
+ = (sizeof PROC_SELF_FD_FORMAT - (sizeof "%d" - 1)
+ + INT_STRLEN_BOUND (int))
+ };
+
+ static int proc_status = 0;
+ if (! proc_status)
+ {
+ /* Set PROC_STATUS to a positive value if /proc/self/fd is
+ reliable, and a negative value otherwise. Solaris 10
+ /proc/self/fd mishandles "..", and any file name might expand
+ to ".." after symbolic link expansion, so avoid /proc/self/fd
+ if it mishandles "..". Solaris 10 has openat, but this
+ problem is exhibited on code that built on Solaris 8 and
+ running on Solaris 10. */
+
+ int proc_self_fd =
+ open ("/proc/self/fd",
+ O_SEARCH | O_DIRECTORY | O_NOCTTY | O_NONBLOCK | O_CLOEXEC);
+ if (proc_self_fd < 0)
+ proc_status = -1;
+ else
+ {
+ /* Detect whether /proc/self/fd/%i/../fd exists, where %i is the
+ number of a file descriptor open on /proc/self/fd. On Linux,
+ that name resolves to /proc/self/fd, which was opened above.
+ However, on Solaris, it may resolve to /proc/self/fd/fd, which
+ cannot exist, since all names in /proc/self/fd are numeric. */
+ char dotdot_buf[PROC_SELF_FD_DIR_SIZE_BOUND + sizeof "../fd" - 1];
+ sprintf (dotdot_buf, PROC_SELF_FD_FORMAT "../fd", proc_self_fd);
+ proc_status = access (dotdot_buf, F_OK) ? -1 : 1;
+ close (proc_self_fd);
+ }
+ }
+
+ if (proc_status < 0)
+ return NULL;
+ else
+ {
+ size_t bufsize = PROC_SELF_FD_DIR_SIZE_BOUND + strlen (file);
+ if (OPENAT_BUFFER_SIZE < bufsize)
+ {
+ result = malloc (bufsize);
+ if (! result)
+ return NULL;
+ }
+
+ dirlen = sprintf (result, PROC_SELF_FD_FORMAT, fd);
+ }
+ }
+#else
+ /* OS/2 kLIBC provides a function to retrieve a path from a fd. */
+ {
+ char dir[_MAX_PATH];
+ size_t bufsize;
+
+ if (__libc_Back_ioFHToPath (fd, dir, sizeof dir))
+ return NULL;
+
+ dirlen = strlen (dir);
+ bufsize = dirlen + 1 + strlen (file) + 1; /* 1 for '/', 1 for null */
+ if (OPENAT_BUFFER_SIZE < bufsize)
+ {
+ result = malloc (bufsize);
+ if (! result)
+ return NULL;
+ }
+
+ strcpy (result, dir);
+ result[dirlen++] = '/';
+ }
+#endif
+
+ strcpy (result + dirlen, file);
+ return result;
+}
diff --git a/gl/lib/openat.c b/gl/lib/openat.c
new file mode 100644
index 0000000..52aab19
--- /dev/null
+++ b/gl/lib/openat.c
@@ -0,0 +1,312 @@
+/* provide a replacement openat function
+ Copyright (C) 2004-2022 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 */
+
+/* If the user's config.h happens to include <fcntl.h>, let it include only
+ the system's <fcntl.h> here, so that orig_openat doesn't recurse to
+ rpl_openat. */
+#define __need_system_fcntl_h
+#include <config.h>
+
+/* Get the original definition of open. It might be defined as a macro. */
+#include <fcntl.h>
+#include <sys/types.h>
+#undef __need_system_fcntl_h
+
+#if HAVE_OPENAT
+static int
+orig_openat (int fd, char const *filename, int flags, mode_t mode)
+{
+ return openat (fd, filename, flags, mode);
+}
+#endif
+
+/* Write "fcntl.h" here, not <fcntl.h>, otherwise OSF/1 5.1 DTK cc eliminates
+ this include because of the preliminary #include <fcntl.h> above. */
+#include "fcntl.h"
+
+#include "openat.h"
+
+#include "cloexec.h"
+
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <errno.h>
+
+#if HAVE_OPENAT
+
+/* Like openat, but support O_CLOEXEC and work around Solaris 9 bugs
+ with trailing slash. */
+int
+rpl_openat (int dfd, char const *filename, int flags, ...)
+{
+ /* 0 = unknown, 1 = yes, -1 = no. */
+#if GNULIB_defined_O_CLOEXEC
+ int have_cloexec = -1;
+#else
+ static int have_cloexec;
+#endif
+
+ mode_t mode;
+ int fd;
+
+ mode = 0;
+ if (flags & O_CREAT)
+ {
+ va_list arg;
+ va_start (arg, flags);
+
+ /* We have to use PROMOTED_MODE_T instead of mode_t, otherwise GCC 4
+ creates crashing code when 'mode_t' is smaller than 'int'. */
+ mode = va_arg (arg, PROMOTED_MODE_T);
+
+ va_end (arg);
+ }
+
+# if OPEN_TRAILING_SLASH_BUG
+ /* Fail if one of O_CREAT, O_WRONLY, O_RDWR is specified and the filename
+ ends in a slash, as POSIX says such a filename must name a directory
+ <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>:
+ "A pathname that contains at least one non-<slash> character and that
+ ends with one or more trailing <slash> characters shall not be resolved
+ successfully unless the last pathname component before the trailing
+ <slash> characters names an existing directory"
+ If the named file already exists as a directory, then
+ - if O_CREAT is specified, open() must fail because of the semantics
+ of O_CREAT,
+ - if O_WRONLY or O_RDWR is specified, open() must fail because POSIX
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/openat.html>
+ says that it fails with errno = EISDIR in this case.
+ If the named file does not exist or does not name a directory, then
+ - if O_CREAT is specified, open() must fail since open() cannot create
+ directories,
+ - if O_WRONLY or O_RDWR is specified, open() must fail because the
+ file does not contain a '.' directory. */
+ if ((flags & O_CREAT)
+ || (flags & O_ACCMODE) == O_RDWR
+ || (flags & O_ACCMODE) == O_WRONLY)
+ {
+ size_t len = strlen (filename);
+ if (len > 0 && filename[len - 1] == '/')
+ {
+ errno = EISDIR;
+ return -1;
+ }
+ }
+# endif
+
+ fd = orig_openat (dfd, filename,
+ flags & ~(have_cloexec < 0 ? O_CLOEXEC : 0), mode);
+
+ if (flags & O_CLOEXEC)
+ {
+ if (! have_cloexec)
+ {
+ if (0 <= fd)
+ have_cloexec = 1;
+ else if (errno == EINVAL)
+ {
+ fd = orig_openat (dfd, filename, flags & ~O_CLOEXEC, mode);
+ have_cloexec = -1;
+ }
+ }
+ if (have_cloexec < 0 && 0 <= fd)
+ set_cloexec_flag (fd, true);
+ }
+
+
+# if OPEN_TRAILING_SLASH_BUG
+ /* If the filename ends in a slash and fd does not refer to a directory,
+ then fail.
+ Rationale: POSIX says such a filename must name a directory
+ <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>:
+ "A pathname that contains at least one non-<slash> character and that
+ ends with one or more trailing <slash> characters shall not be resolved
+ successfully unless the last pathname component before the trailing
+ <slash> characters names an existing directory"
+ If the named file without the slash is not a directory, open() must fail
+ with ENOTDIR. */
+ if (fd >= 0)
+ {
+ /* We know len is positive, since open did not fail with ENOENT. */
+ size_t len = strlen (filename);
+ if (filename[len - 1] == '/')
+ {
+ struct stat statbuf;
+
+ if (fstat (fd, &statbuf) >= 0 && !S_ISDIR (statbuf.st_mode))
+ {
+ close (fd);
+ errno = ENOTDIR;
+ return -1;
+ }
+ }
+ }
+# endif
+
+ return fd;
+}
+
+#else /* !HAVE_OPENAT */
+
+# include "filename.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
+# include "openat-priv.h"
+# include "save-cwd.h"
+
+/* Replacement for Solaris' openat function.
+ <https://www.google.com/search?q=openat+site:docs.oracle.com>
+ First, try to simulate it via open ("/proc/self/fd/FD/FILE").
+ Failing that, simulate it by doing save_cwd/fchdir/open/restore_cwd.
+ If either the save_cwd or the restore_cwd fails (relatively unlikely),
+ then give a diagnostic and exit nonzero.
+ Otherwise, upon failure, set errno and return -1, as openat does.
+ Upon successful completion, return a file descriptor. */
+int
+openat (int fd, char const *file, int flags, ...)
+{
+ mode_t mode = 0;
+
+ if (flags & O_CREAT)
+ {
+ va_list arg;
+ va_start (arg, flags);
+
+ /* We have to use PROMOTED_MODE_T instead of mode_t, otherwise GCC 4
+ creates crashing code when 'mode_t' is smaller than 'int'. */
+ mode = va_arg (arg, PROMOTED_MODE_T);
+
+ va_end (arg);
+ }
+
+ return openat_permissive (fd, file, flags, mode, NULL);
+}
+
+/* Like openat (FD, FILE, FLAGS, MODE), but if CWD_ERRNO is
+ nonnull, set *CWD_ERRNO to an errno value if unable to save
+ or restore the initial working directory. This is needed only
+ the first time remove.c's remove_dir opens a command-line
+ directory argument.
+
+ If a previous attempt to restore the current working directory
+ failed, then we must not even try to access a '.'-relative name.
+ It is the caller's responsibility not to call this function
+ in that case. */
+
+int
+openat_permissive (int fd, char const *file, int flags, mode_t mode,
+ int *cwd_errno)
+{
+ struct saved_cwd saved_cwd;
+ int saved_errno;
+ int err;
+ bool save_ok;
+
+ if (fd == AT_FDCWD || IS_ABSOLUTE_FILE_NAME (file))
+ return open (file, flags, mode);
+
+ {
+ char buf[OPENAT_BUFFER_SIZE];
+ char *proc_file = openat_proc_name (buf, fd, file);
+ if (proc_file)
+ {
+ int open_result = open (proc_file, flags, mode);
+ int open_errno = errno;
+ if (proc_file != buf)
+ free (proc_file);
+ /* If the syscall succeeds, or if it fails with an unexpected
+ errno value, then return right away. Otherwise, fall through
+ and resort to using save_cwd/restore_cwd. */
+ if (0 <= open_result || ! EXPECTED_ERRNO (open_errno))
+ {
+ errno = open_errno;
+ return open_result;
+ }
+ }
+ }
+
+ save_ok = (save_cwd (&saved_cwd) == 0);
+ if (! save_ok)
+ {
+ if (! cwd_errno)
+ openat_save_fail (errno);
+ *cwd_errno = errno;
+ }
+ if (0 <= fd && fd == saved_cwd.desc)
+ {
+ /* If saving the working directory collides with the user's
+ requested fd, then the user's fd must have been closed to
+ begin with. */
+ free_cwd (&saved_cwd);
+ errno = EBADF;
+ return -1;
+ }
+
+ err = fchdir (fd);
+ saved_errno = errno;
+
+ if (! err)
+ {
+ err = open (file, flags, mode);
+ saved_errno = errno;
+ if (save_ok && restore_cwd (&saved_cwd) != 0)
+ {
+ if (! cwd_errno)
+ {
+ /* Don't write a message to just-created fd 2. */
+ saved_errno = errno;
+ if (err == STDERR_FILENO)
+ close (err);
+ openat_restore_fail (saved_errno);
+ }
+ *cwd_errno = errno;
+ }
+ }
+
+ free_cwd (&saved_cwd);
+ errno = saved_errno;
+ return err;
+}
+
+/* Return true if our openat implementation must resort to
+ using save_cwd and restore_cwd. */
+bool
+openat_needs_fchdir (void)
+{
+ bool needs_fchdir = true;
+ int fd = open ("/", O_SEARCH | O_CLOEXEC);
+
+ if (0 <= fd)
+ {
+ char buf[OPENAT_BUFFER_SIZE];
+ char *proc_file = openat_proc_name (buf, fd, ".");
+ if (proc_file)
+ {
+ needs_fchdir = false;
+ if (proc_file != buf)
+ free (proc_file);
+ }
+ close (fd);
+ }
+
+ return needs_fchdir;
+}
+
+#endif /* !HAVE_OPENAT */
diff --git a/gl/lib/openat.h b/gl/lib/openat.h
new file mode 100644
index 0000000..56919ef
--- /dev/null
+++ b/gl/lib/openat.h
@@ -0,0 +1,125 @@
+/* provide a replacement openat function
+ Copyright (C) 2004-2006, 2008-2022 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 */
+
+#ifndef _GL_HEADER_OPENAT
+#define _GL_HEADER_OPENAT
+
+#include <fcntl.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <stdbool.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+
+#if !HAVE_OPENAT
+
+int openat_permissive (int fd, char const *file, int flags, mode_t mode,
+ int *cwd_errno);
+bool openat_needs_fchdir (void);
+
+#else
+
+# define openat_permissive(Fd, File, Flags, Mode, Cwd_errno) \
+ openat (Fd, File, Flags, Mode)
+# define openat_needs_fchdir() false
+
+#endif
+
+_Noreturn void openat_restore_fail (int);
+_Noreturn void openat_save_fail (int);
+
+/* Using these function names makes application code
+ slightly more readable than it would be with
+ fchownat (..., 0) or fchownat (..., AT_SYMLINK_NOFOLLOW). */
+
+#if GNULIB_CHOWNAT
+
+# ifndef CHOWNAT_INLINE
+# define CHOWNAT_INLINE _GL_INLINE
+# endif
+
+CHOWNAT_INLINE int
+chownat (int fd, char const *file, uid_t owner, gid_t group)
+{
+ return fchownat (fd, file, owner, group, 0);
+}
+
+CHOWNAT_INLINE int
+lchownat (int fd, char const *file, uid_t owner, gid_t group)
+{
+ return fchownat (fd, file, owner, group, AT_SYMLINK_NOFOLLOW);
+}
+
+#endif
+
+#if GNULIB_CHMODAT
+
+# ifndef CHMODAT_INLINE
+# define CHMODAT_INLINE _GL_INLINE
+# endif
+
+CHMODAT_INLINE int
+chmodat (int fd, char const *file, mode_t mode)
+{
+ return fchmodat (fd, file, mode, 0);
+}
+
+CHMODAT_INLINE int
+lchmodat (int fd, char const *file, mode_t mode)
+{
+ return fchmodat (fd, file, mode, AT_SYMLINK_NOFOLLOW);
+}
+
+#endif
+
+#if GNULIB_STATAT
+
+# ifndef STATAT_INLINE
+# define STATAT_INLINE _GL_INLINE
+# endif
+
+_GL_ATTRIBUTE_DEPRECATED
+STATAT_INLINE int
+statat (int fd, char const *name, struct stat *st)
+{
+ return fstatat (fd, name, st, 0);
+}
+
+_GL_ATTRIBUTE_DEPRECATED
+STATAT_INLINE int
+lstatat (int fd, char const *name, struct stat *st)
+{
+ return fstatat (fd, name, st, AT_SYMLINK_NOFOLLOW);
+}
+
+#endif
+
+/* For now, there are no wrappers named laccessat or leuidaccessat,
+ since gnulib doesn't support faccessat(,AT_SYMLINK_NOFOLLOW) and
+ since access rights on symlinks are of limited utility. Likewise,
+ wrappers are not provided for accessat or euidaccessat, so as to
+ avoid dragging in -lgen on some platforms. */
+
+_GL_INLINE_HEADER_END
+
+#endif /* _GL_HEADER_OPENAT */
diff --git a/gl/lib/opendir.c b/gl/lib/opendir.c
new file mode 100644
index 0000000..fc6b455
--- /dev/null
+++ b/gl/lib/opendir.c
@@ -0,0 +1,179 @@
+/* Start reading the entries of a directory.
+ Copyright (C) 2006-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <dirent.h>
+
+#include <errno.h>
+#include <stddef.h>
+
+#if HAVE_OPENDIR
+
+/* Override opendir(), to keep track of the open file descriptors.
+ Needed because there is a function dirfd(). */
+
+#else
+
+# include <stdlib.h>
+
+# include "dirent-private.h"
+# include "filename.h"
+
+#endif
+
+#if REPLACE_FCHDIR
+# include <unistd.h>
+#endif
+
+#ifdef __KLIBC__
+# include <io.h>
+# include <fcntl.h>
+#endif
+
+#if defined _WIN32 && ! defined __CYGWIN__
+/* Don't assume that UNICODE is not defined. */
+# undef WIN32_FIND_DATA
+# define WIN32_FIND_DATA WIN32_FIND_DATAA
+# undef GetFullPathName
+# define GetFullPathName GetFullPathNameA
+# undef FindFirstFile
+# define FindFirstFile FindFirstFileA
+#endif
+
+DIR *
+opendir (const char *dir_name)
+{
+#if HAVE_OPENDIR
+# undef opendir
+ DIR *dirp;
+
+ dirp = opendir (dir_name);
+ if (dirp == NULL)
+ return NULL;
+
+# ifdef __KLIBC__
+ {
+ int fd = open (dir_name, O_RDONLY);
+ if (fd == -1 || _gl_register_dirp_fd (fd, dirp))
+ {
+ int saved_errno = errno;
+
+ close (fd);
+ closedir (dirp);
+
+ errno = saved_errno;
+
+ return NULL;
+ }
+ }
+# endif
+#else
+
+ char dir_name_mask[MAX_PATH + 1 + 1 + 1];
+ int status;
+ HANDLE current;
+ WIN32_FIND_DATA entry;
+ struct gl_directory *dirp;
+
+ if (dir_name[0] == '\0')
+ {
+ errno = ENOENT;
+ return NULL;
+ }
+
+ /* Make the dir_name absolute, so that we continue reading the same
+ directory if the current directory changed between this opendir()
+ call and a subsequent rewinddir() call. */
+ if (!GetFullPathName (dir_name, MAX_PATH, dir_name_mask, NULL))
+ {
+ errno = EINVAL;
+ return NULL;
+ }
+
+ /* Append the mask.
+ "*" and "*.*" appear to be equivalent. */
+ {
+ char *p;
+
+ p = dir_name_mask + strlen (dir_name_mask);
+ if (p > dir_name_mask && !ISSLASH (p[-1]))
+ *p++ = '\\';
+ *p++ = '*';
+ *p = '\0';
+ }
+
+ /* Start searching the directory. */
+ status = -1;
+ current = FindFirstFile (dir_name_mask, &entry);
+ if (current == INVALID_HANDLE_VALUE)
+ {
+ switch (GetLastError ())
+ {
+ case ERROR_FILE_NOT_FOUND:
+ status = -2;
+ break;
+ case ERROR_PATH_NOT_FOUND:
+ errno = ENOENT;
+ return NULL;
+ case ERROR_DIRECTORY:
+ errno = ENOTDIR;
+ return NULL;
+ case ERROR_ACCESS_DENIED:
+ errno = EACCES;
+ return NULL;
+ default:
+ errno = EIO;
+ return NULL;
+ }
+ }
+
+ /* Allocate the result. */
+ dirp =
+ (struct gl_directory *)
+ malloc (offsetof (struct gl_directory, dir_name_mask[0])
+ + strlen (dir_name_mask) + 1);
+ if (dirp == NULL)
+ {
+ if (current != INVALID_HANDLE_VALUE)
+ FindClose (current);
+ errno = ENOMEM;
+ return NULL;
+ }
+ dirp->status = status;
+ dirp->current = current;
+ if (status == -1)
+ memcpy (&dirp->entry, &entry, sizeof (WIN32_FIND_DATA));
+ strcpy (dirp->dir_name_mask, dir_name_mask);
+
+#endif
+
+#if REPLACE_FCHDIR
+ {
+ int fd = dirfd (dirp);
+ if (0 <= fd && _gl_register_fd (fd, dir_name) != fd)
+ {
+ int saved_errno = errno;
+ closedir (dirp);
+ errno = saved_errno;
+ return NULL;
+ }
+ }
+#endif
+
+ return dirp;
+}
diff --git a/gl/lib/pathmax.h b/gl/lib/pathmax.h
new file mode 100644
index 0000000..19b93d7
--- /dev/null
+++ b/gl/lib/pathmax.h
@@ -0,0 +1,83 @@
+/* Define PATH_MAX somehow. Requires sys/types.h.
+ Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2022 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 2.1 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/>. */
+
+#ifndef _PATHMAX_H
+# define _PATHMAX_H
+
+/* POSIX:2008 defines PATH_MAX to be the maximum number of bytes in a filename,
+ including the terminating NUL byte.
+ <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html>
+ PATH_MAX is not defined on systems which have no limit on filename length,
+ such as GNU/Hurd.
+
+ This file does *not* define PATH_MAX always. Programs that use this file
+ can handle the GNU/Hurd case in several ways:
+ - Either with a package-wide handling, or with a per-file handling,
+ - Either through a
+ #ifdef PATH_MAX
+ or through a fallback like
+ #ifndef PATH_MAX
+ # define PATH_MAX 8192
+ #endif
+ or through a fallback like
+ #ifndef PATH_MAX
+ # define PATH_MAX pathconf ("/", _PC_PATH_MAX)
+ #endif
+ */
+
+# include <unistd.h>
+
+# include <limits.h>
+
+# ifndef _POSIX_PATH_MAX
+# define _POSIX_PATH_MAX 256
+# endif
+
+/* Don't include sys/param.h if it already has been. */
+# if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
+# include <sys/param.h>
+# endif
+
+# if !defined PATH_MAX && defined MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+# endif
+
+# ifdef __hpux
+/* On HP-UX, PATH_MAX designates the maximum number of bytes in a filename,
+ *not* including the terminating NUL byte, and is set to 1023.
+ Additionally, when _XOPEN_SOURCE is defined to 500 or more, PATH_MAX is
+ not defined at all any more. */
+# undef PATH_MAX
+# define PATH_MAX 1024
+# endif
+
+# if defined _WIN32 && ! defined __CYGWIN__
+/* The page "Naming Files, Paths, and Namespaces" on msdn.microsoft.com,
+ section "Maximum Path Length Limitation",
+ <https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#maximum-path-length-limitation>
+ explains that the maximum size of a filename, including the terminating
+ NUL byte, is 260 = 3 + 256 + 1.
+ This is the same value as
+ - FILENAME_MAX in <stdio.h>,
+ - _MAX_PATH in <stdlib.h>,
+ - MAX_PATH in <windef.h>.
+ Undefine the original value, because mingw's <limits.h> gets it wrong. */
+# undef PATH_MAX
+# define PATH_MAX 260
+# endif
+
+#endif /* _PATHMAX_H */
diff --git a/gl/lib/pipe-safer.c b/gl/lib/pipe-safer.c
new file mode 100644
index 0000000..22f8695
--- /dev/null
+++ b/gl/lib/pipe-safer.c
@@ -0,0 +1,52 @@
+/* Invoke pipe, but avoid some glitches.
+ Copyright (C) 2005-2006, 2009-2022 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 "unistd-safer.h"
+
+#include <unistd.h>
+#include <errno.h>
+
+/* Like pipe, but ensure that neither of the file descriptors is
+ STDIN_FILENO, STDOUT_FILENO, or STDERR_FILENO. Fail with ENOSYS on
+ platforms that lack pipe. */
+
+int
+pipe_safer (int fd[2])
+{
+ if (pipe (fd) == 0)
+ {
+ int i;
+ for (i = 0; i < 2; i++)
+ {
+ fd[i] = fd_safer (fd[i]);
+ if (fd[i] < 0)
+ {
+ int saved_errno = errno;
+ close (fd[1 - i]);
+ errno = saved_errno;
+ return -1;
+ }
+ }
+
+ return 0;
+ }
+
+ return -1;
+}
diff --git a/gl/lib/pipe.c b/gl/lib/pipe.c
new file mode 100644
index 0000000..ce909b9
--- /dev/null
+++ b/gl/lib/pipe.c
@@ -0,0 +1,50 @@
+/* Create a pipe.
+ Copyright (C) 2009-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+/* Native Windows API. */
+
+/* Get _pipe(). */
+# include <io.h>
+
+/* Get _O_BINARY. */
+# include <fcntl.h>
+
+int
+pipe (int fd[2])
+{
+ /* Mingw changes fd to {-1,-1} on failure, but this violates
+ http://austingroupbugs.net/view.php?id=467 */
+ int tmp[2];
+ int result = _pipe (tmp, 4096, _O_BINARY);
+ if (!result)
+ {
+ fd[0] = tmp[0];
+ fd[1] = tmp[1];
+ }
+ return result;
+}
+
+#else
+
+# error "This platform lacks a pipe function, and Gnulib doesn't provide a replacement. This is a bug in Gnulib."
+
+#endif
diff --git a/gl/lib/printf-args.c b/gl/lib/printf-args.c
new file mode 100644
index 0000000..669c24a
--- /dev/null
+++ b/gl/lib/printf-args.c
@@ -0,0 +1,183 @@
+/* Decomposed printf argument list.
+ Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2022 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 2.1 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/>. */
+
+/* This file can be parametrized with the following macros:
+ ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
+ PRINTF_FETCHARGS Name of the function to be defined.
+ STATIC Set to 'static' to declare the function static. */
+
+#ifndef PRINTF_FETCHARGS
+# include <config.h>
+#endif
+
+/* Specification. */
+#ifndef PRINTF_FETCHARGS
+# include "printf-args.h"
+#endif
+
+#ifdef STATIC
+STATIC
+#endif
+int
+PRINTF_FETCHARGS (va_list args, arguments *a)
+{
+ size_t i;
+ argument *ap;
+
+ for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++)
+ switch (ap->type)
+ {
+ case TYPE_SCHAR:
+ ap->a.a_schar = va_arg (args, /*signed char*/ int);
+ break;
+ case TYPE_UCHAR:
+ ap->a.a_uchar = va_arg (args, /*unsigned char*/ int);
+ break;
+ case TYPE_SHORT:
+ ap->a.a_short = va_arg (args, /*short*/ int);
+ break;
+ case TYPE_USHORT:
+ ap->a.a_ushort = va_arg (args, /*unsigned short*/ int);
+ break;
+ case TYPE_INT:
+ ap->a.a_int = va_arg (args, int);
+ break;
+ case TYPE_UINT:
+ ap->a.a_uint = va_arg (args, unsigned int);
+ break;
+ case TYPE_LONGINT:
+ ap->a.a_longint = va_arg (args, long int);
+ break;
+ case TYPE_ULONGINT:
+ ap->a.a_ulongint = va_arg (args, unsigned long int);
+ break;
+ case TYPE_LONGLONGINT:
+ ap->a.a_longlongint = va_arg (args, long long int);
+ break;
+ case TYPE_ULONGLONGINT:
+ ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
+ break;
+ case TYPE_DOUBLE:
+ ap->a.a_double = va_arg (args, double);
+ break;
+ case TYPE_LONGDOUBLE:
+ ap->a.a_longdouble = va_arg (args, long double);
+ break;
+ case TYPE_CHAR:
+ ap->a.a_char = va_arg (args, int);
+ break;
+#if HAVE_WINT_T
+ case TYPE_WIDE_CHAR:
+ /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by
+ default argument promotions", this is not the case in mingw32,
+ where wint_t is 'unsigned short'. */
+ ap->a.a_wide_char =
+ (sizeof (wint_t) < sizeof (int)
+ ? (wint_t) va_arg (args, int)
+ : va_arg (args, wint_t));
+ break;
+#endif
+ case TYPE_STRING:
+ ap->a.a_string = va_arg (args, const char *);
+ /* A null pointer is an invalid argument for "%s", but in practice
+ it occurs quite frequently in printf statements that produce
+ debug output. Use a fallback in this case. */
+ if (ap->a.a_string == NULL)
+ ap->a.a_string = "(NULL)";
+ break;
+#if HAVE_WCHAR_T
+ case TYPE_WIDE_STRING:
+ ap->a.a_wide_string = va_arg (args, const wchar_t *);
+ /* A null pointer is an invalid argument for "%ls", but in practice
+ it occurs quite frequently in printf statements that produce
+ debug output. Use a fallback in this case. */
+ if (ap->a.a_wide_string == NULL)
+ {
+ static const wchar_t wide_null_string[] =
+ {
+ (wchar_t)'(',
+ (wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L',
+ (wchar_t)')',
+ (wchar_t)0
+ };
+ ap->a.a_wide_string = wide_null_string;
+ }
+ break;
+#endif
+ case TYPE_POINTER:
+ ap->a.a_pointer = va_arg (args, void *);
+ break;
+ case TYPE_COUNT_SCHAR_POINTER:
+ ap->a.a_count_schar_pointer = va_arg (args, signed char *);
+ break;
+ case TYPE_COUNT_SHORT_POINTER:
+ ap->a.a_count_short_pointer = va_arg (args, short *);
+ break;
+ case TYPE_COUNT_INT_POINTER:
+ ap->a.a_count_int_pointer = va_arg (args, int *);
+ break;
+ case TYPE_COUNT_LONGINT_POINTER:
+ ap->a.a_count_longint_pointer = va_arg (args, long int *);
+ break;
+ case TYPE_COUNT_LONGLONGINT_POINTER:
+ ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
+ break;
+#if ENABLE_UNISTDIO
+ /* The unistdio extensions. */
+ case TYPE_U8_STRING:
+ ap->a.a_u8_string = va_arg (args, const uint8_t *);
+ /* A null pointer is an invalid argument for "%U", but in practice
+ it occurs quite frequently in printf statements that produce
+ debug output. Use a fallback in this case. */
+ if (ap->a.a_u8_string == NULL)
+ {
+ static const uint8_t u8_null_string[] =
+ { '(', 'N', 'U', 'L', 'L', ')', 0 };
+ ap->a.a_u8_string = u8_null_string;
+ }
+ break;
+ case TYPE_U16_STRING:
+ ap->a.a_u16_string = va_arg (args, const uint16_t *);
+ /* A null pointer is an invalid argument for "%lU", but in practice
+ it occurs quite frequently in printf statements that produce
+ debug output. Use a fallback in this case. */
+ if (ap->a.a_u16_string == NULL)
+ {
+ static const uint16_t u16_null_string[] =
+ { '(', 'N', 'U', 'L', 'L', ')', 0 };
+ ap->a.a_u16_string = u16_null_string;
+ }
+ break;
+ case TYPE_U32_STRING:
+ ap->a.a_u32_string = va_arg (args, const uint32_t *);
+ /* A null pointer is an invalid argument for "%llU", but in practice
+ it occurs quite frequently in printf statements that produce
+ debug output. Use a fallback in this case. */
+ if (ap->a.a_u32_string == NULL)
+ {
+ static const uint32_t u32_null_string[] =
+ { '(', 'N', 'U', 'L', 'L', ')', 0 };
+ ap->a.a_u32_string = u32_null_string;
+ }
+ break;
+#endif
+ default:
+ /* Unknown type. */
+ return -1;
+ }
+ return 0;
+}
diff --git a/gl/lib/printf-args.h b/gl/lib/printf-args.h
new file mode 100644
index 0000000..553fe96
--- /dev/null
+++ b/gl/lib/printf-args.h
@@ -0,0 +1,150 @@
+/* Decomposed printf argument list.
+ Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2022 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 2.1 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/>. */
+
+#ifndef _PRINTF_ARGS_H
+#define _PRINTF_ARGS_H
+
+/* This file can be parametrized with the following macros:
+ ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
+ PRINTF_FETCHARGS Name of the function to be declared.
+ STATIC Set to 'static' to declare the function static. */
+
+/* Default parameters. */
+#ifndef PRINTF_FETCHARGS
+# define PRINTF_FETCHARGS printf_fetchargs
+#endif
+
+/* Get size_t. */
+#include <stddef.h>
+
+/* Get wchar_t. */
+#if HAVE_WCHAR_T
+# include <stddef.h>
+#endif
+
+/* Get wint_t. */
+#if HAVE_WINT_T
+# include <wchar.h>
+#endif
+
+/* Get va_list. */
+#include <stdarg.h>
+
+
+/* Argument types */
+typedef enum
+{
+ TYPE_NONE,
+ TYPE_SCHAR,
+ TYPE_UCHAR,
+ TYPE_SHORT,
+ TYPE_USHORT,
+ TYPE_INT,
+ TYPE_UINT,
+ TYPE_LONGINT,
+ TYPE_ULONGINT,
+ TYPE_LONGLONGINT,
+ TYPE_ULONGLONGINT,
+ TYPE_DOUBLE,
+ TYPE_LONGDOUBLE,
+ TYPE_CHAR,
+#if HAVE_WINT_T
+ TYPE_WIDE_CHAR,
+#endif
+ TYPE_STRING,
+#if HAVE_WCHAR_T
+ TYPE_WIDE_STRING,
+#endif
+ TYPE_POINTER,
+ TYPE_COUNT_SCHAR_POINTER,
+ TYPE_COUNT_SHORT_POINTER,
+ TYPE_COUNT_INT_POINTER,
+ TYPE_COUNT_LONGINT_POINTER,
+ TYPE_COUNT_LONGLONGINT_POINTER
+#if ENABLE_UNISTDIO
+ /* The unistdio extensions. */
+, TYPE_U8_STRING
+, TYPE_U16_STRING
+, TYPE_U32_STRING
+#endif
+} arg_type;
+
+/* Polymorphic argument */
+typedef struct
+{
+ arg_type type;
+ union
+ {
+ signed char a_schar;
+ unsigned char a_uchar;
+ short a_short;
+ unsigned short a_ushort;
+ int a_int;
+ unsigned int a_uint;
+ long int a_longint;
+ unsigned long int a_ulongint;
+ long long int a_longlongint;
+ unsigned long long int a_ulonglongint;
+ float a_float;
+ double a_double;
+ long double a_longdouble;
+ int a_char;
+#if HAVE_WINT_T
+ wint_t a_wide_char;
+#endif
+ const char* a_string;
+#if HAVE_WCHAR_T
+ const wchar_t* a_wide_string;
+#endif
+ void* a_pointer;
+ signed char * a_count_schar_pointer;
+ short * a_count_short_pointer;
+ int * a_count_int_pointer;
+ long int * a_count_longint_pointer;
+ long long int * a_count_longlongint_pointer;
+#if ENABLE_UNISTDIO
+ /* The unistdio extensions. */
+ const uint8_t * a_u8_string;
+ const uint16_t * a_u16_string;
+ const uint32_t * a_u32_string;
+#endif
+ }
+ a;
+}
+argument;
+
+/* Number of directly allocated arguments (no malloc() needed). */
+#define N_DIRECT_ALLOC_ARGUMENTS 7
+
+typedef struct
+{
+ size_t count;
+ argument *arg;
+ argument direct_alloc_arg[N_DIRECT_ALLOC_ARGUMENTS];
+}
+arguments;
+
+
+/* Fetch the arguments, putting them into a. */
+#ifdef STATIC
+STATIC
+#else
+extern
+#endif
+int PRINTF_FETCHARGS (va_list args, arguments *a);
+
+#endif /* _PRINTF_ARGS_H */
diff --git a/gl/lib/printf-parse.c b/gl/lib/printf-parse.c
new file mode 100644
index 0000000..aab02dc
--- /dev/null
+++ b/gl/lib/printf-parse.c
@@ -0,0 +1,623 @@
+/* Formatted output to strings.
+ Copyright (C) 1999-2000, 2002-2003, 2006-2022 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 2.1 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/>. */
+
+/* This file can be parametrized with the following macros:
+ CHAR_T The element type of the format string.
+ CHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters
+ in the format string are ASCII.
+ DIRECTIVE Structure denoting a format directive.
+ Depends on CHAR_T.
+ DIRECTIVES Structure denoting the set of format directives of a
+ format string. Depends on CHAR_T.
+ PRINTF_PARSE Function that parses a format string.
+ Depends on CHAR_T.
+ STATIC Set to 'static' to declare the function static.
+ ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. */
+
+#ifndef PRINTF_PARSE
+# include <config.h>
+#endif
+
+/* Specification. */
+#ifndef PRINTF_PARSE
+# include "printf-parse.h"
+#endif
+
+/* Default parameters. */
+#ifndef PRINTF_PARSE
+# define PRINTF_PARSE printf_parse
+# define CHAR_T char
+# define DIRECTIVE char_directive
+# define DIRECTIVES char_directives
+#endif
+
+/* Get size_t, NULL. */
+#include <stddef.h>
+
+/* Get intmax_t. */
+#include <stdint.h>
+
+/* malloc(), realloc(), free(). */
+#include <stdlib.h>
+
+/* memcpy(). */
+#include <string.h>
+
+/* errno. */
+#include <errno.h>
+
+/* Checked size_t computations. */
+#include "xsize.h"
+
+#if CHAR_T_ONLY_ASCII
+/* c_isascii(). */
+# include "c-ctype.h"
+#endif
+
+#ifdef STATIC
+STATIC
+#endif
+int
+PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
+{
+ const CHAR_T *cp = format; /* pointer into format */
+ size_t arg_posn = 0; /* number of regular arguments consumed */
+ size_t d_allocated; /* allocated elements of d->dir */
+ size_t a_allocated; /* allocated elements of a->arg */
+ size_t max_width_length = 0;
+ size_t max_precision_length = 0;
+
+ d->count = 0;
+ d_allocated = N_DIRECT_ALLOC_DIRECTIVES;
+ d->dir = d->direct_alloc_dir;
+
+ a->count = 0;
+ a_allocated = N_DIRECT_ALLOC_ARGUMENTS;
+ a->arg = a->direct_alloc_arg;
+
+#define REGISTER_ARG(_index_,_type_) \
+ { \
+ size_t n = (_index_); \
+ if (n >= a_allocated) \
+ { \
+ size_t memory_size; \
+ argument *memory; \
+ \
+ a_allocated = xtimes (a_allocated, 2); \
+ if (a_allocated <= n) \
+ a_allocated = xsum (n, 1); \
+ memory_size = xtimes (a_allocated, sizeof (argument)); \
+ if (size_overflow_p (memory_size)) \
+ /* Overflow, would lead to out of memory. */ \
+ goto out_of_memory; \
+ memory = (argument *) (a->arg != a->direct_alloc_arg \
+ ? realloc (a->arg, memory_size) \
+ : malloc (memory_size)); \
+ if (memory == NULL) \
+ /* Out of memory. */ \
+ goto out_of_memory; \
+ if (a->arg == a->direct_alloc_arg) \
+ memcpy (memory, a->arg, a->count * sizeof (argument)); \
+ a->arg = memory; \
+ } \
+ while (a->count <= n) \
+ a->arg[a->count++].type = TYPE_NONE; \
+ if (a->arg[n].type == TYPE_NONE) \
+ a->arg[n].type = (_type_); \
+ else if (a->arg[n].type != (_type_)) \
+ /* Ambiguous type for positional argument. */ \
+ goto error; \
+ }
+
+ while (*cp != '\0')
+ {
+ CHAR_T c = *cp++;
+ if (c == '%')
+ {
+ size_t arg_index = ARG_NONE;
+ DIRECTIVE *dp = &d->dir[d->count]; /* pointer to next directive */
+
+ /* Initialize the next directive. */
+ dp->dir_start = cp - 1;
+ dp->flags = 0;
+ dp->width_start = NULL;
+ dp->width_end = NULL;
+ dp->width_arg_index = ARG_NONE;
+ dp->precision_start = NULL;
+ dp->precision_end = NULL;
+ dp->precision_arg_index = ARG_NONE;
+ dp->arg_index = ARG_NONE;
+
+ /* Test for positional argument. */
+ if (*cp >= '0' && *cp <= '9')
+ {
+ const CHAR_T *np;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ ;
+ if (*np == '$')
+ {
+ size_t n = 0;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ n = xsum (xtimes (n, 10), *np - '0');
+ if (n == 0)
+ /* Positional argument 0. */
+ goto error;
+ if (size_overflow_p (n))
+ /* n too large, would lead to out of memory later. */
+ goto error;
+ arg_index = n - 1;
+ cp = np + 1;
+ }
+ }
+
+ /* Read the flags. */
+ for (;;)
+ {
+ if (*cp == '\'')
+ {
+ dp->flags |= FLAG_GROUP;
+ cp++;
+ }
+ else if (*cp == '-')
+ {
+ dp->flags |= FLAG_LEFT;
+ cp++;
+ }
+ else if (*cp == '+')
+ {
+ dp->flags |= FLAG_SHOWSIGN;
+ cp++;
+ }
+ else if (*cp == ' ')
+ {
+ dp->flags |= FLAG_SPACE;
+ cp++;
+ }
+ else if (*cp == '#')
+ {
+ dp->flags |= FLAG_ALT;
+ cp++;
+ }
+ else if (*cp == '0')
+ {
+ dp->flags |= FLAG_ZERO;
+ cp++;
+ }
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
+ else if (*cp == 'I')
+ {
+ dp->flags |= FLAG_LOCALIZED;
+ cp++;
+ }
+#endif
+ else
+ break;
+ }
+
+ /* Parse the field width. */
+ if (*cp == '*')
+ {
+ dp->width_start = cp;
+ cp++;
+ dp->width_end = cp;
+ if (max_width_length < 1)
+ max_width_length = 1;
+
+ /* Test for positional argument. */
+ if (*cp >= '0' && *cp <= '9')
+ {
+ const CHAR_T *np;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ ;
+ if (*np == '$')
+ {
+ size_t n = 0;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ n = xsum (xtimes (n, 10), *np - '0');
+ if (n == 0)
+ /* Positional argument 0. */
+ goto error;
+ if (size_overflow_p (n))
+ /* n too large, would lead to out of memory later. */
+ goto error;
+ dp->width_arg_index = n - 1;
+ cp = np + 1;
+ }
+ }
+ if (dp->width_arg_index == ARG_NONE)
+ {
+ dp->width_arg_index = arg_posn++;
+ if (dp->width_arg_index == ARG_NONE)
+ /* arg_posn wrapped around. */
+ goto error;
+ }
+ REGISTER_ARG (dp->width_arg_index, TYPE_INT);
+ }
+ else if (*cp >= '0' && *cp <= '9')
+ {
+ size_t width_length;
+
+ dp->width_start = cp;
+ for (; *cp >= '0' && *cp <= '9'; cp++)
+ ;
+ dp->width_end = cp;
+ width_length = dp->width_end - dp->width_start;
+ if (max_width_length < width_length)
+ max_width_length = width_length;
+ }
+
+ /* Parse the precision. */
+ if (*cp == '.')
+ {
+ cp++;
+ if (*cp == '*')
+ {
+ dp->precision_start = cp - 1;
+ cp++;
+ dp->precision_end = cp;
+ if (max_precision_length < 2)
+ max_precision_length = 2;
+
+ /* Test for positional argument. */
+ if (*cp >= '0' && *cp <= '9')
+ {
+ const CHAR_T *np;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ ;
+ if (*np == '$')
+ {
+ size_t n = 0;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ n = xsum (xtimes (n, 10), *np - '0');
+ if (n == 0)
+ /* Positional argument 0. */
+ goto error;
+ if (size_overflow_p (n))
+ /* n too large, would lead to out of memory
+ later. */
+ goto error;
+ dp->precision_arg_index = n - 1;
+ cp = np + 1;
+ }
+ }
+ if (dp->precision_arg_index == ARG_NONE)
+ {
+ dp->precision_arg_index = arg_posn++;
+ if (dp->precision_arg_index == ARG_NONE)
+ /* arg_posn wrapped around. */
+ goto error;
+ }
+ REGISTER_ARG (dp->precision_arg_index, TYPE_INT);
+ }
+ else
+ {
+ size_t precision_length;
+
+ dp->precision_start = cp - 1;
+ for (; *cp >= '0' && *cp <= '9'; cp++)
+ ;
+ dp->precision_end = cp;
+ precision_length = dp->precision_end - dp->precision_start;
+ if (max_precision_length < precision_length)
+ max_precision_length = precision_length;
+ }
+ }
+
+ {
+ arg_type type;
+
+ /* Parse argument type/size specifiers. */
+ {
+ int flags = 0;
+
+ for (;;)
+ {
+ if (*cp == 'h')
+ {
+ flags |= (1 << (flags & 1));
+ cp++;
+ }
+ else if (*cp == 'L')
+ {
+ flags |= 4;
+ cp++;
+ }
+ else if (*cp == 'l')
+ {
+ flags += 8;
+ cp++;
+ }
+ else if (*cp == 'j')
+ {
+ if (sizeof (intmax_t) > sizeof (long))
+ {
+ /* intmax_t = long long */
+ flags += 16;
+ }
+ else if (sizeof (intmax_t) > sizeof (int))
+ {
+ /* intmax_t = long */
+ flags += 8;
+ }
+ cp++;
+ }
+ else if (*cp == 'z' || *cp == 'Z')
+ {
+ /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
+ because the warning facility in gcc-2.95.2 understands
+ only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */
+ if (sizeof (size_t) > sizeof (long))
+ {
+ /* size_t = long long */
+ flags += 16;
+ }
+ else if (sizeof (size_t) > sizeof (int))
+ {
+ /* size_t = long */
+ flags += 8;
+ }
+ cp++;
+ }
+ else if (*cp == 't')
+ {
+ if (sizeof (ptrdiff_t) > sizeof (long))
+ {
+ /* ptrdiff_t = long long */
+ flags += 16;
+ }
+ else if (sizeof (ptrdiff_t) > sizeof (int))
+ {
+ /* ptrdiff_t = long */
+ flags += 8;
+ }
+ cp++;
+ }
+#if defined __APPLE__ && defined __MACH__
+ /* On Mac OS X 10.3, PRIdMAX is defined as "qd".
+ We cannot change it to "lld" because PRIdMAX must also
+ be understood by the system's printf routines. */
+ else if (*cp == 'q')
+ {
+ if (64 / 8 > sizeof (long))
+ {
+ /* int64_t = long long */
+ flags += 16;
+ }
+ else
+ {
+ /* int64_t = long */
+ flags += 8;
+ }
+ cp++;
+ }
+#endif
+#if defined _WIN32 && ! defined __CYGWIN__
+ /* On native Windows, PRIdMAX is defined as "I64d".
+ We cannot change it to "lld" because PRIdMAX must also
+ be understood by the system's printf routines. */
+ else if (*cp == 'I' && cp[1] == '6' && cp[2] == '4')
+ {
+ if (64 / 8 > sizeof (long))
+ {
+ /* __int64 = long long */
+ flags += 16;
+ }
+ else
+ {
+ /* __int64 = long */
+ flags += 8;
+ }
+ cp += 3;
+ }
+#endif
+ else
+ break;
+ }
+
+ /* Read the conversion character. */
+ c = *cp++;
+ switch (c)
+ {
+ case 'd': case 'i':
+ /* If 'long long' is larger than 'long': */
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_LONGLONGINT;
+ else
+ /* If 'long long' is the same as 'long', we parse "lld" into
+ TYPE_LONGINT. */
+ if (flags >= 8)
+ type = TYPE_LONGINT;
+ else if (flags & 2)
+ type = TYPE_SCHAR;
+ else if (flags & 1)
+ type = TYPE_SHORT;
+ else
+ type = TYPE_INT;
+ break;
+ case 'o': case 'u': case 'x': case 'X':
+ /* If 'unsigned long long' is larger than 'unsigned long': */
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_ULONGLONGINT;
+ else
+ /* If 'unsigned long long' is the same as 'unsigned long', we
+ parse "llu" into TYPE_ULONGINT. */
+ if (flags >= 8)
+ type = TYPE_ULONGINT;
+ else if (flags & 2)
+ type = TYPE_UCHAR;
+ else if (flags & 1)
+ type = TYPE_USHORT;
+ else
+ type = TYPE_UINT;
+ break;
+ case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
+ case 'a': case 'A':
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_LONGDOUBLE;
+ else
+ type = TYPE_DOUBLE;
+ break;
+ case 'c':
+ if (flags >= 8)
+#if HAVE_WINT_T
+ type = TYPE_WIDE_CHAR;
+#else
+ goto error;
+#endif
+ else
+ type = TYPE_CHAR;
+ break;
+#if HAVE_WINT_T
+ case 'C':
+ type = TYPE_WIDE_CHAR;
+ c = 'c';
+ break;
+#endif
+ case 's':
+ if (flags >= 8)
+#if HAVE_WCHAR_T
+ type = TYPE_WIDE_STRING;
+#else
+ goto error;
+#endif
+ else
+ type = TYPE_STRING;
+ break;
+#if HAVE_WCHAR_T
+ case 'S':
+ type = TYPE_WIDE_STRING;
+ c = 's';
+ break;
+#endif
+ case 'p':
+ type = TYPE_POINTER;
+ break;
+ case 'n':
+ /* If 'long long' is larger than 'long': */
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_COUNT_LONGLONGINT_POINTER;
+ else
+ /* If 'long long' is the same as 'long', we parse "lln" into
+ TYPE_COUNT_LONGINT_POINTER. */
+ if (flags >= 8)
+ type = TYPE_COUNT_LONGINT_POINTER;
+ else if (flags & 2)
+ type = TYPE_COUNT_SCHAR_POINTER;
+ else if (flags & 1)
+ type = TYPE_COUNT_SHORT_POINTER;
+ else
+ type = TYPE_COUNT_INT_POINTER;
+ break;
+#if ENABLE_UNISTDIO
+ /* The unistdio extensions. */
+ case 'U':
+ if (flags >= 16)
+ type = TYPE_U32_STRING;
+ else if (flags >= 8)
+ type = TYPE_U16_STRING;
+ else
+ type = TYPE_U8_STRING;
+ break;
+#endif
+ case '%':
+ type = TYPE_NONE;
+ break;
+ default:
+ /* Unknown conversion character. */
+ goto error;
+ }
+ }
+
+ if (type != TYPE_NONE)
+ {
+ dp->arg_index = arg_index;
+ if (dp->arg_index == ARG_NONE)
+ {
+ dp->arg_index = arg_posn++;
+ if (dp->arg_index == ARG_NONE)
+ /* arg_posn wrapped around. */
+ goto error;
+ }
+ REGISTER_ARG (dp->arg_index, type);
+ }
+ dp->conversion = c;
+ dp->dir_end = cp;
+ }
+
+ d->count++;
+ if (d->count >= d_allocated)
+ {
+ size_t memory_size;
+ DIRECTIVE *memory;
+
+ d_allocated = xtimes (d_allocated, 2);
+ memory_size = xtimes (d_allocated, sizeof (DIRECTIVE));
+ if (size_overflow_p (memory_size))
+ /* Overflow, would lead to out of memory. */
+ goto out_of_memory;
+ memory = (DIRECTIVE *) (d->dir != d->direct_alloc_dir
+ ? realloc (d->dir, memory_size)
+ : malloc (memory_size));
+ if (memory == NULL)
+ /* Out of memory. */
+ goto out_of_memory;
+ if (d->dir == d->direct_alloc_dir)
+ memcpy (memory, d->dir, d->count * sizeof (DIRECTIVE));
+ d->dir = memory;
+ }
+ }
+#if CHAR_T_ONLY_ASCII
+ else if (!c_isascii (c))
+ {
+ /* Non-ASCII character. Not supported. */
+ goto error;
+ }
+#endif
+ }
+ d->dir[d->count].dir_start = cp;
+
+ d->max_width_length = max_width_length;
+ d->max_precision_length = max_precision_length;
+ return 0;
+
+error:
+ if (a->arg != a->direct_alloc_arg)
+ free (a->arg);
+ if (d->dir != d->direct_alloc_dir)
+ free (d->dir);
+ errno = EINVAL;
+ return -1;
+
+out_of_memory:
+ if (a->arg != a->direct_alloc_arg)
+ free (a->arg);
+ if (d->dir != d->direct_alloc_dir)
+ free (d->dir);
+ errno = ENOMEM;
+ return -1;
+}
+
+#undef PRINTF_PARSE
+#undef DIRECTIVES
+#undef DIRECTIVE
+#undef CHAR_T_ONLY_ASCII
+#undef CHAR_T
diff --git a/gl/lib/printf-parse.h b/gl/lib/printf-parse.h
new file mode 100644
index 0000000..b12ccea
--- /dev/null
+++ b/gl/lib/printf-parse.h
@@ -0,0 +1,193 @@
+/* Parse printf format string.
+ Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2022 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 2.1 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/>. */
+
+#ifndef _PRINTF_PARSE_H
+#define _PRINTF_PARSE_H
+
+/* This file can be parametrized with the following macros:
+ ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
+ STATIC Set to 'static' to declare the function static. */
+
+#if HAVE_FEATURES_H
+# include <features.h> /* for __GLIBC__, __UCLIBC__ */
+#endif
+
+#include "printf-args.h"
+
+
+/* Flags */
+#define FLAG_GROUP 1 /* ' flag */
+#define FLAG_LEFT 2 /* - flag */
+#define FLAG_SHOWSIGN 4 /* + flag */
+#define FLAG_SPACE 8 /* space flag */
+#define FLAG_ALT 16 /* # flag */
+#define FLAG_ZERO 32
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
+# define FLAG_LOCALIZED 64 /* I flag, uses localized digits */
+#endif
+
+/* arg_index value indicating that no argument is consumed. */
+#define ARG_NONE (~(size_t)0)
+
+/* xxx_directive: A parsed directive.
+ xxx_directives: A parsed format string. */
+
+/* Number of directly allocated directives (no malloc() needed). */
+#define N_DIRECT_ALLOC_DIRECTIVES 7
+
+/* A parsed directive. */
+typedef struct
+{
+ const char* dir_start;
+ const char* dir_end;
+ int flags;
+ const char* width_start;
+ const char* width_end;
+ size_t width_arg_index;
+ const char* precision_start;
+ const char* precision_end;
+ size_t precision_arg_index;
+ char conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
+ size_t arg_index;
+}
+char_directive;
+
+/* A parsed format string. */
+typedef struct
+{
+ size_t count;
+ char_directive *dir;
+ size_t max_width_length;
+ size_t max_precision_length;
+ char_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
+}
+char_directives;
+
+#if ENABLE_UNISTDIO
+
+/* A parsed directive. */
+typedef struct
+{
+ const uint8_t* dir_start;
+ const uint8_t* dir_end;
+ int flags;
+ const uint8_t* width_start;
+ const uint8_t* width_end;
+ size_t width_arg_index;
+ const uint8_t* precision_start;
+ const uint8_t* precision_end;
+ size_t precision_arg_index;
+ uint8_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
+ size_t arg_index;
+}
+u8_directive;
+
+/* A parsed format string. */
+typedef struct
+{
+ size_t count;
+ u8_directive *dir;
+ size_t max_width_length;
+ size_t max_precision_length;
+ u8_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
+}
+u8_directives;
+
+/* A parsed directive. */
+typedef struct
+{
+ const uint16_t* dir_start;
+ const uint16_t* dir_end;
+ int flags;
+ const uint16_t* width_start;
+ const uint16_t* width_end;
+ size_t width_arg_index;
+ const uint16_t* precision_start;
+ const uint16_t* precision_end;
+ size_t precision_arg_index;
+ uint16_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
+ size_t arg_index;
+}
+u16_directive;
+
+/* A parsed format string. */
+typedef struct
+{
+ size_t count;
+ u16_directive *dir;
+ size_t max_width_length;
+ size_t max_precision_length;
+ u16_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
+}
+u16_directives;
+
+/* A parsed directive. */
+typedef struct
+{
+ const uint32_t* dir_start;
+ const uint32_t* dir_end;
+ int flags;
+ const uint32_t* width_start;
+ const uint32_t* width_end;
+ size_t width_arg_index;
+ const uint32_t* precision_start;
+ const uint32_t* precision_end;
+ size_t precision_arg_index;
+ uint32_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
+ size_t arg_index;
+}
+u32_directive;
+
+/* A parsed format string. */
+typedef struct
+{
+ size_t count;
+ u32_directive *dir;
+ size_t max_width_length;
+ size_t max_precision_length;
+ u32_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
+}
+u32_directives;
+
+#endif
+
+
+/* Parses the format string. Fills in the number N of directives, and fills
+ in directives[0], ..., directives[N-1], and sets directives[N].dir_start
+ to the end of the format string. Also fills in the arg_type fields of the
+ arguments and the needed count of arguments. */
+#if ENABLE_UNISTDIO
+extern int
+ ulc_printf_parse (const char *format, char_directives *d, arguments *a);
+extern int
+ u8_printf_parse (const uint8_t *format, u8_directives *d, arguments *a);
+extern int
+ u16_printf_parse (const uint16_t *format, u16_directives *d,
+ arguments *a);
+extern int
+ u32_printf_parse (const uint32_t *format, u32_directives *d,
+ arguments *a);
+#else
+# ifdef STATIC
+STATIC
+# else
+extern
+# endif
+int printf_parse (const char *format, char_directives *d, arguments *a);
+#endif
+
+#endif /* _PRINTF_PARSE_H */
diff --git a/gl/lib/progname.c b/gl/lib/progname.c
new file mode 100644
index 0000000..6f09c2b
--- /dev/null
+++ b/gl/lib/progname.c
@@ -0,0 +1,92 @@
+/* Program name management.
+ Copyright (C) 2001-2003, 2005-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2001.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+
+#include <config.h>
+
+/* Specification. */
+#undef ENABLE_RELOCATABLE /* avoid defining set_program_name as a macro */
+#include "progname.h"
+
+#include <errno.h> /* get program_invocation_name declaration */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+/* String containing name the program is called with.
+ To be initialized by main(). */
+const char *program_name = NULL;
+
+/* Set program_name, based on argv[0].
+ argv0 must be a string allocated with indefinite extent, and must not be
+ modified after this call. */
+void
+set_program_name (const char *argv0)
+{
+ /* libtool creates a temporary executable whose name is sometimes prefixed
+ with "lt-" (depends on the platform). It also makes argv[0] absolute.
+ But the name of the temporary executable is a detail that should not be
+ visible to the end user and to the test suite.
+ Remove this "<dirname>/.libs/" or "<dirname>/.libs/lt-" prefix here. */
+ const char *slash;
+ const char *base;
+
+ /* Sanity check. POSIX requires the invoking process to pass a non-NULL
+ argv[0]. */
+ if (argv0 == NULL)
+ {
+ /* It's a bug in the invoking program. Help diagnosing it. */
+ fputs ("A NULL argv[0] was passed through an exec system call.\n",
+ stderr);
+ abort ();
+ }
+
+ slash = strrchr (argv0, '/');
+ base = (slash != NULL ? slash + 1 : argv0);
+ if (base - argv0 >= 7 && strncmp (base - 7, "/.libs/", 7) == 0)
+ {
+ argv0 = base;
+ if (strncmp (base, "lt-", 3) == 0)
+ {
+ argv0 = base + 3;
+ /* On glibc systems, remove the "lt-" prefix from the variable
+ program_invocation_short_name. */
+#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
+ program_invocation_short_name = (char *) argv0;
+#endif
+ }
+ }
+
+ /* But don't strip off a leading <dirname>/ in general, because when the user
+ runs
+ /some/hidden/place/bin/cp foo foo
+ he should get the error message
+ /some/hidden/place/bin/cp: `foo' and `foo' are the same file
+ not
+ cp: `foo' and `foo' are the same file
+ */
+
+ program_name = argv0;
+
+ /* On glibc systems, the error() function comes from libc and uses the
+ variable program_invocation_name, not program_name. So set this variable
+ as well. */
+#if HAVE_DECL_PROGRAM_INVOCATION_NAME
+ program_invocation_name = (char *) argv0;
+#endif
+}
diff --git a/gl/lib/progname.h b/gl/lib/progname.h
new file mode 100644
index 0000000..0561089
--- /dev/null
+++ b/gl/lib/progname.h
@@ -0,0 +1,62 @@
+/* Program name management.
+ Copyright (C) 2001-2004, 2006, 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2001.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _PROGNAME_H
+#define _PROGNAME_H
+
+/* Programs using this file should do the following in main():
+ set_program_name (argv[0]);
+ */
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* String containing name the program is called with. */
+extern const char *program_name;
+
+/* Set program_name, based on argv[0].
+ argv0 must be a string allocated with indefinite extent, and must not be
+ modified after this call. */
+extern void set_program_name (const char *argv0);
+
+#if ENABLE_RELOCATABLE
+
+/* Set program_name, based on argv[0], and original installation prefix and
+ directory, for relocatability. */
+extern void set_program_name_and_installdir (const char *argv0,
+ const char *orig_installprefix,
+ const char *orig_installdir);
+#undef set_program_name
+#define set_program_name(ARG0) \
+ set_program_name_and_installdir (ARG0, INSTALLPREFIX, INSTALLDIR)
+
+/* Return the full pathname of the current executable, based on the earlier
+ call to set_program_name_and_installdir. Return NULL if unknown. */
+extern char *get_full_program_name (void);
+
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _PROGNAME_H */
diff --git a/gl/lib/pselect.c b/gl/lib/pselect.c
new file mode 100644
index 0000000..a1eca0c
--- /dev/null
+++ b/gl/lib/pselect.c
@@ -0,0 +1,110 @@
+/* pselect - synchronous I/O multiplexing
+
+ Copyright 2011-2022 Free Software Foundation, Inc.
+
+ This file is part of gnulib.
+
+ 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 2.1 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 Paul Eggert */
+
+#include <config.h>
+
+#include <sys/select.h>
+
+#include <errno.h>
+#include <signal.h>
+
+/* Examine the size-NFDS file descriptor sets in RFDS, WFDS, and XFDS
+ to see whether some of their descriptors are ready for reading,
+ ready for writing, or have exceptions pending. Wait for at most
+ TIMEOUT seconds, and use signal mask SIGMASK while waiting. A null
+ pointer parameter stands for no descriptors, an infinite timeout,
+ or an unaffected signal mask. */
+
+#if !HAVE_PSELECT
+
+int
+pselect (int nfds, fd_set *restrict rfds,
+ fd_set *restrict wfds, fd_set *restrict xfds,
+ struct timespec const *restrict timeout,
+ sigset_t const *restrict sigmask)
+{
+ int select_result;
+ sigset_t origmask;
+ struct timeval tv, *tvp;
+
+ if (timeout)
+ {
+ if (! (0 <= timeout->tv_nsec && timeout->tv_nsec < 1000000000))
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
+ tv.tv_sec = timeout->tv_sec;
+ tv.tv_usec = (timeout->tv_nsec + 999) / 1000;
+ tvp = &tv;
+ }
+ else
+ tvp = NULL;
+
+ /* Signal mask munging should be atomic, but this is the best we can
+ do in this emulation. */
+ if (sigmask)
+ pthread_sigmask (SIG_SETMASK, sigmask, &origmask);
+
+ select_result = select (nfds, rfds, wfds, xfds, tvp);
+
+ if (sigmask)
+ {
+ int select_errno = errno;
+ pthread_sigmask (SIG_SETMASK, &origmask, NULL);
+ errno = select_errno;
+ }
+
+ return select_result;
+}
+
+#else /* HAVE_PSELECT */
+# include <unistd.h>
+# undef pselect
+
+int
+rpl_pselect (int nfds, fd_set *restrict rfds,
+ fd_set *restrict wfds, fd_set *restrict xfds,
+ struct timespec const *restrict timeout,
+ sigset_t const *restrict sigmask)
+{
+ int i;
+
+ /* FreeBSD 8.2 has a bug: it does not always detect invalid fds. */
+ if (nfds < 0 || nfds > FD_SETSIZE)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ for (i = 0; i < nfds; i++)
+ {
+ if (((rfds && FD_ISSET (i, rfds))
+ || (wfds && FD_ISSET (i, wfds))
+ || (xfds && FD_ISSET (i, xfds)))
+ && dup2 (i, i) != i)
+ return -1;
+ }
+
+ return pselect (nfds, rfds, wfds, xfds, timeout, sigmask);
+}
+
+#endif
diff --git a/gl/lib/pthread_sigmask.c b/gl/lib/pthread_sigmask.c
new file mode 100644
index 0000000..cd4eb80
--- /dev/null
+++ b/gl/lib/pthread_sigmask.c
@@ -0,0 +1,92 @@
+/* POSIX compatible signal blocking for threads.
+ Copyright (C) 2011-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <signal.h>
+
+#include <errno.h>
+#include <stddef.h>
+
+#if PTHREAD_SIGMASK_INEFFECTIVE
+# include <string.h>
+#endif
+
+#if PTHREAD_SIGMASK_UNBLOCK_BUG
+# include <unistd.h>
+#endif
+
+int
+pthread_sigmask (int how, const sigset_t *new_mask, sigset_t *old_mask)
+#undef pthread_sigmask
+{
+#if HAVE_PTHREAD_SIGMASK
+ int ret;
+
+# if PTHREAD_SIGMASK_INEFFECTIVE
+ sigset_t omask, omask_copy;
+ sigset_t *old_mask_ptr = &omask;
+ sigemptyset (&omask);
+ /* Add a signal unlikely to be blocked, so that OMASK_COPY
+ is unlikely to match the actual mask. */
+ sigaddset (&omask, SIGILL);
+ memcpy (&omask_copy, &omask, sizeof omask);
+# else
+ sigset_t *old_mask_ptr = old_mask;
+# endif
+
+ ret = pthread_sigmask (how, new_mask, old_mask_ptr);
+
+# if PTHREAD_SIGMASK_INEFFECTIVE
+ if (ret == 0)
+ {
+ /* Detect whether pthread_sigmask is currently ineffective.
+ Don't cache the information: libpthread.so could be dynamically
+ loaded after the program started and after pthread_sigmask was
+ called for the first time. */
+ if (memcmp (&omask_copy, &omask, sizeof omask) == 0
+ && pthread_sigmask (1729, &omask_copy, NULL) == 0)
+ {
+ /* pthread_sigmask is currently ineffective. The program is not
+ linked to -lpthread. So use sigprocmask instead. */
+ return (sigprocmask (how, new_mask, old_mask) < 0 ? errno : 0);
+ }
+
+ if (old_mask)
+ memcpy (old_mask, &omask, sizeof omask);
+ }
+# endif
+# if PTHREAD_SIGMASK_FAILS_WITH_ERRNO
+ if (ret == -1)
+ return errno;
+# endif
+# if PTHREAD_SIGMASK_UNBLOCK_BUG
+ if (ret == 0
+ && new_mask != NULL
+ && (how == SIG_UNBLOCK || how == SIG_SETMASK))
+ {
+ /* Give the OS the opportunity to raise signals that were pending before
+ the pthread_sigmask call and have now been unblocked. */
+ usleep (1);
+ }
+# endif
+ return ret;
+#else
+ int ret = sigprocmask (how, new_mask, old_mask);
+ return (ret < 0 ? errno : 0);
+#endif
+}
diff --git a/gl/lib/raise.c b/gl/lib/raise.c
new file mode 100644
index 0000000..385ddd3
--- /dev/null
+++ b/gl/lib/raise.c
@@ -0,0 +1,83 @@
+/* Provide a non-threads replacement for the POSIX raise function.
+
+ Copyright (C) 2002-2003, 2005-2006, 2009-2022 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 2.1 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 Jim Meyering and Bruno Haible */
+
+#include <config.h>
+
+/* Specification. */
+#include <signal.h>
+
+#if HAVE_RAISE
+/* Native Windows platform. */
+
+# include <errno.h>
+
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+# endif
+
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+/* Forward declaration. */
+static int raise_nothrow (int sig);
+# else
+# define raise_nothrow raise
+# endif
+
+#else
+/* An old Unix platform. */
+
+# include <unistd.h>
+
+#endif
+
+int
+raise (int sig)
+#undef raise
+{
+#if GNULIB_defined_signal_blocking && GNULIB_defined_SIGPIPE
+ if (sig == SIGPIPE)
+ return _gl_raise_SIGPIPE ();
+#endif
+
+#if HAVE_RAISE
+ return raise_nothrow (sig);
+#else
+ return kill (getpid (), sig);
+#endif
+}
+
+#if HAVE_RAISE && HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static int
+raise_nothrow (int sig)
+{
+ int result;
+
+ TRY_MSVC_INVAL
+ {
+ result = raise (sig);
+ }
+ CATCH_MSVC_INVAL
+ {
+ result = -1;
+ errno = EINVAL;
+ }
+ DONE_MSVC_INVAL;
+
+ return result;
+}
+#endif
diff --git a/gl/lib/rawmemchr.c b/gl/lib/rawmemchr.c
new file mode 100644
index 0000000..ea68c1b
--- /dev/null
+++ b/gl/lib/rawmemchr.c
@@ -0,0 +1,125 @@
+/* Searching in a string.
+ Copyright (C) 2008-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <string.h>
+
+/* A function definition is only needed if HAVE_RAWMEMCHR is not defined. */
+#if !HAVE_RAWMEMCHR
+
+# include <limits.h>
+# include <stdalign.h>
+# include <stdint.h>
+
+# include "verify.h"
+
+/* Find the first occurrence of C in S. */
+void *
+rawmemchr (const void *s, int c_in)
+{
+ /* Change this typedef to experiment with performance. */
+ typedef uintptr_t longword;
+ /* If you change the "uintptr_t", you should change UINTPTR_WIDTH to match.
+ This verifies that the type does not have padding bits. */
+ verify (UINTPTR_WIDTH == UCHAR_WIDTH * sizeof (longword));
+
+ const unsigned char *char_ptr;
+ unsigned char c = c_in;
+
+ /* Handle the first few bytes by reading one byte at a time.
+ Do this until CHAR_PTR is aligned on a longword boundary. */
+ for (char_ptr = (const unsigned char *) s;
+ (uintptr_t) char_ptr % alignof (longword) != 0;
+ ++char_ptr)
+ if (*char_ptr == c)
+ return (void *) char_ptr;
+
+ longword const *longword_ptr = s = char_ptr;
+
+ /* Compute auxiliary longword values:
+ repeated_one is a value which has a 1 in every byte.
+ repeated_c has c in every byte. */
+ longword repeated_one = (longword) -1 / UCHAR_MAX;
+ longword repeated_c = repeated_one * c;
+ longword repeated_hibit = repeated_one * (UCHAR_MAX / 2 + 1);
+
+ /* Instead of the traditional loop which tests each byte, we will
+ test a longword at a time. The tricky part is testing if any of
+ the bytes in the longword in question are equal to
+ c. We first use an xor with repeated_c. This reduces the task
+ to testing whether any of the bytes in longword1 is zero.
+
+ (The following comments assume 8-bit bytes, as POSIX requires;
+ the code's use of UCHAR_MAX should work even if bytes have more
+ than 8 bits.)
+
+ We compute tmp =
+ ((longword1 - repeated_one) & ~longword1) & (repeated_one * 0x80).
+ That is, we perform the following operations:
+ 1. Subtract repeated_one.
+ 2. & ~longword1.
+ 3. & a mask consisting of 0x80 in every byte.
+ Consider what happens in each byte:
+ - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff,
+ and step 3 transforms it into 0x80. A carry can also be propagated
+ to more significant bytes.
+ - If a byte of longword1 is nonzero, let its lowest 1 bit be at
+ position k (0 <= k <= 7); so the lowest k bits are 0. After step 1,
+ the byte ends in a single bit of value 0 and k bits of value 1.
+ After step 2, the result is just k bits of value 1: 2^k - 1. After
+ step 3, the result is 0. And no carry is produced.
+ So, if longword1 has only non-zero bytes, tmp is zero.
+ Whereas if longword1 has a zero byte, call j the position of the least
+ significant zero byte. Then the result has a zero at positions 0, ...,
+ j-1 and a 0x80 at position j. We cannot predict the result at the more
+ significant bytes (positions j+1..3), but it does not matter since we
+ already have a non-zero bit at position 8*j+7.
+
+ The test whether any byte in longword1 is zero is equivalent
+ to testing whether tmp is nonzero.
+
+ This test can read beyond the end of a string, depending on where
+ C_IN is encountered. However, this is considered safe since the
+ initialization phase ensured that the read will be aligned,
+ therefore, the read will not cross page boundaries and will not
+ cause a fault. */
+
+ while (1)
+ {
+ longword longword1 = *longword_ptr ^ repeated_c;
+
+ if ((((longword1 - repeated_one) & ~longword1) & repeated_hibit) != 0)
+ break;
+ longword_ptr++;
+ }
+
+ char_ptr = s = longword_ptr;
+
+ /* At this point, we know that one of the sizeof (longword) bytes
+ starting at char_ptr is == c. If we knew endianness, we
+ could determine the first such byte without any further memory
+ accesses, just by looking at the tmp result from the last loop
+ iteration. However, the following simple and portable code does
+ not attempt this potential optimization. */
+
+ while (*char_ptr != c)
+ char_ptr++;
+ return (void *) char_ptr;
+}
+
+#endif
diff --git a/gl/lib/rawmemchr.valgrind b/gl/lib/rawmemchr.valgrind
new file mode 100644
index 0000000..64cf86c
--- /dev/null
+++ b/gl/lib/rawmemchr.valgrind
@@ -0,0 +1,28 @@
+# Suppress a valgrind message about use of uninitialized memory in rawmemchr().
+
+# Copyright (C) 2008-2022 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 2.1 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/>.
+
+# This use is OK because it provides only a speedup.
+{
+ rawmemchr-value4
+ Memcheck:Value4
+ fun:rawmemchr
+}
+{
+ rawmemchr-value8
+ Memcheck:Value8
+ fun:rawmemchr
+}
diff --git a/gl/lib/readdir.c b/gl/lib/readdir.c
new file mode 100644
index 0000000..8e841df
--- /dev/null
+++ b/gl/lib/readdir.c
@@ -0,0 +1,102 @@
+/* Read the next entry of a directory.
+ Copyright (C) 2011-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <dirent.h>
+
+#include <errno.h>
+#include <stddef.h>
+
+#include "dirent-private.h"
+
+/* Don't assume that UNICODE is not defined. */
+#undef FindNextFile
+#define FindNextFile FindNextFileA
+
+struct dirent *
+readdir (DIR *dirp)
+{
+ char type;
+ struct dirent *result;
+
+ /* There is no need to add code to produce entries for "." and "..".
+ According to the POSIX:2008 section "4.12 Pathname Resolution"
+ <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html>
+ "." and ".." are syntactic entities.
+ POSIX also says:
+ "If entries for dot or dot-dot exist, one entry shall be returned
+ for dot and one entry shall be returned for dot-dot; otherwise,
+ they shall not be returned." */
+
+ switch (dirp->status)
+ {
+ case -2:
+ /* End of directory already reached. */
+ return NULL;
+ case -1:
+ break;
+ case 0:
+ if (!FindNextFile (dirp->current, &dirp->entry))
+ {
+ switch (GetLastError ())
+ {
+ case ERROR_NO_MORE_FILES:
+ dirp->status = -2;
+ return NULL;
+ default:
+ errno = EIO;
+ return NULL;
+ }
+ }
+ break;
+ default:
+ errno = dirp->status;
+ return NULL;
+ }
+
+ dirp->status = 0;
+
+ if (dirp->entry.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+ type = DT_DIR;
+ else if (dirp->entry.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
+ type = DT_LNK;
+ else if ((dirp->entry.dwFileAttributes
+ & ~(FILE_ATTRIBUTE_READONLY
+ | FILE_ATTRIBUTE_HIDDEN
+ | FILE_ATTRIBUTE_SYSTEM
+ | FILE_ATTRIBUTE_ARCHIVE
+ | FILE_ATTRIBUTE_NORMAL
+ | FILE_ATTRIBUTE_TEMPORARY
+ | FILE_ATTRIBUTE_SPARSE_FILE
+ | FILE_ATTRIBUTE_COMPRESSED
+ | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
+ | FILE_ATTRIBUTE_ENCRYPTED)) == 0)
+ /* Devices like COM1, LPT1, NUL would also have the attributes 0x20 but
+ they cannot occur here. */
+ type = DT_REG;
+ else
+ type = DT_UNKNOWN;
+
+ /* Reuse the memory of dirp->entry for the result. */
+ result =
+ (struct dirent *)
+ ((char *) dirp->entry.cFileName - offsetof (struct dirent, d_name[0]));
+ result->d_type = type;
+
+ return result;
+}
diff --git a/gl/lib/readlink.c b/gl/lib/readlink.c
new file mode 100644
index 0000000..ed03cc8
--- /dev/null
+++ b/gl/lib/readlink.c
@@ -0,0 +1,104 @@
+/* Read the contents of a symbolic link.
+ Copyright (C) 2003-2007, 2009-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#include <errno.h>
+#include <string.h>
+#include <sys/stat.h>
+
+#if !HAVE_READLINK
+
+/* readlink() substitute for systems that don't have a readlink() function,
+ such as DJGPP 2.03 and mingw32. */
+
+ssize_t
+readlink (char const *file, _GL_UNUSED char *buf,
+ _GL_UNUSED size_t bufsize)
+{
+ struct stat statbuf;
+
+ /* In general we should use lstat() here, not stat(). But on platforms
+ without symbolic links, lstat() - if it exists - would be equivalent to
+ stat(), therefore we can use stat(). This saves us a configure check. */
+ if (stat (file, &statbuf) >= 0)
+ errno = EINVAL;
+ return -1;
+}
+
+#else /* HAVE_READLINK */
+
+# undef readlink
+
+/* readlink() wrapper that uses correct types, for systems like cygwin
+ 1.5.x where readlink returns int, and which rejects trailing slash,
+ for Solaris 9. */
+
+ssize_t
+rpl_readlink (char const *file, char *buf, size_t bufsize)
+{
+# if READLINK_TRAILING_SLASH_BUG
+ size_t file_len = strlen (file);
+ if (file_len && file[file_len - 1] == '/')
+ {
+ /* Even if FILE without the slash is a symlink to a directory,
+ both lstat() and stat() must resolve the trailing slash to
+ the directory rather than the symlink. We can therefore
+ safely use stat() to distinguish between EINVAL and
+ ENOTDIR/ENOENT, avoiding extra overhead of rpl_lstat(). */
+ struct stat st;
+ if (stat (file, &st) == 0 || errno == EOVERFLOW)
+ errno = EINVAL;
+ return -1;
+ }
+# endif /* READLINK_TRAILING_SLASH_BUG */
+
+ ssize_t r = readlink (file, buf, bufsize);
+
+# if READLINK_TRUNCATE_BUG
+ if (r < 0 && errno == ERANGE)
+ {
+ /* Try again with a bigger buffer. This is just for test cases;
+ real code invariably discards short reads. */
+ char stackbuf[4032];
+ r = readlink (file, stackbuf, sizeof stackbuf);
+ if (r < 0)
+ {
+ if (errno == ERANGE)
+ {
+ /* Clear the buffer, which is good enough for real code.
+ Thankfully, no test cases try short reads of enormous
+ symlinks and what would be the point anyway? */
+ r = bufsize;
+ memset (buf, 0, r);
+ }
+ }
+ else
+ {
+ if (bufsize < r)
+ r = bufsize;
+ memcpy (buf, stackbuf, r);
+ }
+ }
+# endif
+
+ return r;
+}
+
+#endif /* HAVE_READLINK */
diff --git a/gl/lib/readlinkat.c b/gl/lib/readlinkat.c
new file mode 100644
index 0000000..ab45e14
--- /dev/null
+++ b/gl/lib/readlinkat.c
@@ -0,0 +1,113 @@
+/* Read a symlink relative to an open directory.
+ Copyright (C) 2009-2022 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 Eric Blake */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+
+#if HAVE_READLINKAT
+
+# undef fstatat
+# undef readlinkat
+
+ssize_t
+rpl_readlinkat (int fd, char const *file, char *buf, size_t bufsize)
+{
+# if READLINK_TRAILING_SLASH_BUG
+ size_t file_len = strlen (file);
+ if (file_len && file[file_len - 1] == '/')
+ {
+ /* Even if FILE without the slash is a symlink to a directory,
+ both lstat() and stat() must resolve the trailing slash to
+ the directory rather than the symlink. We can therefore
+ safely use fstatat(..., 0) to distinguish between EINVAL and
+ ENOTDIR/ENOENT, avoiding extra overhead of rpl_fstatat(). */
+ struct stat st;
+ if (fstatat (fd, file, &st, 0) == 0 || errno == EOVERFLOW)
+ errno = EINVAL;
+ return -1;
+ }
+# endif /* READLINK_TRAILING_SLASH_BUG */
+
+ ssize_t r = readlinkat (fd, file, buf, bufsize);
+
+# if READLINK_TRUNCATE_BUG
+ if (r < 0 && errno == ERANGE)
+ {
+ /* Try again with a bigger buffer. This is just for test cases;
+ real code invariably discards short reads. */
+ char stackbuf[4032];
+ r = readlinkat (fd, file, stackbuf, sizeof stackbuf);
+ if (r < 0)
+ {
+ if (errno == ERANGE)
+ {
+ /* Clear the buffer, which is good enough for real code.
+ Thankfully, no test cases try short reads of enormous
+ symlinks and what would be the point anyway? */
+ r = bufsize;
+ memset (buf, 0, r);
+ }
+ }
+ else
+ {
+ if (bufsize < r)
+ r = bufsize;
+ memcpy (buf, stackbuf, r);
+ }
+ }
+# endif
+
+ return r;
+}
+
+#else
+
+/* Gnulib provides a readlink stub for mingw; use it for distinction
+ between EINVAL and ENOENT, rather than always failing with ENOSYS. */
+
+/* POSIX 2008 says that unlike readlink, readlinkat returns 0 for
+ success instead of the buffer length. But this would render
+ readlinkat worthless since readlink does not guarantee a
+ NUL-terminated buffer. Assume this was a bug in POSIX. */
+
+/* Read the contents of symlink FILE into buffer BUF of size BUFSIZE, in the
+ directory open on descriptor FD. If possible, do it without changing
+ the working directory. Otherwise, resort to using save_cwd/fchdir,
+ then readlink/restore_cwd. If either the save_cwd or the restore_cwd
+ fails, then give a diagnostic and exit nonzero. */
+
+# define AT_FUNC_NAME readlinkat
+# define AT_FUNC_F1 readlink
+# define AT_FUNC_POST_FILE_PARAM_DECLS , char *buf, size_t bufsize
+# define AT_FUNC_POST_FILE_ARGS , buf, bufsize
+# define AT_FUNC_RESULT ssize_t
+# include "at-func.c"
+# undef AT_FUNC_NAME
+# undef AT_FUNC_F1
+# undef AT_FUNC_POST_FILE_PARAM_DECLS
+# undef AT_FUNC_POST_FILE_ARGS
+# undef AT_FUNC_RESULT
+
+#endif
diff --git a/gl/lib/realloc.c b/gl/lib/realloc.c
new file mode 100644
index 0000000..c878381
--- /dev/null
+++ b/gl/lib/realloc.c
@@ -0,0 +1,63 @@
+/* realloc() function that is glibc compatible.
+
+ Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2022 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 2.1 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 Jim Meyering and Bruno Haible */
+
+#include <config.h>
+
+#include <stdlib.h>
+
+#include <errno.h>
+
+#include "xalloc-oversized.h"
+
+/* Call the system's realloc below. This file does not define
+ _GL_USE_STDLIB_ALLOC because it needs Gnulib's malloc if present. */
+#undef realloc
+
+/* Change the size of an allocated block of memory P to N bytes,
+ with error checking. If P is NULL, use malloc. Otherwise if N is zero,
+ free P and return NULL. */
+
+void *
+rpl_realloc (void *p, size_t n)
+{
+ if (p == NULL)
+ return malloc (n);
+
+ if (n == 0)
+ {
+ free (p);
+ return NULL;
+ }
+
+ if (xalloc_oversized (n, 1))
+ {
+ errno = ENOMEM;
+ return NULL;
+ }
+
+ void *result = realloc (p, n);
+
+#if !HAVE_MALLOC_POSIX
+ if (result == NULL)
+ errno = ENOMEM;
+#endif
+
+ return result;
+}
diff --git a/gl/lib/reallocarray.c b/gl/lib/reallocarray.c
new file mode 100644
index 0000000..bc4cba4
--- /dev/null
+++ b/gl/lib/reallocarray.c
@@ -0,0 +1,39 @@
+/* reallocarray function that is glibc compatible.
+
+ Copyright (C) 2017-2022 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 2.1 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 Darshit Shah */
+
+#include <config.h>
+
+#include <stdlib.h>
+#include <errno.h>
+
+#include "intprops.h"
+
+void *
+reallocarray (void *ptr, size_t nmemb, size_t size)
+{
+ size_t nbytes;
+ if (INT_MULTIPLY_WRAPV (nmemb, size, &nbytes))
+ {
+ errno = ENOMEM;
+ return NULL;
+ }
+
+ /* Rely on the semantics of GNU realloc. */
+ return realloc (ptr, nbytes);
+}
diff --git a/gl/lib/regcomp.c b/gl/lib/regcomp.c
new file mode 100644
index 0000000..122c3de
--- /dev/null
+++ b/gl/lib/regcomp.c
@@ -0,0 +1,3788 @@
+/* Extended regular expression matching and search library.
+ Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifdef _LIBC
+# include <locale/weight.h>
+#endif
+
+static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern,
+ size_t length, reg_syntax_t syntax);
+static void re_compile_fastmap_iter (regex_t *bufp,
+ const re_dfastate_t *init_state,
+ char *fastmap);
+static reg_errcode_t init_dfa (re_dfa_t *dfa, size_t pat_len);
+static void free_charset (re_charset_t *cset);
+static void free_workarea_compile (regex_t *preg);
+static reg_errcode_t create_initial_state (re_dfa_t *dfa);
+static void optimize_utf8 (re_dfa_t *dfa);
+static reg_errcode_t analyze (regex_t *preg);
+static reg_errcode_t preorder (bin_tree_t *root,
+ reg_errcode_t (fn (void *, bin_tree_t *)),
+ void *extra);
+static reg_errcode_t postorder (bin_tree_t *root,
+ reg_errcode_t (fn (void *, bin_tree_t *)),
+ void *extra);
+static reg_errcode_t optimize_subexps (void *extra, bin_tree_t *node);
+static reg_errcode_t lower_subexps (void *extra, bin_tree_t *node);
+static bin_tree_t *lower_subexp (reg_errcode_t *err, regex_t *preg,
+ bin_tree_t *node);
+static reg_errcode_t calc_first (void *extra, bin_tree_t *node);
+static reg_errcode_t calc_next (void *extra, bin_tree_t *node);
+static reg_errcode_t link_nfa_nodes (void *extra, bin_tree_t *node);
+static Idx duplicate_node (re_dfa_t *dfa, Idx org_idx, unsigned int constraint);
+static Idx search_duplicated_node (const re_dfa_t *dfa, Idx org_node,
+ unsigned int constraint);
+static reg_errcode_t calc_eclosure (re_dfa_t *dfa);
+static reg_errcode_t calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa,
+ Idx node, bool root);
+static reg_errcode_t calc_inveclosure (re_dfa_t *dfa);
+static Idx fetch_number (re_string_t *input, re_token_t *token,
+ reg_syntax_t syntax);
+static int peek_token (re_token_t *token, re_string_t *input,
+ reg_syntax_t syntax);
+static bin_tree_t *parse (re_string_t *regexp, regex_t *preg,
+ reg_syntax_t syntax, reg_errcode_t *err);
+static bin_tree_t *parse_reg_exp (re_string_t *regexp, regex_t *preg,
+ re_token_t *token, reg_syntax_t syntax,
+ Idx nest, reg_errcode_t *err);
+static bin_tree_t *parse_branch (re_string_t *regexp, regex_t *preg,
+ re_token_t *token, reg_syntax_t syntax,
+ Idx nest, reg_errcode_t *err);
+static bin_tree_t *parse_expression (re_string_t *regexp, regex_t *preg,
+ re_token_t *token, reg_syntax_t syntax,
+ Idx nest, reg_errcode_t *err);
+static bin_tree_t *parse_sub_exp (re_string_t *regexp, regex_t *preg,
+ re_token_t *token, reg_syntax_t syntax,
+ Idx nest, reg_errcode_t *err);
+static bin_tree_t *parse_dup_op (bin_tree_t *dup_elem, re_string_t *regexp,
+ re_dfa_t *dfa, re_token_t *token,
+ reg_syntax_t syntax, reg_errcode_t *err);
+static bin_tree_t *parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa,
+ re_token_t *token, reg_syntax_t syntax,
+ reg_errcode_t *err);
+static reg_errcode_t parse_bracket_element (bracket_elem_t *elem,
+ re_string_t *regexp,
+ re_token_t *token, int token_len,
+ re_dfa_t *dfa,
+ reg_syntax_t syntax,
+ bool accept_hyphen);
+static reg_errcode_t parse_bracket_symbol (bracket_elem_t *elem,
+ re_string_t *regexp,
+ re_token_t *token);
+static reg_errcode_t build_equiv_class (bitset_t sbcset,
+ re_charset_t *mbcset,
+ Idx *equiv_class_alloc,
+ const unsigned char *name);
+static reg_errcode_t build_charclass (RE_TRANSLATE_TYPE trans,
+ bitset_t sbcset,
+ re_charset_t *mbcset,
+ Idx *char_class_alloc,
+ const char *class_name,
+ reg_syntax_t syntax);
+static bin_tree_t *build_charclass_op (re_dfa_t *dfa,
+ RE_TRANSLATE_TYPE trans,
+ const char *class_name,
+ const char *extra,
+ bool non_match, reg_errcode_t *err);
+static bin_tree_t *create_tree (re_dfa_t *dfa,
+ bin_tree_t *left, bin_tree_t *right,
+ re_token_type_t type);
+static bin_tree_t *create_token_tree (re_dfa_t *dfa,
+ bin_tree_t *left, bin_tree_t *right,
+ const re_token_t *token);
+static bin_tree_t *duplicate_tree (const bin_tree_t *src, re_dfa_t *dfa);
+static void free_token (re_token_t *node);
+static reg_errcode_t free_tree (void *extra, bin_tree_t *node);
+static reg_errcode_t mark_opt_subexp (void *extra, bin_tree_t *node);
+
+/* This table gives an error message for each of the error codes listed
+ in regex.h. Obviously the order here has to be same as there.
+ POSIX doesn't require that we do anything for REG_NOERROR,
+ but why not be nice? */
+
+static const char __re_error_msgid[] =
+ {
+#define REG_NOERROR_IDX 0
+ gettext_noop ("Success") /* REG_NOERROR */
+ "\0"
+#define REG_NOMATCH_IDX (REG_NOERROR_IDX + sizeof "Success")
+ gettext_noop ("No match") /* REG_NOMATCH */
+ "\0"
+#define REG_BADPAT_IDX (REG_NOMATCH_IDX + sizeof "No match")
+ gettext_noop ("Invalid regular expression") /* REG_BADPAT */
+ "\0"
+#define REG_ECOLLATE_IDX (REG_BADPAT_IDX + sizeof "Invalid regular expression")
+ gettext_noop ("Invalid collation character") /* REG_ECOLLATE */
+ "\0"
+#define REG_ECTYPE_IDX (REG_ECOLLATE_IDX + sizeof "Invalid collation character")
+ gettext_noop ("Invalid character class name") /* REG_ECTYPE */
+ "\0"
+#define REG_EESCAPE_IDX (REG_ECTYPE_IDX + sizeof "Invalid character class name")
+ gettext_noop ("Trailing backslash") /* REG_EESCAPE */
+ "\0"
+#define REG_ESUBREG_IDX (REG_EESCAPE_IDX + sizeof "Trailing backslash")
+ gettext_noop ("Invalid back reference") /* REG_ESUBREG */
+ "\0"
+#define REG_EBRACK_IDX (REG_ESUBREG_IDX + sizeof "Invalid back reference")
+ gettext_noop ("Unmatched [, [^, [:, [., or [=") /* REG_EBRACK */
+ "\0"
+#define REG_EPAREN_IDX (REG_EBRACK_IDX + sizeof "Unmatched [, [^, [:, [., or [=")
+ gettext_noop ("Unmatched ( or \\(") /* REG_EPAREN */
+ "\0"
+#define REG_EBRACE_IDX (REG_EPAREN_IDX + sizeof "Unmatched ( or \\(")
+ gettext_noop ("Unmatched \\{") /* REG_EBRACE */
+ "\0"
+#define REG_BADBR_IDX (REG_EBRACE_IDX + sizeof "Unmatched \\{")
+ gettext_noop ("Invalid content of \\{\\}") /* REG_BADBR */
+ "\0"
+#define REG_ERANGE_IDX (REG_BADBR_IDX + sizeof "Invalid content of \\{\\}")
+ gettext_noop ("Invalid range end") /* REG_ERANGE */
+ "\0"
+#define REG_ESPACE_IDX (REG_ERANGE_IDX + sizeof "Invalid range end")
+ gettext_noop ("Memory exhausted") /* REG_ESPACE */
+ "\0"
+#define REG_BADRPT_IDX (REG_ESPACE_IDX + sizeof "Memory exhausted")
+ gettext_noop ("Invalid preceding regular expression") /* REG_BADRPT */
+ "\0"
+#define REG_EEND_IDX (REG_BADRPT_IDX + sizeof "Invalid preceding regular expression")
+ gettext_noop ("Premature end of regular expression") /* REG_EEND */
+ "\0"
+#define REG_ESIZE_IDX (REG_EEND_IDX + sizeof "Premature end of regular expression")
+ gettext_noop ("Regular expression too big") /* REG_ESIZE */
+ "\0"
+#define REG_ERPAREN_IDX (REG_ESIZE_IDX + sizeof "Regular expression too big")
+ gettext_noop ("Unmatched ) or \\)") /* REG_ERPAREN */
+ };
+
+static const size_t __re_error_msgid_idx[] =
+ {
+ REG_NOERROR_IDX,
+ REG_NOMATCH_IDX,
+ REG_BADPAT_IDX,
+ REG_ECOLLATE_IDX,
+ REG_ECTYPE_IDX,
+ REG_EESCAPE_IDX,
+ REG_ESUBREG_IDX,
+ REG_EBRACK_IDX,
+ REG_EPAREN_IDX,
+ REG_EBRACE_IDX,
+ REG_BADBR_IDX,
+ REG_ERANGE_IDX,
+ REG_ESPACE_IDX,
+ REG_BADRPT_IDX,
+ REG_EEND_IDX,
+ REG_ESIZE_IDX,
+ REG_ERPAREN_IDX
+ };
+
+/* Entry points for GNU code. */
+
+/* re_compile_pattern is the GNU regular expression compiler: it
+ compiles PATTERN (of length LENGTH) and puts the result in BUFP.
+ Returns 0 if the pattern was valid, otherwise an error string.
+
+ Assumes the 'allocated' (and perhaps 'buffer') and 'translate' fields
+ are set in BUFP on entry. */
+
+const char *
+re_compile_pattern (const char *pattern, size_t length,
+ struct re_pattern_buffer *bufp)
+{
+ reg_errcode_t ret;
+
+ /* And GNU code determines whether or not to get register information
+ by passing null for the REGS argument to re_match, etc., not by
+ setting no_sub, unless RE_NO_SUB is set. */
+ bufp->no_sub = !!(re_syntax_options & RE_NO_SUB);
+
+ /* Match anchors at newline. */
+ bufp->newline_anchor = 1;
+
+ ret = re_compile_internal (bufp, pattern, length, re_syntax_options);
+
+ if (!ret)
+ return NULL;
+ return gettext (__re_error_msgid + __re_error_msgid_idx[(int) ret]);
+}
+weak_alias (__re_compile_pattern, re_compile_pattern)
+
+/* Set by 're_set_syntax' to the current regexp syntax to recognize. Can
+ also be assigned to arbitrarily: each pattern buffer stores its own
+ syntax, so it can be changed between regex compilations. */
+/* This has no initializer because initialized variables in Emacs
+ become read-only after dumping. */
+reg_syntax_t re_syntax_options;
+
+
+/* Specify the precise syntax of regexps for compilation. This provides
+ for compatibility for various utilities which historically have
+ different, incompatible syntaxes.
+
+ The argument SYNTAX is a bit mask comprised of the various bits
+ defined in regex.h. We return the old syntax. */
+
+reg_syntax_t
+re_set_syntax (reg_syntax_t syntax)
+{
+ reg_syntax_t ret = re_syntax_options;
+
+ re_syntax_options = syntax;
+ return ret;
+}
+weak_alias (__re_set_syntax, re_set_syntax)
+
+int
+re_compile_fastmap (struct re_pattern_buffer *bufp)
+{
+ re_dfa_t *dfa = bufp->buffer;
+ char *fastmap = bufp->fastmap;
+
+ memset (fastmap, '\0', sizeof (char) * SBC_MAX);
+ re_compile_fastmap_iter (bufp, dfa->init_state, fastmap);
+ if (dfa->init_state != dfa->init_state_word)
+ re_compile_fastmap_iter (bufp, dfa->init_state_word, fastmap);
+ if (dfa->init_state != dfa->init_state_nl)
+ re_compile_fastmap_iter (bufp, dfa->init_state_nl, fastmap);
+ if (dfa->init_state != dfa->init_state_begbuf)
+ re_compile_fastmap_iter (bufp, dfa->init_state_begbuf, fastmap);
+ bufp->fastmap_accurate = 1;
+ return 0;
+}
+weak_alias (__re_compile_fastmap, re_compile_fastmap)
+
+static __always_inline void
+re_set_fastmap (char *fastmap, bool icase, int ch)
+{
+ fastmap[ch] = 1;
+ if (icase)
+ fastmap[tolower (ch)] = 1;
+}
+
+/* Helper function for re_compile_fastmap.
+ Compile fastmap for the initial_state INIT_STATE. */
+
+static void
+re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
+ char *fastmap)
+{
+ re_dfa_t *dfa = bufp->buffer;
+ Idx node_cnt;
+ bool icase = (dfa->mb_cur_max == 1 && (bufp->syntax & RE_ICASE));
+ for (node_cnt = 0; node_cnt < init_state->nodes.nelem; ++node_cnt)
+ {
+ Idx node = init_state->nodes.elems[node_cnt];
+ re_token_type_t type = dfa->nodes[node].type;
+
+ if (type == CHARACTER)
+ {
+ re_set_fastmap (fastmap, icase, dfa->nodes[node].opr.c);
+ if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1)
+ {
+ unsigned char buf[MB_LEN_MAX];
+ unsigned char *p;
+ wchar_t wc;
+ mbstate_t state;
+
+ p = buf;
+ *p++ = dfa->nodes[node].opr.c;
+ while (++node < dfa->nodes_len
+ && dfa->nodes[node].type == CHARACTER
+ && dfa->nodes[node].mb_partial)
+ *p++ = dfa->nodes[node].opr.c;
+ memset (&state, '\0', sizeof (state));
+ if (__mbrtowc (&wc, (const char *) buf, p - buf,
+ &state) == p - buf
+ && (__wcrtomb ((char *) buf, __towlower (wc), &state)
+ != (size_t) -1))
+ re_set_fastmap (fastmap, false, buf[0]);
+ }
+ }
+ else if (type == SIMPLE_BRACKET)
+ {
+ int i, ch;
+ for (i = 0, ch = 0; i < BITSET_WORDS; ++i)
+ {
+ int j;
+ bitset_word_t w = dfa->nodes[node].opr.sbcset[i];
+ for (j = 0; j < BITSET_WORD_BITS; ++j, ++ch)
+ if (w & ((bitset_word_t) 1 << j))
+ re_set_fastmap (fastmap, icase, ch);
+ }
+ }
+ else if (type == COMPLEX_BRACKET)
+ {
+ re_charset_t *cset = dfa->nodes[node].opr.mbcset;
+ Idx i;
+
+#ifdef _LIBC
+ /* See if we have to try all bytes which start multiple collation
+ elements.
+ e.g. In da_DK, we want to catch 'a' since "aa" is a valid
+ collation element, and don't catch 'b' since 'b' is
+ the only collation element which starts from 'b' (and
+ it is caught by SIMPLE_BRACKET). */
+ if (_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES) != 0
+ && (cset->ncoll_syms || cset->nranges))
+ {
+ const int32_t *table = (const int32_t *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
+ for (i = 0; i < SBC_MAX; ++i)
+ if (table[i] < 0)
+ re_set_fastmap (fastmap, icase, i);
+ }
+#endif /* _LIBC */
+
+ /* See if we have to start the match at all multibyte characters,
+ i.e. where we would not find an invalid sequence. This only
+ applies to multibyte character sets; for single byte character
+ sets, the SIMPLE_BRACKET again suffices. */
+ if (dfa->mb_cur_max > 1
+ && (cset->nchar_classes || cset->non_match || cset->nranges
+#ifdef _LIBC
+ || cset->nequiv_classes
+#endif /* _LIBC */
+ ))
+ {
+ unsigned char c = 0;
+ do
+ {
+ mbstate_t mbs;
+ memset (&mbs, 0, sizeof (mbs));
+ if (__mbrtowc (NULL, (char *) &c, 1, &mbs) == (size_t) -2)
+ re_set_fastmap (fastmap, false, (int) c);
+ }
+ while (++c != 0);
+ }
+
+ else
+ {
+ /* ... Else catch all bytes which can start the mbchars. */
+ for (i = 0; i < cset->nmbchars; ++i)
+ {
+ char buf[256];
+ mbstate_t state;
+ memset (&state, '\0', sizeof (state));
+ if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1)
+ re_set_fastmap (fastmap, icase, *(unsigned char *) buf);
+ if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1)
+ {
+ if (__wcrtomb (buf, __towlower (cset->mbchars[i]), &state)
+ != (size_t) -1)
+ re_set_fastmap (fastmap, false, *(unsigned char *) buf);
+ }
+ }
+ }
+ }
+ else if (type == OP_PERIOD || type == OP_UTF8_PERIOD || type == END_OF_RE)
+ {
+ memset (fastmap, '\1', sizeof (char) * SBC_MAX);
+ if (type == END_OF_RE)
+ bufp->can_be_null = 1;
+ return;
+ }
+ }
+}
+
+/* Entry point for POSIX code. */
+/* regcomp takes a regular expression as a string and compiles it.
+
+ PREG is a regex_t *. We do not expect any fields to be initialized,
+ since POSIX says we shouldn't. Thus, we set
+
+ 'buffer' to the compiled pattern;
+ 'used' to the length of the compiled pattern;
+ 'syntax' to RE_SYNTAX_POSIX_EXTENDED if the
+ REG_EXTENDED bit in CFLAGS is set; otherwise, to
+ RE_SYNTAX_POSIX_BASIC;
+ 'newline_anchor' to REG_NEWLINE being set in CFLAGS;
+ 'fastmap' to an allocated space for the fastmap;
+ 'fastmap_accurate' to zero;
+ 're_nsub' to the number of subexpressions in PATTERN.
+
+ PATTERN is the address of the pattern string.
+
+ CFLAGS is a series of bits which affect compilation.
+
+ If REG_EXTENDED is set, we use POSIX extended syntax; otherwise, we
+ use POSIX basic syntax.
+
+ If REG_NEWLINE is set, then . and [^...] don't match newline.
+ Also, regexec will try a match beginning after every newline.
+
+ If REG_ICASE is set, then we considers upper- and lowercase
+ versions of letters to be equivalent when matching.
+
+ If REG_NOSUB is set, then when PREG is passed to regexec, that
+ routine will report only success or failure, and nothing about the
+ registers.
+
+ It returns 0 if it succeeds, nonzero if it doesn't. (See regex.h for
+ the return codes and their meanings.) */
+
+int
+regcomp (regex_t *__restrict preg, const char *__restrict pattern, int cflags)
+{
+ reg_errcode_t ret;
+ reg_syntax_t syntax = ((cflags & REG_EXTENDED) ? RE_SYNTAX_POSIX_EXTENDED
+ : RE_SYNTAX_POSIX_BASIC);
+
+ preg->buffer = NULL;
+ preg->allocated = 0;
+ preg->used = 0;
+
+ /* Try to allocate space for the fastmap. */
+ preg->fastmap = re_malloc (char, SBC_MAX);
+ if (__glibc_unlikely (preg->fastmap == NULL))
+ return REG_ESPACE;
+
+ syntax |= (cflags & REG_ICASE) ? RE_ICASE : 0;
+
+ /* If REG_NEWLINE is set, newlines are treated differently. */
+ if (cflags & REG_NEWLINE)
+ { /* REG_NEWLINE implies neither . nor [^...] match newline. */
+ syntax &= ~RE_DOT_NEWLINE;
+ syntax |= RE_HAT_LISTS_NOT_NEWLINE;
+ /* It also changes the matching behavior. */
+ preg->newline_anchor = 1;
+ }
+ else
+ preg->newline_anchor = 0;
+ preg->no_sub = !!(cflags & REG_NOSUB);
+ preg->translate = NULL;
+
+ ret = re_compile_internal (preg, pattern, strlen (pattern), syntax);
+
+ /* POSIX doesn't distinguish between an unmatched open-group and an
+ unmatched close-group: both are REG_EPAREN. */
+ if (ret == REG_ERPAREN)
+ ret = REG_EPAREN;
+
+ /* We have already checked preg->fastmap != NULL. */
+ if (__glibc_likely (ret == REG_NOERROR))
+ /* Compute the fastmap now, since regexec cannot modify the pattern
+ buffer. This function never fails in this implementation. */
+ (void) re_compile_fastmap (preg);
+ else
+ {
+ /* Some error occurred while compiling the expression. */
+ re_free (preg->fastmap);
+ preg->fastmap = NULL;
+ }
+
+ return (int) ret;
+}
+libc_hidden_def (__regcomp)
+weak_alias (__regcomp, regcomp)
+
+/* Returns a message corresponding to an error code, ERRCODE, returned
+ from either regcomp or regexec. We don't use PREG here. */
+
+size_t
+regerror (int errcode, const regex_t *__restrict preg, char *__restrict errbuf,
+ size_t errbuf_size)
+{
+ const char *msg;
+ size_t msg_size;
+ int nerrcodes = sizeof __re_error_msgid_idx / sizeof __re_error_msgid_idx[0];
+
+ if (__glibc_unlikely (errcode < 0 || errcode >= nerrcodes))
+ /* Only error codes returned by the rest of the code should be passed
+ to this routine. If we are given anything else, or if other regex
+ code generates an invalid error code, then the program has a bug.
+ Dump core so we can fix it. */
+ abort ();
+
+ msg = gettext (__re_error_msgid + __re_error_msgid_idx[errcode]);
+
+ msg_size = strlen (msg) + 1; /* Includes the null. */
+
+ if (__glibc_likely (errbuf_size != 0))
+ {
+ size_t cpy_size = msg_size;
+ if (__glibc_unlikely (msg_size > errbuf_size))
+ {
+ cpy_size = errbuf_size - 1;
+ errbuf[cpy_size] = '\0';
+ }
+ memcpy (errbuf, msg, cpy_size);
+ }
+
+ return msg_size;
+}
+weak_alias (__regerror, regerror)
+
+
+/* This static array is used for the map to single-byte characters when
+ UTF-8 is used. Otherwise we would allocate memory just to initialize
+ it the same all the time. UTF-8 is the preferred encoding so this is
+ a worthwhile optimization. */
+static const bitset_t utf8_sb_map =
+{
+ /* Set the first 128 bits. */
+#if (defined __GNUC__ || __clang_major__ >= 4) && !defined __STRICT_ANSI__
+ [0 ... 0x80 / BITSET_WORD_BITS - 1] = BITSET_WORD_MAX
+#else
+# if 4 * BITSET_WORD_BITS < ASCII_CHARS
+# error "bitset_word_t is narrower than 32 bits"
+# elif 3 * BITSET_WORD_BITS < ASCII_CHARS
+ BITSET_WORD_MAX, BITSET_WORD_MAX, BITSET_WORD_MAX,
+# elif 2 * BITSET_WORD_BITS < ASCII_CHARS
+ BITSET_WORD_MAX, BITSET_WORD_MAX,
+# elif 1 * BITSET_WORD_BITS < ASCII_CHARS
+ BITSET_WORD_MAX,
+# endif
+ (BITSET_WORD_MAX
+ >> (SBC_MAX % BITSET_WORD_BITS == 0
+ ? 0
+ : BITSET_WORD_BITS - SBC_MAX % BITSET_WORD_BITS))
+#endif
+};
+
+
+static void
+free_dfa_content (re_dfa_t *dfa)
+{
+ Idx i, j;
+
+ if (dfa->nodes)
+ for (i = 0; i < dfa->nodes_len; ++i)
+ free_token (dfa->nodes + i);
+ re_free (dfa->nexts);
+ for (i = 0; i < dfa->nodes_len; ++i)
+ {
+ if (dfa->eclosures != NULL)
+ re_node_set_free (dfa->eclosures + i);
+ if (dfa->inveclosures != NULL)
+ re_node_set_free (dfa->inveclosures + i);
+ if (dfa->edests != NULL)
+ re_node_set_free (dfa->edests + i);
+ }
+ re_free (dfa->edests);
+ re_free (dfa->eclosures);
+ re_free (dfa->inveclosures);
+ re_free (dfa->nodes);
+
+ if (dfa->state_table)
+ for (i = 0; i <= dfa->state_hash_mask; ++i)
+ {
+ struct re_state_table_entry *entry = dfa->state_table + i;
+ for (j = 0; j < entry->num; ++j)
+ {
+ re_dfastate_t *state = entry->array[j];
+ free_state (state);
+ }
+ re_free (entry->array);
+ }
+ re_free (dfa->state_table);
+ if (dfa->sb_char != utf8_sb_map)
+ re_free (dfa->sb_char);
+ re_free (dfa->subexp_map);
+#ifdef DEBUG
+ re_free (dfa->re_str);
+#endif
+
+ re_free (dfa);
+}
+
+
+/* Free dynamically allocated space used by PREG. */
+
+void
+regfree (regex_t *preg)
+{
+ re_dfa_t *dfa = preg->buffer;
+ if (__glibc_likely (dfa != NULL))
+ {
+ lock_fini (dfa->lock);
+ free_dfa_content (dfa);
+ }
+ preg->buffer = NULL;
+ preg->allocated = 0;
+
+ re_free (preg->fastmap);
+ preg->fastmap = NULL;
+
+ re_free (preg->translate);
+ preg->translate = NULL;
+}
+libc_hidden_def (__regfree)
+weak_alias (__regfree, regfree)
+
+/* Entry points compatible with 4.2 BSD regex library. We don't define
+ them unless specifically requested. */
+
+#if defined _REGEX_RE_COMP || defined _LIBC
+
+/* BSD has one and only one pattern buffer. */
+static struct re_pattern_buffer re_comp_buf;
+
+char *
+# ifdef _LIBC
+/* Make these definitions weak in libc, so POSIX programs can redefine
+ these names if they don't use our functions, and still use
+ regcomp/regexec above without link errors. */
+weak_function
+# endif
+re_comp (const char *s)
+{
+ reg_errcode_t ret;
+ char *fastmap;
+
+ if (!s)
+ {
+ if (!re_comp_buf.buffer)
+ return gettext ("No previous regular expression");
+ return 0;
+ }
+
+ if (re_comp_buf.buffer)
+ {
+ fastmap = re_comp_buf.fastmap;
+ re_comp_buf.fastmap = NULL;
+ __regfree (&re_comp_buf);
+ memset (&re_comp_buf, '\0', sizeof (re_comp_buf));
+ re_comp_buf.fastmap = fastmap;
+ }
+
+ if (re_comp_buf.fastmap == NULL)
+ {
+ re_comp_buf.fastmap = re_malloc (char, SBC_MAX);
+ if (re_comp_buf.fastmap == NULL)
+ return (char *) gettext (__re_error_msgid
+ + __re_error_msgid_idx[(int) REG_ESPACE]);
+ }
+
+ /* Since 're_exec' always passes NULL for the 'regs' argument, we
+ don't need to initialize the pattern buffer fields which affect it. */
+
+ /* Match anchors at newlines. */
+ re_comp_buf.newline_anchor = 1;
+
+ ret = re_compile_internal (&re_comp_buf, s, strlen (s), re_syntax_options);
+
+ if (!ret)
+ return NULL;
+
+ /* Yes, we're discarding 'const' here if !HAVE_LIBINTL. */
+ return (char *) gettext (__re_error_msgid + __re_error_msgid_idx[(int) ret]);
+}
+
+#ifdef _LIBC
+libc_freeres_fn (free_mem)
+{
+ __regfree (&re_comp_buf);
+}
+#endif
+
+#endif /* _REGEX_RE_COMP */
+
+/* Internal entry point.
+ Compile the regular expression PATTERN, whose length is LENGTH.
+ SYNTAX indicate regular expression's syntax. */
+
+static reg_errcode_t
+re_compile_internal (regex_t *preg, const char * pattern, size_t length,
+ reg_syntax_t syntax)
+{
+ reg_errcode_t err = REG_NOERROR;
+ re_dfa_t *dfa;
+ re_string_t regexp;
+
+ /* Initialize the pattern buffer. */
+ preg->fastmap_accurate = 0;
+ preg->syntax = syntax;
+ preg->not_bol = preg->not_eol = 0;
+ preg->used = 0;
+ preg->re_nsub = 0;
+ preg->can_be_null = 0;
+ preg->regs_allocated = REGS_UNALLOCATED;
+
+ /* Initialize the dfa. */
+ dfa = preg->buffer;
+ if (__glibc_unlikely (preg->allocated < sizeof (re_dfa_t)))
+ {
+ /* If zero allocated, but buffer is non-null, try to realloc
+ enough space. This loses if buffer's address is bogus, but
+ that is the user's responsibility. If ->buffer is NULL this
+ is a simple allocation. */
+ dfa = re_realloc (preg->buffer, re_dfa_t, 1);
+ if (dfa == NULL)
+ return REG_ESPACE;
+ preg->allocated = sizeof (re_dfa_t);
+ preg->buffer = dfa;
+ }
+ preg->used = sizeof (re_dfa_t);
+
+ err = init_dfa (dfa, length);
+ if (__glibc_unlikely (err == REG_NOERROR && lock_init (dfa->lock) != 0))
+ err = REG_ESPACE;
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ free_dfa_content (dfa);
+ preg->buffer = NULL;
+ preg->allocated = 0;
+ return err;
+ }
+#ifdef DEBUG
+ /* Note: length+1 will not overflow since it is checked in init_dfa. */
+ dfa->re_str = re_malloc (char, length + 1);
+ strncpy (dfa->re_str, pattern, length + 1);
+#endif
+
+ err = re_string_construct (&regexp, pattern, length, preg->translate,
+ (syntax & RE_ICASE) != 0, dfa);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_compile_internal_free_return:
+ free_workarea_compile (preg);
+ re_string_destruct (&regexp);
+ lock_fini (dfa->lock);
+ free_dfa_content (dfa);
+ preg->buffer = NULL;
+ preg->allocated = 0;
+ return err;
+ }
+
+ /* Parse the regular expression, and build a structure tree. */
+ preg->re_nsub = 0;
+ dfa->str_tree = parse (&regexp, preg, syntax, &err);
+ if (__glibc_unlikely (dfa->str_tree == NULL))
+ goto re_compile_internal_free_return;
+
+ /* Analyze the tree and create the nfa. */
+ err = analyze (preg);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto re_compile_internal_free_return;
+
+ /* If possible, do searching in single byte encoding to speed things up. */
+ if (dfa->is_utf8 && !(syntax & RE_ICASE) && preg->translate == NULL)
+ optimize_utf8 (dfa);
+
+ /* Then create the initial state of the dfa. */
+ err = create_initial_state (dfa);
+
+ /* Release work areas. */
+ free_workarea_compile (preg);
+ re_string_destruct (&regexp);
+
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ lock_fini (dfa->lock);
+ free_dfa_content (dfa);
+ preg->buffer = NULL;
+ preg->allocated = 0;
+ }
+
+ return err;
+}
+
+/* Initialize DFA. We use the length of the regular expression PAT_LEN
+ as the initial length of some arrays. */
+
+static reg_errcode_t
+init_dfa (re_dfa_t *dfa, size_t pat_len)
+{
+ __re_size_t table_size;
+#ifndef _LIBC
+ const char *codeset_name;
+#endif
+ size_t max_i18n_object_size = MAX (sizeof (wchar_t), sizeof (wctype_t));
+ size_t max_object_size =
+ MAX (sizeof (struct re_state_table_entry),
+ MAX (sizeof (re_token_t),
+ MAX (sizeof (re_node_set),
+ MAX (sizeof (regmatch_t),
+ max_i18n_object_size))));
+
+ memset (dfa, '\0', sizeof (re_dfa_t));
+
+ /* Force allocation of str_tree_storage the first time. */
+ dfa->str_tree_storage_idx = BIN_TREE_STORAGE_SIZE;
+
+ /* Avoid overflows. The extra "/ 2" is for the table_size doubling
+ calculation below, and for similar doubling calculations
+ elsewhere. And it's <= rather than <, because some of the
+ doubling calculations add 1 afterwards. */
+ if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / max_object_size) / 2
+ <= pat_len))
+ return REG_ESPACE;
+
+ dfa->nodes_alloc = pat_len + 1;
+ dfa->nodes = re_malloc (re_token_t, dfa->nodes_alloc);
+
+ /* table_size = 2 ^ ceil(log pat_len) */
+ for (table_size = 1; ; table_size <<= 1)
+ if (table_size > pat_len)
+ break;
+
+ dfa->state_table = calloc (sizeof (struct re_state_table_entry), table_size);
+ dfa->state_hash_mask = table_size - 1;
+
+ dfa->mb_cur_max = MB_CUR_MAX;
+#ifdef _LIBC
+ if (dfa->mb_cur_max == 6
+ && strcmp (_NL_CURRENT (LC_CTYPE, _NL_CTYPE_CODESET_NAME), "UTF-8") == 0)
+ dfa->is_utf8 = 1;
+ dfa->map_notascii = (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MAP_TO_NONASCII)
+ != 0);
+#else
+ codeset_name = nl_langinfo (CODESET);
+ if ((codeset_name[0] == 'U' || codeset_name[0] == 'u')
+ && (codeset_name[1] == 'T' || codeset_name[1] == 't')
+ && (codeset_name[2] == 'F' || codeset_name[2] == 'f')
+ && strcmp (codeset_name + 3 + (codeset_name[3] == '-'), "8") == 0)
+ dfa->is_utf8 = 1;
+
+ /* We check exhaustively in the loop below if this charset is a
+ superset of ASCII. */
+ dfa->map_notascii = 0;
+#endif
+
+ if (dfa->mb_cur_max > 1)
+ {
+ if (dfa->is_utf8)
+ dfa->sb_char = (re_bitset_ptr_t) utf8_sb_map;
+ else
+ {
+ int i, j, ch;
+
+ dfa->sb_char = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1);
+ if (__glibc_unlikely (dfa->sb_char == NULL))
+ return REG_ESPACE;
+
+ /* Set the bits corresponding to single byte chars. */
+ for (i = 0, ch = 0; i < BITSET_WORDS; ++i)
+ for (j = 0; j < BITSET_WORD_BITS; ++j, ++ch)
+ {
+ wint_t wch = __btowc (ch);
+ if (wch != WEOF)
+ dfa->sb_char[i] |= (bitset_word_t) 1 << j;
+#ifndef _LIBC
+ if (isascii (ch) && wch != ch)
+ dfa->map_notascii = 1;
+#endif
+ }
+ }
+ }
+
+ if (__glibc_unlikely (dfa->nodes == NULL || dfa->state_table == NULL))
+ return REG_ESPACE;
+ return REG_NOERROR;
+}
+
+/* Initialize WORD_CHAR table, which indicate which character is
+ "word". In this case "word" means that it is the word construction
+ character used by some operators like "\<", "\>", etc. */
+
+static void
+init_word_char (re_dfa_t *dfa)
+{
+ int i = 0;
+ int j;
+ int ch = 0;
+ dfa->word_ops_used = 1;
+ if (__glibc_likely (dfa->map_notascii == 0))
+ {
+ bitset_word_t bits0 = 0x00000000;
+ bitset_word_t bits1 = 0x03ff0000;
+ bitset_word_t bits2 = 0x87fffffe;
+ bitset_word_t bits3 = 0x07fffffe;
+ if (BITSET_WORD_BITS == 64)
+ {
+ /* Pacify gcc -Woverflow on 32-bit platformns. */
+ dfa->word_char[0] = bits1 << 31 << 1 | bits0;
+ dfa->word_char[1] = bits3 << 31 << 1 | bits2;
+ i = 2;
+ }
+ else if (BITSET_WORD_BITS == 32)
+ {
+ dfa->word_char[0] = bits0;
+ dfa->word_char[1] = bits1;
+ dfa->word_char[2] = bits2;
+ dfa->word_char[3] = bits3;
+ i = 4;
+ }
+ else
+ goto general_case;
+ ch = 128;
+
+ if (__glibc_likely (dfa->is_utf8))
+ {
+ memset (&dfa->word_char[i], '\0', (SBC_MAX - ch) / 8);
+ return;
+ }
+ }
+
+ general_case:
+ for (; i < BITSET_WORDS; ++i)
+ for (j = 0; j < BITSET_WORD_BITS; ++j, ++ch)
+ if (isalnum (ch) || ch == '_')
+ dfa->word_char[i] |= (bitset_word_t) 1 << j;
+}
+
+/* Free the work area which are only used while compiling. */
+
+static void
+free_workarea_compile (regex_t *preg)
+{
+ re_dfa_t *dfa = preg->buffer;
+ bin_tree_storage_t *storage, *next;
+ for (storage = dfa->str_tree_storage; storage; storage = next)
+ {
+ next = storage->next;
+ re_free (storage);
+ }
+ dfa->str_tree_storage = NULL;
+ dfa->str_tree_storage_idx = BIN_TREE_STORAGE_SIZE;
+ dfa->str_tree = NULL;
+ re_free (dfa->org_indices);
+ dfa->org_indices = NULL;
+}
+
+/* Create initial states for all contexts. */
+
+static reg_errcode_t
+create_initial_state (re_dfa_t *dfa)
+{
+ Idx first, i;
+ reg_errcode_t err;
+ re_node_set init_nodes;
+
+ /* Initial states have the epsilon closure of the node which is
+ the first node of the regular expression. */
+ first = dfa->str_tree->first->node_idx;
+ dfa->init_node = first;
+ err = re_node_set_init_copy (&init_nodes, dfa->eclosures + first);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+
+ /* The back-references which are in initial states can epsilon transit,
+ since in this case all of the subexpressions can be null.
+ Then we add epsilon closures of the nodes which are the next nodes of
+ the back-references. */
+ if (dfa->nbackref > 0)
+ for (i = 0; i < init_nodes.nelem; ++i)
+ {
+ Idx node_idx = init_nodes.elems[i];
+ re_token_type_t type = dfa->nodes[node_idx].type;
+
+ Idx clexp_idx;
+ if (type != OP_BACK_REF)
+ continue;
+ for (clexp_idx = 0; clexp_idx < init_nodes.nelem; ++clexp_idx)
+ {
+ re_token_t *clexp_node;
+ clexp_node = dfa->nodes + init_nodes.elems[clexp_idx];
+ if (clexp_node->type == OP_CLOSE_SUBEXP
+ && clexp_node->opr.idx == dfa->nodes[node_idx].opr.idx)
+ break;
+ }
+ if (clexp_idx == init_nodes.nelem)
+ continue;
+
+ if (type == OP_BACK_REF)
+ {
+ Idx dest_idx = dfa->edests[node_idx].elems[0];
+ if (!re_node_set_contains (&init_nodes, dest_idx))
+ {
+ reg_errcode_t merge_err
+ = re_node_set_merge (&init_nodes, dfa->eclosures + dest_idx);
+ if (merge_err != REG_NOERROR)
+ return merge_err;
+ i = 0;
+ }
+ }
+ }
+
+ /* It must be the first time to invoke acquire_state. */
+ dfa->init_state = re_acquire_state_context (&err, dfa, &init_nodes, 0);
+ /* We don't check ERR here, since the initial state must not be NULL. */
+ if (__glibc_unlikely (dfa->init_state == NULL))
+ return err;
+ if (dfa->init_state->has_constraint)
+ {
+ dfa->init_state_word = re_acquire_state_context (&err, dfa, &init_nodes,
+ CONTEXT_WORD);
+ dfa->init_state_nl = re_acquire_state_context (&err, dfa, &init_nodes,
+ CONTEXT_NEWLINE);
+ dfa->init_state_begbuf = re_acquire_state_context (&err, dfa,
+ &init_nodes,
+ CONTEXT_NEWLINE
+ | CONTEXT_BEGBUF);
+ if (__glibc_unlikely (dfa->init_state_word == NULL
+ || dfa->init_state_nl == NULL
+ || dfa->init_state_begbuf == NULL))
+ return err;
+ }
+ else
+ dfa->init_state_word = dfa->init_state_nl
+ = dfa->init_state_begbuf = dfa->init_state;
+
+ re_node_set_free (&init_nodes);
+ return REG_NOERROR;
+}
+
+/* If it is possible to do searching in single byte encoding instead of UTF-8
+ to speed things up, set dfa->mb_cur_max to 1, clear is_utf8 and change
+ DFA nodes where needed. */
+
+static void
+optimize_utf8 (re_dfa_t *dfa)
+{
+ Idx node;
+ int i;
+ bool mb_chars = false;
+ bool has_period = false;
+
+ for (node = 0; node < dfa->nodes_len; ++node)
+ switch (dfa->nodes[node].type)
+ {
+ case CHARACTER:
+ if (dfa->nodes[node].opr.c >= ASCII_CHARS)
+ mb_chars = true;
+ break;
+ case ANCHOR:
+ switch (dfa->nodes[node].opr.ctx_type)
+ {
+ case LINE_FIRST:
+ case LINE_LAST:
+ case BUF_FIRST:
+ case BUF_LAST:
+ break;
+ default:
+ /* Word anchors etc. cannot be handled. It's okay to test
+ opr.ctx_type since constraints (for all DFA nodes) are
+ created by ORing one or more opr.ctx_type values. */
+ return;
+ }
+ break;
+ case OP_PERIOD:
+ has_period = true;
+ break;
+ case OP_BACK_REF:
+ case OP_ALT:
+ case END_OF_RE:
+ case OP_DUP_ASTERISK:
+ case OP_OPEN_SUBEXP:
+ case OP_CLOSE_SUBEXP:
+ break;
+ case COMPLEX_BRACKET:
+ return;
+ case SIMPLE_BRACKET:
+ /* Just double check. */
+ {
+ int rshift = (ASCII_CHARS % BITSET_WORD_BITS == 0
+ ? 0
+ : BITSET_WORD_BITS - ASCII_CHARS % BITSET_WORD_BITS);
+ for (i = ASCII_CHARS / BITSET_WORD_BITS; i < BITSET_WORDS; ++i)
+ {
+ if (dfa->nodes[node].opr.sbcset[i] >> rshift != 0)
+ return;
+ rshift = 0;
+ }
+ }
+ break;
+ default:
+ abort ();
+ }
+
+ if (mb_chars || has_period)
+ for (node = 0; node < dfa->nodes_len; ++node)
+ {
+ if (dfa->nodes[node].type == CHARACTER
+ && dfa->nodes[node].opr.c >= ASCII_CHARS)
+ dfa->nodes[node].mb_partial = 0;
+ else if (dfa->nodes[node].type == OP_PERIOD)
+ dfa->nodes[node].type = OP_UTF8_PERIOD;
+ }
+
+ /* The search can be in single byte locale. */
+ dfa->mb_cur_max = 1;
+ dfa->is_utf8 = 0;
+ dfa->has_mb_node = dfa->nbackref > 0 || has_period;
+}
+
+/* Analyze the structure tree, and calculate "first", "next", "edest",
+ "eclosure", and "inveclosure". */
+
+static reg_errcode_t
+analyze (regex_t *preg)
+{
+ re_dfa_t *dfa = preg->buffer;
+ reg_errcode_t ret;
+
+ /* Allocate arrays. */
+ dfa->nexts = re_malloc (Idx, dfa->nodes_alloc);
+ dfa->org_indices = re_malloc (Idx, dfa->nodes_alloc);
+ dfa->edests = re_malloc (re_node_set, dfa->nodes_alloc);
+ dfa->eclosures = re_malloc (re_node_set, dfa->nodes_alloc);
+ if (__glibc_unlikely (dfa->nexts == NULL || dfa->org_indices == NULL
+ || dfa->edests == NULL || dfa->eclosures == NULL))
+ return REG_ESPACE;
+
+ dfa->subexp_map = re_malloc (Idx, preg->re_nsub);
+ if (dfa->subexp_map != NULL)
+ {
+ Idx i;
+ for (i = 0; i < preg->re_nsub; i++)
+ dfa->subexp_map[i] = i;
+ preorder (dfa->str_tree, optimize_subexps, dfa);
+ for (i = 0; i < preg->re_nsub; i++)
+ if (dfa->subexp_map[i] != i)
+ break;
+ if (i == preg->re_nsub)
+ {
+ re_free (dfa->subexp_map);
+ dfa->subexp_map = NULL;
+ }
+ }
+
+ ret = postorder (dfa->str_tree, lower_subexps, preg);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+ ret = postorder (dfa->str_tree, calc_first, dfa);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+ preorder (dfa->str_tree, calc_next, dfa);
+ ret = preorder (dfa->str_tree, link_nfa_nodes, dfa);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+ ret = calc_eclosure (dfa);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+
+ /* We only need this during the prune_impossible_nodes pass in regexec.c;
+ skip it if p_i_n will not run, as calc_inveclosure can be quadratic. */
+ if ((!preg->no_sub && preg->re_nsub > 0 && dfa->has_plural_match)
+ || dfa->nbackref)
+ {
+ dfa->inveclosures = re_malloc (re_node_set, dfa->nodes_len);
+ if (__glibc_unlikely (dfa->inveclosures == NULL))
+ return REG_ESPACE;
+ ret = calc_inveclosure (dfa);
+ }
+
+ return ret;
+}
+
+/* Our parse trees are very unbalanced, so we cannot use a stack to
+ implement parse tree visits. Instead, we use parent pointers and
+ some hairy code in these two functions. */
+static reg_errcode_t
+postorder (bin_tree_t *root, reg_errcode_t (fn (void *, bin_tree_t *)),
+ void *extra)
+{
+ bin_tree_t *node, *prev;
+
+ for (node = root; ; )
+ {
+ /* Descend down the tree, preferably to the left (or to the right
+ if that's the only child). */
+ while (node->left || node->right)
+ if (node->left)
+ node = node->left;
+ else
+ node = node->right;
+
+ do
+ {
+ reg_errcode_t err = fn (extra, node);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ if (node->parent == NULL)
+ return REG_NOERROR;
+ prev = node;
+ node = node->parent;
+ }
+ /* Go up while we have a node that is reached from the right. */
+ while (node->right == prev || node->right == NULL);
+ node = node->right;
+ }
+}
+
+static reg_errcode_t
+preorder (bin_tree_t *root, reg_errcode_t (fn (void *, bin_tree_t *)),
+ void *extra)
+{
+ bin_tree_t *node;
+
+ for (node = root; ; )
+ {
+ reg_errcode_t err = fn (extra, node);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+
+ /* Go to the left node, or up and to the right. */
+ if (node->left)
+ node = node->left;
+ else
+ {
+ bin_tree_t *prev = NULL;
+ while (node->right == prev || node->right == NULL)
+ {
+ prev = node;
+ node = node->parent;
+ if (!node)
+ return REG_NOERROR;
+ }
+ node = node->right;
+ }
+ }
+}
+
+/* Optimization pass: if a SUBEXP is entirely contained, strip it and tell
+ re_search_internal to map the inner one's opr.idx to this one's. Adjust
+ backreferences as well. Requires a preorder visit. */
+static reg_errcode_t
+optimize_subexps (void *extra, bin_tree_t *node)
+{
+ re_dfa_t *dfa = (re_dfa_t *) extra;
+
+ if (node->token.type == OP_BACK_REF && dfa->subexp_map)
+ {
+ int idx = node->token.opr.idx;
+ node->token.opr.idx = dfa->subexp_map[idx];
+ dfa->used_bkref_map |= 1 << node->token.opr.idx;
+ }
+
+ else if (node->token.type == SUBEXP
+ && node->left && node->left->token.type == SUBEXP)
+ {
+ Idx other_idx = node->left->token.opr.idx;
+
+ node->left = node->left->left;
+ if (node->left)
+ node->left->parent = node;
+
+ dfa->subexp_map[other_idx] = dfa->subexp_map[node->token.opr.idx];
+ if (other_idx < BITSET_WORD_BITS)
+ dfa->used_bkref_map &= ~((bitset_word_t) 1 << other_idx);
+ }
+
+ return REG_NOERROR;
+}
+
+/* Lowering pass: Turn each SUBEXP node into the appropriate concatenation
+ of OP_OPEN_SUBEXP, the body of the SUBEXP (if any) and OP_CLOSE_SUBEXP. */
+static reg_errcode_t
+lower_subexps (void *extra, bin_tree_t *node)
+{
+ regex_t *preg = (regex_t *) extra;
+ reg_errcode_t err = REG_NOERROR;
+
+ if (node->left && node->left->token.type == SUBEXP)
+ {
+ node->left = lower_subexp (&err, preg, node->left);
+ if (node->left)
+ node->left->parent = node;
+ }
+ if (node->right && node->right->token.type == SUBEXP)
+ {
+ node->right = lower_subexp (&err, preg, node->right);
+ if (node->right)
+ node->right->parent = node;
+ }
+
+ return err;
+}
+
+static bin_tree_t *
+lower_subexp (reg_errcode_t *err, regex_t *preg, bin_tree_t *node)
+{
+ re_dfa_t *dfa = preg->buffer;
+ bin_tree_t *body = node->left;
+ bin_tree_t *op, *cls, *tree1, *tree;
+
+ if (preg->no_sub
+ /* We do not optimize empty subexpressions, because otherwise we may
+ have bad CONCAT nodes with NULL children. This is obviously not
+ very common, so we do not lose much. An example that triggers
+ this case is the sed "script" /\(\)/x. */
+ && node->left != NULL
+ && (node->token.opr.idx >= BITSET_WORD_BITS
+ || !(dfa->used_bkref_map
+ & ((bitset_word_t) 1 << node->token.opr.idx))))
+ return node->left;
+
+ /* Convert the SUBEXP node to the concatenation of an
+ OP_OPEN_SUBEXP, the contents, and an OP_CLOSE_SUBEXP. */
+ op = create_tree (dfa, NULL, NULL, OP_OPEN_SUBEXP);
+ cls = create_tree (dfa, NULL, NULL, OP_CLOSE_SUBEXP);
+ tree1 = body ? create_tree (dfa, body, cls, CONCAT) : cls;
+ tree = create_tree (dfa, op, tree1, CONCAT);
+ if (__glibc_unlikely (tree == NULL || tree1 == NULL
+ || op == NULL || cls == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+
+ op->token.opr.idx = cls->token.opr.idx = node->token.opr.idx;
+ op->token.opt_subexp = cls->token.opt_subexp = node->token.opt_subexp;
+ return tree;
+}
+
+/* Pass 1 in building the NFA: compute FIRST and create unlinked automaton
+ nodes. Requires a postorder visit. */
+static reg_errcode_t
+calc_first (void *extra, bin_tree_t *node)
+{
+ re_dfa_t *dfa = (re_dfa_t *) extra;
+ if (node->token.type == CONCAT)
+ {
+ node->first = node->left->first;
+ node->node_idx = node->left->node_idx;
+ }
+ else
+ {
+ node->first = node;
+ node->node_idx = re_dfa_add_node (dfa, node->token);
+ if (__glibc_unlikely (node->node_idx == -1))
+ return REG_ESPACE;
+ if (node->token.type == ANCHOR)
+ dfa->nodes[node->node_idx].constraint = node->token.opr.ctx_type;
+ }
+ return REG_NOERROR;
+}
+
+/* Pass 2: compute NEXT on the tree. Preorder visit. */
+static reg_errcode_t
+calc_next (void *extra, bin_tree_t *node)
+{
+ switch (node->token.type)
+ {
+ case OP_DUP_ASTERISK:
+ node->left->next = node;
+ break;
+ case CONCAT:
+ node->left->next = node->right->first;
+ node->right->next = node->next;
+ break;
+ default:
+ if (node->left)
+ node->left->next = node->next;
+ if (node->right)
+ node->right->next = node->next;
+ break;
+ }
+ return REG_NOERROR;
+}
+
+/* Pass 3: link all DFA nodes to their NEXT node (any order will do). */
+static reg_errcode_t
+link_nfa_nodes (void *extra, bin_tree_t *node)
+{
+ re_dfa_t *dfa = (re_dfa_t *) extra;
+ Idx idx = node->node_idx;
+ reg_errcode_t err = REG_NOERROR;
+
+ switch (node->token.type)
+ {
+ case CONCAT:
+ break;
+
+ case END_OF_RE:
+ DEBUG_ASSERT (node->next == NULL);
+ break;
+
+ case OP_DUP_ASTERISK:
+ case OP_ALT:
+ {
+ Idx left, right;
+ dfa->has_plural_match = 1;
+ if (node->left != NULL)
+ left = node->left->first->node_idx;
+ else
+ left = node->next->node_idx;
+ if (node->right != NULL)
+ right = node->right->first->node_idx;
+ else
+ right = node->next->node_idx;
+ DEBUG_ASSERT (left > -1);
+ DEBUG_ASSERT (right > -1);
+ err = re_node_set_init_2 (dfa->edests + idx, left, right);
+ }
+ break;
+
+ case ANCHOR:
+ case OP_OPEN_SUBEXP:
+ case OP_CLOSE_SUBEXP:
+ err = re_node_set_init_1 (dfa->edests + idx, node->next->node_idx);
+ break;
+
+ case OP_BACK_REF:
+ dfa->nexts[idx] = node->next->node_idx;
+ if (node->token.type == OP_BACK_REF)
+ err = re_node_set_init_1 (dfa->edests + idx, dfa->nexts[idx]);
+ break;
+
+ default:
+ DEBUG_ASSERT (!IS_EPSILON_NODE (node->token.type));
+ dfa->nexts[idx] = node->next->node_idx;
+ break;
+ }
+
+ return err;
+}
+
+/* Duplicate the epsilon closure of the node ROOT_NODE.
+ Note that duplicated nodes have constraint INIT_CONSTRAINT in addition
+ to their own constraint. */
+
+static reg_errcode_t
+duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node,
+ Idx root_node, unsigned int init_constraint)
+{
+ Idx org_node, clone_node;
+ bool ok;
+ unsigned int constraint = init_constraint;
+ for (org_node = top_org_node, clone_node = top_clone_node;;)
+ {
+ Idx org_dest, clone_dest;
+ if (dfa->nodes[org_node].type == OP_BACK_REF)
+ {
+ /* If the back reference epsilon-transit, its destination must
+ also have the constraint. Then duplicate the epsilon closure
+ of the destination of the back reference, and store it in
+ edests of the back reference. */
+ org_dest = dfa->nexts[org_node];
+ re_node_set_empty (dfa->edests + clone_node);
+ clone_dest = duplicate_node (dfa, org_dest, constraint);
+ if (__glibc_unlikely (clone_dest == -1))
+ return REG_ESPACE;
+ dfa->nexts[clone_node] = dfa->nexts[org_node];
+ ok = re_node_set_insert (dfa->edests + clone_node, clone_dest);
+ if (__glibc_unlikely (! ok))
+ return REG_ESPACE;
+ }
+ else if (dfa->edests[org_node].nelem == 0)
+ {
+ /* In case of the node can't epsilon-transit, don't duplicate the
+ destination and store the original destination as the
+ destination of the node. */
+ dfa->nexts[clone_node] = dfa->nexts[org_node];
+ break;
+ }
+ else if (dfa->edests[org_node].nelem == 1)
+ {
+ /* In case of the node can epsilon-transit, and it has only one
+ destination. */
+ org_dest = dfa->edests[org_node].elems[0];
+ re_node_set_empty (dfa->edests + clone_node);
+ /* If the node is root_node itself, it means the epsilon closure
+ has a loop. Then tie it to the destination of the root_node. */
+ if (org_node == root_node && clone_node != org_node)
+ {
+ ok = re_node_set_insert (dfa->edests + clone_node, org_dest);
+ if (__glibc_unlikely (! ok))
+ return REG_ESPACE;
+ break;
+ }
+ /* In case the node has another constraint, append it. */
+ constraint |= dfa->nodes[org_node].constraint;
+ clone_dest = duplicate_node (dfa, org_dest, constraint);
+ if (__glibc_unlikely (clone_dest == -1))
+ return REG_ESPACE;
+ ok = re_node_set_insert (dfa->edests + clone_node, clone_dest);
+ if (__glibc_unlikely (! ok))
+ return REG_ESPACE;
+ }
+ else /* dfa->edests[org_node].nelem == 2 */
+ {
+ /* In case of the node can epsilon-transit, and it has two
+ destinations. In the bin_tree_t and DFA, that's '|' and '*'. */
+ org_dest = dfa->edests[org_node].elems[0];
+ re_node_set_empty (dfa->edests + clone_node);
+ /* Search for a duplicated node which satisfies the constraint. */
+ clone_dest = search_duplicated_node (dfa, org_dest, constraint);
+ if (clone_dest == -1)
+ {
+ /* There is no such duplicated node, create a new one. */
+ reg_errcode_t err;
+ clone_dest = duplicate_node (dfa, org_dest, constraint);
+ if (__glibc_unlikely (clone_dest == -1))
+ return REG_ESPACE;
+ ok = re_node_set_insert (dfa->edests + clone_node, clone_dest);
+ if (__glibc_unlikely (! ok))
+ return REG_ESPACE;
+ err = duplicate_node_closure (dfa, org_dest, clone_dest,
+ root_node, constraint);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ else
+ {
+ /* There is a duplicated node which satisfies the constraint,
+ use it to avoid infinite loop. */
+ ok = re_node_set_insert (dfa->edests + clone_node, clone_dest);
+ if (__glibc_unlikely (! ok))
+ return REG_ESPACE;
+ }
+
+ org_dest = dfa->edests[org_node].elems[1];
+ clone_dest = duplicate_node (dfa, org_dest, constraint);
+ if (__glibc_unlikely (clone_dest == -1))
+ return REG_ESPACE;
+ ok = re_node_set_insert (dfa->edests + clone_node, clone_dest);
+ if (__glibc_unlikely (! ok))
+ return REG_ESPACE;
+ }
+ org_node = org_dest;
+ clone_node = clone_dest;
+ }
+ return REG_NOERROR;
+}
+
+/* Search for a node which is duplicated from the node ORG_NODE, and
+ satisfies the constraint CONSTRAINT. */
+
+static Idx
+search_duplicated_node (const re_dfa_t *dfa, Idx org_node,
+ unsigned int constraint)
+{
+ Idx idx;
+ for (idx = dfa->nodes_len - 1; dfa->nodes[idx].duplicated && idx > 0; --idx)
+ {
+ if (org_node == dfa->org_indices[idx]
+ && constraint == dfa->nodes[idx].constraint)
+ return idx; /* Found. */
+ }
+ return -1; /* Not found. */
+}
+
+/* Duplicate the node whose index is ORG_IDX and set the constraint CONSTRAINT.
+ Return the index of the new node, or -1 if insufficient storage is
+ available. */
+
+static Idx
+duplicate_node (re_dfa_t *dfa, Idx org_idx, unsigned int constraint)
+{
+ Idx dup_idx = re_dfa_add_node (dfa, dfa->nodes[org_idx]);
+ if (__glibc_likely (dup_idx != -1))
+ {
+ dfa->nodes[dup_idx].constraint = constraint;
+ dfa->nodes[dup_idx].constraint |= dfa->nodes[org_idx].constraint;
+ dfa->nodes[dup_idx].duplicated = 1;
+
+ /* Store the index of the original node. */
+ dfa->org_indices[dup_idx] = org_idx;
+ }
+ return dup_idx;
+}
+
+static reg_errcode_t
+calc_inveclosure (re_dfa_t *dfa)
+{
+ Idx src, idx;
+ bool ok;
+ for (idx = 0; idx < dfa->nodes_len; ++idx)
+ re_node_set_init_empty (dfa->inveclosures + idx);
+
+ for (src = 0; src < dfa->nodes_len; ++src)
+ {
+ Idx *elems = dfa->eclosures[src].elems;
+ for (idx = 0; idx < dfa->eclosures[src].nelem; ++idx)
+ {
+ ok = re_node_set_insert_last (dfa->inveclosures + elems[idx], src);
+ if (__glibc_unlikely (! ok))
+ return REG_ESPACE;
+ }
+ }
+
+ return REG_NOERROR;
+}
+
+/* Calculate "eclosure" for all the node in DFA. */
+
+static reg_errcode_t
+calc_eclosure (re_dfa_t *dfa)
+{
+ Idx node_idx;
+ bool incomplete;
+ DEBUG_ASSERT (dfa->nodes_len > 0);
+ incomplete = false;
+ /* For each nodes, calculate epsilon closure. */
+ for (node_idx = 0; ; ++node_idx)
+ {
+ reg_errcode_t err;
+ re_node_set eclosure_elem;
+ if (node_idx == dfa->nodes_len)
+ {
+ if (!incomplete)
+ break;
+ incomplete = false;
+ node_idx = 0;
+ }
+
+ DEBUG_ASSERT (dfa->eclosures[node_idx].nelem != -1);
+
+ /* If we have already calculated, skip it. */
+ if (dfa->eclosures[node_idx].nelem != 0)
+ continue;
+ /* Calculate epsilon closure of 'node_idx'. */
+ err = calc_eclosure_iter (&eclosure_elem, dfa, node_idx, true);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+
+ if (dfa->eclosures[node_idx].nelem == 0)
+ {
+ incomplete = true;
+ re_node_set_free (&eclosure_elem);
+ }
+ }
+ return REG_NOERROR;
+}
+
+/* Calculate epsilon closure of NODE. */
+
+static reg_errcode_t
+calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root)
+{
+ reg_errcode_t err;
+ Idx i;
+ re_node_set eclosure;
+ bool incomplete = false;
+ err = re_node_set_alloc (&eclosure, dfa->edests[node].nelem + 1);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+
+ /* An epsilon closure includes itself. */
+ eclosure.elems[eclosure.nelem++] = node;
+
+ /* This indicates that we are calculating this node now.
+ We reference this value to avoid infinite loop. */
+ dfa->eclosures[node].nelem = -1;
+
+ /* If the current node has constraints, duplicate all nodes
+ since they must inherit the constraints. */
+ if (dfa->nodes[node].constraint
+ && dfa->edests[node].nelem
+ && !dfa->nodes[dfa->edests[node].elems[0]].duplicated)
+ {
+ err = duplicate_node_closure (dfa, node, node, node,
+ dfa->nodes[node].constraint);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+
+ /* Expand each epsilon destination nodes. */
+ if (IS_EPSILON_NODE(dfa->nodes[node].type))
+ for (i = 0; i < dfa->edests[node].nelem; ++i)
+ {
+ re_node_set eclosure_elem;
+ Idx edest = dfa->edests[node].elems[i];
+ /* If calculating the epsilon closure of 'edest' is in progress,
+ return intermediate result. */
+ if (dfa->eclosures[edest].nelem == -1)
+ {
+ incomplete = true;
+ continue;
+ }
+ /* If we haven't calculated the epsilon closure of 'edest' yet,
+ calculate now. Otherwise use calculated epsilon closure. */
+ if (dfa->eclosures[edest].nelem == 0)
+ {
+ err = calc_eclosure_iter (&eclosure_elem, dfa, edest, false);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ else
+ eclosure_elem = dfa->eclosures[edest];
+ /* Merge the epsilon closure of 'edest'. */
+ err = re_node_set_merge (&eclosure, &eclosure_elem);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ /* If the epsilon closure of 'edest' is incomplete,
+ the epsilon closure of this node is also incomplete. */
+ if (dfa->eclosures[edest].nelem == 0)
+ {
+ incomplete = true;
+ re_node_set_free (&eclosure_elem);
+ }
+ }
+
+ if (incomplete && !root)
+ dfa->eclosures[node].nelem = 0;
+ else
+ dfa->eclosures[node] = eclosure;
+ *new_set = eclosure;
+ return REG_NOERROR;
+}
+
+/* Functions for token which are used in the parser. */
+
+/* Fetch a token from INPUT.
+ We must not use this function inside bracket expressions. */
+
+static void
+fetch_token (re_token_t *result, re_string_t *input, reg_syntax_t syntax)
+{
+ re_string_skip_bytes (input, peek_token (result, input, syntax));
+}
+
+/* Peek a token from INPUT, and return the length of the token.
+ We must not use this function inside bracket expressions. */
+
+static int
+peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
+{
+ unsigned char c;
+
+ if (re_string_eoi (input))
+ {
+ token->type = END_OF_RE;
+ return 0;
+ }
+
+ c = re_string_peek_byte (input, 0);
+ token->opr.c = c;
+
+ token->word_char = 0;
+ token->mb_partial = 0;
+ if (input->mb_cur_max > 1
+ && !re_string_first_byte (input, re_string_cur_idx (input)))
+ {
+ token->type = CHARACTER;
+ token->mb_partial = 1;
+ return 1;
+ }
+ if (c == '\\')
+ {
+ unsigned char c2;
+ if (re_string_cur_idx (input) + 1 >= re_string_length (input))
+ {
+ token->type = BACK_SLASH;
+ return 1;
+ }
+
+ c2 = re_string_peek_byte_case (input, 1);
+ token->opr.c = c2;
+ token->type = CHARACTER;
+ if (input->mb_cur_max > 1)
+ {
+ wint_t wc = re_string_wchar_at (input,
+ re_string_cur_idx (input) + 1);
+ token->word_char = IS_WIDE_WORD_CHAR (wc) != 0;
+ }
+ else
+ token->word_char = IS_WORD_CHAR (c2) != 0;
+
+ switch (c2)
+ {
+ case '|':
+ if (!(syntax & RE_LIMITED_OPS) && !(syntax & RE_NO_BK_VBAR))
+ token->type = OP_ALT;
+ break;
+ case '1': case '2': case '3': case '4': case '5':
+ case '6': case '7': case '8': case '9':
+ if (!(syntax & RE_NO_BK_REFS))
+ {
+ token->type = OP_BACK_REF;
+ token->opr.idx = c2 - '1';
+ }
+ break;
+ case '<':
+ if (!(syntax & RE_NO_GNU_OPS))
+ {
+ token->type = ANCHOR;
+ token->opr.ctx_type = WORD_FIRST;
+ }
+ break;
+ case '>':
+ if (!(syntax & RE_NO_GNU_OPS))
+ {
+ token->type = ANCHOR;
+ token->opr.ctx_type = WORD_LAST;
+ }
+ break;
+ case 'b':
+ if (!(syntax & RE_NO_GNU_OPS))
+ {
+ token->type = ANCHOR;
+ token->opr.ctx_type = WORD_DELIM;
+ }
+ break;
+ case 'B':
+ if (!(syntax & RE_NO_GNU_OPS))
+ {
+ token->type = ANCHOR;
+ token->opr.ctx_type = NOT_WORD_DELIM;
+ }
+ break;
+ case 'w':
+ if (!(syntax & RE_NO_GNU_OPS))
+ token->type = OP_WORD;
+ break;
+ case 'W':
+ if (!(syntax & RE_NO_GNU_OPS))
+ token->type = OP_NOTWORD;
+ break;
+ case 's':
+ if (!(syntax & RE_NO_GNU_OPS))
+ token->type = OP_SPACE;
+ break;
+ case 'S':
+ if (!(syntax & RE_NO_GNU_OPS))
+ token->type = OP_NOTSPACE;
+ break;
+ case '`':
+ if (!(syntax & RE_NO_GNU_OPS))
+ {
+ token->type = ANCHOR;
+ token->opr.ctx_type = BUF_FIRST;
+ }
+ break;
+ case '\'':
+ if (!(syntax & RE_NO_GNU_OPS))
+ {
+ token->type = ANCHOR;
+ token->opr.ctx_type = BUF_LAST;
+ }
+ break;
+ case '(':
+ if (!(syntax & RE_NO_BK_PARENS))
+ token->type = OP_OPEN_SUBEXP;
+ break;
+ case ')':
+ if (!(syntax & RE_NO_BK_PARENS))
+ token->type = OP_CLOSE_SUBEXP;
+ break;
+ case '+':
+ if (!(syntax & RE_LIMITED_OPS) && (syntax & RE_BK_PLUS_QM))
+ token->type = OP_DUP_PLUS;
+ break;
+ case '?':
+ if (!(syntax & RE_LIMITED_OPS) && (syntax & RE_BK_PLUS_QM))
+ token->type = OP_DUP_QUESTION;
+ break;
+ case '{':
+ if ((syntax & RE_INTERVALS) && (!(syntax & RE_NO_BK_BRACES)))
+ token->type = OP_OPEN_DUP_NUM;
+ break;
+ case '}':
+ if ((syntax & RE_INTERVALS) && (!(syntax & RE_NO_BK_BRACES)))
+ token->type = OP_CLOSE_DUP_NUM;
+ break;
+ default:
+ break;
+ }
+ return 2;
+ }
+
+ token->type = CHARACTER;
+ if (input->mb_cur_max > 1)
+ {
+ wint_t wc = re_string_wchar_at (input, re_string_cur_idx (input));
+ token->word_char = IS_WIDE_WORD_CHAR (wc) != 0;
+ }
+ else
+ token->word_char = IS_WORD_CHAR (token->opr.c);
+
+ switch (c)
+ {
+ case '\n':
+ if (syntax & RE_NEWLINE_ALT)
+ token->type = OP_ALT;
+ break;
+ case '|':
+ if (!(syntax & RE_LIMITED_OPS) && (syntax & RE_NO_BK_VBAR))
+ token->type = OP_ALT;
+ break;
+ case '*':
+ token->type = OP_DUP_ASTERISK;
+ break;
+ case '+':
+ if (!(syntax & RE_LIMITED_OPS) && !(syntax & RE_BK_PLUS_QM))
+ token->type = OP_DUP_PLUS;
+ break;
+ case '?':
+ if (!(syntax & RE_LIMITED_OPS) && !(syntax & RE_BK_PLUS_QM))
+ token->type = OP_DUP_QUESTION;
+ break;
+ case '{':
+ if ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
+ token->type = OP_OPEN_DUP_NUM;
+ break;
+ case '}':
+ if ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
+ token->type = OP_CLOSE_DUP_NUM;
+ break;
+ case '(':
+ if (syntax & RE_NO_BK_PARENS)
+ token->type = OP_OPEN_SUBEXP;
+ break;
+ case ')':
+ if (syntax & RE_NO_BK_PARENS)
+ token->type = OP_CLOSE_SUBEXP;
+ break;
+ case '[':
+ token->type = OP_OPEN_BRACKET;
+ break;
+ case '.':
+ token->type = OP_PERIOD;
+ break;
+ case '^':
+ if (!(syntax & (RE_CONTEXT_INDEP_ANCHORS | RE_CARET_ANCHORS_HERE))
+ && re_string_cur_idx (input) != 0)
+ {
+ char prev = re_string_peek_byte (input, -1);
+ if (!(syntax & RE_NEWLINE_ALT) || prev != '\n')
+ break;
+ }
+ token->type = ANCHOR;
+ token->opr.ctx_type = LINE_FIRST;
+ break;
+ case '$':
+ if (!(syntax & RE_CONTEXT_INDEP_ANCHORS)
+ && re_string_cur_idx (input) + 1 != re_string_length (input))
+ {
+ re_token_t next;
+ re_string_skip_bytes (input, 1);
+ peek_token (&next, input, syntax);
+ re_string_skip_bytes (input, -1);
+ if (next.type != OP_ALT && next.type != OP_CLOSE_SUBEXP)
+ break;
+ }
+ token->type = ANCHOR;
+ token->opr.ctx_type = LINE_LAST;
+ break;
+ default:
+ break;
+ }
+ return 1;
+}
+
+/* Peek a token from INPUT, and return the length of the token.
+ We must not use this function out of bracket expressions. */
+
+static int
+peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
+{
+ unsigned char c;
+ if (re_string_eoi (input))
+ {
+ token->type = END_OF_RE;
+ return 0;
+ }
+ c = re_string_peek_byte (input, 0);
+ token->opr.c = c;
+
+ if (input->mb_cur_max > 1
+ && !re_string_first_byte (input, re_string_cur_idx (input)))
+ {
+ token->type = CHARACTER;
+ return 1;
+ }
+
+ if (c == '\\' && (syntax & RE_BACKSLASH_ESCAPE_IN_LISTS)
+ && re_string_cur_idx (input) + 1 < re_string_length (input))
+ {
+ /* In this case, '\' escape a character. */
+ unsigned char c2;
+ re_string_skip_bytes (input, 1);
+ c2 = re_string_peek_byte (input, 0);
+ token->opr.c = c2;
+ token->type = CHARACTER;
+ return 1;
+ }
+ if (c == '[') /* '[' is a special char in a bracket exps. */
+ {
+ unsigned char c2;
+ int token_len;
+ if (re_string_cur_idx (input) + 1 < re_string_length (input))
+ c2 = re_string_peek_byte (input, 1);
+ else
+ c2 = 0;
+ token->opr.c = c2;
+ token_len = 2;
+ switch (c2)
+ {
+ case '.':
+ token->type = OP_OPEN_COLL_ELEM;
+ break;
+
+ case '=':
+ token->type = OP_OPEN_EQUIV_CLASS;
+ break;
+
+ case ':':
+ if (syntax & RE_CHAR_CLASSES)
+ {
+ token->type = OP_OPEN_CHAR_CLASS;
+ break;
+ }
+ FALLTHROUGH;
+ default:
+ token->type = CHARACTER;
+ token->opr.c = c;
+ token_len = 1;
+ break;
+ }
+ return token_len;
+ }
+ switch (c)
+ {
+ case ']':
+ token->type = OP_CLOSE_BRACKET;
+ break;
+ case '^':
+ token->type = OP_NON_MATCH_LIST;
+ break;
+ case '-':
+ /* In V7 Unix grep and Unix awk and mawk, [...---...]
+ (3 adjacent minus signs) stands for a single minus sign.
+ Support that without breaking anything else. */
+ if (! (re_string_cur_idx (input) + 2 < re_string_length (input)
+ && re_string_peek_byte (input, 1) == '-'
+ && re_string_peek_byte (input, 2) == '-'))
+ {
+ token->type = OP_CHARSET_RANGE;
+ break;
+ }
+ re_string_skip_bytes (input, 2);
+ FALLTHROUGH;
+ default:
+ token->type = CHARACTER;
+ }
+ return 1;
+}
+
+/* Functions for parser. */
+
+/* Entry point of the parser.
+ Parse the regular expression REGEXP and return the structure tree.
+ If an error occurs, ERR is set by error code, and return NULL.
+ This function build the following tree, from regular expression <reg_exp>:
+ CAT
+ / \
+ / \
+ <reg_exp> EOR
+
+ CAT means concatenation.
+ EOR means end of regular expression. */
+
+static bin_tree_t *
+parse (re_string_t *regexp, regex_t *preg, reg_syntax_t syntax,
+ reg_errcode_t *err)
+{
+ re_dfa_t *dfa = preg->buffer;
+ bin_tree_t *tree, *eor, *root;
+ re_token_t current_token;
+ dfa->syntax = syntax;
+ fetch_token (&current_token, regexp, syntax | RE_CARET_ANCHORS_HERE);
+ tree = parse_reg_exp (regexp, preg, &current_token, syntax, 0, err);
+ if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL))
+ return NULL;
+ eor = create_tree (dfa, NULL, NULL, END_OF_RE);
+ if (tree != NULL)
+ root = create_tree (dfa, tree, eor, CONCAT);
+ else
+ root = eor;
+ if (__glibc_unlikely (eor == NULL || root == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ return root;
+}
+
+/* This function build the following tree, from regular expression
+ <branch1>|<branch2>:
+ ALT
+ / \
+ / \
+ <branch1> <branch2>
+
+ ALT means alternative, which represents the operator '|'. */
+
+static bin_tree_t *
+parse_reg_exp (re_string_t *regexp, regex_t *preg, re_token_t *token,
+ reg_syntax_t syntax, Idx nest, reg_errcode_t *err)
+{
+ re_dfa_t *dfa = preg->buffer;
+ bin_tree_t *tree, *branch = NULL;
+ bitset_word_t initial_bkref_map = dfa->completed_bkref_map;
+ tree = parse_branch (regexp, preg, token, syntax, nest, err);
+ if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL))
+ return NULL;
+
+ while (token->type == OP_ALT)
+ {
+ fetch_token (token, regexp, syntax | RE_CARET_ANCHORS_HERE);
+ if (token->type != OP_ALT && token->type != END_OF_RE
+ && (nest == 0 || token->type != OP_CLOSE_SUBEXP))
+ {
+ bitset_word_t accumulated_bkref_map = dfa->completed_bkref_map;
+ dfa->completed_bkref_map = initial_bkref_map;
+ branch = parse_branch (regexp, preg, token, syntax, nest, err);
+ if (__glibc_unlikely (*err != REG_NOERROR && branch == NULL))
+ {
+ if (tree != NULL)
+ postorder (tree, free_tree, NULL);
+ return NULL;
+ }
+ dfa->completed_bkref_map |= accumulated_bkref_map;
+ }
+ else
+ branch = NULL;
+ tree = create_tree (dfa, tree, branch, OP_ALT);
+ if (__glibc_unlikely (tree == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ }
+ return tree;
+}
+
+/* This function build the following tree, from regular expression
+ <exp1><exp2>:
+ CAT
+ / \
+ / \
+ <exp1> <exp2>
+
+ CAT means concatenation. */
+
+static bin_tree_t *
+parse_branch (re_string_t *regexp, regex_t *preg, re_token_t *token,
+ reg_syntax_t syntax, Idx nest, reg_errcode_t *err)
+{
+ bin_tree_t *tree, *expr;
+ re_dfa_t *dfa = preg->buffer;
+ tree = parse_expression (regexp, preg, token, syntax, nest, err);
+ if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL))
+ return NULL;
+
+ while (token->type != OP_ALT && token->type != END_OF_RE
+ && (nest == 0 || token->type != OP_CLOSE_SUBEXP))
+ {
+ expr = parse_expression (regexp, preg, token, syntax, nest, err);
+ if (__glibc_unlikely (*err != REG_NOERROR && expr == NULL))
+ {
+ if (tree != NULL)
+ postorder (tree, free_tree, NULL);
+ return NULL;
+ }
+ if (tree != NULL && expr != NULL)
+ {
+ bin_tree_t *newtree = create_tree (dfa, tree, expr, CONCAT);
+ if (newtree == NULL)
+ {
+ postorder (expr, free_tree, NULL);
+ postorder (tree, free_tree, NULL);
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ tree = newtree;
+ }
+ else if (tree == NULL)
+ tree = expr;
+ /* Otherwise expr == NULL, we don't need to create new tree. */
+ }
+ return tree;
+}
+
+/* This function build the following tree, from regular expression a*:
+ *
+ |
+ a
+*/
+
+static bin_tree_t *
+parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
+ reg_syntax_t syntax, Idx nest, reg_errcode_t *err)
+{
+ re_dfa_t *dfa = preg->buffer;
+ bin_tree_t *tree;
+ switch (token->type)
+ {
+ case CHARACTER:
+ tree = create_token_tree (dfa, NULL, NULL, token);
+ if (__glibc_unlikely (tree == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ if (dfa->mb_cur_max > 1)
+ {
+ while (!re_string_eoi (regexp)
+ && !re_string_first_byte (regexp, re_string_cur_idx (regexp)))
+ {
+ bin_tree_t *mbc_remain;
+ fetch_token (token, regexp, syntax);
+ mbc_remain = create_token_tree (dfa, NULL, NULL, token);
+ tree = create_tree (dfa, tree, mbc_remain, CONCAT);
+ if (__glibc_unlikely (mbc_remain == NULL || tree == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ }
+ }
+ break;
+
+ case OP_OPEN_SUBEXP:
+ tree = parse_sub_exp (regexp, preg, token, syntax, nest + 1, err);
+ if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL))
+ return NULL;
+ break;
+
+ case OP_OPEN_BRACKET:
+ tree = parse_bracket_exp (regexp, dfa, token, syntax, err);
+ if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL))
+ return NULL;
+ break;
+
+ case OP_BACK_REF:
+ if (!__glibc_likely (dfa->completed_bkref_map & (1 << token->opr.idx)))
+ {
+ *err = REG_ESUBREG;
+ return NULL;
+ }
+ dfa->used_bkref_map |= 1 << token->opr.idx;
+ tree = create_token_tree (dfa, NULL, NULL, token);
+ if (__glibc_unlikely (tree == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ ++dfa->nbackref;
+ dfa->has_mb_node = 1;
+ break;
+
+ case OP_OPEN_DUP_NUM:
+ if (syntax & RE_CONTEXT_INVALID_DUP)
+ {
+ *err = REG_BADRPT;
+ return NULL;
+ }
+ FALLTHROUGH;
+ case OP_DUP_ASTERISK:
+ case OP_DUP_PLUS:
+ case OP_DUP_QUESTION:
+ if (syntax & RE_CONTEXT_INVALID_OPS)
+ {
+ *err = REG_BADRPT;
+ return NULL;
+ }
+ else if (syntax & RE_CONTEXT_INDEP_OPS)
+ {
+ fetch_token (token, regexp, syntax);
+ return parse_expression (regexp, preg, token, syntax, nest, err);
+ }
+ FALLTHROUGH;
+ case OP_CLOSE_SUBEXP:
+ if ((token->type == OP_CLOSE_SUBEXP)
+ && !(syntax & RE_UNMATCHED_RIGHT_PAREN_ORD))
+ {
+ *err = REG_ERPAREN;
+ return NULL;
+ }
+ FALLTHROUGH;
+ case OP_CLOSE_DUP_NUM:
+ /* We treat it as a normal character. */
+
+ /* Then we can these characters as normal characters. */
+ token->type = CHARACTER;
+ /* mb_partial and word_char bits should be initialized already
+ by peek_token. */
+ tree = create_token_tree (dfa, NULL, NULL, token);
+ if (__glibc_unlikely (tree == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ break;
+
+ case ANCHOR:
+ if ((token->opr.ctx_type
+ & (WORD_DELIM | NOT_WORD_DELIM | WORD_FIRST | WORD_LAST))
+ && dfa->word_ops_used == 0)
+ init_word_char (dfa);
+ if (token->opr.ctx_type == WORD_DELIM
+ || token->opr.ctx_type == NOT_WORD_DELIM)
+ {
+ bin_tree_t *tree_first, *tree_last;
+ if (token->opr.ctx_type == WORD_DELIM)
+ {
+ token->opr.ctx_type = WORD_FIRST;
+ tree_first = create_token_tree (dfa, NULL, NULL, token);
+ token->opr.ctx_type = WORD_LAST;
+ }
+ else
+ {
+ token->opr.ctx_type = INSIDE_WORD;
+ tree_first = create_token_tree (dfa, NULL, NULL, token);
+ token->opr.ctx_type = INSIDE_NOTWORD;
+ }
+ tree_last = create_token_tree (dfa, NULL, NULL, token);
+ tree = create_tree (dfa, tree_first, tree_last, OP_ALT);
+ if (__glibc_unlikely (tree_first == NULL || tree_last == NULL
+ || tree == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ }
+ else
+ {
+ tree = create_token_tree (dfa, NULL, NULL, token);
+ if (__glibc_unlikely (tree == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ }
+ /* We must return here, since ANCHORs can't be followed
+ by repetition operators.
+ eg. RE"^*" is invalid or "<ANCHOR(^)><CHAR(*)>",
+ it must not be "<ANCHOR(^)><REPEAT(*)>". */
+ fetch_token (token, regexp, syntax);
+ return tree;
+
+ case OP_PERIOD:
+ tree = create_token_tree (dfa, NULL, NULL, token);
+ if (__glibc_unlikely (tree == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ if (dfa->mb_cur_max > 1)
+ dfa->has_mb_node = 1;
+ break;
+
+ case OP_WORD:
+ case OP_NOTWORD:
+ tree = build_charclass_op (dfa, regexp->trans,
+ "alnum",
+ "_",
+ token->type == OP_NOTWORD, err);
+ if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL))
+ return NULL;
+ break;
+
+ case OP_SPACE:
+ case OP_NOTSPACE:
+ tree = build_charclass_op (dfa, regexp->trans,
+ "space",
+ "",
+ token->type == OP_NOTSPACE, err);
+ if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL))
+ return NULL;
+ break;
+
+ case OP_ALT:
+ case END_OF_RE:
+ return NULL;
+
+ case BACK_SLASH:
+ *err = REG_EESCAPE;
+ return NULL;
+
+ default:
+ /* Must not happen? */
+ DEBUG_ASSERT (false);
+ return NULL;
+ }
+ fetch_token (token, regexp, syntax);
+
+ while (token->type == OP_DUP_ASTERISK || token->type == OP_DUP_PLUS
+ || token->type == OP_DUP_QUESTION || token->type == OP_OPEN_DUP_NUM)
+ {
+ bin_tree_t *dup_tree = parse_dup_op (tree, regexp, dfa, token,
+ syntax, err);
+ if (__glibc_unlikely (*err != REG_NOERROR && dup_tree == NULL))
+ {
+ if (tree != NULL)
+ postorder (tree, free_tree, NULL);
+ return NULL;
+ }
+ tree = dup_tree;
+ /* In BRE consecutive duplications are not allowed. */
+ if ((syntax & RE_CONTEXT_INVALID_DUP)
+ && (token->type == OP_DUP_ASTERISK
+ || token->type == OP_OPEN_DUP_NUM))
+ {
+ if (tree != NULL)
+ postorder (tree, free_tree, NULL);
+ *err = REG_BADRPT;
+ return NULL;
+ }
+ }
+
+ return tree;
+}
+
+/* This function build the following tree, from regular expression
+ (<reg_exp>):
+ SUBEXP
+ |
+ <reg_exp>
+*/
+
+static bin_tree_t *
+parse_sub_exp (re_string_t *regexp, regex_t *preg, re_token_t *token,
+ reg_syntax_t syntax, Idx nest, reg_errcode_t *err)
+{
+ re_dfa_t *dfa = preg->buffer;
+ bin_tree_t *tree;
+ size_t cur_nsub;
+ cur_nsub = preg->re_nsub++;
+
+ fetch_token (token, regexp, syntax | RE_CARET_ANCHORS_HERE);
+
+ /* The subexpression may be a null string. */
+ if (token->type == OP_CLOSE_SUBEXP)
+ tree = NULL;
+ else
+ {
+ tree = parse_reg_exp (regexp, preg, token, syntax, nest, err);
+ if (__glibc_unlikely (*err == REG_NOERROR
+ && token->type != OP_CLOSE_SUBEXP))
+ {
+ if (tree != NULL)
+ postorder (tree, free_tree, NULL);
+ *err = REG_EPAREN;
+ }
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ return NULL;
+ }
+
+ if (cur_nsub <= '9' - '1')
+ dfa->completed_bkref_map |= 1 << cur_nsub;
+
+ tree = create_tree (dfa, tree, NULL, SUBEXP);
+ if (__glibc_unlikely (tree == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ tree->token.opr.idx = cur_nsub;
+ return tree;
+}
+
+/* This function parse repetition operators like "*", "+", "{1,3}" etc. */
+
+static bin_tree_t *
+parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
+ re_token_t *token, reg_syntax_t syntax, reg_errcode_t *err)
+{
+ bin_tree_t *tree = NULL, *old_tree = NULL;
+ Idx i, start, end, start_idx = re_string_cur_idx (regexp);
+ re_token_t start_token = *token;
+
+ if (token->type == OP_OPEN_DUP_NUM)
+ {
+ end = 0;
+ start = fetch_number (regexp, token, syntax);
+ if (start == -1)
+ {
+ if (token->type == CHARACTER && token->opr.c == ',')
+ start = 0; /* We treat "{,m}" as "{0,m}". */
+ else
+ {
+ *err = REG_BADBR; /* <re>{} is invalid. */
+ return NULL;
+ }
+ }
+ if (__glibc_likely (start != -2))
+ {
+ /* We treat "{n}" as "{n,n}". */
+ end = ((token->type == OP_CLOSE_DUP_NUM) ? start
+ : ((token->type == CHARACTER && token->opr.c == ',')
+ ? fetch_number (regexp, token, syntax) : -2));
+ }
+ if (__glibc_unlikely (start == -2 || end == -2))
+ {
+ /* Invalid sequence. */
+ if (__glibc_unlikely (!(syntax & RE_INVALID_INTERVAL_ORD)))
+ {
+ if (token->type == END_OF_RE)
+ *err = REG_EBRACE;
+ else
+ *err = REG_BADBR;
+
+ return NULL;
+ }
+
+ /* If the syntax bit is set, rollback. */
+ re_string_set_index (regexp, start_idx);
+ *token = start_token;
+ token->type = CHARACTER;
+ /* mb_partial and word_char bits should be already initialized by
+ peek_token. */
+ return elem;
+ }
+
+ if (__glibc_unlikely ((end != -1 && start > end)
+ || token->type != OP_CLOSE_DUP_NUM))
+ {
+ /* First number greater than second. */
+ *err = REG_BADBR;
+ return NULL;
+ }
+
+ if (__glibc_unlikely (RE_DUP_MAX < (end == -1 ? start : end)))
+ {
+ *err = REG_ESIZE;
+ return NULL;
+ }
+ }
+ else
+ {
+ start = (token->type == OP_DUP_PLUS) ? 1 : 0;
+ end = (token->type == OP_DUP_QUESTION) ? 1 : -1;
+ }
+
+ fetch_token (token, regexp, syntax);
+
+ if (__glibc_unlikely (elem == NULL))
+ return NULL;
+ if (__glibc_unlikely (start == 0 && end == 0))
+ {
+ postorder (elem, free_tree, NULL);
+ return NULL;
+ }
+
+ /* Extract "<re>{n,m}" to "<re><re>...<re><re>{0,<m-n>}". */
+ if (__glibc_unlikely (start > 0))
+ {
+ tree = elem;
+ for (i = 2; i <= start; ++i)
+ {
+ elem = duplicate_tree (elem, dfa);
+ tree = create_tree (dfa, tree, elem, CONCAT);
+ if (__glibc_unlikely (elem == NULL || tree == NULL))
+ goto parse_dup_op_espace;
+ }
+
+ if (start == end)
+ return tree;
+
+ /* Duplicate ELEM before it is marked optional. */
+ elem = duplicate_tree (elem, dfa);
+ if (__glibc_unlikely (elem == NULL))
+ goto parse_dup_op_espace;
+ old_tree = tree;
+ }
+ else
+ old_tree = NULL;
+
+ if (elem->token.type == SUBEXP)
+ {
+ uintptr_t subidx = elem->token.opr.idx;
+ postorder (elem, mark_opt_subexp, (void *) subidx);
+ }
+
+ tree = create_tree (dfa, elem, NULL,
+ (end == -1 ? OP_DUP_ASTERISK : OP_ALT));
+ if (__glibc_unlikely (tree == NULL))
+ goto parse_dup_op_espace;
+
+ /* This loop is actually executed only when end != -1,
+ to rewrite <re>{0,n} as (<re>(<re>...<re>?)?)?... We have
+ already created the start+1-th copy. */
+ if (TYPE_SIGNED (Idx) || end != -1)
+ for (i = start + 2; i <= end; ++i)
+ {
+ elem = duplicate_tree (elem, dfa);
+ tree = create_tree (dfa, tree, elem, CONCAT);
+ if (__glibc_unlikely (elem == NULL || tree == NULL))
+ goto parse_dup_op_espace;
+
+ tree = create_tree (dfa, tree, NULL, OP_ALT);
+ if (__glibc_unlikely (tree == NULL))
+ goto parse_dup_op_espace;
+ }
+
+ if (old_tree)
+ tree = create_tree (dfa, old_tree, tree, CONCAT);
+
+ return tree;
+
+ parse_dup_op_espace:
+ *err = REG_ESPACE;
+ return NULL;
+}
+
+/* Size of the names for collating symbol/equivalence_class/character_class.
+ I'm not sure, but maybe enough. */
+#define BRACKET_NAME_BUF_SIZE 32
+
+#ifndef _LIBC
+
+/* Convert the byte B to the corresponding wide character. In a
+ unibyte locale, treat B as itself. In a multibyte locale, return
+ WEOF if B is an encoding error. */
+static wint_t
+parse_byte (unsigned char b, re_dfa_t const *dfa)
+{
+ return dfa->mb_cur_max > 1 ? __btowc (b) : b;
+}
+
+/* Local function for parse_bracket_exp used in _LIBC environment.
+ Build the range expression which starts from START_ELEM, and ends
+ at END_ELEM. The result are written to MBCSET and SBCSET.
+ RANGE_ALLOC is the allocated size of mbcset->range_starts, and
+ mbcset->range_ends, is a pointer argument since we may
+ update it. */
+
+static reg_errcode_t
+build_range_exp (bitset_t sbcset, re_charset_t *mbcset, Idx *range_alloc,
+ bracket_elem_t *start_elem, bracket_elem_t *end_elem,
+ re_dfa_t *dfa, reg_syntax_t syntax, uint_fast32_t nrules,
+ const unsigned char *collseqmb, const char *collseqwc,
+ int_fast32_t table_size, const void *symb_table,
+ const unsigned char *extra)
+{
+ /* Equivalence Classes and Character Classes can't be a range start/end. */
+ if (__glibc_unlikely (start_elem->type == EQUIV_CLASS
+ || start_elem->type == CHAR_CLASS
+ || end_elem->type == EQUIV_CLASS
+ || end_elem->type == CHAR_CLASS))
+ return REG_ERANGE;
+
+ /* We can handle no multi character collating elements without libc
+ support. */
+ if (__glibc_unlikely ((start_elem->type == COLL_SYM
+ && strlen ((char *) start_elem->opr.name) > 1)
+ || (end_elem->type == COLL_SYM
+ && strlen ((char *) end_elem->opr.name) > 1)))
+ return REG_ECOLLATE;
+
+ unsigned int
+ start_ch = ((start_elem->type == SB_CHAR) ? start_elem->opr.ch
+ : ((start_elem->type == COLL_SYM) ? start_elem->opr.name[0]
+ : 0)),
+ end_ch = ((end_elem->type == SB_CHAR) ? end_elem->opr.ch
+ : ((end_elem->type == COLL_SYM) ? end_elem->opr.name[0]
+ : 0));
+ wint_t
+ start_wc = ((start_elem->type == SB_CHAR || start_elem->type == COLL_SYM)
+ ? parse_byte (start_ch, dfa) : start_elem->opr.wch),
+ end_wc = ((end_elem->type == SB_CHAR || end_elem->type == COLL_SYM)
+ ? parse_byte (end_ch, dfa) : end_elem->opr.wch);
+
+ if (start_wc == WEOF || end_wc == WEOF)
+ return REG_ECOLLATE;
+ else if (__glibc_unlikely ((syntax & RE_NO_EMPTY_RANGES)
+ && start_wc > end_wc))
+ return REG_ERANGE;
+
+ /* Got valid collation sequence values, add them as a new entry.
+ However, for !_LIBC we have no collation elements: if the
+ character set is single byte, the single byte character set
+ that we build below suffices. parse_bracket_exp passes
+ no MBCSET if dfa->mb_cur_max == 1. */
+ if (dfa->mb_cur_max > 1)
+ {
+ /* Check the space of the arrays. */
+ if (__glibc_unlikely (*range_alloc == mbcset->nranges))
+ {
+ /* There is not enough space, need realloc. */
+ wchar_t *new_array_start, *new_array_end;
+ Idx new_nranges;
+
+ /* +1 in case of mbcset->nranges is 0. */
+ new_nranges = 2 * mbcset->nranges + 1;
+ /* Use realloc since mbcset->range_starts and mbcset->range_ends
+ are NULL if *range_alloc == 0. */
+ new_array_start = re_realloc (mbcset->range_starts, wchar_t,
+ new_nranges);
+ new_array_end = re_realloc (mbcset->range_ends, wchar_t,
+ new_nranges);
+
+ if (__glibc_unlikely (new_array_start == NULL
+ || new_array_end == NULL))
+ {
+ re_free (new_array_start);
+ re_free (new_array_end);
+ return REG_ESPACE;
+ }
+
+ mbcset->range_starts = new_array_start;
+ mbcset->range_ends = new_array_end;
+ *range_alloc = new_nranges;
+ }
+
+ mbcset->range_starts[mbcset->nranges] = start_wc;
+ mbcset->range_ends[mbcset->nranges++] = end_wc;
+ }
+
+ /* Build the table for single byte characters. */
+ for (wchar_t wc = 0; wc < SBC_MAX; ++wc)
+ {
+ if (start_wc <= wc && wc <= end_wc)
+ bitset_set (sbcset, wc);
+ }
+
+ return REG_NOERROR;
+}
+#endif /* not _LIBC */
+
+#ifndef _LIBC
+/* Helper function for parse_bracket_exp only used in case of NOT _LIBC.
+ Build the collating element which is represented by NAME.
+ The result are written to MBCSET and SBCSET.
+ COLL_SYM_ALLOC is the allocated size of mbcset->coll_sym, is a
+ pointer argument since we may update it. */
+
+static reg_errcode_t
+build_collating_symbol (bitset_t sbcset, re_charset_t *mbcset,
+ Idx *coll_sym_alloc, const unsigned char *name,
+ uint_fast32_t nrules, int_fast32_t table_size,
+ const void *symb_table, const unsigned char *extra)
+{
+ size_t name_len = strlen ((const char *) name);
+ if (__glibc_unlikely (name_len != 1))
+ return REG_ECOLLATE;
+ else
+ {
+ bitset_set (sbcset, name[0]);
+ return REG_NOERROR;
+ }
+}
+#endif /* not _LIBC */
+
+#ifdef _LIBC
+/* Local function for parse_bracket_exp used in _LIBC environment.
+ Seek the collating symbol entry corresponding to NAME.
+ Return the index of the symbol in the SYMB_TABLE,
+ or -1 if not found. */
+
+static __always_inline int32_t
+seek_collating_symbol_entry (const unsigned char *name, size_t name_len,
+ const int32_t *symb_table,
+ int_fast32_t table_size,
+ const unsigned char *extra)
+{
+ int_fast32_t elem;
+
+ for (elem = 0; elem < table_size; elem++)
+ if (symb_table[2 * elem] != 0)
+ {
+ int32_t idx = symb_table[2 * elem + 1];
+ /* Skip the name of collating element name. */
+ idx += 1 + extra[idx];
+ if (/* Compare the length of the name. */
+ name_len == extra[idx]
+ /* Compare the name. */
+ && memcmp (name, &extra[idx + 1], name_len) == 0)
+ /* Yep, this is the entry. */
+ return elem;
+ }
+ return -1;
+}
+
+/* Local function for parse_bracket_exp used in _LIBC environment.
+ Look up the collation sequence value of BR_ELEM.
+ Return the value if succeeded, UINT_MAX otherwise. */
+
+static __always_inline unsigned int
+lookup_collation_sequence_value (bracket_elem_t *br_elem, uint32_t nrules,
+ const unsigned char *collseqmb,
+ const char *collseqwc,
+ int_fast32_t table_size,
+ const int32_t *symb_table,
+ const unsigned char *extra)
+{
+ if (br_elem->type == SB_CHAR)
+ {
+ /* if (MB_CUR_MAX == 1) */
+ if (nrules == 0)
+ return collseqmb[br_elem->opr.ch];
+ else
+ {
+ wint_t wc = __btowc (br_elem->opr.ch);
+ return __collseq_table_lookup (collseqwc, wc);
+ }
+ }
+ else if (br_elem->type == MB_CHAR)
+ {
+ if (nrules != 0)
+ return __collseq_table_lookup (collseqwc, br_elem->opr.wch);
+ }
+ else if (br_elem->type == COLL_SYM)
+ {
+ size_t sym_name_len = strlen ((char *) br_elem->opr.name);
+ if (nrules != 0)
+ {
+ int32_t elem, idx;
+ elem = seek_collating_symbol_entry (br_elem->opr.name,
+ sym_name_len,
+ symb_table, table_size,
+ extra);
+ if (elem != -1)
+ {
+ /* We found the entry. */
+ idx = symb_table[2 * elem + 1];
+ /* Skip the name of collating element name. */
+ idx += 1 + extra[idx];
+ /* Skip the byte sequence of the collating element. */
+ idx += 1 + extra[idx];
+ /* Adjust for the alignment. */
+ idx = (idx + 3) & ~3;
+ /* Skip the multibyte collation sequence value. */
+ idx += sizeof (unsigned int);
+ /* Skip the wide char sequence of the collating element. */
+ idx += sizeof (unsigned int) *
+ (1 + *(unsigned int *) (extra + idx));
+ /* Return the collation sequence value. */
+ return *(unsigned int *) (extra + idx);
+ }
+ else if (sym_name_len == 1)
+ {
+ /* No valid character. Match it as a single byte
+ character. */
+ return collseqmb[br_elem->opr.name[0]];
+ }
+ }
+ else if (sym_name_len == 1)
+ return collseqmb[br_elem->opr.name[0]];
+ }
+ return UINT_MAX;
+}
+
+/* Local function for parse_bracket_exp used in _LIBC environment.
+ Build the range expression which starts from START_ELEM, and ends
+ at END_ELEM. The result are written to MBCSET and SBCSET.
+ RANGE_ALLOC is the allocated size of mbcset->range_starts, and
+ mbcset->range_ends, is a pointer argument since we may
+ update it. */
+
+static __always_inline reg_errcode_t
+build_range_exp (bitset_t sbcset, re_charset_t *mbcset, Idx *range_alloc,
+ bracket_elem_t *start_elem, bracket_elem_t *end_elem,
+ re_dfa_t *dfa, reg_syntax_t syntax, uint32_t nrules,
+ const unsigned char *collseqmb, const char *collseqwc,
+ int_fast32_t table_size, const int32_t *symb_table,
+ const unsigned char *extra)
+{
+ unsigned int ch;
+ uint32_t start_collseq;
+ uint32_t end_collseq;
+
+ /* Equivalence Classes and Character Classes can't be a range
+ start/end. */
+ if (__glibc_unlikely (start_elem->type == EQUIV_CLASS
+ || start_elem->type == CHAR_CLASS
+ || end_elem->type == EQUIV_CLASS
+ || end_elem->type == CHAR_CLASS))
+ return REG_ERANGE;
+
+ /* FIXME: Implement rational ranges here, too. */
+ start_collseq = lookup_collation_sequence_value (start_elem, nrules, collseqmb, collseqwc,
+ table_size, symb_table, extra);
+ end_collseq = lookup_collation_sequence_value (end_elem, nrules, collseqmb, collseqwc,
+ table_size, symb_table, extra);
+ /* Check start/end collation sequence values. */
+ if (__glibc_unlikely (start_collseq == UINT_MAX
+ || end_collseq == UINT_MAX))
+ return REG_ECOLLATE;
+ if (__glibc_unlikely ((syntax & RE_NO_EMPTY_RANGES)
+ && start_collseq > end_collseq))
+ return REG_ERANGE;
+
+ /* Got valid collation sequence values, add them as a new entry.
+ However, if we have no collation elements, and the character set
+ is single byte, the single byte character set that we
+ build below suffices. */
+ if (nrules > 0 || dfa->mb_cur_max > 1)
+ {
+ /* Check the space of the arrays. */
+ if (__glibc_unlikely (*range_alloc == mbcset->nranges))
+ {
+ /* There is not enough space, need realloc. */
+ uint32_t *new_array_start;
+ uint32_t *new_array_end;
+ int new_nranges;
+
+ /* +1 in case of mbcset->nranges is 0. */
+ new_nranges = 2 * mbcset->nranges + 1;
+ new_array_start = re_realloc (mbcset->range_starts, uint32_t,
+ new_nranges);
+ new_array_end = re_realloc (mbcset->range_ends, uint32_t,
+ new_nranges);
+
+ if (__glibc_unlikely (new_array_start == NULL
+ || new_array_end == NULL))
+ return REG_ESPACE;
+
+ mbcset->range_starts = new_array_start;
+ mbcset->range_ends = new_array_end;
+ *range_alloc = new_nranges;
+ }
+
+ mbcset->range_starts[mbcset->nranges] = start_collseq;
+ mbcset->range_ends[mbcset->nranges++] = end_collseq;
+ }
+
+ /* Build the table for single byte characters. */
+ for (ch = 0; ch < SBC_MAX; ch++)
+ {
+ uint32_t ch_collseq;
+ /* if (MB_CUR_MAX == 1) */
+ if (nrules == 0)
+ ch_collseq = collseqmb[ch];
+ else
+ ch_collseq = __collseq_table_lookup (collseqwc, __btowc (ch));
+ if (start_collseq <= ch_collseq && ch_collseq <= end_collseq)
+ bitset_set (sbcset, ch);
+ }
+ return REG_NOERROR;
+}
+
+/* Local function for parse_bracket_exp used in _LIBC environment.
+ Build the collating element which is represented by NAME.
+ The result are written to MBCSET and SBCSET.
+ COLL_SYM_ALLOC is the allocated size of mbcset->coll_sym, is a
+ pointer argument since we may update it. */
+
+static __always_inline reg_errcode_t
+build_collating_symbol (bitset_t sbcset, re_charset_t *mbcset,
+ Idx *coll_sym_alloc, const unsigned char *name,
+ uint_fast32_t nrules, int_fast32_t table_size,
+ const int32_t *symb_table, const unsigned char *extra)
+{
+ int32_t elem, idx;
+ size_t name_len = strlen ((const char *) name);
+ if (nrules != 0)
+ {
+ elem = seek_collating_symbol_entry (name, name_len, symb_table,
+ table_size, extra);
+ if (elem != -1)
+ {
+ /* We found the entry. */
+ idx = symb_table[2 * elem + 1];
+ /* Skip the name of collating element name. */
+ idx += 1 + extra[idx];
+ }
+ else if (name_len == 1)
+ {
+ /* No valid character, treat it as a normal
+ character. */
+ bitset_set (sbcset, name[0]);
+ return REG_NOERROR;
+ }
+ else
+ return REG_ECOLLATE;
+
+ /* Got valid collation sequence, add it as a new entry. */
+ /* Check the space of the arrays. */
+ if (__glibc_unlikely (*coll_sym_alloc == mbcset->ncoll_syms))
+ {
+ /* Not enough, realloc it. */
+ /* +1 in case of mbcset->ncoll_syms is 0. */
+ int new_coll_sym_alloc = 2 * mbcset->ncoll_syms + 1;
+ /* Use realloc since mbcset->coll_syms is NULL
+ if *alloc == 0. */
+ int32_t *new_coll_syms = re_realloc (mbcset->coll_syms, int32_t,
+ new_coll_sym_alloc);
+ if (__glibc_unlikely (new_coll_syms == NULL))
+ return REG_ESPACE;
+ mbcset->coll_syms = new_coll_syms;
+ *coll_sym_alloc = new_coll_sym_alloc;
+ }
+ mbcset->coll_syms[mbcset->ncoll_syms++] = idx;
+ return REG_NOERROR;
+ }
+ else
+ {
+ if (__glibc_unlikely (name_len != 1))
+ return REG_ECOLLATE;
+ else
+ {
+ bitset_set (sbcset, name[0]);
+ return REG_NOERROR;
+ }
+ }
+}
+#endif /* _LIBC */
+
+/* This function parse bracket expression like "[abc]", "[a-c]",
+ "[[.a-a.]]" etc. */
+
+static bin_tree_t *
+parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
+ reg_syntax_t syntax, reg_errcode_t *err)
+{
+ const unsigned char *collseqmb = NULL;
+ const char *collseqwc = NULL;
+ uint_fast32_t nrules = 0;
+ int_fast32_t table_size = 0;
+ const void *symb_table = NULL;
+ const unsigned char *extra = NULL;
+
+ re_token_t br_token;
+ re_bitset_ptr_t sbcset;
+ re_charset_t *mbcset;
+ Idx coll_sym_alloc = 0, range_alloc = 0, mbchar_alloc = 0;
+ Idx equiv_class_alloc = 0, char_class_alloc = 0;
+ bool non_match = false;
+ bin_tree_t *work_tree;
+ int token_len;
+ bool first_round = true;
+#ifdef _LIBC
+ collseqmb = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQMB);
+ nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+ if (nrules)
+ {
+ /*
+ if (MB_CUR_MAX > 1)
+ */
+ collseqwc = _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQWC);
+ table_size = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_SYMB_HASH_SIZEMB);
+ symb_table = _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_TABLEMB);
+ extra = (const unsigned char *) _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_SYMB_EXTRAMB);
+ }
+#endif
+ sbcset = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1);
+ mbcset = (re_charset_t *) calloc (sizeof (re_charset_t), 1);
+ if (__glibc_unlikely (sbcset == NULL || mbcset == NULL))
+ {
+ re_free (sbcset);
+ re_free (mbcset);
+ *err = REG_ESPACE;
+ return NULL;
+ }
+
+ token_len = peek_token_bracket (token, regexp, syntax);
+ if (__glibc_unlikely (token->type == END_OF_RE))
+ {
+ *err = REG_BADPAT;
+ goto parse_bracket_exp_free_return;
+ }
+ if (token->type == OP_NON_MATCH_LIST)
+ {
+ mbcset->non_match = 1;
+ non_match = true;
+ if (syntax & RE_HAT_LISTS_NOT_NEWLINE)
+ bitset_set (sbcset, '\n');
+ re_string_skip_bytes (regexp, token_len); /* Skip a token. */
+ token_len = peek_token_bracket (token, regexp, syntax);
+ if (__glibc_unlikely (token->type == END_OF_RE))
+ {
+ *err = REG_BADPAT;
+ goto parse_bracket_exp_free_return;
+ }
+ }
+
+ /* We treat the first ']' as a normal character. */
+ if (token->type == OP_CLOSE_BRACKET)
+ token->type = CHARACTER;
+
+ while (1)
+ {
+ bracket_elem_t start_elem, end_elem;
+ unsigned char start_name_buf[BRACKET_NAME_BUF_SIZE];
+ unsigned char end_name_buf[BRACKET_NAME_BUF_SIZE];
+ reg_errcode_t ret;
+ int token_len2 = 0;
+ bool is_range_exp = false;
+ re_token_t token2;
+
+ start_elem.opr.name = start_name_buf;
+ start_elem.type = COLL_SYM;
+ ret = parse_bracket_element (&start_elem, regexp, token, token_len, dfa,
+ syntax, first_round);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ {
+ *err = ret;
+ goto parse_bracket_exp_free_return;
+ }
+ first_round = false;
+
+ /* Get information about the next token. We need it in any case. */
+ token_len = peek_token_bracket (token, regexp, syntax);
+
+ /* Do not check for ranges if we know they are not allowed. */
+ if (start_elem.type != CHAR_CLASS && start_elem.type != EQUIV_CLASS)
+ {
+ if (__glibc_unlikely (token->type == END_OF_RE))
+ {
+ *err = REG_EBRACK;
+ goto parse_bracket_exp_free_return;
+ }
+ if (token->type == OP_CHARSET_RANGE)
+ {
+ re_string_skip_bytes (regexp, token_len); /* Skip '-'. */
+ token_len2 = peek_token_bracket (&token2, regexp, syntax);
+ if (__glibc_unlikely (token2.type == END_OF_RE))
+ {
+ *err = REG_EBRACK;
+ goto parse_bracket_exp_free_return;
+ }
+ if (token2.type == OP_CLOSE_BRACKET)
+ {
+ /* We treat the last '-' as a normal character. */
+ re_string_skip_bytes (regexp, -token_len);
+ token->type = CHARACTER;
+ }
+ else
+ is_range_exp = true;
+ }
+ }
+
+ if (is_range_exp == true)
+ {
+ end_elem.opr.name = end_name_buf;
+ end_elem.type = COLL_SYM;
+ ret = parse_bracket_element (&end_elem, regexp, &token2, token_len2,
+ dfa, syntax, true);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ {
+ *err = ret;
+ goto parse_bracket_exp_free_return;
+ }
+
+ token_len = peek_token_bracket (token, regexp, syntax);
+
+ *err = build_range_exp (sbcset, mbcset, &range_alloc,
+ &start_elem, &end_elem,
+ dfa, syntax, nrules, collseqmb, collseqwc,
+ table_size, symb_table, extra);
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ goto parse_bracket_exp_free_return;
+ }
+ else
+ {
+ switch (start_elem.type)
+ {
+ case SB_CHAR:
+ bitset_set (sbcset, start_elem.opr.ch);
+ break;
+ case MB_CHAR:
+ /* Check whether the array has enough space. */
+ if (__glibc_unlikely (mbchar_alloc == mbcset->nmbchars))
+ {
+ wchar_t *new_mbchars;
+ /* Not enough, realloc it. */
+ /* +1 in case of mbcset->nmbchars is 0. */
+ mbchar_alloc = 2 * mbcset->nmbchars + 1;
+ /* Use realloc since array is NULL if *alloc == 0. */
+ new_mbchars = re_realloc (mbcset->mbchars, wchar_t,
+ mbchar_alloc);
+ if (__glibc_unlikely (new_mbchars == NULL))
+ goto parse_bracket_exp_espace;
+ mbcset->mbchars = new_mbchars;
+ }
+ mbcset->mbchars[mbcset->nmbchars++] = start_elem.opr.wch;
+ break;
+ case EQUIV_CLASS:
+ *err = build_equiv_class (sbcset,
+ mbcset, &equiv_class_alloc,
+ start_elem.opr.name);
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ goto parse_bracket_exp_free_return;
+ break;
+ case COLL_SYM:
+ *err = build_collating_symbol (sbcset,
+ mbcset, &coll_sym_alloc,
+ start_elem.opr.name,
+ nrules, table_size, symb_table, extra);
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ goto parse_bracket_exp_free_return;
+ break;
+ case CHAR_CLASS:
+ *err = build_charclass (regexp->trans, sbcset,
+ mbcset, &char_class_alloc,
+ (const char *) start_elem.opr.name,
+ syntax);
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ goto parse_bracket_exp_free_return;
+ break;
+ default:
+ DEBUG_ASSERT (false);
+ break;
+ }
+ }
+ if (__glibc_unlikely (token->type == END_OF_RE))
+ {
+ *err = REG_EBRACK;
+ goto parse_bracket_exp_free_return;
+ }
+ if (token->type == OP_CLOSE_BRACKET)
+ break;
+ }
+
+ re_string_skip_bytes (regexp, token_len); /* Skip a token. */
+
+ /* If it is non-matching list. */
+ if (non_match)
+ bitset_not (sbcset);
+
+ /* Ensure only single byte characters are set. */
+ if (dfa->mb_cur_max > 1)
+ bitset_mask (sbcset, dfa->sb_char);
+
+ if (mbcset->nmbchars || mbcset->ncoll_syms || mbcset->nequiv_classes
+ || mbcset->nranges || (dfa->mb_cur_max > 1 && (mbcset->nchar_classes
+ || mbcset->non_match)))
+ {
+ bin_tree_t *mbc_tree;
+ int sbc_idx;
+ /* Build a tree for complex bracket. */
+ dfa->has_mb_node = 1;
+ br_token.type = COMPLEX_BRACKET;
+ br_token.opr.mbcset = mbcset;
+ mbc_tree = create_token_tree (dfa, NULL, NULL, &br_token);
+ if (__glibc_unlikely (mbc_tree == NULL))
+ goto parse_bracket_exp_espace;
+ for (sbc_idx = 0; sbc_idx < BITSET_WORDS; ++sbc_idx)
+ if (sbcset[sbc_idx])
+ break;
+ /* If there are no bits set in sbcset, there is no point
+ of having both SIMPLE_BRACKET and COMPLEX_BRACKET. */
+ if (sbc_idx < BITSET_WORDS)
+ {
+ /* Build a tree for simple bracket. */
+ br_token.type = SIMPLE_BRACKET;
+ br_token.opr.sbcset = sbcset;
+ work_tree = create_token_tree (dfa, NULL, NULL, &br_token);
+ if (__glibc_unlikely (work_tree == NULL))
+ goto parse_bracket_exp_espace;
+
+ /* Then join them by ALT node. */
+ work_tree = create_tree (dfa, work_tree, mbc_tree, OP_ALT);
+ if (__glibc_unlikely (work_tree == NULL))
+ goto parse_bracket_exp_espace;
+ }
+ else
+ {
+ re_free (sbcset);
+ work_tree = mbc_tree;
+ }
+ }
+ else
+ {
+ free_charset (mbcset);
+ /* Build a tree for simple bracket. */
+ br_token.type = SIMPLE_BRACKET;
+ br_token.opr.sbcset = sbcset;
+ work_tree = create_token_tree (dfa, NULL, NULL, &br_token);
+ if (__glibc_unlikely (work_tree == NULL))
+ goto parse_bracket_exp_espace;
+ }
+ return work_tree;
+
+ parse_bracket_exp_espace:
+ *err = REG_ESPACE;
+ parse_bracket_exp_free_return:
+ re_free (sbcset);
+ free_charset (mbcset);
+ return NULL;
+}
+
+/* Parse an element in the bracket expression. */
+
+static reg_errcode_t
+parse_bracket_element (bracket_elem_t *elem, re_string_t *regexp,
+ re_token_t *token, int token_len, re_dfa_t *dfa,
+ reg_syntax_t syntax, bool accept_hyphen)
+{
+ int cur_char_size;
+ cur_char_size = re_string_char_size_at (regexp, re_string_cur_idx (regexp));
+ if (cur_char_size > 1)
+ {
+ elem->type = MB_CHAR;
+ elem->opr.wch = re_string_wchar_at (regexp, re_string_cur_idx (regexp));
+ re_string_skip_bytes (regexp, cur_char_size);
+ return REG_NOERROR;
+ }
+ re_string_skip_bytes (regexp, token_len); /* Skip a token. */
+ if (token->type == OP_OPEN_COLL_ELEM || token->type == OP_OPEN_CHAR_CLASS
+ || token->type == OP_OPEN_EQUIV_CLASS)
+ return parse_bracket_symbol (elem, regexp, token);
+ if (__glibc_unlikely (token->type == OP_CHARSET_RANGE) && !accept_hyphen)
+ {
+ /* A '-' must only appear as anything but a range indicator before
+ the closing bracket. Everything else is an error. */
+ re_token_t token2;
+ (void) peek_token_bracket (&token2, regexp, syntax);
+ if (token2.type != OP_CLOSE_BRACKET)
+ /* The actual error value is not standardized since this whole
+ case is undefined. But ERANGE makes good sense. */
+ return REG_ERANGE;
+ }
+ elem->type = SB_CHAR;
+ elem->opr.ch = token->opr.c;
+ return REG_NOERROR;
+}
+
+/* Parse a bracket symbol in the bracket expression. Bracket symbols are
+ such as [:<character_class>:], [.<collating_element>.], and
+ [=<equivalent_class>=]. */
+
+static reg_errcode_t
+parse_bracket_symbol (bracket_elem_t *elem, re_string_t *regexp,
+ re_token_t *token)
+{
+ unsigned char ch, delim = token->opr.c;
+ int i = 0;
+ if (re_string_eoi(regexp))
+ return REG_EBRACK;
+ for (;; ++i)
+ {
+ if (i >= BRACKET_NAME_BUF_SIZE)
+ return REG_EBRACK;
+ if (token->type == OP_OPEN_CHAR_CLASS)
+ ch = re_string_fetch_byte_case (regexp);
+ else
+ ch = re_string_fetch_byte (regexp);
+ if (re_string_eoi(regexp))
+ return REG_EBRACK;
+ if (ch == delim && re_string_peek_byte (regexp, 0) == ']')
+ break;
+ elem->opr.name[i] = ch;
+ }
+ re_string_skip_bytes (regexp, 1);
+ elem->opr.name[i] = '\0';
+ switch (token->type)
+ {
+ case OP_OPEN_COLL_ELEM:
+ elem->type = COLL_SYM;
+ break;
+ case OP_OPEN_EQUIV_CLASS:
+ elem->type = EQUIV_CLASS;
+ break;
+ case OP_OPEN_CHAR_CLASS:
+ elem->type = CHAR_CLASS;
+ break;
+ default:
+ break;
+ }
+ return REG_NOERROR;
+}
+
+ /* Helper function for parse_bracket_exp.
+ Build the equivalence class which is represented by NAME.
+ The result are written to MBCSET and SBCSET.
+ EQUIV_CLASS_ALLOC is the allocated size of mbcset->equiv_classes,
+ is a pointer argument since we may update it. */
+
+static reg_errcode_t
+build_equiv_class (bitset_t sbcset, re_charset_t *mbcset,
+ Idx *equiv_class_alloc, const unsigned char *name)
+{
+#ifdef _LIBC
+ uint32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+ if (nrules != 0)
+ {
+ const int32_t *table, *indirect;
+ const unsigned char *weights, *extra, *cp;
+ unsigned char char_buf[2];
+ int32_t idx1, idx2;
+ unsigned int ch;
+ size_t len;
+ /* Calculate the index for equivalence class. */
+ cp = name;
+ table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
+ weights = (const unsigned char *) _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_WEIGHTMB);
+ extra = (const unsigned char *) _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_EXTRAMB);
+ indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_INDIRECTMB);
+ idx1 = findidx (table, indirect, extra, &cp, -1);
+ if (__glibc_unlikely (idx1 == 0 || *cp != '\0'))
+ /* This isn't a valid character. */
+ return REG_ECOLLATE;
+
+ /* Build single byte matching table for this equivalence class. */
+ len = weights[idx1 & 0xffffff];
+ for (ch = 0; ch < SBC_MAX; ++ch)
+ {
+ char_buf[0] = ch;
+ cp = char_buf;
+ idx2 = findidx (table, indirect, extra, &cp, 1);
+/*
+ idx2 = table[ch];
+*/
+ if (idx2 == 0)
+ /* This isn't a valid character. */
+ continue;
+ /* Compare only if the length matches and the collation rule
+ index is the same. */
+ if (len == weights[idx2 & 0xffffff] && (idx1 >> 24) == (idx2 >> 24)
+ && memcmp (weights + (idx1 & 0xffffff) + 1,
+ weights + (idx2 & 0xffffff) + 1, len) == 0)
+ bitset_set (sbcset, ch);
+ }
+ /* Check whether the array has enough space. */
+ if (__glibc_unlikely (*equiv_class_alloc == mbcset->nequiv_classes))
+ {
+ /* Not enough, realloc it. */
+ /* +1 in case of mbcset->nequiv_classes is 0. */
+ Idx new_equiv_class_alloc = 2 * mbcset->nequiv_classes + 1;
+ /* Use realloc since the array is NULL if *alloc == 0. */
+ int32_t *new_equiv_classes = re_realloc (mbcset->equiv_classes,
+ int32_t,
+ new_equiv_class_alloc);
+ if (__glibc_unlikely (new_equiv_classes == NULL))
+ return REG_ESPACE;
+ mbcset->equiv_classes = new_equiv_classes;
+ *equiv_class_alloc = new_equiv_class_alloc;
+ }
+ mbcset->equiv_classes[mbcset->nequiv_classes++] = idx1;
+ }
+ else
+#endif /* _LIBC */
+ {
+ if (__glibc_unlikely (strlen ((const char *) name) != 1))
+ return REG_ECOLLATE;
+ bitset_set (sbcset, *name);
+ }
+ return REG_NOERROR;
+}
+
+ /* Helper function for parse_bracket_exp.
+ Build the character class which is represented by NAME.
+ The result are written to MBCSET and SBCSET.
+ CHAR_CLASS_ALLOC is the allocated size of mbcset->char_classes,
+ is a pointer argument since we may update it. */
+
+static reg_errcode_t
+build_charclass (RE_TRANSLATE_TYPE trans, bitset_t sbcset,
+ re_charset_t *mbcset, Idx *char_class_alloc,
+ const char *class_name, reg_syntax_t syntax)
+{
+ int i;
+ const char *name = class_name;
+
+ /* In case of REG_ICASE "upper" and "lower" match the both of
+ upper and lower cases. */
+ if ((syntax & RE_ICASE)
+ && (strcmp (name, "upper") == 0 || strcmp (name, "lower") == 0))
+ name = "alpha";
+
+ /* Check the space of the arrays. */
+ if (__glibc_unlikely (*char_class_alloc == mbcset->nchar_classes))
+ {
+ /* Not enough, realloc it. */
+ /* +1 in case of mbcset->nchar_classes is 0. */
+ Idx new_char_class_alloc = 2 * mbcset->nchar_classes + 1;
+ /* Use realloc since array is NULL if *alloc == 0. */
+ wctype_t *new_char_classes = re_realloc (mbcset->char_classes, wctype_t,
+ new_char_class_alloc);
+ if (__glibc_unlikely (new_char_classes == NULL))
+ return REG_ESPACE;
+ mbcset->char_classes = new_char_classes;
+ *char_class_alloc = new_char_class_alloc;
+ }
+ mbcset->char_classes[mbcset->nchar_classes++] = __wctype (name);
+
+#define BUILD_CHARCLASS_LOOP(ctype_func) \
+ do { \
+ if (__glibc_unlikely (trans != NULL)) \
+ { \
+ for (i = 0; i < SBC_MAX; ++i) \
+ if (ctype_func (i)) \
+ bitset_set (sbcset, trans[i]); \
+ } \
+ else \
+ { \
+ for (i = 0; i < SBC_MAX; ++i) \
+ if (ctype_func (i)) \
+ bitset_set (sbcset, i); \
+ } \
+ } while (0)
+
+ if (strcmp (name, "alnum") == 0)
+ BUILD_CHARCLASS_LOOP (isalnum);
+ else if (strcmp (name, "cntrl") == 0)
+ BUILD_CHARCLASS_LOOP (iscntrl);
+ else if (strcmp (name, "lower") == 0)
+ BUILD_CHARCLASS_LOOP (islower);
+ else if (strcmp (name, "space") == 0)
+ BUILD_CHARCLASS_LOOP (isspace);
+ else if (strcmp (name, "alpha") == 0)
+ BUILD_CHARCLASS_LOOP (isalpha);
+ else if (strcmp (name, "digit") == 0)
+ BUILD_CHARCLASS_LOOP (isdigit);
+ else if (strcmp (name, "print") == 0)
+ BUILD_CHARCLASS_LOOP (isprint);
+ else if (strcmp (name, "upper") == 0)
+ BUILD_CHARCLASS_LOOP (isupper);
+ else if (strcmp (name, "blank") == 0)
+ BUILD_CHARCLASS_LOOP (isblank);
+ else if (strcmp (name, "graph") == 0)
+ BUILD_CHARCLASS_LOOP (isgraph);
+ else if (strcmp (name, "punct") == 0)
+ BUILD_CHARCLASS_LOOP (ispunct);
+ else if (strcmp (name, "xdigit") == 0)
+ BUILD_CHARCLASS_LOOP (isxdigit);
+ else
+ return REG_ECTYPE;
+
+ return REG_NOERROR;
+}
+
+static bin_tree_t *
+build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans,
+ const char *class_name,
+ const char *extra, bool non_match,
+ reg_errcode_t *err)
+{
+ re_bitset_ptr_t sbcset;
+ re_charset_t *mbcset;
+ Idx alloc = 0;
+ reg_errcode_t ret;
+ bin_tree_t *tree;
+
+ sbcset = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1);
+ if (__glibc_unlikely (sbcset == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ mbcset = (re_charset_t *) calloc (sizeof (re_charset_t), 1);
+ if (__glibc_unlikely (mbcset == NULL))
+ {
+ re_free (sbcset);
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ mbcset->non_match = non_match;
+
+ /* We don't care the syntax in this case. */
+ ret = build_charclass (trans, sbcset, mbcset, &alloc, class_name, 0);
+
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ {
+ re_free (sbcset);
+ free_charset (mbcset);
+ *err = ret;
+ return NULL;
+ }
+ /* \w match '_' also. */
+ for (; *extra; extra++)
+ bitset_set (sbcset, *extra);
+
+ /* If it is non-matching list. */
+ if (non_match)
+ bitset_not (sbcset);
+
+ /* Ensure only single byte characters are set. */
+ if (dfa->mb_cur_max > 1)
+ bitset_mask (sbcset, dfa->sb_char);
+
+ /* Build a tree for simple bracket. */
+ re_token_t br_token = { .type = SIMPLE_BRACKET, .opr.sbcset = sbcset };
+ tree = create_token_tree (dfa, NULL, NULL, &br_token);
+ if (__glibc_unlikely (tree == NULL))
+ goto build_word_op_espace;
+
+ if (dfa->mb_cur_max > 1)
+ {
+ bin_tree_t *mbc_tree;
+ /* Build a tree for complex bracket. */
+ br_token.type = COMPLEX_BRACKET;
+ br_token.opr.mbcset = mbcset;
+ dfa->has_mb_node = 1;
+ mbc_tree = create_token_tree (dfa, NULL, NULL, &br_token);
+ if (__glibc_unlikely (mbc_tree == NULL))
+ goto build_word_op_espace;
+ /* Then join them by ALT node. */
+ tree = create_tree (dfa, tree, mbc_tree, OP_ALT);
+ if (__glibc_likely (mbc_tree != NULL))
+ return tree;
+ }
+ else
+ {
+ free_charset (mbcset);
+ return tree;
+ }
+
+ build_word_op_espace:
+ re_free (sbcset);
+ free_charset (mbcset);
+ *err = REG_ESPACE;
+ return NULL;
+}
+
+/* This is intended for the expressions like "a{1,3}".
+ Fetch a number from 'input', and return the number.
+ Return -1 if the number field is empty like "{,1}".
+ Return RE_DUP_MAX + 1 if the number field is too large.
+ Return -2 if an error occurred. */
+
+static Idx
+fetch_number (re_string_t *input, re_token_t *token, reg_syntax_t syntax)
+{
+ Idx num = -1;
+ unsigned char c;
+ while (1)
+ {
+ fetch_token (token, input, syntax);
+ c = token->opr.c;
+ if (__glibc_unlikely (token->type == END_OF_RE))
+ return -2;
+ if (token->type == OP_CLOSE_DUP_NUM || c == ',')
+ break;
+ num = ((token->type != CHARACTER || c < '0' || '9' < c || num == -2)
+ ? -2
+ : num == -1
+ ? c - '0'
+ : MIN (RE_DUP_MAX + 1, num * 10 + c - '0'));
+ }
+ return num;
+}
+
+static void
+free_charset (re_charset_t *cset)
+{
+ re_free (cset->mbchars);
+#ifdef _LIBC
+ re_free (cset->coll_syms);
+ re_free (cset->equiv_classes);
+#endif
+ re_free (cset->range_starts);
+ re_free (cset->range_ends);
+ re_free (cset->char_classes);
+ re_free (cset);
+}
+
+/* Functions for binary tree operation. */
+
+/* Create a tree node. */
+
+static bin_tree_t *
+create_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right,
+ re_token_type_t type)
+{
+ re_token_t t = { .type = type };
+ return create_token_tree (dfa, left, right, &t);
+}
+
+static bin_tree_t *
+create_token_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right,
+ const re_token_t *token)
+{
+ bin_tree_t *tree;
+ if (__glibc_unlikely (dfa->str_tree_storage_idx == BIN_TREE_STORAGE_SIZE))
+ {
+ bin_tree_storage_t *storage = re_malloc (bin_tree_storage_t, 1);
+
+ if (storage == NULL)
+ return NULL;
+ storage->next = dfa->str_tree_storage;
+ dfa->str_tree_storage = storage;
+ dfa->str_tree_storage_idx = 0;
+ }
+ tree = &dfa->str_tree_storage->data[dfa->str_tree_storage_idx++];
+
+ tree->parent = NULL;
+ tree->left = left;
+ tree->right = right;
+ tree->token = *token;
+ tree->token.duplicated = 0;
+ tree->token.opt_subexp = 0;
+ tree->first = NULL;
+ tree->next = NULL;
+ tree->node_idx = -1;
+
+ if (left != NULL)
+ left->parent = tree;
+ if (right != NULL)
+ right->parent = tree;
+ return tree;
+}
+
+/* Mark the tree SRC as an optional subexpression.
+ To be called from preorder or postorder. */
+
+static reg_errcode_t
+mark_opt_subexp (void *extra, bin_tree_t *node)
+{
+ Idx idx = (uintptr_t) extra;
+ if (node->token.type == SUBEXP && node->token.opr.idx == idx)
+ node->token.opt_subexp = 1;
+
+ return REG_NOERROR;
+}
+
+/* Free the allocated memory inside NODE. */
+
+static void
+free_token (re_token_t *node)
+{
+ if (node->type == COMPLEX_BRACKET && node->duplicated == 0)
+ free_charset (node->opr.mbcset);
+ else if (node->type == SIMPLE_BRACKET && node->duplicated == 0)
+ re_free (node->opr.sbcset);
+}
+
+/* Worker function for tree walking. Free the allocated memory inside NODE
+ and its children. */
+
+static reg_errcode_t
+free_tree (void *extra, bin_tree_t *node)
+{
+ free_token (&node->token);
+ return REG_NOERROR;
+}
+
+
+/* Duplicate the node SRC, and return new node. This is a preorder
+ visit similar to the one implemented by the generic visitor, but
+ we need more infrastructure to maintain two parallel trees --- so,
+ it's easier to duplicate. */
+
+static bin_tree_t *
+duplicate_tree (const bin_tree_t *root, re_dfa_t *dfa)
+{
+ const bin_tree_t *node;
+ bin_tree_t *dup_root;
+ bin_tree_t **p_new = &dup_root, *dup_node = root->parent;
+
+ for (node = root; ; )
+ {
+ /* Create a new tree and link it back to the current parent. */
+ *p_new = create_token_tree (dfa, NULL, NULL, &node->token);
+ if (*p_new == NULL)
+ return NULL;
+ (*p_new)->parent = dup_node;
+ (*p_new)->token.duplicated = 1;
+ dup_node = *p_new;
+
+ /* Go to the left node, or up and to the right. */
+ if (node->left)
+ {
+ node = node->left;
+ p_new = &dup_node->left;
+ }
+ else
+ {
+ const bin_tree_t *prev = NULL;
+ while (node->right == prev || node->right == NULL)
+ {
+ prev = node;
+ node = node->parent;
+ dup_node = dup_node->parent;
+ if (!node)
+ return dup_root;
+ }
+ node = node->right;
+ p_new = &dup_node->right;
+ }
+ }
+}
diff --git a/gl/lib/regex.c b/gl/lib/regex.c
new file mode 100644
index 0000000..ff11767
--- /dev/null
+++ b/gl/lib/regex.c
@@ -0,0 +1,84 @@
+/* Extended regular expression matching and search library.
+ Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#define __STDC_WANT_IEC_60559_BFP_EXT__
+
+#ifndef _LIBC
+# include <libc-config.h>
+
+# if __GNUC_PREREQ (4, 6)
+# pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
+# pragma GCC diagnostic ignored "-Wvla"
+# endif
+# if __GNUC_PREREQ (4, 3)
+# pragma GCC diagnostic ignored "-Wold-style-definition"
+# pragma GCC diagnostic ignored "-Wtype-limits"
+# endif
+#endif
+
+/* Make sure no one compiles this code with a C++ compiler. */
+#if defined __cplusplus && defined _LIBC
+# error "This is C code, use a C compiler"
+#endif
+
+#ifdef _LIBC
+/* We have to keep the namespace clean. */
+# define regfree(preg) __regfree (preg)
+# define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef)
+# define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags)
+# define regerror(errcode, preg, errbuf, errbuf_size) \
+ __regerror(errcode, preg, errbuf, errbuf_size)
+# define re_set_registers(bu, re, nu, st, en) \
+ __re_set_registers (bu, re, nu, st, en)
+# define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \
+ __re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
+# define re_match(bufp, string, size, pos, regs) \
+ __re_match (bufp, string, size, pos, regs)
+# define re_search(bufp, string, size, startpos, range, regs) \
+ __re_search (bufp, string, size, startpos, range, regs)
+# define re_compile_pattern(pattern, length, bufp) \
+ __re_compile_pattern (pattern, length, bufp)
+# define re_set_syntax(syntax) __re_set_syntax (syntax)
+# define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \
+ __re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
+# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
+
+# include "../locale/localeinfo.h"
+#endif
+
+/* On some systems, limits.h sets RE_DUP_MAX to a lower value than
+ GNU regex allows. Include it before <regex.h>, which correctly
+ #undefs RE_DUP_MAX and sets it to the right value. */
+#include <limits.h>
+
+#include <regex.h>
+#include "regex_internal.h"
+
+#include "regex_internal.c"
+#include "regcomp.c"
+#include "regexec.c"
+
+/* Binary backward compatibility. */
+#if _LIBC
+# include <shlib-compat.h>
+# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3)
+link_warning (re_max_failures, "the 're_max_failures' variable is obsolete and will go away.")
+int re_max_failures = 2000;
+# endif
+#endif
diff --git a/gl/lib/regex.h b/gl/lib/regex.h
new file mode 100644
index 0000000..a7e0bd0
--- /dev/null
+++ b/gl/lib/regex.h
@@ -0,0 +1,699 @@
+/* Definitions for data structures and routines for the regular
+ expression library.
+ Copyright (C) 1985, 1989-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _REGEX_H
+#define _REGEX_H 1
+
+#include <sys/types.h>
+
+/* Allow the use in C++ code. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Define __USE_GNU to declare GNU extensions that violate the
+ POSIX name space rules. */
+#ifdef _GNU_SOURCE
+# define __USE_GNU 1
+#endif
+
+#ifdef _REGEX_LARGE_OFFSETS
+
+/* Use types and values that are wide enough to represent signed and
+ unsigned byte offsets in memory. This currently works only when
+ the regex code is used outside of the GNU C library; it is not yet
+ supported within glibc itself, and glibc users should not define
+ _REGEX_LARGE_OFFSETS. */
+
+/* The type of object sizes. */
+typedef size_t __re_size_t;
+
+/* The type of object sizes, in places where the traditional code
+ uses unsigned long int. */
+typedef size_t __re_long_size_t;
+
+#else
+
+/* The traditional GNU regex implementation mishandles strings longer
+ than INT_MAX. */
+typedef unsigned int __re_size_t;
+typedef unsigned long int __re_long_size_t;
+
+#endif
+
+/* The following two types have to be signed and unsigned integer type
+ wide enough to hold a value of a pointer. For most ANSI compilers
+ ptrdiff_t and size_t should be likely OK. Still size of these two
+ types is 2 for Microsoft C. Ugh... */
+typedef long int s_reg_t;
+typedef unsigned long int active_reg_t;
+
+/* The following bits are used to determine the regexp syntax we
+ recognize. The set/not-set meanings are chosen so that Emacs syntax
+ remains the value 0. The bits are given in alphabetical order, and
+ the definitions shifted by one from the previous bit; thus, when we
+ add or remove a bit, only one other definition need change. */
+typedef unsigned long int reg_syntax_t;
+
+#ifdef __USE_GNU
+/* If this bit is not set, then \ inside a bracket expression is literal.
+ If set, then such a \ quotes the following character. */
+# define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1)
+
+/* If this bit is not set, then + and ? are operators, and \+ and \? are
+ literals.
+ If set, then \+ and \? are operators and + and ? are literals. */
+# define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
+
+/* If this bit is set, then character classes are supported. They are:
+ [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:],
+ [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
+ If not set, then character classes are not supported. */
+# define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)
+
+/* If this bit is set, then ^ and $ are always anchors (outside bracket
+ expressions, of course).
+ If this bit is not set, then it depends:
+ ^ is an anchor if it is at the beginning of a regular
+ expression or after an open-group or an alternation operator;
+ $ is an anchor if it is at the end of a regular expression, or
+ before a close-group or an alternation operator.
+
+ This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
+ POSIX draft 11.2 says that * etc. in leading positions is undefined.
+ We already implemented a previous draft which made those constructs
+ invalid, though, so we haven't changed the code back. */
+# define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)
+
+/* If this bit is set, then special characters are always special
+ regardless of where they are in the pattern.
+ If this bit is not set, then special characters are special only in
+ some contexts; otherwise they are ordinary. Specifically,
+ * + ? and intervals are only special when not after the beginning,
+ open-group, or alternation operator. */
+# define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
+
+/* If this bit is set, then *, +, ?, and { cannot be first in an re or
+ immediately after an alternation or begin-group operator. */
+# define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)
+
+/* If this bit is set, then . matches newline.
+ If not set, then it doesn't. */
+# define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)
+
+/* If this bit is set, then . doesn't match NUL.
+ If not set, then it does. */
+# define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)
+
+/* If this bit is set, nonmatching lists [^...] do not match newline.
+ If not set, they do. */
+# define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
+
+/* If this bit is set, either \{...\} or {...} defines an
+ interval, depending on RE_NO_BK_BRACES.
+ If not set, \{, \}, {, and } are literals. */
+# define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
+
+/* If this bit is set, +, ? and | aren't recognized as operators.
+ If not set, they are. */
+# define RE_LIMITED_OPS (RE_INTERVALS << 1)
+
+/* If this bit is set, newline is an alternation operator.
+ If not set, newline is literal. */
+# define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
+
+/* If this bit is set, then '{...}' defines an interval, and \{ and \}
+ are literals.
+ If not set, then '\{...\}' defines an interval. */
+# define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
+
+/* If this bit is set, (...) defines a group, and \( and \) are literals.
+ If not set, \(...\) defines a group, and ( and ) are literals. */
+# define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)
+
+/* If this bit is set, then \<digit> matches <digit>.
+ If not set, then \<digit> is a back-reference. */
+# define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
+
+/* If this bit is set, then | is an alternation operator, and \| is literal.
+ If not set, then \| is an alternation operator, and | is literal. */
+# define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
+
+/* If this bit is set, then an ending range point collating higher
+ than the starting range point, as in [z-a], is invalid.
+ If not set, then when ending range point collates higher than the
+ starting range point, the range is ignored. */
+# define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)
+
+/* If this bit is set, then an unmatched ) is ordinary.
+ If not set, then an unmatched ) is invalid. */
+# define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
+
+/* If this bit is set, succeed as soon as we match the whole pattern,
+ without further backtracking. */
+# define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)
+
+/* If this bit is set, do not process the GNU regex operators.
+ If not set, then the GNU regex operators are recognized. */
+# define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1)
+
+/* If this bit is set, turn on internal regex debugging.
+ If not set, and debugging was on, turn it off.
+ This only works if regex.c is compiled -DDEBUG.
+ We define this bit always, so that all that's needed to turn on
+ debugging is to recompile regex.c; the calling code can always have
+ this bit set, and it won't affect anything in the normal case. */
+# define RE_DEBUG (RE_NO_GNU_OPS << 1)
+
+/* If this bit is set, a syntactically invalid interval is treated as
+ a string of ordinary characters. For example, the ERE 'a{1' is
+ treated as 'a\{1'. */
+# define RE_INVALID_INTERVAL_ORD (RE_DEBUG << 1)
+
+/* If this bit is set, then ignore case when matching.
+ If not set, then case is significant. */
+# define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1)
+
+/* This bit is used internally like RE_CONTEXT_INDEP_ANCHORS but only
+ for ^, because it is difficult to scan the regex backwards to find
+ whether ^ should be special. */
+# define RE_CARET_ANCHORS_HERE (RE_ICASE << 1)
+
+/* If this bit is set, then \{ cannot be first in a regex or
+ immediately after an alternation, open-group or \} operator. */
+# define RE_CONTEXT_INVALID_DUP (RE_CARET_ANCHORS_HERE << 1)
+
+/* If this bit is set, then no_sub will be set to 1 during
+ re_compile_pattern. */
+# define RE_NO_SUB (RE_CONTEXT_INVALID_DUP << 1)
+#endif
+
+/* This global variable defines the particular regexp syntax to use (for
+ some interfaces). When a regexp is compiled, the syntax used is
+ stored in the pattern buffer, so changing this does not affect
+ already-compiled regexps. */
+extern reg_syntax_t re_syntax_options;
+
+#ifdef __USE_GNU
+/* Define combinations of the above bits for the standard possibilities.
+ (The [[[ comments delimit what gets put into the Texinfo file, so
+ don't delete them!) */
+/* [[[begin syntaxes]]] */
+# define RE_SYNTAX_EMACS 0
+
+# define RE_SYNTAX_AWK \
+ (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
+ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
+ | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
+ | RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CHAR_CLASSES \
+ | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
+
+# define RE_SYNTAX_GNU_AWK \
+ ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \
+ | RE_INVALID_INTERVAL_ORD) \
+ & ~(RE_DOT_NOT_NULL | RE_CONTEXT_INDEP_OPS \
+ | RE_CONTEXT_INVALID_OPS ))
+
+# define RE_SYNTAX_POSIX_AWK \
+ (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \
+ | RE_INTERVALS | RE_NO_GNU_OPS \
+ | RE_INVALID_INTERVAL_ORD)
+
+# define RE_SYNTAX_GREP \
+ ((RE_SYNTAX_POSIX_BASIC | RE_NEWLINE_ALT) \
+ & ~(RE_CONTEXT_INVALID_DUP | RE_DOT_NOT_NULL))
+
+# define RE_SYNTAX_EGREP \
+ ((RE_SYNTAX_POSIX_EXTENDED | RE_INVALID_INTERVAL_ORD | RE_NEWLINE_ALT) \
+ & ~(RE_CONTEXT_INVALID_OPS | RE_DOT_NOT_NULL))
+
+/* POSIX grep -E behavior is no longer incompatible with GNU. */
+# define RE_SYNTAX_POSIX_EGREP \
+ RE_SYNTAX_EGREP
+
+/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
+# define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
+
+# define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
+
+/* Syntax bits common to both basic and extended POSIX regex syntax. */
+# define _RE_SYNTAX_POSIX_COMMON \
+ (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
+ | RE_INTERVALS | RE_NO_EMPTY_RANGES)
+
+# define RE_SYNTAX_POSIX_BASIC \
+ (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM | RE_CONTEXT_INVALID_DUP)
+
+/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
+ RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
+ isn't minimal, since other operators, such as \`, aren't disabled. */
+# define RE_SYNTAX_POSIX_MINIMAL_BASIC \
+ (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
+
+# define RE_SYNTAX_POSIX_EXTENDED \
+ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_VBAR \
+ | RE_CONTEXT_INVALID_OPS | RE_UNMATCHED_RIGHT_PAREN_ORD)
+
+/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INDEP_OPS is
+ removed and RE_NO_BK_REFS is added. */
+# define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
+ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
+ | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
+/* [[[end syntaxes]]] */
+
+/* Maximum number of duplicates an interval can allow. POSIX-conforming
+ systems might define this in <limits.h>, but we want our
+ value, so remove any previous define. */
+# ifdef _REGEX_INCLUDE_LIMITS_H
+# include <limits.h>
+# endif
+# ifdef RE_DUP_MAX
+# undef RE_DUP_MAX
+# endif
+
+/* RE_DUP_MAX is 2**15 - 1 because an earlier implementation stored
+ the counter as a 2-byte signed integer. This is no longer true, so
+ RE_DUP_MAX could be increased to (INT_MAX / 10 - 1), or to
+ ((SIZE_MAX - 9) / 10) if _REGEX_LARGE_OFFSETS is defined.
+ However, there would be a huge performance problem if someone
+ actually used a pattern like a\{214748363\}, so RE_DUP_MAX retains
+ its historical value. */
+# define RE_DUP_MAX (0x7fff)
+#endif
+
+
+/* POSIX 'cflags' bits (i.e., information for 'regcomp'). */
+
+/* If this bit is set, then use extended regular expression syntax.
+ If not set, then use basic regular expression syntax. */
+#define REG_EXTENDED 1
+
+/* If this bit is set, then ignore case when matching.
+ If not set, then case is significant. */
+#define REG_ICASE (1 << 1)
+
+/* If this bit is set, then anchors do not match at newline
+ characters in the string.
+ If not set, then anchors do match at newlines. */
+#define REG_NEWLINE (1 << 2)
+
+/* If this bit is set, then report only success or fail in regexec.
+ If not set, then returns differ between not matching and errors. */
+#define REG_NOSUB (1 << 3)
+
+
+/* POSIX 'eflags' bits (i.e., information for regexec). */
+
+/* If this bit is set, then the beginning-of-line operator doesn't match
+ the beginning of the string (presumably because it's not the
+ beginning of a line).
+ If not set, then the beginning-of-line operator does match the
+ beginning of the string. */
+#define REG_NOTBOL 1
+
+/* Like REG_NOTBOL, except for the end-of-line. */
+#define REG_NOTEOL (1 << 1)
+
+/* Use PMATCH[0] to delimit the start and end of the search in the
+ buffer. */
+#define REG_STARTEND (1 << 2)
+
+
+/* If any error codes are removed, changed, or added, update the
+ '__re_error_msgid' table in regcomp.c. */
+
+typedef enum
+{
+ _REG_ENOSYS = -1, /* This will never happen for this implementation. */
+ _REG_NOERROR = 0, /* Success. */
+ _REG_NOMATCH, /* Didn't find a match (for regexec). */
+
+ /* POSIX regcomp return error codes. (In the order listed in the
+ standard.) */
+ _REG_BADPAT, /* Invalid pattern. */
+ _REG_ECOLLATE, /* Invalid collating element. */
+ _REG_ECTYPE, /* Invalid character class name. */
+ _REG_EESCAPE, /* Trailing backslash. */
+ _REG_ESUBREG, /* Invalid back reference. */
+ _REG_EBRACK, /* Unmatched left bracket. */
+ _REG_EPAREN, /* Parenthesis imbalance. */
+ _REG_EBRACE, /* Unmatched \{. */
+ _REG_BADBR, /* Invalid contents of \{\}. */
+ _REG_ERANGE, /* Invalid range end. */
+ _REG_ESPACE, /* Ran out of memory. */
+ _REG_BADRPT, /* No preceding re for repetition op. */
+
+ /* Error codes we've added. */
+ _REG_EEND, /* Premature end. */
+ _REG_ESIZE, /* Too large (e.g., repeat count too large). */
+ _REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
+} reg_errcode_t;
+
+#if defined _XOPEN_SOURCE || defined __USE_XOPEN2K
+# define REG_ENOSYS _REG_ENOSYS
+#endif
+#define REG_NOERROR _REG_NOERROR
+#define REG_NOMATCH _REG_NOMATCH
+#define REG_BADPAT _REG_BADPAT
+#define REG_ECOLLATE _REG_ECOLLATE
+#define REG_ECTYPE _REG_ECTYPE
+#define REG_EESCAPE _REG_EESCAPE
+#define REG_ESUBREG _REG_ESUBREG
+#define REG_EBRACK _REG_EBRACK
+#define REG_EPAREN _REG_EPAREN
+#define REG_EBRACE _REG_EBRACE
+#define REG_BADBR _REG_BADBR
+#define REG_ERANGE _REG_ERANGE
+#define REG_ESPACE _REG_ESPACE
+#define REG_BADRPT _REG_BADRPT
+#define REG_EEND _REG_EEND
+#define REG_ESIZE _REG_ESIZE
+#define REG_ERPAREN _REG_ERPAREN
+
+/* This data structure represents a compiled pattern. Before calling
+ the pattern compiler, the fields 'buffer', 'allocated', 'fastmap',
+ and 'translate' can be set. After the pattern has been compiled,
+ the fields 're_nsub', 'not_bol' and 'not_eol' are available. All
+ other fields are private to the regex routines. */
+
+#ifndef RE_TRANSLATE_TYPE
+# define __RE_TRANSLATE_TYPE unsigned char *
+# ifdef __USE_GNU
+# define RE_TRANSLATE_TYPE __RE_TRANSLATE_TYPE
+# endif
+#endif
+
+#ifdef __USE_GNU
+# define __REPB_PREFIX(name) name
+#else
+# define __REPB_PREFIX(name) __##name
+#endif
+
+struct re_pattern_buffer
+{
+ /* Space that holds the compiled pattern. The type
+ 'struct re_dfa_t' is private and is not declared here. */
+ struct re_dfa_t *__REPB_PREFIX(buffer);
+
+ /* Number of bytes to which 'buffer' points. */
+ __re_long_size_t __REPB_PREFIX(allocated);
+
+ /* Number of bytes actually used in 'buffer'. */
+ __re_long_size_t __REPB_PREFIX(used);
+
+ /* Syntax setting with which the pattern was compiled. */
+ reg_syntax_t __REPB_PREFIX(syntax);
+
+ /* Pointer to a fastmap, if any, otherwise zero. re_search uses the
+ fastmap, if there is one, to skip over impossible starting points
+ for matches. */
+ char *__REPB_PREFIX(fastmap);
+
+ /* Either a translate table to apply to all characters before
+ comparing them, or zero for no translation. The translation is
+ applied to a pattern when it is compiled and to a string when it
+ is matched. */
+ __RE_TRANSLATE_TYPE __REPB_PREFIX(translate);
+
+ /* Number of subexpressions found by the compiler. */
+ size_t re_nsub;
+
+ /* Zero if this pattern cannot match the empty string, one else.
+ Well, in truth it's used only in 're_search_2', to see whether or
+ not we should use the fastmap, so we don't set this absolutely
+ perfectly; see 're_compile_fastmap' (the "duplicate" case). */
+ unsigned __REPB_PREFIX(can_be_null) : 1;
+
+ /* If REGS_UNALLOCATED, allocate space in the 'regs' structure
+ for 'max (RE_NREGS, re_nsub + 1)' groups.
+ If REGS_REALLOCATE, reallocate space if necessary.
+ If REGS_FIXED, use what's there. */
+#ifdef __USE_GNU
+# define REGS_UNALLOCATED 0
+# define REGS_REALLOCATE 1
+# define REGS_FIXED 2
+#endif
+ unsigned __REPB_PREFIX(regs_allocated) : 2;
+
+ /* Set to zero when 're_compile_pattern' compiles a pattern; set to
+ one by 're_compile_fastmap' if it updates the fastmap. */
+ unsigned __REPB_PREFIX(fastmap_accurate) : 1;
+
+ /* If set, 're_match_2' does not return information about
+ subexpressions. */
+ unsigned __REPB_PREFIX(no_sub) : 1;
+
+ /* If set, a beginning-of-line anchor doesn't match at the beginning
+ of the string. */
+ unsigned __REPB_PREFIX(not_bol) : 1;
+
+ /* Similarly for an end-of-line anchor. */
+ unsigned __REPB_PREFIX(not_eol) : 1;
+
+ /* If true, an anchor at a newline matches. */
+ unsigned __REPB_PREFIX(newline_anchor) : 1;
+};
+
+typedef struct re_pattern_buffer regex_t;
+
+/* Type for byte offsets within the string. POSIX mandates this. */
+#ifdef _REGEX_LARGE_OFFSETS
+/* POSIX 1003.1-2008 requires that regoff_t be at least as wide as
+ ptrdiff_t and ssize_t. We don't know of any hosts where ptrdiff_t
+ is wider than ssize_t, so ssize_t is safe. ptrdiff_t is not
+ visible here, so use ssize_t. */
+typedef ssize_t regoff_t;
+#else
+/* The traditional GNU regex implementation mishandles strings longer
+ than INT_MAX. */
+typedef int regoff_t;
+#endif
+
+
+#ifdef __USE_GNU
+/* This is the structure we store register match data in. See
+ regex.texinfo for a full description of what registers match. */
+struct re_registers
+{
+ __re_size_t num_regs;
+ regoff_t *start;
+ regoff_t *end;
+};
+
+
+/* If 'regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
+ 're_match_2' returns information about at least this many registers
+ the first time a 'regs' structure is passed. */
+# ifndef RE_NREGS
+# define RE_NREGS 30
+# endif
+#endif
+
+
+/* POSIX specification for registers. Aside from the different names than
+ 're_registers', POSIX uses an array of structures, instead of a
+ structure of arrays. */
+typedef struct
+{
+ regoff_t rm_so; /* Byte offset from string's start to substring's start. */
+ regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
+} regmatch_t;
+
+/* Declarations for routines. */
+
+#ifndef _REGEX_NELTS
+# if (defined __STDC_VERSION__ && 199901L <= __STDC_VERSION__ \
+ && !defined __STDC_NO_VLA__)
+# define _REGEX_NELTS(n) n
+# else
+# define _REGEX_NELTS(n)
+# endif
+#endif
+
+#if defined __GNUC__ && 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wvla"
+#endif
+
+#ifndef _Attr_access_
+# ifdef __attr_access
+# define _Attr_access_(arg) __attr_access (arg)
+# elif defined __GNUC__ && 10 <= __GNUC__
+# define _Attr_access_(x) __attribute__ ((__access__ x))
+# else
+# define _Attr_access_(x)
+# endif
+#endif
+
+#ifdef __USE_GNU
+/* Sets the current default syntax to SYNTAX, and return the old syntax.
+ You can also simply assign to the 're_syntax_options' variable. */
+extern reg_syntax_t re_set_syntax (reg_syntax_t __syntax);
+
+/* Compile the regular expression PATTERN, with length LENGTH
+ and syntax given by the global 're_syntax_options', into the buffer
+ BUFFER. Return NULL if successful, and an error string if not.
+
+ To free the allocated storage, you must call 'regfree' on BUFFER.
+ Note that the translate table must either have been initialized by
+ 'regcomp', with a malloc'ed value, or set to NULL before calling
+ 'regfree'. */
+extern const char *re_compile_pattern (const char *__pattern, size_t __length,
+ struct re_pattern_buffer *__buffer)
+ _Attr_access_ ((__read_only__, 1, 2));
+
+
+/* Compile a fastmap for the compiled pattern in BUFFER; used to
+ accelerate searches. Return 0 if successful and -2 if was an
+ internal error. */
+extern int re_compile_fastmap (struct re_pattern_buffer *__buffer);
+
+
+/* Search in the string STRING (with length LENGTH) for the pattern
+ compiled into BUFFER. Start searching at position START, for RANGE
+ characters. Return the starting position of the match, -1 for no
+ match, or -2 for an internal error. Also return register
+ information in REGS (if REGS and BUFFER->no_sub are nonzero). */
+extern regoff_t re_search (struct re_pattern_buffer *__buffer,
+ const char *__String, regoff_t __length,
+ regoff_t __start, regoff_t __range,
+ struct re_registers *__regs)
+ _Attr_access_ ((__read_only__, 2, 3));
+
+
+/* Like 're_search', but search in the concatenation of STRING1 and
+ STRING2. Also, stop searching at index START + STOP. */
+extern regoff_t re_search_2 (struct re_pattern_buffer *__buffer,
+ const char *__string1, regoff_t __length1,
+ const char *__string2, regoff_t __length2,
+ regoff_t __start, regoff_t __range,
+ struct re_registers *__regs,
+ regoff_t __stop)
+ _Attr_access_ ((__read_only__, 2, 3))
+ _Attr_access_ ((__read_only__, 4, 5));
+
+
+/* Like 're_search', but return how many characters in STRING the regexp
+ in BUFFER matched, starting at position START. */
+extern regoff_t re_match (struct re_pattern_buffer *__buffer,
+ const char *__String, regoff_t __length,
+ regoff_t __start, struct re_registers *__regs)
+ _Attr_access_ ((__read_only__, 2, 3));
+
+
+/* Relates to 're_match' as 're_search_2' relates to 're_search'. */
+extern regoff_t re_match_2 (struct re_pattern_buffer *__buffer,
+ const char *__string1, regoff_t __length1,
+ const char *__string2, regoff_t __length2,
+ regoff_t __start, struct re_registers *__regs,
+ regoff_t __stop)
+ _Attr_access_ ((__read_only__, 2, 3))
+ _Attr_access_ ((__read_only__, 4, 5));
+
+
+/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
+ ENDS. Subsequent matches using BUFFER and REGS will use this memory
+ for recording register information. STARTS and ENDS must be
+ allocated with malloc, and must each be at least 'NUM_REGS * sizeof
+ (regoff_t)' bytes long.
+
+ If NUM_REGS == 0, then subsequent matches should allocate their own
+ register data.
+
+ Unless this function is called, the first search or match using
+ BUFFER will allocate its own register data, without
+ freeing the old data. */
+extern void re_set_registers (struct re_pattern_buffer *__buffer,
+ struct re_registers *__regs,
+ __re_size_t __num_regs,
+ regoff_t *__starts, regoff_t *__ends);
+#endif /* Use GNU */
+
+#if defined _REGEX_RE_COMP || (defined _LIBC && defined __USE_MISC)
+/* 4.2 bsd compatibility. */
+extern char *re_comp (const char *);
+extern int re_exec (const char *);
+#endif
+
+/* For plain 'restrict', use glibc's __restrict if defined.
+ Otherwise, GCC 2.95 and later have "__restrict"; C99 compilers have
+ "restrict", and "configure" may have defined "restrict".
+ Other compilers use __restrict, __restrict__, and _Restrict, and
+ 'configure' might #define 'restrict' to those words, so pick a
+ different name. */
+#ifndef _Restrict_
+# if defined __restrict \
+ || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \
+ || __clang_major__ >= 3
+# define _Restrict_ __restrict
+# elif 199901L <= __STDC_VERSION__ || defined restrict
+# define _Restrict_ restrict
+# else
+# define _Restrict_
+# endif
+#endif
+/* For the ISO C99 syntax
+ array_name[restrict]
+ use glibc's __restrict_arr if available.
+ Otherwise, GCC 3.1 and clang support this syntax (but not in C++ mode).
+ Other ISO C99 compilers support it as well. */
+#ifndef _Restrict_arr_
+# ifdef __restrict_arr
+# define _Restrict_arr_ __restrict_arr
+# elif ((199901L <= __STDC_VERSION__ \
+ || 3 < __GNUC__ + (1 <= __GNUC_MINOR__) \
+ || __clang_major__ >= 3) \
+ && !defined __cplusplus)
+# define _Restrict_arr_ _Restrict_
+# else
+# define _Restrict_arr_
+# endif
+#endif
+
+/* POSIX compatibility. */
+extern int regcomp (regex_t *_Restrict_ __preg,
+ const char *_Restrict_ __pattern,
+ int __cflags);
+
+extern int regexec (const regex_t *_Restrict_ __preg,
+ const char *_Restrict_ __String, size_t __nmatch,
+ regmatch_t __pmatch[_Restrict_arr_
+ _REGEX_NELTS (__nmatch)],
+ int __eflags);
+
+extern size_t regerror (int __errcode, const regex_t *_Restrict_ __preg,
+ char *_Restrict_ __errbuf, size_t __errbuf_size)
+ _Attr_access_ ((__write_only__, 3, 4));
+
+extern void regfree (regex_t *__preg);
+
+#if defined __GNUC__ && 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
+# pragma GCC diagnostic pop
+#endif
+
+#ifdef __cplusplus
+}
+#endif /* C++ */
+
+#endif /* regex.h */
diff --git a/gl/lib/regex_internal.c b/gl/lib/regex_internal.c
new file mode 100644
index 0000000..0e6919f
--- /dev/null
+++ b/gl/lib/regex_internal.c
@@ -0,0 +1,1711 @@
+/* Extended regular expression matching and search library.
+ Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+static void re_string_construct_common (const char *str, Idx len,
+ re_string_t *pstr,
+ RE_TRANSLATE_TYPE trans, bool icase,
+ const re_dfa_t *dfa);
+static re_dfastate_t *create_ci_newstate (const re_dfa_t *dfa,
+ const re_node_set *nodes,
+ re_hashval_t hash);
+static re_dfastate_t *create_cd_newstate (const re_dfa_t *dfa,
+ const re_node_set *nodes,
+ unsigned int context,
+ re_hashval_t hash);
+static reg_errcode_t re_string_realloc_buffers (re_string_t *pstr,
+ Idx new_buf_len);
+static void build_wcs_buffer (re_string_t *pstr);
+static reg_errcode_t build_wcs_upper_buffer (re_string_t *pstr);
+static void build_upper_buffer (re_string_t *pstr);
+static void re_string_translate_buffer (re_string_t *pstr);
+static unsigned int re_string_context_at (const re_string_t *input, Idx idx,
+ int eflags) __attribute__ ((pure));
+
+/* Functions for string operation. */
+
+/* This function allocate the buffers. It is necessary to call
+ re_string_reconstruct before using the object. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_string_allocate (re_string_t *pstr, const char *str, Idx len, Idx init_len,
+ RE_TRANSLATE_TYPE trans, bool icase, const re_dfa_t *dfa)
+{
+ reg_errcode_t ret;
+ Idx init_buf_len;
+
+ /* Ensure at least one character fits into the buffers. */
+ if (init_len < dfa->mb_cur_max)
+ init_len = dfa->mb_cur_max;
+ init_buf_len = (len + 1 < init_len) ? len + 1: init_len;
+ re_string_construct_common (str, len, pstr, trans, icase, dfa);
+
+ ret = re_string_realloc_buffers (pstr, init_buf_len);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+
+ pstr->word_char = dfa->word_char;
+ pstr->word_ops_used = dfa->word_ops_used;
+ pstr->mbs = pstr->mbs_allocated ? pstr->mbs : (unsigned char *) str;
+ pstr->valid_len = (pstr->mbs_allocated || dfa->mb_cur_max > 1) ? 0 : len;
+ pstr->valid_raw_len = pstr->valid_len;
+ return REG_NOERROR;
+}
+
+/* This function allocate the buffers, and initialize them. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_string_construct (re_string_t *pstr, const char *str, Idx len,
+ RE_TRANSLATE_TYPE trans, bool icase, const re_dfa_t *dfa)
+{
+ reg_errcode_t ret;
+ memset (pstr, '\0', sizeof (re_string_t));
+ re_string_construct_common (str, len, pstr, trans, icase, dfa);
+
+ if (len > 0)
+ {
+ ret = re_string_realloc_buffers (pstr, len + 1);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+ }
+ pstr->mbs = pstr->mbs_allocated ? pstr->mbs : (unsigned char *) str;
+
+ if (icase)
+ {
+ if (dfa->mb_cur_max > 1)
+ {
+ while (1)
+ {
+ ret = build_wcs_upper_buffer (pstr);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+ if (pstr->valid_raw_len >= len)
+ break;
+ if (pstr->bufs_len > pstr->valid_len + dfa->mb_cur_max)
+ break;
+ ret = re_string_realloc_buffers (pstr, pstr->bufs_len * 2);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+ }
+ }
+ else
+ build_upper_buffer (pstr);
+ }
+ else
+ {
+ if (dfa->mb_cur_max > 1)
+ build_wcs_buffer (pstr);
+ else
+ {
+ if (trans != NULL)
+ re_string_translate_buffer (pstr);
+ else
+ {
+ pstr->valid_len = pstr->bufs_len;
+ pstr->valid_raw_len = pstr->bufs_len;
+ }
+ }
+ }
+
+ return REG_NOERROR;
+}
+
+/* Helper functions for re_string_allocate, and re_string_construct. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_string_realloc_buffers (re_string_t *pstr, Idx new_buf_len)
+{
+ if (pstr->mb_cur_max > 1)
+ {
+ wint_t *new_wcs;
+
+ /* Avoid overflow in realloc. */
+ const size_t max_object_size = MAX (sizeof (wint_t), sizeof (Idx));
+ if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / max_object_size)
+ < new_buf_len))
+ return REG_ESPACE;
+
+ new_wcs = re_realloc (pstr->wcs, wint_t, new_buf_len);
+ if (__glibc_unlikely (new_wcs == NULL))
+ return REG_ESPACE;
+ pstr->wcs = new_wcs;
+ if (pstr->offsets != NULL)
+ {
+ Idx *new_offsets = re_realloc (pstr->offsets, Idx, new_buf_len);
+ if (__glibc_unlikely (new_offsets == NULL))
+ return REG_ESPACE;
+ pstr->offsets = new_offsets;
+ }
+ }
+ if (pstr->mbs_allocated)
+ {
+ unsigned char *new_mbs = re_realloc (pstr->mbs, unsigned char,
+ new_buf_len);
+ if (__glibc_unlikely (new_mbs == NULL))
+ return REG_ESPACE;
+ pstr->mbs = new_mbs;
+ }
+ pstr->bufs_len = new_buf_len;
+ return REG_NOERROR;
+}
+
+
+static void
+re_string_construct_common (const char *str, Idx len, re_string_t *pstr,
+ RE_TRANSLATE_TYPE trans, bool icase,
+ const re_dfa_t *dfa)
+{
+ pstr->raw_mbs = (const unsigned char *) str;
+ pstr->len = len;
+ pstr->raw_len = len;
+ pstr->trans = trans;
+ pstr->icase = icase;
+ pstr->mbs_allocated = (trans != NULL || icase);
+ pstr->mb_cur_max = dfa->mb_cur_max;
+ pstr->is_utf8 = dfa->is_utf8;
+ pstr->map_notascii = dfa->map_notascii;
+ pstr->stop = pstr->len;
+ pstr->raw_stop = pstr->stop;
+}
+
+
+/* Build wide character buffer PSTR->WCS.
+ If the byte sequence of the string are:
+ <mb1>(0), <mb1>(1), <mb2>(0), <mb2>(1), <sb3>
+ Then wide character buffer will be:
+ <wc1> , WEOF , <wc2> , WEOF , <wc3>
+ We use WEOF for padding, they indicate that the position isn't
+ a first byte of a multibyte character.
+
+ Note that this function assumes PSTR->VALID_LEN elements are already
+ built and starts from PSTR->VALID_LEN. */
+
+static void
+build_wcs_buffer (re_string_t *pstr)
+{
+#ifdef _LIBC
+ unsigned char buf[MB_LEN_MAX];
+ DEBUG_ASSERT (MB_LEN_MAX >= pstr->mb_cur_max);
+#else
+ unsigned char buf[64];
+#endif
+ mbstate_t prev_st;
+ Idx byte_idx, end_idx, remain_len;
+ size_t mbclen;
+
+ /* Build the buffers from pstr->valid_len to either pstr->len or
+ pstr->bufs_len. */
+ end_idx = (pstr->bufs_len > pstr->len) ? pstr->len : pstr->bufs_len;
+ for (byte_idx = pstr->valid_len; byte_idx < end_idx;)
+ {
+ wchar_t wc;
+ const char *p;
+
+ remain_len = end_idx - byte_idx;
+ prev_st = pstr->cur_state;
+ /* Apply the translation if we need. */
+ if (__glibc_unlikely (pstr->trans != NULL))
+ {
+ int i, ch;
+
+ for (i = 0; i < pstr->mb_cur_max && i < remain_len; ++i)
+ {
+ ch = pstr->raw_mbs [pstr->raw_mbs_idx + byte_idx + i];
+ buf[i] = pstr->mbs[byte_idx + i] = pstr->trans[ch];
+ }
+ p = (const char *) buf;
+ }
+ else
+ p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + byte_idx;
+ mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state);
+ if (__glibc_unlikely (mbclen == (size_t) -1 || mbclen == 0
+ || (mbclen == (size_t) -2
+ && pstr->bufs_len >= pstr->len)))
+ {
+ /* We treat these cases as a singlebyte character. */
+ mbclen = 1;
+ wc = (wchar_t) pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx];
+ if (__glibc_unlikely (pstr->trans != NULL))
+ wc = pstr->trans[wc];
+ pstr->cur_state = prev_st;
+ }
+ else if (__glibc_unlikely (mbclen == (size_t) -2))
+ {
+ /* The buffer doesn't have enough space, finish to build. */
+ pstr->cur_state = prev_st;
+ break;
+ }
+
+ /* Write wide character and padding. */
+ pstr->wcs[byte_idx++] = wc;
+ /* Write paddings. */
+ for (remain_len = byte_idx + mbclen - 1; byte_idx < remain_len ;)
+ pstr->wcs[byte_idx++] = WEOF;
+ }
+ pstr->valid_len = byte_idx;
+ pstr->valid_raw_len = byte_idx;
+}
+
+/* Build wide character buffer PSTR->WCS like build_wcs_buffer,
+ but for REG_ICASE. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+build_wcs_upper_buffer (re_string_t *pstr)
+{
+ mbstate_t prev_st;
+ Idx src_idx, byte_idx, end_idx, remain_len;
+ size_t mbclen;
+#ifdef _LIBC
+ char buf[MB_LEN_MAX];
+ DEBUG_ASSERT (pstr->mb_cur_max <= MB_LEN_MAX);
+#else
+ char buf[64];
+#endif
+
+ byte_idx = pstr->valid_len;
+ end_idx = (pstr->bufs_len > pstr->len) ? pstr->len : pstr->bufs_len;
+
+ /* The following optimization assumes that ASCII characters can be
+ mapped to wide characters with a simple cast. */
+ if (! pstr->map_notascii && pstr->trans == NULL && !pstr->offsets_needed)
+ {
+ while (byte_idx < end_idx)
+ {
+ wchar_t wc;
+ unsigned char ch = pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx];
+
+ if (isascii (ch) && mbsinit (&pstr->cur_state))
+ {
+ /* The next step uses the assumption that wchar_t is encoded
+ ASCII-safe: all ASCII values can be converted like this. */
+ wchar_t wcu = __towupper (ch);
+ if (isascii (wcu))
+ {
+ pstr->mbs[byte_idx] = wcu;
+ pstr->wcs[byte_idx] = wcu;
+ byte_idx++;
+ continue;
+ }
+ }
+
+ remain_len = end_idx - byte_idx;
+ prev_st = pstr->cur_state;
+ mbclen = __mbrtowc (&wc,
+ ((const char *) pstr->raw_mbs + pstr->raw_mbs_idx
+ + byte_idx), remain_len, &pstr->cur_state);
+ if (__glibc_likely (0 < mbclen && mbclen < (size_t) -2))
+ {
+ wchar_t wcu = __towupper (wc);
+ if (wcu != wc)
+ {
+ size_t mbcdlen;
+
+ mbcdlen = __wcrtomb (buf, wcu, &prev_st);
+ if (__glibc_likely (mbclen == mbcdlen))
+ memcpy (pstr->mbs + byte_idx, buf, mbclen);
+ else
+ {
+ src_idx = byte_idx;
+ goto offsets_needed;
+ }
+ }
+ else
+ memcpy (pstr->mbs + byte_idx,
+ pstr->raw_mbs + pstr->raw_mbs_idx + byte_idx, mbclen);
+ pstr->wcs[byte_idx++] = wcu;
+ /* Write paddings. */
+ for (remain_len = byte_idx + mbclen - 1; byte_idx < remain_len ;)
+ pstr->wcs[byte_idx++] = WEOF;
+ }
+ else if (mbclen == (size_t) -1 || mbclen == 0
+ || (mbclen == (size_t) -2 && pstr->bufs_len >= pstr->len))
+ {
+ /* It is an invalid character, an incomplete character
+ at the end of the string, or '\0'. Just use the byte. */
+ pstr->mbs[byte_idx] = ch;
+ /* And also cast it to wide char. */
+ pstr->wcs[byte_idx++] = (wchar_t) ch;
+ if (__glibc_unlikely (mbclen == (size_t) -1))
+ pstr->cur_state = prev_st;
+ }
+ else
+ {
+ /* The buffer doesn't have enough space, finish to build. */
+ pstr->cur_state = prev_st;
+ break;
+ }
+ }
+ pstr->valid_len = byte_idx;
+ pstr->valid_raw_len = byte_idx;
+ return REG_NOERROR;
+ }
+ else
+ for (src_idx = pstr->valid_raw_len; byte_idx < end_idx;)
+ {
+ wchar_t wc;
+ const char *p;
+ offsets_needed:
+ remain_len = end_idx - byte_idx;
+ prev_st = pstr->cur_state;
+ if (__glibc_unlikely (pstr->trans != NULL))
+ {
+ int i, ch;
+
+ for (i = 0; i < pstr->mb_cur_max && i < remain_len; ++i)
+ {
+ ch = pstr->raw_mbs [pstr->raw_mbs_idx + src_idx + i];
+ buf[i] = pstr->trans[ch];
+ }
+ p = (const char *) buf;
+ }
+ else
+ p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + src_idx;
+ mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state);
+ if (__glibc_likely (0 < mbclen && mbclen < (size_t) -2))
+ {
+ wchar_t wcu = __towupper (wc);
+ if (wcu != wc)
+ {
+ size_t mbcdlen;
+
+ mbcdlen = __wcrtomb ((char *) buf, wcu, &prev_st);
+ if (__glibc_likely (mbclen == mbcdlen))
+ memcpy (pstr->mbs + byte_idx, buf, mbclen);
+ else if (mbcdlen != (size_t) -1)
+ {
+ size_t i;
+
+ if (byte_idx + mbcdlen > pstr->bufs_len)
+ {
+ pstr->cur_state = prev_st;
+ break;
+ }
+
+ if (pstr->offsets == NULL)
+ {
+ pstr->offsets = re_malloc (Idx, pstr->bufs_len);
+
+ if (pstr->offsets == NULL)
+ return REG_ESPACE;
+ }
+ if (!pstr->offsets_needed)
+ {
+ for (i = 0; i < (size_t) byte_idx; ++i)
+ pstr->offsets[i] = i;
+ pstr->offsets_needed = 1;
+ }
+
+ memcpy (pstr->mbs + byte_idx, buf, mbcdlen);
+ pstr->wcs[byte_idx] = wcu;
+ pstr->offsets[byte_idx] = src_idx;
+ for (i = 1; i < mbcdlen; ++i)
+ {
+ pstr->offsets[byte_idx + i]
+ = src_idx + (i < mbclen ? i : mbclen - 1);
+ pstr->wcs[byte_idx + i] = WEOF;
+ }
+ pstr->len += mbcdlen - mbclen;
+ if (pstr->raw_stop > src_idx)
+ pstr->stop += mbcdlen - mbclen;
+ end_idx = (pstr->bufs_len > pstr->len)
+ ? pstr->len : pstr->bufs_len;
+ byte_idx += mbcdlen;
+ src_idx += mbclen;
+ continue;
+ }
+ else
+ memcpy (pstr->mbs + byte_idx, p, mbclen);
+ }
+ else
+ memcpy (pstr->mbs + byte_idx, p, mbclen);
+
+ if (__glibc_unlikely (pstr->offsets_needed != 0))
+ {
+ size_t i;
+ for (i = 0; i < mbclen; ++i)
+ pstr->offsets[byte_idx + i] = src_idx + i;
+ }
+ src_idx += mbclen;
+
+ pstr->wcs[byte_idx++] = wcu;
+ /* Write paddings. */
+ for (remain_len = byte_idx + mbclen - 1; byte_idx < remain_len ;)
+ pstr->wcs[byte_idx++] = WEOF;
+ }
+ else if (mbclen == (size_t) -1 || mbclen == 0
+ || (mbclen == (size_t) -2 && pstr->bufs_len >= pstr->len))
+ {
+ /* It is an invalid character or '\0'. Just use the byte. */
+ int ch = pstr->raw_mbs[pstr->raw_mbs_idx + src_idx];
+
+ if (__glibc_unlikely (pstr->trans != NULL))
+ ch = pstr->trans [ch];
+ pstr->mbs[byte_idx] = ch;
+
+ if (__glibc_unlikely (pstr->offsets_needed != 0))
+ pstr->offsets[byte_idx] = src_idx;
+ ++src_idx;
+
+ /* And also cast it to wide char. */
+ pstr->wcs[byte_idx++] = (wchar_t) ch;
+ if (__glibc_unlikely (mbclen == (size_t) -1))
+ pstr->cur_state = prev_st;
+ }
+ else
+ {
+ /* The buffer doesn't have enough space, finish to build. */
+ pstr->cur_state = prev_st;
+ break;
+ }
+ }
+ pstr->valid_len = byte_idx;
+ pstr->valid_raw_len = src_idx;
+ return REG_NOERROR;
+}
+
+/* Skip characters until the index becomes greater than NEW_RAW_IDX.
+ Return the index. */
+
+static Idx
+re_string_skip_chars (re_string_t *pstr, Idx new_raw_idx, wint_t *last_wc)
+{
+ mbstate_t prev_st;
+ Idx rawbuf_idx;
+ size_t mbclen;
+ wint_t wc = WEOF;
+
+ /* Skip the characters which are not necessary to check. */
+ for (rawbuf_idx = pstr->raw_mbs_idx + pstr->valid_raw_len;
+ rawbuf_idx < new_raw_idx;)
+ {
+ wchar_t wc2;
+ Idx remain_len = pstr->raw_len - rawbuf_idx;
+ prev_st = pstr->cur_state;
+ mbclen = __mbrtowc (&wc2, (const char *) pstr->raw_mbs + rawbuf_idx,
+ remain_len, &pstr->cur_state);
+ if (__glibc_unlikely (mbclen == (size_t) -2 || mbclen == (size_t) -1
+ || mbclen == 0))
+ {
+ /* We treat these cases as a single byte character. */
+ if (mbclen == 0 || remain_len == 0)
+ wc = L'\0';
+ else
+ wc = *(unsigned char *) (pstr->raw_mbs + rawbuf_idx);
+ mbclen = 1;
+ pstr->cur_state = prev_st;
+ }
+ else
+ wc = wc2;
+ /* Then proceed the next character. */
+ rawbuf_idx += mbclen;
+ }
+ *last_wc = wc;
+ return rawbuf_idx;
+}
+
+/* Build the buffer PSTR->MBS, and apply the translation if we need.
+ This function is used in case of REG_ICASE. */
+
+static void
+build_upper_buffer (re_string_t *pstr)
+{
+ Idx char_idx, end_idx;
+ end_idx = (pstr->bufs_len > pstr->len) ? pstr->len : pstr->bufs_len;
+
+ for (char_idx = pstr->valid_len; char_idx < end_idx; ++char_idx)
+ {
+ int ch = pstr->raw_mbs[pstr->raw_mbs_idx + char_idx];
+ if (__glibc_unlikely (pstr->trans != NULL))
+ ch = pstr->trans[ch];
+ pstr->mbs[char_idx] = toupper (ch);
+ }
+ pstr->valid_len = char_idx;
+ pstr->valid_raw_len = char_idx;
+}
+
+/* Apply TRANS to the buffer in PSTR. */
+
+static void
+re_string_translate_buffer (re_string_t *pstr)
+{
+ Idx buf_idx, end_idx;
+ end_idx = (pstr->bufs_len > pstr->len) ? pstr->len : pstr->bufs_len;
+
+ for (buf_idx = pstr->valid_len; buf_idx < end_idx; ++buf_idx)
+ {
+ int ch = pstr->raw_mbs[pstr->raw_mbs_idx + buf_idx];
+ pstr->mbs[buf_idx] = pstr->trans[ch];
+ }
+
+ pstr->valid_len = buf_idx;
+ pstr->valid_raw_len = buf_idx;
+}
+
+/* This function re-construct the buffers.
+ Concretely, convert to wide character in case of pstr->mb_cur_max > 1,
+ convert to upper case in case of REG_ICASE, apply translation. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags)
+{
+ Idx offset;
+
+ if (__glibc_unlikely (pstr->raw_mbs_idx <= idx))
+ offset = idx - pstr->raw_mbs_idx;
+ else
+ {
+ /* Reset buffer. */
+ if (pstr->mb_cur_max > 1)
+ memset (&pstr->cur_state, '\0', sizeof (mbstate_t));
+ pstr->len = pstr->raw_len;
+ pstr->stop = pstr->raw_stop;
+ pstr->valid_len = 0;
+ pstr->raw_mbs_idx = 0;
+ pstr->valid_raw_len = 0;
+ pstr->offsets_needed = 0;
+ pstr->tip_context = ((eflags & REG_NOTBOL) ? CONTEXT_BEGBUF
+ : CONTEXT_NEWLINE | CONTEXT_BEGBUF);
+ if (!pstr->mbs_allocated)
+ pstr->mbs = (unsigned char *) pstr->raw_mbs;
+ offset = idx;
+ }
+
+ if (__glibc_likely (offset != 0))
+ {
+ /* Should the already checked characters be kept? */
+ if (__glibc_likely (offset < pstr->valid_raw_len))
+ {
+ /* Yes, move them to the front of the buffer. */
+ if (__glibc_unlikely (pstr->offsets_needed))
+ {
+ Idx low = 0, high = pstr->valid_len, mid;
+ do
+ {
+ mid = (high + low) / 2;
+ if (pstr->offsets[mid] > offset)
+ high = mid;
+ else if (pstr->offsets[mid] < offset)
+ low = mid + 1;
+ else
+ break;
+ }
+ while (low < high);
+ if (pstr->offsets[mid] < offset)
+ ++mid;
+ pstr->tip_context = re_string_context_at (pstr, mid - 1,
+ eflags);
+ /* This can be quite complicated, so handle specially
+ only the common and easy case where the character with
+ different length representation of lower and upper
+ case is present at or after offset. */
+ if (pstr->valid_len > offset
+ && mid == offset && pstr->offsets[mid] == offset)
+ {
+ memmove (pstr->wcs, pstr->wcs + offset,
+ (pstr->valid_len - offset) * sizeof (wint_t));
+ memmove (pstr->mbs, pstr->mbs + offset, pstr->valid_len - offset);
+ pstr->valid_len -= offset;
+ pstr->valid_raw_len -= offset;
+ for (low = 0; low < pstr->valid_len; low++)
+ pstr->offsets[low] = pstr->offsets[low + offset] - offset;
+ }
+ else
+ {
+ /* Otherwise, just find out how long the partial multibyte
+ character at offset is and fill it with WEOF/255. */
+ pstr->len = pstr->raw_len - idx + offset;
+ pstr->stop = pstr->raw_stop - idx + offset;
+ pstr->offsets_needed = 0;
+ while (mid > 0 && pstr->offsets[mid - 1] == offset)
+ --mid;
+ while (mid < pstr->valid_len)
+ if (pstr->wcs[mid] != WEOF)
+ break;
+ else
+ ++mid;
+ if (mid == pstr->valid_len)
+ pstr->valid_len = 0;
+ else
+ {
+ pstr->valid_len = pstr->offsets[mid] - offset;
+ if (pstr->valid_len)
+ {
+ for (low = 0; low < pstr->valid_len; ++low)
+ pstr->wcs[low] = WEOF;
+ memset (pstr->mbs, 255, pstr->valid_len);
+ }
+ }
+ pstr->valid_raw_len = pstr->valid_len;
+ }
+ }
+ else
+ {
+ pstr->tip_context = re_string_context_at (pstr, offset - 1,
+ eflags);
+ if (pstr->mb_cur_max > 1)
+ memmove (pstr->wcs, pstr->wcs + offset,
+ (pstr->valid_len - offset) * sizeof (wint_t));
+ if (__glibc_unlikely (pstr->mbs_allocated))
+ memmove (pstr->mbs, pstr->mbs + offset,
+ pstr->valid_len - offset);
+ pstr->valid_len -= offset;
+ pstr->valid_raw_len -= offset;
+ DEBUG_ASSERT (pstr->valid_len > 0);
+ }
+ }
+ else
+ {
+ /* No, skip all characters until IDX. */
+ Idx prev_valid_len = pstr->valid_len;
+
+ if (__glibc_unlikely (pstr->offsets_needed))
+ {
+ pstr->len = pstr->raw_len - idx + offset;
+ pstr->stop = pstr->raw_stop - idx + offset;
+ pstr->offsets_needed = 0;
+ }
+ pstr->valid_len = 0;
+ if (pstr->mb_cur_max > 1)
+ {
+ Idx wcs_idx;
+ wint_t wc = WEOF;
+
+ if (pstr->is_utf8)
+ {
+ const unsigned char *raw, *p, *end;
+
+ /* Special case UTF-8. Multi-byte chars start with any
+ byte other than 0x80 - 0xbf. */
+ raw = pstr->raw_mbs + pstr->raw_mbs_idx;
+ end = raw + (offset - pstr->mb_cur_max);
+ if (end < pstr->raw_mbs)
+ end = pstr->raw_mbs;
+ p = raw + offset - 1;
+#ifdef _LIBC
+ /* We know the wchar_t encoding is UCS4, so for the simple
+ case, ASCII characters, skip the conversion step. */
+ if (isascii (*p) && __glibc_likely (pstr->trans == NULL))
+ {
+ memset (&pstr->cur_state, '\0', sizeof (mbstate_t));
+ /* pstr->valid_len = 0; */
+ wc = (wchar_t) *p;
+ }
+ else
+#endif
+ for (; p >= end; --p)
+ if ((*p & 0xc0) != 0x80)
+ {
+ mbstate_t cur_state;
+ wchar_t wc2;
+ Idx mlen = raw + pstr->len - p;
+ unsigned char buf[6];
+ size_t mbclen;
+
+ const unsigned char *pp = p;
+ if (__glibc_unlikely (pstr->trans != NULL))
+ {
+ int i = mlen < 6 ? mlen : 6;
+ while (--i >= 0)
+ buf[i] = pstr->trans[p[i]];
+ pp = buf;
+ }
+ /* XXX Don't use mbrtowc, we know which conversion
+ to use (UTF-8 -> UCS4). */
+ memset (&cur_state, 0, sizeof (cur_state));
+ mbclen = __mbrtowc (&wc2, (const char *) pp, mlen,
+ &cur_state);
+ if (raw + offset - p <= mbclen
+ && mbclen < (size_t) -2)
+ {
+ memset (&pstr->cur_state, '\0',
+ sizeof (mbstate_t));
+ pstr->valid_len = mbclen - (raw + offset - p);
+ wc = wc2;
+ }
+ break;
+ }
+ }
+
+ if (wc == WEOF)
+ pstr->valid_len = re_string_skip_chars (pstr, idx, &wc) - idx;
+ if (wc == WEOF)
+ pstr->tip_context
+ = re_string_context_at (pstr, prev_valid_len - 1, eflags);
+ else
+ pstr->tip_context = ((__glibc_unlikely (pstr->word_ops_used != 0)
+ && IS_WIDE_WORD_CHAR (wc))
+ ? CONTEXT_WORD
+ : ((IS_WIDE_NEWLINE (wc)
+ && pstr->newline_anchor)
+ ? CONTEXT_NEWLINE : 0));
+ if (__glibc_unlikely (pstr->valid_len))
+ {
+ for (wcs_idx = 0; wcs_idx < pstr->valid_len; ++wcs_idx)
+ pstr->wcs[wcs_idx] = WEOF;
+ if (pstr->mbs_allocated)
+ memset (pstr->mbs, 255, pstr->valid_len);
+ }
+ pstr->valid_raw_len = pstr->valid_len;
+ }
+ else
+ {
+ int c = pstr->raw_mbs[pstr->raw_mbs_idx + offset - 1];
+ pstr->valid_raw_len = 0;
+ if (pstr->trans)
+ c = pstr->trans[c];
+ pstr->tip_context = (bitset_contain (pstr->word_char, c)
+ ? CONTEXT_WORD
+ : ((IS_NEWLINE (c) && pstr->newline_anchor)
+ ? CONTEXT_NEWLINE : 0));
+ }
+ }
+ if (!__glibc_unlikely (pstr->mbs_allocated))
+ pstr->mbs += offset;
+ }
+ pstr->raw_mbs_idx = idx;
+ pstr->len -= offset;
+ pstr->stop -= offset;
+
+ /* Then build the buffers. */
+ if (pstr->mb_cur_max > 1)
+ {
+ if (pstr->icase)
+ {
+ reg_errcode_t ret = build_wcs_upper_buffer (pstr);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+ }
+ else
+ build_wcs_buffer (pstr);
+ }
+ else
+ if (__glibc_unlikely (pstr->mbs_allocated))
+ {
+ if (pstr->icase)
+ build_upper_buffer (pstr);
+ else if (pstr->trans != NULL)
+ re_string_translate_buffer (pstr);
+ }
+ else
+ pstr->valid_len = pstr->len;
+
+ pstr->cur_idx = 0;
+ return REG_NOERROR;
+}
+
+static unsigned char
+__attribute__ ((pure))
+re_string_peek_byte_case (const re_string_t *pstr, Idx idx)
+{
+ int ch;
+ Idx off;
+
+ /* Handle the common (easiest) cases first. */
+ if (__glibc_likely (!pstr->mbs_allocated))
+ return re_string_peek_byte (pstr, idx);
+
+ if (pstr->mb_cur_max > 1
+ && ! re_string_is_single_byte_char (pstr, pstr->cur_idx + idx))
+ return re_string_peek_byte (pstr, idx);
+
+ off = pstr->cur_idx + idx;
+ if (pstr->offsets_needed)
+ off = pstr->offsets[off];
+
+ ch = pstr->raw_mbs[pstr->raw_mbs_idx + off];
+
+ /* Ensure that e.g. for tr_TR.UTF-8 BACKSLASH DOTLESS SMALL LETTER I
+ this function returns CAPITAL LETTER I instead of first byte of
+ DOTLESS SMALL LETTER I. The latter would confuse the parser,
+ since peek_byte_case doesn't advance cur_idx in any way. */
+ if (pstr->offsets_needed && !isascii (ch))
+ return re_string_peek_byte (pstr, idx);
+
+ return ch;
+}
+
+static unsigned char
+re_string_fetch_byte_case (re_string_t *pstr)
+{
+ if (__glibc_likely (!pstr->mbs_allocated))
+ return re_string_fetch_byte (pstr);
+
+ if (pstr->offsets_needed)
+ {
+ Idx off;
+ int ch;
+
+ /* For tr_TR.UTF-8 [[:islower:]] there is
+ [[: CAPITAL LETTER I WITH DOT lower:]] in mbs. Skip
+ in that case the whole multi-byte character and return
+ the original letter. On the other side, with
+ [[: DOTLESS SMALL LETTER I return [[:I, as doing
+ anything else would complicate things too much. */
+
+ if (!re_string_first_byte (pstr, pstr->cur_idx))
+ return re_string_fetch_byte (pstr);
+
+ off = pstr->offsets[pstr->cur_idx];
+ ch = pstr->raw_mbs[pstr->raw_mbs_idx + off];
+
+ if (! isascii (ch))
+ return re_string_fetch_byte (pstr);
+
+ re_string_skip_bytes (pstr,
+ re_string_char_size_at (pstr, pstr->cur_idx));
+ return ch;
+ }
+
+ return pstr->raw_mbs[pstr->raw_mbs_idx + pstr->cur_idx++];
+}
+
+static void
+re_string_destruct (re_string_t *pstr)
+{
+ re_free (pstr->wcs);
+ re_free (pstr->offsets);
+ if (pstr->mbs_allocated)
+ re_free (pstr->mbs);
+}
+
+/* Return the context at IDX in INPUT. */
+
+static unsigned int
+re_string_context_at (const re_string_t *input, Idx idx, int eflags)
+{
+ int c;
+ if (__glibc_unlikely (idx < 0))
+ /* In this case, we use the value stored in input->tip_context,
+ since we can't know the character in input->mbs[-1] here. */
+ return input->tip_context;
+ if (__glibc_unlikely (idx == input->len))
+ return ((eflags & REG_NOTEOL) ? CONTEXT_ENDBUF
+ : CONTEXT_NEWLINE | CONTEXT_ENDBUF);
+ if (input->mb_cur_max > 1)
+ {
+ wint_t wc;
+ Idx wc_idx = idx;
+ while(input->wcs[wc_idx] == WEOF)
+ {
+ DEBUG_ASSERT (wc_idx >= 0);
+ --wc_idx;
+ if (wc_idx < 0)
+ return input->tip_context;
+ }
+ wc = input->wcs[wc_idx];
+ if (__glibc_unlikely (input->word_ops_used != 0)
+ && IS_WIDE_WORD_CHAR (wc))
+ return CONTEXT_WORD;
+ return (IS_WIDE_NEWLINE (wc) && input->newline_anchor
+ ? CONTEXT_NEWLINE : 0);
+ }
+ else
+ {
+ c = re_string_byte_at (input, idx);
+ if (bitset_contain (input->word_char, c))
+ return CONTEXT_WORD;
+ return IS_NEWLINE (c) && input->newline_anchor ? CONTEXT_NEWLINE : 0;
+ }
+}
+
+/* Functions for set operation. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_node_set_alloc (re_node_set *set, Idx size)
+{
+ set->alloc = size;
+ set->nelem = 0;
+ set->elems = re_malloc (Idx, size);
+ if (__glibc_unlikely (set->elems == NULL)
+ && (MALLOC_0_IS_NONNULL || size != 0))
+ return REG_ESPACE;
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_node_set_init_1 (re_node_set *set, Idx elem)
+{
+ set->alloc = 1;
+ set->nelem = 1;
+ set->elems = re_malloc (Idx, 1);
+ if (__glibc_unlikely (set->elems == NULL))
+ {
+ set->alloc = set->nelem = 0;
+ return REG_ESPACE;
+ }
+ set->elems[0] = elem;
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_node_set_init_2 (re_node_set *set, Idx elem1, Idx elem2)
+{
+ set->alloc = 2;
+ set->elems = re_malloc (Idx, 2);
+ if (__glibc_unlikely (set->elems == NULL))
+ return REG_ESPACE;
+ if (elem1 == elem2)
+ {
+ set->nelem = 1;
+ set->elems[0] = elem1;
+ }
+ else
+ {
+ set->nelem = 2;
+ if (elem1 < elem2)
+ {
+ set->elems[0] = elem1;
+ set->elems[1] = elem2;
+ }
+ else
+ {
+ set->elems[0] = elem2;
+ set->elems[1] = elem1;
+ }
+ }
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_node_set_init_copy (re_node_set *dest, const re_node_set *src)
+{
+ dest->nelem = src->nelem;
+ if (src->nelem > 0)
+ {
+ dest->alloc = dest->nelem;
+ dest->elems = re_malloc (Idx, dest->alloc);
+ if (__glibc_unlikely (dest->elems == NULL))
+ {
+ dest->alloc = dest->nelem = 0;
+ return REG_ESPACE;
+ }
+ memcpy (dest->elems, src->elems, src->nelem * sizeof (Idx));
+ }
+ else
+ re_node_set_init_empty (dest);
+ return REG_NOERROR;
+}
+
+/* Calculate the intersection of the sets SRC1 and SRC2. And merge it to
+ DEST. Return value indicate the error code or REG_NOERROR if succeeded.
+ Note: We assume dest->elems is NULL, when dest->alloc is 0. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_node_set_add_intersect (re_node_set *dest, const re_node_set *src1,
+ const re_node_set *src2)
+{
+ Idx i1, i2, is, id, delta, sbase;
+ if (src1->nelem == 0 || src2->nelem == 0)
+ return REG_NOERROR;
+
+ /* We need dest->nelem + 2 * elems_in_intersection; this is a
+ conservative estimate. */
+ if (src1->nelem + src2->nelem + dest->nelem > dest->alloc)
+ {
+ Idx new_alloc = src1->nelem + src2->nelem + dest->alloc;
+ Idx *new_elems = re_realloc (dest->elems, Idx, new_alloc);
+ if (__glibc_unlikely (new_elems == NULL))
+ return REG_ESPACE;
+ dest->elems = new_elems;
+ dest->alloc = new_alloc;
+ }
+
+ /* Find the items in the intersection of SRC1 and SRC2, and copy
+ into the top of DEST those that are not already in DEST itself. */
+ sbase = dest->nelem + src1->nelem + src2->nelem;
+ i1 = src1->nelem - 1;
+ i2 = src2->nelem - 1;
+ id = dest->nelem - 1;
+ for (;;)
+ {
+ if (src1->elems[i1] == src2->elems[i2])
+ {
+ /* Try to find the item in DEST. Maybe we could binary search? */
+ while (id >= 0 && dest->elems[id] > src1->elems[i1])
+ --id;
+
+ if (id < 0 || dest->elems[id] != src1->elems[i1])
+ dest->elems[--sbase] = src1->elems[i1];
+
+ if (--i1 < 0 || --i2 < 0)
+ break;
+ }
+
+ /* Lower the highest of the two items. */
+ else if (src1->elems[i1] < src2->elems[i2])
+ {
+ if (--i2 < 0)
+ break;
+ }
+ else
+ {
+ if (--i1 < 0)
+ break;
+ }
+ }
+
+ id = dest->nelem - 1;
+ is = dest->nelem + src1->nelem + src2->nelem - 1;
+ delta = is - sbase + 1;
+
+ /* Now copy. When DELTA becomes zero, the remaining
+ DEST elements are already in place; this is more or
+ less the same loop that is in re_node_set_merge. */
+ dest->nelem += delta;
+ if (delta > 0 && id >= 0)
+ for (;;)
+ {
+ if (dest->elems[is] > dest->elems[id])
+ {
+ /* Copy from the top. */
+ dest->elems[id + delta--] = dest->elems[is--];
+ if (delta == 0)
+ break;
+ }
+ else
+ {
+ /* Slide from the bottom. */
+ dest->elems[id + delta] = dest->elems[id];
+ if (--id < 0)
+ break;
+ }
+ }
+
+ /* Copy remaining SRC elements. */
+ memcpy (dest->elems, dest->elems + sbase, delta * sizeof (Idx));
+
+ return REG_NOERROR;
+}
+
+/* Calculate the union set of the sets SRC1 and SRC2. And store it to
+ DEST. Return value indicate the error code or REG_NOERROR if succeeded. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_node_set_init_union (re_node_set *dest, const re_node_set *src1,
+ const re_node_set *src2)
+{
+ Idx i1, i2, id;
+ if (src1 != NULL && src1->nelem > 0 && src2 != NULL && src2->nelem > 0)
+ {
+ dest->alloc = src1->nelem + src2->nelem;
+ dest->elems = re_malloc (Idx, dest->alloc);
+ if (__glibc_unlikely (dest->elems == NULL))
+ return REG_ESPACE;
+ }
+ else
+ {
+ if (src1 != NULL && src1->nelem > 0)
+ return re_node_set_init_copy (dest, src1);
+ else if (src2 != NULL && src2->nelem > 0)
+ return re_node_set_init_copy (dest, src2);
+ else
+ re_node_set_init_empty (dest);
+ return REG_NOERROR;
+ }
+ for (i1 = i2 = id = 0 ; i1 < src1->nelem && i2 < src2->nelem ;)
+ {
+ if (src1->elems[i1] > src2->elems[i2])
+ {
+ dest->elems[id++] = src2->elems[i2++];
+ continue;
+ }
+ if (src1->elems[i1] == src2->elems[i2])
+ ++i2;
+ dest->elems[id++] = src1->elems[i1++];
+ }
+ if (i1 < src1->nelem)
+ {
+ memcpy (dest->elems + id, src1->elems + i1,
+ (src1->nelem - i1) * sizeof (Idx));
+ id += src1->nelem - i1;
+ }
+ else if (i2 < src2->nelem)
+ {
+ memcpy (dest->elems + id, src2->elems + i2,
+ (src2->nelem - i2) * sizeof (Idx));
+ id += src2->nelem - i2;
+ }
+ dest->nelem = id;
+ return REG_NOERROR;
+}
+
+/* Calculate the union set of the sets DEST and SRC. And store it to
+ DEST. Return value indicate the error code or REG_NOERROR if succeeded. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_node_set_merge (re_node_set *dest, const re_node_set *src)
+{
+ Idx is, id, sbase, delta;
+ if (src == NULL || src->nelem == 0)
+ return REG_NOERROR;
+ if (dest->alloc < 2 * src->nelem + dest->nelem)
+ {
+ Idx new_alloc = 2 * (src->nelem + dest->alloc);
+ Idx *new_buffer = re_realloc (dest->elems, Idx, new_alloc);
+ if (__glibc_unlikely (new_buffer == NULL))
+ return REG_ESPACE;
+ dest->elems = new_buffer;
+ dest->alloc = new_alloc;
+ }
+
+ if (__glibc_unlikely (dest->nelem == 0))
+ {
+ /* Although we already guaranteed above that dest->alloc != 0 and
+ therefore dest->elems != NULL, add a debug assertion to pacify
+ GCC 11.2.1's -fanalyzer. */
+ DEBUG_ASSERT (dest->elems);
+ dest->nelem = src->nelem;
+ memcpy (dest->elems, src->elems, src->nelem * sizeof (Idx));
+ return REG_NOERROR;
+ }
+
+ /* Copy into the top of DEST the items of SRC that are not
+ found in DEST. Maybe we could binary search in DEST? */
+ for (sbase = dest->nelem + 2 * src->nelem,
+ is = src->nelem - 1, id = dest->nelem - 1; is >= 0 && id >= 0; )
+ {
+ if (dest->elems[id] == src->elems[is])
+ is--, id--;
+ else if (dest->elems[id] < src->elems[is])
+ dest->elems[--sbase] = src->elems[is--];
+ else /* if (dest->elems[id] > src->elems[is]) */
+ --id;
+ }
+
+ if (is >= 0)
+ {
+ /* If DEST is exhausted, the remaining items of SRC must be unique. */
+ sbase -= is + 1;
+ memcpy (dest->elems + sbase, src->elems, (is + 1) * sizeof (Idx));
+ }
+
+ id = dest->nelem - 1;
+ is = dest->nelem + 2 * src->nelem - 1;
+ delta = is - sbase + 1;
+ if (delta == 0)
+ return REG_NOERROR;
+
+ /* Now copy. When DELTA becomes zero, the remaining
+ DEST elements are already in place. */
+ dest->nelem += delta;
+ for (;;)
+ {
+ if (dest->elems[is] > dest->elems[id])
+ {
+ /* Copy from the top. */
+ dest->elems[id + delta--] = dest->elems[is--];
+ if (delta == 0)
+ break;
+ }
+ else
+ {
+ /* Slide from the bottom. */
+ dest->elems[id + delta] = dest->elems[id];
+ if (--id < 0)
+ {
+ /* Copy remaining SRC elements. */
+ memcpy (dest->elems, dest->elems + sbase,
+ delta * sizeof (Idx));
+ break;
+ }
+ }
+ }
+
+ return REG_NOERROR;
+}
+
+/* Insert the new element ELEM to the re_node_set* SET.
+ SET should not already have ELEM.
+ Return true if successful. */
+
+static bool
+__attribute_warn_unused_result__
+re_node_set_insert (re_node_set *set, Idx elem)
+{
+ Idx idx;
+ /* In case the set is empty. */
+ if (set->alloc == 0)
+ return __glibc_likely (re_node_set_init_1 (set, elem) == REG_NOERROR);
+
+ if (__glibc_unlikely (set->nelem) == 0)
+ {
+ /* Although we already guaranteed above that set->alloc != 0 and
+ therefore set->elems != NULL, add a debug assertion to pacify
+ GCC 11.2 -fanalyzer. */
+ DEBUG_ASSERT (set->elems);
+ set->elems[0] = elem;
+ ++set->nelem;
+ return true;
+ }
+
+ /* Realloc if we need. */
+ if (set->alloc == set->nelem)
+ {
+ Idx *new_elems;
+ set->alloc = set->alloc * 2;
+ new_elems = re_realloc (set->elems, Idx, set->alloc);
+ if (__glibc_unlikely (new_elems == NULL))
+ return false;
+ set->elems = new_elems;
+ }
+
+ /* Move the elements which follows the new element. Test the
+ first element separately to skip a check in the inner loop. */
+ if (elem < set->elems[0])
+ {
+ for (idx = set->nelem; idx > 0; idx--)
+ set->elems[idx] = set->elems[idx - 1];
+ }
+ else
+ {
+ for (idx = set->nelem; set->elems[idx - 1] > elem; idx--)
+ set->elems[idx] = set->elems[idx - 1];
+ DEBUG_ASSERT (set->elems[idx - 1] < elem);
+ }
+
+ /* Insert the new element. */
+ set->elems[idx] = elem;
+ ++set->nelem;
+ return true;
+}
+
+/* Insert the new element ELEM to the re_node_set* SET.
+ SET should not already have any element greater than or equal to ELEM.
+ Return true if successful. */
+
+static bool
+__attribute_warn_unused_result__
+re_node_set_insert_last (re_node_set *set, Idx elem)
+{
+ /* Realloc if we need. */
+ if (set->alloc == set->nelem)
+ {
+ Idx *new_elems;
+ set->alloc = (set->alloc + 1) * 2;
+ new_elems = re_realloc (set->elems, Idx, set->alloc);
+ if (__glibc_unlikely (new_elems == NULL))
+ return false;
+ set->elems = new_elems;
+ }
+
+ /* Insert the new element. */
+ set->elems[set->nelem++] = elem;
+ return true;
+}
+
+/* Compare two node sets SET1 and SET2.
+ Return true if SET1 and SET2 are equivalent. */
+
+static bool
+__attribute__ ((pure))
+re_node_set_compare (const re_node_set *set1, const re_node_set *set2)
+{
+ Idx i;
+ if (set1 == NULL || set2 == NULL || set1->nelem != set2->nelem)
+ return false;
+ for (i = set1->nelem ; --i >= 0 ; )
+ if (set1->elems[i] != set2->elems[i])
+ return false;
+ return true;
+}
+
+/* Return (idx + 1) if SET contains the element ELEM, return 0 otherwise. */
+
+static Idx
+__attribute__ ((pure))
+re_node_set_contains (const re_node_set *set, Idx elem)
+{
+ __re_size_t idx, right, mid;
+ if (set->nelem <= 0)
+ return 0;
+
+ /* Binary search the element. */
+ idx = 0;
+ right = set->nelem - 1;
+ while (idx < right)
+ {
+ mid = (idx + right) / 2;
+ if (set->elems[mid] < elem)
+ idx = mid + 1;
+ else
+ right = mid;
+ }
+ return set->elems[idx] == elem ? idx + 1 : 0;
+}
+
+static void
+re_node_set_remove_at (re_node_set *set, Idx idx)
+{
+ if (idx < 0 || idx >= set->nelem)
+ return;
+ --set->nelem;
+ for (; idx < set->nelem; idx++)
+ set->elems[idx] = set->elems[idx + 1];
+}
+
+
+/* Add the token TOKEN to dfa->nodes, and return the index of the token.
+ Or return -1 if an error occurred. */
+
+static Idx
+re_dfa_add_node (re_dfa_t *dfa, re_token_t token)
+{
+ if (__glibc_unlikely (dfa->nodes_len >= dfa->nodes_alloc))
+ {
+ size_t new_nodes_alloc = dfa->nodes_alloc * 2;
+ Idx *new_nexts, *new_indices;
+ re_node_set *new_edests, *new_eclosures;
+ re_token_t *new_nodes;
+
+ /* Avoid overflows in realloc. */
+ const size_t max_object_size = MAX (sizeof (re_token_t),
+ MAX (sizeof (re_node_set),
+ sizeof (Idx)));
+ if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / max_object_size)
+ < new_nodes_alloc))
+ return -1;
+
+ new_nodes = re_realloc (dfa->nodes, re_token_t, new_nodes_alloc);
+ if (__glibc_unlikely (new_nodes == NULL))
+ return -1;
+ dfa->nodes = new_nodes;
+ dfa->nodes_alloc = new_nodes_alloc;
+ new_nexts = re_realloc (dfa->nexts, Idx, new_nodes_alloc);
+ if (new_nexts != NULL)
+ dfa->nexts = new_nexts;
+ new_indices = re_realloc (dfa->org_indices, Idx, new_nodes_alloc);
+ if (new_indices != NULL)
+ dfa->org_indices = new_indices;
+ new_edests = re_realloc (dfa->edests, re_node_set, new_nodes_alloc);
+ if (new_edests != NULL)
+ dfa->edests = new_edests;
+ new_eclosures = re_realloc (dfa->eclosures, re_node_set, new_nodes_alloc);
+ if (new_eclosures != NULL)
+ dfa->eclosures = new_eclosures;
+ if (__glibc_unlikely (new_nexts == NULL || new_indices == NULL
+ || new_edests == NULL || new_eclosures == NULL))
+ return -1;
+ }
+ dfa->nodes[dfa->nodes_len] = token;
+ dfa->nodes[dfa->nodes_len].constraint = 0;
+ dfa->nodes[dfa->nodes_len].accept_mb =
+ ((token.type == OP_PERIOD && dfa->mb_cur_max > 1)
+ || token.type == COMPLEX_BRACKET);
+ dfa->nexts[dfa->nodes_len] = -1;
+ re_node_set_init_empty (dfa->edests + dfa->nodes_len);
+ re_node_set_init_empty (dfa->eclosures + dfa->nodes_len);
+ return dfa->nodes_len++;
+}
+
+static re_hashval_t
+calc_state_hash (const re_node_set *nodes, unsigned int context)
+{
+ re_hashval_t hash = nodes->nelem + context;
+ Idx i;
+ for (i = 0 ; i < nodes->nelem ; i++)
+ hash += nodes->elems[i];
+ return hash;
+}
+
+/* Search for the state whose node_set is equivalent to NODES.
+ Return the pointer to the state, if we found it in the DFA.
+ Otherwise create the new one and return it. In case of an error
+ return NULL and set the error code in ERR.
+ Note: - We assume NULL as the invalid state, then it is possible that
+ return value is NULL and ERR is REG_NOERROR.
+ - We never return non-NULL value in case of any errors, it is for
+ optimization. */
+
+static re_dfastate_t *
+__attribute_warn_unused_result__
+re_acquire_state (reg_errcode_t *err, const re_dfa_t *dfa,
+ const re_node_set *nodes)
+{
+ re_hashval_t hash;
+ re_dfastate_t *new_state;
+ struct re_state_table_entry *spot;
+ Idx i;
+#if defined GCC_LINT || defined lint
+ /* Suppress bogus uninitialized-variable warnings. */
+ *err = REG_NOERROR;
+#endif
+ if (__glibc_unlikely (nodes->nelem == 0))
+ {
+ *err = REG_NOERROR;
+ return NULL;
+ }
+ hash = calc_state_hash (nodes, 0);
+ spot = dfa->state_table + (hash & dfa->state_hash_mask);
+
+ for (i = 0 ; i < spot->num ; i++)
+ {
+ re_dfastate_t *state = spot->array[i];
+ if (hash != state->hash)
+ continue;
+ if (re_node_set_compare (&state->nodes, nodes))
+ return state;
+ }
+
+ /* There are no appropriate state in the dfa, create the new one. */
+ new_state = create_ci_newstate (dfa, nodes, hash);
+ if (__glibc_unlikely (new_state == NULL))
+ *err = REG_ESPACE;
+
+ return new_state;
+}
+
+/* Search for the state whose node_set is equivalent to NODES and
+ whose context is equivalent to CONTEXT.
+ Return the pointer to the state, if we found it in the DFA.
+ Otherwise create the new one and return it. In case of an error
+ return NULL and set the error code in ERR.
+ Note: - We assume NULL as the invalid state, then it is possible that
+ return value is NULL and ERR is REG_NOERROR.
+ - We never return non-NULL value in case of any errors, it is for
+ optimization. */
+
+static re_dfastate_t *
+__attribute_warn_unused_result__
+re_acquire_state_context (reg_errcode_t *err, const re_dfa_t *dfa,
+ const re_node_set *nodes, unsigned int context)
+{
+ re_hashval_t hash;
+ re_dfastate_t *new_state;
+ struct re_state_table_entry *spot;
+ Idx i;
+#if defined GCC_LINT || defined lint
+ /* Suppress bogus uninitialized-variable warnings. */
+ *err = REG_NOERROR;
+#endif
+ if (nodes->nelem == 0)
+ {
+ *err = REG_NOERROR;
+ return NULL;
+ }
+ hash = calc_state_hash (nodes, context);
+ spot = dfa->state_table + (hash & dfa->state_hash_mask);
+
+ for (i = 0 ; i < spot->num ; i++)
+ {
+ re_dfastate_t *state = spot->array[i];
+ if (state->hash == hash
+ && state->context == context
+ && re_node_set_compare (state->entrance_nodes, nodes))
+ return state;
+ }
+ /* There are no appropriate state in 'dfa', create the new one. */
+ new_state = create_cd_newstate (dfa, nodes, context, hash);
+ if (__glibc_unlikely (new_state == NULL))
+ *err = REG_ESPACE;
+
+ return new_state;
+}
+
+/* Finish initialization of the new state NEWSTATE, and using its hash value
+ HASH put in the appropriate bucket of DFA's state table. Return value
+ indicates the error code if failed. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+register_state (const re_dfa_t *dfa, re_dfastate_t *newstate,
+ re_hashval_t hash)
+{
+ struct re_state_table_entry *spot;
+ reg_errcode_t err;
+ Idx i;
+
+ newstate->hash = hash;
+ err = re_node_set_alloc (&newstate->non_eps_nodes, newstate->nodes.nelem);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return REG_ESPACE;
+ for (i = 0; i < newstate->nodes.nelem; i++)
+ {
+ Idx elem = newstate->nodes.elems[i];
+ if (!IS_EPSILON_NODE (dfa->nodes[elem].type))
+ if (! re_node_set_insert_last (&newstate->non_eps_nodes, elem))
+ return REG_ESPACE;
+ }
+
+ spot = dfa->state_table + (hash & dfa->state_hash_mask);
+ if (__glibc_unlikely (spot->alloc <= spot->num))
+ {
+ Idx new_alloc = 2 * spot->num + 2;
+ re_dfastate_t **new_array = re_realloc (spot->array, re_dfastate_t *,
+ new_alloc);
+ if (__glibc_unlikely (new_array == NULL))
+ return REG_ESPACE;
+ spot->array = new_array;
+ spot->alloc = new_alloc;
+ }
+ spot->array[spot->num++] = newstate;
+ return REG_NOERROR;
+}
+
+static void
+free_state (re_dfastate_t *state)
+{
+ re_node_set_free (&state->non_eps_nodes);
+ re_node_set_free (&state->inveclosure);
+ if (state->entrance_nodes != &state->nodes)
+ {
+ re_node_set_free (state->entrance_nodes);
+ re_free (state->entrance_nodes);
+ }
+ re_node_set_free (&state->nodes);
+ re_free (state->word_trtable);
+ re_free (state->trtable);
+ re_free (state);
+}
+
+/* Create the new state which is independent of contexts.
+ Return the new state if succeeded, otherwise return NULL. */
+
+static re_dfastate_t *
+__attribute_warn_unused_result__
+create_ci_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
+ re_hashval_t hash)
+{
+ Idx i;
+ reg_errcode_t err;
+ re_dfastate_t *newstate;
+
+ newstate = (re_dfastate_t *) calloc (sizeof (re_dfastate_t), 1);
+ if (__glibc_unlikely (newstate == NULL))
+ return NULL;
+ err = re_node_set_init_copy (&newstate->nodes, nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_free (newstate);
+ return NULL;
+ }
+
+ newstate->entrance_nodes = &newstate->nodes;
+ for (i = 0 ; i < nodes->nelem ; i++)
+ {
+ re_token_t *node = dfa->nodes + nodes->elems[i];
+ re_token_type_t type = node->type;
+ if (type == CHARACTER && !node->constraint)
+ continue;
+ newstate->accept_mb |= node->accept_mb;
+
+ /* If the state has the halt node, the state is a halt state. */
+ if (type == END_OF_RE)
+ newstate->halt = 1;
+ else if (type == OP_BACK_REF)
+ newstate->has_backref = 1;
+ else if (type == ANCHOR || node->constraint)
+ newstate->has_constraint = 1;
+ }
+ err = register_state (dfa, newstate, hash);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ free_state (newstate);
+ newstate = NULL;
+ }
+ return newstate;
+}
+
+/* Create the new state which is depend on the context CONTEXT.
+ Return the new state if succeeded, otherwise return NULL. */
+
+static re_dfastate_t *
+__attribute_warn_unused_result__
+create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
+ unsigned int context, re_hashval_t hash)
+{
+ Idx i, nctx_nodes = 0;
+ reg_errcode_t err;
+ re_dfastate_t *newstate;
+
+ newstate = (re_dfastate_t *) calloc (sizeof (re_dfastate_t), 1);
+ if (__glibc_unlikely (newstate == NULL))
+ return NULL;
+ err = re_node_set_init_copy (&newstate->nodes, nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_free (newstate);
+ return NULL;
+ }
+
+ newstate->context = context;
+ newstate->entrance_nodes = &newstate->nodes;
+
+ for (i = 0 ; i < nodes->nelem ; i++)
+ {
+ re_token_t *node = dfa->nodes + nodes->elems[i];
+ re_token_type_t type = node->type;
+ unsigned int constraint = node->constraint;
+
+ if (type == CHARACTER && !constraint)
+ continue;
+ newstate->accept_mb |= node->accept_mb;
+
+ /* If the state has the halt node, the state is a halt state. */
+ if (type == END_OF_RE)
+ newstate->halt = 1;
+ else if (type == OP_BACK_REF)
+ newstate->has_backref = 1;
+
+ if (constraint)
+ {
+ if (newstate->entrance_nodes == &newstate->nodes)
+ {
+ re_node_set *entrance_nodes = re_malloc (re_node_set, 1);
+ if (__glibc_unlikely (entrance_nodes == NULL))
+ {
+ free_state (newstate);
+ return NULL;
+ }
+ newstate->entrance_nodes = entrance_nodes;
+ if (re_node_set_init_copy (newstate->entrance_nodes, nodes)
+ != REG_NOERROR)
+ {
+ free_state (newstate);
+ return NULL;
+ }
+ nctx_nodes = 0;
+ newstate->has_constraint = 1;
+ }
+
+ if (NOT_SATISFY_PREV_CONSTRAINT (constraint,context))
+ {
+ re_node_set_remove_at (&newstate->nodes, i - nctx_nodes);
+ ++nctx_nodes;
+ }
+ }
+ }
+ err = register_state (dfa, newstate, hash);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ free_state (newstate);
+ newstate = NULL;
+ }
+ return newstate;
+}
diff --git a/gl/lib/regex_internal.h b/gl/lib/regex_internal.h
new file mode 100644
index 0000000..57a455b
--- /dev/null
+++ b/gl/lib/regex_internal.h
@@ -0,0 +1,835 @@
+/* Extended regular expression matching and search library.
+ Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _REGEX_INTERNAL_H
+#define _REGEX_INTERNAL_H 1
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <langinfo.h>
+#include <locale.h>
+#include <wchar.h>
+#include <wctype.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#ifndef _LIBC
+# include <dynarray.h>
+#endif
+
+#include <intprops.h>
+#include <verify.h>
+
+#if defined DEBUG && DEBUG != 0
+# include <assert.h>
+# define DEBUG_ASSERT(x) assert (x)
+#else
+# define DEBUG_ASSERT(x) assume (x)
+#endif
+
+#ifdef _LIBC
+# include <libc-lock.h>
+# define lock_define(name) __libc_lock_define (, name)
+# define lock_init(lock) (__libc_lock_init (lock), 0)
+# define lock_fini(lock) ((void) 0)
+# define lock_lock(lock) __libc_lock_lock (lock)
+# define lock_unlock(lock) __libc_lock_unlock (lock)
+#elif defined GNULIB_LOCK && !defined GNULIB_REGEX_SINGLE_THREAD
+# include "glthread/lock.h"
+# define lock_define(name) gl_lock_define (, name)
+# define lock_init(lock) glthread_lock_init (&(lock))
+# define lock_fini(lock) glthread_lock_destroy (&(lock))
+# define lock_lock(lock) glthread_lock_lock (&(lock))
+# define lock_unlock(lock) glthread_lock_unlock (&(lock))
+#elif defined GNULIB_PTHREAD && !defined GNULIB_REGEX_SINGLE_THREAD
+# include <pthread.h>
+# define lock_define(name) pthread_mutex_t name;
+# define lock_init(lock) pthread_mutex_init (&(lock), 0)
+# define lock_fini(lock) pthread_mutex_destroy (&(lock))
+# define lock_lock(lock) pthread_mutex_lock (&(lock))
+# define lock_unlock(lock) pthread_mutex_unlock (&(lock))
+#else
+# define lock_define(name)
+# define lock_init(lock) 0
+# define lock_fini(lock) ((void) 0)
+ /* The 'dfa' avoids an "unused variable 'dfa'" warning from GCC. */
+# define lock_lock(lock) ((void) dfa)
+# define lock_unlock(lock) ((void) 0)
+#endif
+
+/* In case that the system doesn't have isblank(). */
+#if !defined _LIBC && ! (defined isblank || (HAVE_ISBLANK && HAVE_DECL_ISBLANK))
+# define isblank(ch) ((ch) == ' ' || (ch) == '\t')
+#endif
+
+/* regex code assumes isascii has its usual numeric meaning,
+ even if the portable character set uses EBCDIC encoding,
+ and even if wint_t is wider than int. */
+#ifndef _LIBC
+# undef isascii
+# define isascii(c) (((c) & ~0x7f) == 0)
+#endif
+
+#ifdef _LIBC
+# ifndef _RE_DEFINE_LOCALE_FUNCTIONS
+# define _RE_DEFINE_LOCALE_FUNCTIONS 1
+# include <locale/localeinfo.h>
+# include <locale/coll-lookup.h>
+# endif
+#endif
+
+/* This is for other GNU distributions with internationalized messages. */
+#if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC
+# include <libintl.h>
+# ifdef _LIBC
+# undef gettext
+# define gettext(msgid) \
+ __dcgettext (_libc_intl_domainname, msgid, LC_MESSAGES)
+# endif
+#else
+# undef gettext
+# define gettext(msgid) (msgid)
+#endif
+
+#ifndef gettext_noop
+/* This define is so xgettext can find the internationalizable
+ strings. */
+# define gettext_noop(String) String
+#endif
+
+/* Number of ASCII characters. */
+#define ASCII_CHARS 0x80
+
+/* Number of single byte characters. */
+#define SBC_MAX (UCHAR_MAX + 1)
+
+#define COLL_ELEM_LEN_MAX 8
+
+/* The character which represents newline. */
+#define NEWLINE_CHAR '\n'
+#define WIDE_NEWLINE_CHAR L'\n'
+
+/* Rename to standard API for using out of glibc. */
+#ifndef _LIBC
+# undef __wctype
+# undef __iswalnum
+# undef __iswctype
+# undef __towlower
+# undef __towupper
+# define __wctype wctype
+# define __iswalnum iswalnum
+# define __iswctype iswctype
+# define __towlower towlower
+# define __towupper towupper
+# define __btowc btowc
+# define __mbrtowc mbrtowc
+# define __wcrtomb wcrtomb
+# define __regfree regfree
+#endif /* not _LIBC */
+
+/* Types related to integers. Unless protected by #ifdef _LIBC, the
+ regex code should avoid exact-width types like int32_t and uint64_t
+ as some non-GCC platforms lack them, an issue when this code is
+ used in Gnulib. */
+
+#ifndef SSIZE_MAX
+# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
+#endif
+#ifndef ULONG_WIDTH
+# define ULONG_WIDTH REGEX_UINTEGER_WIDTH (ULONG_MAX)
+/* The number of usable bits in an unsigned integer type with maximum
+ value MAX, as an int expression suitable in #if. Cover all known
+ practical hosts. This implementation exploits the fact that MAX is
+ 1 less than a power of 2, and merely counts the number of 1 bits in
+ MAX; "COBn" means "count the number of 1 bits in the low-order n bits". */
+# define REGEX_UINTEGER_WIDTH(max) REGEX_COB128 (max)
+# define REGEX_COB128(n) (REGEX_COB64 ((n) >> 31 >> 31 >> 2) + REGEX_COB64 (n))
+# define REGEX_COB64(n) (REGEX_COB32 ((n) >> 31 >> 1) + REGEX_COB32 (n))
+# define REGEX_COB32(n) (REGEX_COB16 ((n) >> 16) + REGEX_COB16 (n))
+# define REGEX_COB16(n) (REGEX_COB8 ((n) >> 8) + REGEX_COB8 (n))
+# define REGEX_COB8(n) (REGEX_COB4 ((n) >> 4) + REGEX_COB4 (n))
+# define REGEX_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + ((n) & 1))
+# if ULONG_MAX / 2 + 1 != 1ul << (ULONG_WIDTH - 1)
+# error "ULONG_MAX out of range"
+# endif
+#endif
+
+/* The type of indexes into strings. This is signed, not size_t,
+ since the API requires indexes to fit in regoff_t anyway, and using
+ signed integers makes the code a bit smaller and presumably faster.
+ The traditional GNU regex implementation uses int for indexes.
+ The POSIX-compatible implementation uses a possibly-wider type.
+ The name 'Idx' is three letters to minimize the hassle of
+ reindenting a lot of regex code that formerly used 'int'. */
+typedef regoff_t Idx;
+#ifdef _REGEX_LARGE_OFFSETS
+# define IDX_MAX SSIZE_MAX
+#else
+# define IDX_MAX INT_MAX
+#endif
+
+/* A hash value, suitable for computing hash tables. */
+typedef __re_size_t re_hashval_t;
+
+/* An integer used to represent a set of bits. It must be unsigned,
+ and must be at least as wide as unsigned int. */
+typedef unsigned long int bitset_word_t;
+/* All bits set in a bitset_word_t. */
+#define BITSET_WORD_MAX ULONG_MAX
+/* Number of bits in a bitset_word_t. */
+#define BITSET_WORD_BITS ULONG_WIDTH
+
+/* Number of bitset_word_t values in a bitset_t. */
+#define BITSET_WORDS ((SBC_MAX + BITSET_WORD_BITS - 1) / BITSET_WORD_BITS)
+
+typedef bitset_word_t bitset_t[BITSET_WORDS];
+typedef bitset_word_t *re_bitset_ptr_t;
+typedef const bitset_word_t *re_const_bitset_ptr_t;
+
+#define PREV_WORD_CONSTRAINT 0x0001
+#define PREV_NOTWORD_CONSTRAINT 0x0002
+#define NEXT_WORD_CONSTRAINT 0x0004
+#define NEXT_NOTWORD_CONSTRAINT 0x0008
+#define PREV_NEWLINE_CONSTRAINT 0x0010
+#define NEXT_NEWLINE_CONSTRAINT 0x0020
+#define PREV_BEGBUF_CONSTRAINT 0x0040
+#define NEXT_ENDBUF_CONSTRAINT 0x0080
+#define WORD_DELIM_CONSTRAINT 0x0100
+#define NOT_WORD_DELIM_CONSTRAINT 0x0200
+
+typedef enum
+{
+ INSIDE_WORD = PREV_WORD_CONSTRAINT | NEXT_WORD_CONSTRAINT,
+ WORD_FIRST = PREV_NOTWORD_CONSTRAINT | NEXT_WORD_CONSTRAINT,
+ WORD_LAST = PREV_WORD_CONSTRAINT | NEXT_NOTWORD_CONSTRAINT,
+ INSIDE_NOTWORD = PREV_NOTWORD_CONSTRAINT | NEXT_NOTWORD_CONSTRAINT,
+ LINE_FIRST = PREV_NEWLINE_CONSTRAINT,
+ LINE_LAST = NEXT_NEWLINE_CONSTRAINT,
+ BUF_FIRST = PREV_BEGBUF_CONSTRAINT,
+ BUF_LAST = NEXT_ENDBUF_CONSTRAINT,
+ WORD_DELIM = WORD_DELIM_CONSTRAINT,
+ NOT_WORD_DELIM = NOT_WORD_DELIM_CONSTRAINT
+} re_context_type;
+
+typedef struct
+{
+ Idx alloc;
+ Idx nelem;
+ Idx *elems;
+} re_node_set;
+
+typedef enum
+{
+ NON_TYPE = 0,
+
+ /* Node type, These are used by token, node, tree. */
+ CHARACTER = 1,
+ END_OF_RE = 2,
+ SIMPLE_BRACKET = 3,
+ OP_BACK_REF = 4,
+ OP_PERIOD = 5,
+ COMPLEX_BRACKET = 6,
+ OP_UTF8_PERIOD = 7,
+
+ /* We define EPSILON_BIT as a macro so that OP_OPEN_SUBEXP is used
+ when the debugger shows values of this enum type. */
+#define EPSILON_BIT 8
+ OP_OPEN_SUBEXP = EPSILON_BIT | 0,
+ OP_CLOSE_SUBEXP = EPSILON_BIT | 1,
+ OP_ALT = EPSILON_BIT | 2,
+ OP_DUP_ASTERISK = EPSILON_BIT | 3,
+ ANCHOR = EPSILON_BIT | 4,
+
+ /* Tree type, these are used only by tree. */
+ CONCAT = 16,
+ SUBEXP = 17,
+
+ /* Token type, these are used only by token. */
+ OP_DUP_PLUS = 18,
+ OP_DUP_QUESTION,
+ OP_OPEN_BRACKET,
+ OP_CLOSE_BRACKET,
+ OP_CHARSET_RANGE,
+ OP_OPEN_DUP_NUM,
+ OP_CLOSE_DUP_NUM,
+ OP_NON_MATCH_LIST,
+ OP_OPEN_COLL_ELEM,
+ OP_CLOSE_COLL_ELEM,
+ OP_OPEN_EQUIV_CLASS,
+ OP_CLOSE_EQUIV_CLASS,
+ OP_OPEN_CHAR_CLASS,
+ OP_CLOSE_CHAR_CLASS,
+ OP_WORD,
+ OP_NOTWORD,
+ OP_SPACE,
+ OP_NOTSPACE,
+ BACK_SLASH
+
+} re_token_type_t;
+
+typedef struct
+{
+ /* Multibyte characters. */
+ wchar_t *mbchars;
+
+#ifdef _LIBC
+ /* Collating symbols. */
+ int32_t *coll_syms;
+#endif
+
+#ifdef _LIBC
+ /* Equivalence classes. */
+ int32_t *equiv_classes;
+#endif
+
+ /* Range expressions. */
+#ifdef _LIBC
+ uint32_t *range_starts;
+ uint32_t *range_ends;
+#else
+ wchar_t *range_starts;
+ wchar_t *range_ends;
+#endif
+
+ /* Character classes. */
+ wctype_t *char_classes;
+
+ /* If this character set is the non-matching list. */
+ unsigned int non_match : 1;
+
+ /* # of multibyte characters. */
+ Idx nmbchars;
+
+ /* # of collating symbols. */
+ Idx ncoll_syms;
+
+ /* # of equivalence classes. */
+ Idx nequiv_classes;
+
+ /* # of range expressions. */
+ Idx nranges;
+
+ /* # of character classes. */
+ Idx nchar_classes;
+} re_charset_t;
+
+typedef struct
+{
+ union
+ {
+ unsigned char c; /* for CHARACTER */
+ re_bitset_ptr_t sbcset; /* for SIMPLE_BRACKET */
+ re_charset_t *mbcset; /* for COMPLEX_BRACKET */
+ Idx idx; /* for BACK_REF */
+ re_context_type ctx_type; /* for ANCHOR */
+ } opr;
+#if (__GNUC__ >= 2 || defined __clang__) && !defined __STRICT_ANSI__
+ re_token_type_t type : 8;
+#else
+ re_token_type_t type;
+#endif
+ unsigned int constraint : 10; /* context constraint */
+ unsigned int duplicated : 1;
+ unsigned int opt_subexp : 1;
+ unsigned int accept_mb : 1;
+ /* These 2 bits can be moved into the union if needed (e.g. if running out
+ of bits; move opr.c to opr.c.c and move the flags to opr.c.flags). */
+ unsigned int mb_partial : 1;
+ unsigned int word_char : 1;
+} re_token_t;
+
+#define IS_EPSILON_NODE(type) ((type) & EPSILON_BIT)
+
+struct re_string_t
+{
+ /* Indicate the raw buffer which is the original string passed as an
+ argument of regexec(), re_search(), etc.. */
+ const unsigned char *raw_mbs;
+ /* Store the multibyte string. In case of "case insensitive mode" like
+ REG_ICASE, upper cases of the string are stored, otherwise MBS points
+ the same address that RAW_MBS points. */
+ unsigned char *mbs;
+ /* Store the wide character string which is corresponding to MBS. */
+ wint_t *wcs;
+ Idx *offsets;
+ mbstate_t cur_state;
+ /* Index in RAW_MBS. Each character mbs[i] corresponds to
+ raw_mbs[raw_mbs_idx + i]. */
+ Idx raw_mbs_idx;
+ /* The length of the valid characters in the buffers. */
+ Idx valid_len;
+ /* The corresponding number of bytes in raw_mbs array. */
+ Idx valid_raw_len;
+ /* The length of the buffers MBS and WCS. */
+ Idx bufs_len;
+ /* The index in MBS, which is updated by re_string_fetch_byte. */
+ Idx cur_idx;
+ /* length of RAW_MBS array. */
+ Idx raw_len;
+ /* This is RAW_LEN - RAW_MBS_IDX + VALID_LEN - VALID_RAW_LEN. */
+ Idx len;
+ /* End of the buffer may be shorter than its length in the cases such
+ as re_match_2, re_search_2. Then, we use STOP for end of the buffer
+ instead of LEN. */
+ Idx raw_stop;
+ /* This is RAW_STOP - RAW_MBS_IDX adjusted through OFFSETS. */
+ Idx stop;
+
+ /* The context of mbs[0]. We store the context independently, since
+ the context of mbs[0] may be different from raw_mbs[0], which is
+ the beginning of the input string. */
+ unsigned int tip_context;
+ /* The translation passed as a part of an argument of re_compile_pattern. */
+ RE_TRANSLATE_TYPE trans;
+ /* Copy of re_dfa_t's word_char. */
+ re_const_bitset_ptr_t word_char;
+ /* true if REG_ICASE. */
+ unsigned char icase;
+ unsigned char is_utf8;
+ unsigned char map_notascii;
+ unsigned char mbs_allocated;
+ unsigned char offsets_needed;
+ unsigned char newline_anchor;
+ unsigned char word_ops_used;
+ int mb_cur_max;
+};
+typedef struct re_string_t re_string_t;
+
+
+struct re_dfa_t;
+typedef struct re_dfa_t re_dfa_t;
+
+#ifndef _LIBC
+# define IS_IN(libc) false
+#endif
+
+#define re_string_peek_byte(pstr, offset) \
+ ((pstr)->mbs[(pstr)->cur_idx + offset])
+#define re_string_fetch_byte(pstr) \
+ ((pstr)->mbs[(pstr)->cur_idx++])
+#define re_string_first_byte(pstr, idx) \
+ ((idx) == (pstr)->valid_len || (pstr)->wcs[idx] != WEOF)
+#define re_string_is_single_byte_char(pstr, idx) \
+ ((pstr)->wcs[idx] != WEOF && ((pstr)->valid_len == (idx) + 1 \
+ || (pstr)->wcs[(idx) + 1] != WEOF))
+#define re_string_eoi(pstr) ((pstr)->stop <= (pstr)->cur_idx)
+#define re_string_cur_idx(pstr) ((pstr)->cur_idx)
+#define re_string_get_buffer(pstr) ((pstr)->mbs)
+#define re_string_length(pstr) ((pstr)->len)
+#define re_string_byte_at(pstr,idx) ((pstr)->mbs[idx])
+#define re_string_skip_bytes(pstr,idx) ((pstr)->cur_idx += (idx))
+#define re_string_set_index(pstr,idx) ((pstr)->cur_idx = (idx))
+
+#ifdef _LIBC
+# define MALLOC_0_IS_NONNULL 1
+#elif !defined MALLOC_0_IS_NONNULL
+# define MALLOC_0_IS_NONNULL 0
+#endif
+
+#ifndef MAX
+# define MAX(a,b) ((a) < (b) ? (b) : (a))
+#endif
+#ifndef MIN
+# define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
+
+#define re_malloc(t,n) ((t *) malloc ((n) * sizeof (t)))
+#define re_realloc(p,t,n) ((t *) realloc (p, (n) * sizeof (t)))
+#define re_free(p) free (p)
+
+struct bin_tree_t
+{
+ struct bin_tree_t *parent;
+ struct bin_tree_t *left;
+ struct bin_tree_t *right;
+ struct bin_tree_t *first;
+ struct bin_tree_t *next;
+
+ re_token_t token;
+
+ /* 'node_idx' is the index in dfa->nodes, if 'type' == 0.
+ Otherwise 'type' indicate the type of this node. */
+ Idx node_idx;
+};
+typedef struct bin_tree_t bin_tree_t;
+
+#define BIN_TREE_STORAGE_SIZE \
+ ((1024 - sizeof (void *)) / sizeof (bin_tree_t))
+
+struct bin_tree_storage_t
+{
+ struct bin_tree_storage_t *next;
+ bin_tree_t data[BIN_TREE_STORAGE_SIZE];
+};
+typedef struct bin_tree_storage_t bin_tree_storage_t;
+
+#define CONTEXT_WORD 1
+#define CONTEXT_NEWLINE (CONTEXT_WORD << 1)
+#define CONTEXT_BEGBUF (CONTEXT_NEWLINE << 1)
+#define CONTEXT_ENDBUF (CONTEXT_BEGBUF << 1)
+
+#define IS_WORD_CONTEXT(c) ((c) & CONTEXT_WORD)
+#define IS_NEWLINE_CONTEXT(c) ((c) & CONTEXT_NEWLINE)
+#define IS_BEGBUF_CONTEXT(c) ((c) & CONTEXT_BEGBUF)
+#define IS_ENDBUF_CONTEXT(c) ((c) & CONTEXT_ENDBUF)
+#define IS_ORDINARY_CONTEXT(c) ((c) == 0)
+
+#define IS_WORD_CHAR(ch) (isalnum (ch) || (ch) == '_')
+#define IS_NEWLINE(ch) ((ch) == NEWLINE_CHAR)
+#define IS_WIDE_WORD_CHAR(ch) (__iswalnum (ch) || (ch) == L'_')
+#define IS_WIDE_NEWLINE(ch) ((ch) == WIDE_NEWLINE_CHAR)
+
+#define NOT_SATISFY_PREV_CONSTRAINT(constraint,context) \
+ ((((constraint) & PREV_WORD_CONSTRAINT) && !IS_WORD_CONTEXT (context)) \
+ || ((constraint & PREV_NOTWORD_CONSTRAINT) && IS_WORD_CONTEXT (context)) \
+ || ((constraint & PREV_NEWLINE_CONSTRAINT) && !IS_NEWLINE_CONTEXT (context))\
+ || ((constraint & PREV_BEGBUF_CONSTRAINT) && !IS_BEGBUF_CONTEXT (context)))
+
+#define NOT_SATISFY_NEXT_CONSTRAINT(constraint,context) \
+ ((((constraint) & NEXT_WORD_CONSTRAINT) && !IS_WORD_CONTEXT (context)) \
+ || (((constraint) & NEXT_NOTWORD_CONSTRAINT) && IS_WORD_CONTEXT (context)) \
+ || (((constraint) & NEXT_NEWLINE_CONSTRAINT) && !IS_NEWLINE_CONTEXT (context)) \
+ || (((constraint) & NEXT_ENDBUF_CONSTRAINT) && !IS_ENDBUF_CONTEXT (context)))
+
+struct re_dfastate_t
+{
+ re_hashval_t hash;
+ re_node_set nodes;
+ re_node_set non_eps_nodes;
+ re_node_set inveclosure;
+ re_node_set *entrance_nodes;
+ struct re_dfastate_t **trtable, **word_trtable;
+ unsigned int context : 4;
+ unsigned int halt : 1;
+ /* If this state can accept "multi byte".
+ Note that we refer to multibyte characters, and multi character
+ collating elements as "multi byte". */
+ unsigned int accept_mb : 1;
+ /* If this state has backreference node(s). */
+ unsigned int has_backref : 1;
+ unsigned int has_constraint : 1;
+};
+typedef struct re_dfastate_t re_dfastate_t;
+
+struct re_state_table_entry
+{
+ Idx num;
+ Idx alloc;
+ re_dfastate_t **array;
+};
+
+/* Array type used in re_sub_match_last_t and re_sub_match_top_t. */
+
+typedef struct
+{
+ Idx next_idx;
+ Idx alloc;
+ re_dfastate_t **array;
+} state_array_t;
+
+/* Store information about the node NODE whose type is OP_CLOSE_SUBEXP. */
+
+typedef struct
+{
+ Idx node;
+ Idx str_idx; /* The position NODE match at. */
+ state_array_t path;
+} re_sub_match_last_t;
+
+/* Store information about the node NODE whose type is OP_OPEN_SUBEXP.
+ And information about the node, whose type is OP_CLOSE_SUBEXP,
+ corresponding to NODE is stored in LASTS. */
+
+typedef struct
+{
+ Idx str_idx;
+ Idx node;
+ state_array_t *path;
+ Idx alasts; /* Allocation size of LASTS. */
+ Idx nlasts; /* The number of LASTS. */
+ re_sub_match_last_t **lasts;
+} re_sub_match_top_t;
+
+struct re_backref_cache_entry
+{
+ Idx node;
+ Idx str_idx;
+ Idx subexp_from;
+ Idx subexp_to;
+ bitset_word_t eps_reachable_subexps_map;
+ char more;
+};
+
+typedef struct
+{
+ /* The string object corresponding to the input string. */
+ re_string_t input;
+ const re_dfa_t *const dfa;
+ /* EFLAGS of the argument of regexec. */
+ int eflags;
+ /* Where the matching ends. */
+ Idx match_last;
+ Idx last_node;
+ /* The state log used by the matcher. */
+ re_dfastate_t **state_log;
+ Idx state_log_top;
+ /* Back reference cache. */
+ Idx nbkref_ents;
+ Idx abkref_ents;
+ struct re_backref_cache_entry *bkref_ents;
+ int max_mb_elem_len;
+ Idx nsub_tops;
+ Idx asub_tops;
+ re_sub_match_top_t **sub_tops;
+} re_match_context_t;
+
+typedef struct
+{
+ re_dfastate_t **sifted_states;
+ re_dfastate_t **limited_states;
+ Idx last_node;
+ Idx last_str_idx;
+ re_node_set limits;
+} re_sift_context_t;
+
+struct re_fail_stack_ent_t
+{
+ Idx idx;
+ Idx node;
+ regmatch_t *regs;
+ re_node_set eps_via_nodes;
+};
+
+struct re_fail_stack_t
+{
+ Idx num;
+ Idx alloc;
+ struct re_fail_stack_ent_t *stack;
+};
+
+struct re_dfa_t
+{
+ re_token_t *nodes;
+ size_t nodes_alloc;
+ size_t nodes_len;
+ Idx *nexts;
+ Idx *org_indices;
+ re_node_set *edests;
+ re_node_set *eclosures;
+ re_node_set *inveclosures;
+ struct re_state_table_entry *state_table;
+ re_dfastate_t *init_state;
+ re_dfastate_t *init_state_word;
+ re_dfastate_t *init_state_nl;
+ re_dfastate_t *init_state_begbuf;
+ bin_tree_t *str_tree;
+ bin_tree_storage_t *str_tree_storage;
+ re_bitset_ptr_t sb_char;
+ int str_tree_storage_idx;
+
+ /* number of subexpressions 're_nsub' is in regex_t. */
+ re_hashval_t state_hash_mask;
+ Idx init_node;
+ Idx nbackref; /* The number of backreference in this dfa. */
+
+ /* Bitmap expressing which backreference is used. */
+ bitset_word_t used_bkref_map;
+ bitset_word_t completed_bkref_map;
+
+ unsigned int has_plural_match : 1;
+ /* If this dfa has "multibyte node", which is a backreference or
+ a node which can accept multibyte character or multi character
+ collating element. */
+ unsigned int has_mb_node : 1;
+ unsigned int is_utf8 : 1;
+ unsigned int map_notascii : 1;
+ unsigned int word_ops_used : 1;
+ int mb_cur_max;
+ bitset_t word_char;
+ reg_syntax_t syntax;
+ Idx *subexp_map;
+#ifdef DEBUG
+ char* re_str;
+#endif
+ lock_define (lock)
+};
+
+#define re_node_set_init_empty(set) memset (set, '\0', sizeof (re_node_set))
+#define re_node_set_remove(set,id) \
+ (re_node_set_remove_at (set, re_node_set_contains (set, id) - 1))
+#define re_node_set_empty(p) ((p)->nelem = 0)
+#define re_node_set_free(set) re_free ((set)->elems)
+
+
+typedef enum
+{
+ SB_CHAR,
+ MB_CHAR,
+ EQUIV_CLASS,
+ COLL_SYM,
+ CHAR_CLASS
+} bracket_elem_type;
+
+typedef struct
+{
+ bracket_elem_type type;
+ union
+ {
+ unsigned char ch;
+ unsigned char *name;
+ wchar_t wch;
+ } opr;
+} bracket_elem_t;
+
+
+/* Functions for bitset_t operation. */
+
+static inline void
+bitset_set (bitset_t set, Idx i)
+{
+ set[i / BITSET_WORD_BITS] |= (bitset_word_t) 1 << i % BITSET_WORD_BITS;
+}
+
+static inline void
+bitset_clear (bitset_t set, Idx i)
+{
+ set[i / BITSET_WORD_BITS] &= ~ ((bitset_word_t) 1 << i % BITSET_WORD_BITS);
+}
+
+static inline bool
+bitset_contain (const bitset_t set, Idx i)
+{
+ return (set[i / BITSET_WORD_BITS] >> i % BITSET_WORD_BITS) & 1;
+}
+
+static inline void
+bitset_empty (bitset_t set)
+{
+ memset (set, '\0', sizeof (bitset_t));
+}
+
+static inline void
+bitset_set_all (bitset_t set)
+{
+ memset (set, -1, sizeof (bitset_word_t) * (SBC_MAX / BITSET_WORD_BITS));
+ if (SBC_MAX % BITSET_WORD_BITS != 0)
+ set[BITSET_WORDS - 1] =
+ ((bitset_word_t) 1 << SBC_MAX % BITSET_WORD_BITS) - 1;
+}
+
+static inline void
+bitset_copy (bitset_t dest, const bitset_t src)
+{
+ memcpy (dest, src, sizeof (bitset_t));
+}
+
+static inline void
+bitset_not (bitset_t set)
+{
+ int bitset_i;
+ for (bitset_i = 0; bitset_i < SBC_MAX / BITSET_WORD_BITS; ++bitset_i)
+ set[bitset_i] = ~set[bitset_i];
+ if (SBC_MAX % BITSET_WORD_BITS != 0)
+ set[BITSET_WORDS - 1] =
+ ((((bitset_word_t) 1 << SBC_MAX % BITSET_WORD_BITS) - 1)
+ & ~set[BITSET_WORDS - 1]);
+}
+
+static inline void
+bitset_merge (bitset_t dest, const bitset_t src)
+{
+ int bitset_i;
+ for (bitset_i = 0; bitset_i < BITSET_WORDS; ++bitset_i)
+ dest[bitset_i] |= src[bitset_i];
+}
+
+static inline void
+bitset_mask (bitset_t dest, const bitset_t src)
+{
+ int bitset_i;
+ for (bitset_i = 0; bitset_i < BITSET_WORDS; ++bitset_i)
+ dest[bitset_i] &= src[bitset_i];
+}
+
+/* Functions for re_string. */
+static int
+__attribute__ ((pure, unused))
+re_string_char_size_at (const re_string_t *pstr, Idx idx)
+{
+ int byte_idx;
+ if (pstr->mb_cur_max == 1)
+ return 1;
+ for (byte_idx = 1; idx + byte_idx < pstr->valid_len; ++byte_idx)
+ if (pstr->wcs[idx + byte_idx] != WEOF)
+ break;
+ return byte_idx;
+}
+
+static wint_t
+__attribute__ ((pure, unused))
+re_string_wchar_at (const re_string_t *pstr, Idx idx)
+{
+ if (pstr->mb_cur_max == 1)
+ return (wint_t) pstr->mbs[idx];
+ return (wint_t) pstr->wcs[idx];
+}
+
+#ifdef _LIBC
+# include <locale/weight.h>
+#endif
+
+static int
+__attribute__ ((pure, unused))
+re_string_elem_size_at (const re_string_t *pstr, Idx idx)
+{
+#ifdef _LIBC
+ const unsigned char *p, *extra;
+ const int32_t *table, *indirect;
+ uint_fast32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+
+ if (nrules != 0)
+ {
+ table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
+ extra = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB);
+ indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_INDIRECTMB);
+ p = pstr->mbs + idx;
+ findidx (table, indirect, extra, &p, pstr->len - idx);
+ return p - pstr->mbs - idx;
+ }
+#endif /* _LIBC */
+
+ return 1;
+}
+
+#ifdef _LIBC
+# if __GNUC__ >= 7
+# define FALLTHROUGH __attribute__ ((__fallthrough__))
+# else
+# define FALLTHROUGH ((void) 0)
+# endif
+#else
+# include "attribute.h"
+#endif
+
+#endif /* _REGEX_INTERNAL_H */
diff --git a/gl/lib/regexec.c b/gl/lib/regexec.c
new file mode 100644
index 0000000..521cb02
--- /dev/null
+++ b/gl/lib/regexec.c
@@ -0,0 +1,4221 @@
+/* Extended regular expression matching and search library.
+ Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags,
+ Idx n);
+static void match_ctx_clean (re_match_context_t *mctx);
+static void match_ctx_free (re_match_context_t *cache);
+static reg_errcode_t match_ctx_add_entry (re_match_context_t *cache, Idx node,
+ Idx str_idx, Idx from, Idx to);
+static Idx search_cur_bkref_entry (const re_match_context_t *mctx, Idx str_idx);
+static reg_errcode_t match_ctx_add_subtop (re_match_context_t *mctx, Idx node,
+ Idx str_idx);
+static re_sub_match_last_t * match_ctx_add_sublast (re_sub_match_top_t *subtop,
+ Idx node, Idx str_idx);
+static void sift_ctx_init (re_sift_context_t *sctx, re_dfastate_t **sifted_sts,
+ re_dfastate_t **limited_sts, Idx last_node,
+ Idx last_str_idx);
+static reg_errcode_t re_search_internal (const regex_t *preg,
+ const char *string, Idx length,
+ Idx start, Idx last_start, Idx stop,
+ size_t nmatch, regmatch_t pmatch[],
+ int eflags);
+static regoff_t re_search_2_stub (struct re_pattern_buffer *bufp,
+ const char *string1, Idx length1,
+ const char *string2, Idx length2,
+ Idx start, regoff_t range,
+ struct re_registers *regs,
+ Idx stop, bool ret_len);
+static regoff_t re_search_stub (struct re_pattern_buffer *bufp,
+ const char *string, Idx length, Idx start,
+ regoff_t range, Idx stop,
+ struct re_registers *regs,
+ bool ret_len);
+static unsigned re_copy_regs (struct re_registers *regs, regmatch_t *pmatch,
+ Idx nregs, int regs_allocated);
+static reg_errcode_t prune_impossible_nodes (re_match_context_t *mctx);
+static Idx check_matching (re_match_context_t *mctx, bool fl_longest_match,
+ Idx *p_match_first);
+static Idx check_halt_state_context (const re_match_context_t *mctx,
+ const re_dfastate_t *state, Idx idx);
+static void update_regs (const re_dfa_t *dfa, regmatch_t *pmatch,
+ regmatch_t *prev_idx_match, Idx cur_node,
+ Idx cur_idx, Idx nmatch);
+static reg_errcode_t push_fail_stack (struct re_fail_stack_t *fs,
+ Idx str_idx, Idx dest_node, Idx nregs,
+ regmatch_t *regs, regmatch_t *prevregs,
+ re_node_set *eps_via_nodes);
+static reg_errcode_t set_regs (const regex_t *preg,
+ const re_match_context_t *mctx,
+ size_t nmatch, regmatch_t *pmatch,
+ bool fl_backtrack);
+static reg_errcode_t free_fail_stack_return (struct re_fail_stack_t *fs);
+
+static int sift_states_iter_mb (const re_match_context_t *mctx,
+ re_sift_context_t *sctx,
+ Idx node_idx, Idx str_idx, Idx max_str_idx);
+static reg_errcode_t sift_states_backward (const re_match_context_t *mctx,
+ re_sift_context_t *sctx);
+static reg_errcode_t build_sifted_states (const re_match_context_t *mctx,
+ re_sift_context_t *sctx, Idx str_idx,
+ re_node_set *cur_dest);
+static reg_errcode_t update_cur_sifted_state (const re_match_context_t *mctx,
+ re_sift_context_t *sctx,
+ Idx str_idx,
+ re_node_set *dest_nodes);
+static reg_errcode_t add_epsilon_src_nodes (const re_dfa_t *dfa,
+ re_node_set *dest_nodes,
+ const re_node_set *candidates);
+static bool check_dst_limits (const re_match_context_t *mctx,
+ const re_node_set *limits,
+ Idx dst_node, Idx dst_idx, Idx src_node,
+ Idx src_idx);
+static int check_dst_limits_calc_pos_1 (const re_match_context_t *mctx,
+ int boundaries, Idx subexp_idx,
+ Idx from_node, Idx bkref_idx);
+static int check_dst_limits_calc_pos (const re_match_context_t *mctx,
+ Idx limit, Idx subexp_idx,
+ Idx node, Idx str_idx,
+ Idx bkref_idx);
+static reg_errcode_t check_subexp_limits (const re_dfa_t *dfa,
+ re_node_set *dest_nodes,
+ const re_node_set *candidates,
+ re_node_set *limits,
+ struct re_backref_cache_entry *bkref_ents,
+ Idx str_idx);
+static reg_errcode_t sift_states_bkref (const re_match_context_t *mctx,
+ re_sift_context_t *sctx,
+ Idx str_idx, const re_node_set *candidates);
+static reg_errcode_t merge_state_array (const re_dfa_t *dfa,
+ re_dfastate_t **dst,
+ re_dfastate_t **src, Idx num);
+static re_dfastate_t *find_recover_state (reg_errcode_t *err,
+ re_match_context_t *mctx);
+static re_dfastate_t *transit_state (reg_errcode_t *err,
+ re_match_context_t *mctx,
+ re_dfastate_t *state);
+static re_dfastate_t *merge_state_with_log (reg_errcode_t *err,
+ re_match_context_t *mctx,
+ re_dfastate_t *next_state);
+static reg_errcode_t check_subexp_matching_top (re_match_context_t *mctx,
+ re_node_set *cur_nodes,
+ Idx str_idx);
+#if 0
+static re_dfastate_t *transit_state_sb (reg_errcode_t *err,
+ re_match_context_t *mctx,
+ re_dfastate_t *pstate);
+#endif
+static reg_errcode_t transit_state_mb (re_match_context_t *mctx,
+ re_dfastate_t *pstate);
+static reg_errcode_t transit_state_bkref (re_match_context_t *mctx,
+ const re_node_set *nodes);
+static reg_errcode_t get_subexp (re_match_context_t *mctx,
+ Idx bkref_node, Idx bkref_str_idx);
+static reg_errcode_t get_subexp_sub (re_match_context_t *mctx,
+ const re_sub_match_top_t *sub_top,
+ re_sub_match_last_t *sub_last,
+ Idx bkref_node, Idx bkref_str);
+static Idx find_subexp_node (const re_dfa_t *dfa, const re_node_set *nodes,
+ Idx subexp_idx, int type);
+static reg_errcode_t check_arrival (re_match_context_t *mctx,
+ state_array_t *path, Idx top_node,
+ Idx top_str, Idx last_node, Idx last_str,
+ int type);
+static reg_errcode_t check_arrival_add_next_nodes (re_match_context_t *mctx,
+ Idx str_idx,
+ re_node_set *cur_nodes,
+ re_node_set *next_nodes);
+static reg_errcode_t check_arrival_expand_ecl (const re_dfa_t *dfa,
+ re_node_set *cur_nodes,
+ Idx ex_subexp, int type);
+static reg_errcode_t check_arrival_expand_ecl_sub (const re_dfa_t *dfa,
+ re_node_set *dst_nodes,
+ Idx target, Idx ex_subexp,
+ int type);
+static reg_errcode_t expand_bkref_cache (re_match_context_t *mctx,
+ re_node_set *cur_nodes, Idx cur_str,
+ Idx subexp_num, int type);
+static bool build_trtable (const re_dfa_t *dfa, re_dfastate_t *state);
+static int check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx,
+ const re_string_t *input, Idx idx);
+#ifdef _LIBC
+static unsigned int find_collation_sequence_value (const unsigned char *mbs,
+ size_t name_len);
+#endif
+static Idx group_nodes_into_DFAstates (const re_dfa_t *dfa,
+ const re_dfastate_t *state,
+ re_node_set *states_node,
+ bitset_t *states_ch);
+static bool check_node_accept (const re_match_context_t *mctx,
+ const re_token_t *node, Idx idx);
+static reg_errcode_t extend_buffers (re_match_context_t *mctx, int min_len);
+
+/* Entry point for POSIX code. */
+
+/* regexec searches for a given pattern, specified by PREG, in the
+ string STRING.
+
+ If NMATCH is zero or REG_NOSUB was set in the cflags argument to
+ 'regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at
+ least NMATCH elements, and we set them to the offsets of the
+ corresponding matched substrings.
+
+ EFLAGS specifies "execution flags" which affect matching: if
+ REG_NOTBOL is set, then ^ does not match at the beginning of the
+ string; if REG_NOTEOL is set, then $ does not match at the end.
+
+ Return 0 if a match is found, REG_NOMATCH if not, REG_BADPAT if
+ EFLAGS is invalid. */
+
+int
+regexec (const regex_t *__restrict preg, const char *__restrict string,
+ size_t nmatch, regmatch_t pmatch[_REGEX_NELTS (nmatch)], int eflags)
+{
+ reg_errcode_t err;
+ Idx start, length;
+ re_dfa_t *dfa = preg->buffer;
+
+ if (eflags & ~(REG_NOTBOL | REG_NOTEOL | REG_STARTEND))
+ return REG_BADPAT;
+
+ if (eflags & REG_STARTEND)
+ {
+ start = pmatch[0].rm_so;
+ length = pmatch[0].rm_eo;
+ }
+ else
+ {
+ start = 0;
+ length = strlen (string);
+ }
+
+ lock_lock (dfa->lock);
+ if (preg->no_sub)
+ err = re_search_internal (preg, string, length, start, length,
+ length, 0, NULL, eflags);
+ else
+ err = re_search_internal (preg, string, length, start, length,
+ length, nmatch, pmatch, eflags);
+ lock_unlock (dfa->lock);
+ return err != REG_NOERROR;
+}
+
+#ifdef _LIBC
+libc_hidden_def (__regexec)
+
+# include <shlib-compat.h>
+versioned_symbol (libc, __regexec, regexec, GLIBC_2_3_4);
+
+# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
+__typeof__ (__regexec) __compat_regexec;
+
+int
+attribute_compat_text_section
+__compat_regexec (const regex_t *__restrict preg,
+ const char *__restrict string, size_t nmatch,
+ regmatch_t pmatch[_REGEX_NELTS (nmatch)], int eflags)
+{
+ return regexec (preg, string, nmatch, pmatch,
+ eflags & (REG_NOTBOL | REG_NOTEOL));
+}
+compat_symbol (libc, __compat_regexec, regexec, GLIBC_2_0);
+# endif
+#endif
+
+/* Entry points for GNU code. */
+
+/* re_match, re_search, re_match_2, re_search_2
+
+ The former two functions operate on STRING with length LENGTH,
+ while the later two operate on concatenation of STRING1 and STRING2
+ with lengths LENGTH1 and LENGTH2, respectively.
+
+ re_match() matches the compiled pattern in BUFP against the string,
+ starting at index START.
+
+ re_search() first tries matching at index START, then it tries to match
+ starting from index START + 1, and so on. The last start position tried
+ is START + RANGE. (Thus RANGE = 0 forces re_search to operate the same
+ way as re_match().)
+
+ The parameter STOP of re_{match,search}_2 specifies that no match exceeding
+ the first STOP characters of the concatenation of the strings should be
+ concerned.
+
+ If REGS is not NULL, and BUFP->no_sub is not set, the offsets of the match
+ and all groups is stored in REGS. (For the "_2" variants, the offsets are
+ computed relative to the concatenation, not relative to the individual
+ strings.)
+
+ On success, re_match* functions return the length of the match, re_search*
+ return the position of the start of the match. They return -1 on
+ match failure, -2 on error. */
+
+regoff_t
+re_match (struct re_pattern_buffer *bufp, const char *string, Idx length,
+ Idx start, struct re_registers *regs)
+{
+ return re_search_stub (bufp, string, length, start, 0, length, regs, true);
+}
+#ifdef _LIBC
+weak_alias (__re_match, re_match)
+#endif
+
+regoff_t
+re_search (struct re_pattern_buffer *bufp, const char *string, Idx length,
+ Idx start, regoff_t range, struct re_registers *regs)
+{
+ return re_search_stub (bufp, string, length, start, range, length, regs,
+ false);
+}
+#ifdef _LIBC
+weak_alias (__re_search, re_search)
+#endif
+
+regoff_t
+re_match_2 (struct re_pattern_buffer *bufp, const char *string1, Idx length1,
+ const char *string2, Idx length2, Idx start,
+ struct re_registers *regs, Idx stop)
+{
+ return re_search_2_stub (bufp, string1, length1, string2, length2,
+ start, 0, regs, stop, true);
+}
+#ifdef _LIBC
+weak_alias (__re_match_2, re_match_2)
+#endif
+
+regoff_t
+re_search_2 (struct re_pattern_buffer *bufp, const char *string1, Idx length1,
+ const char *string2, Idx length2, Idx start, regoff_t range,
+ struct re_registers *regs, Idx stop)
+{
+ return re_search_2_stub (bufp, string1, length1, string2, length2,
+ start, range, regs, stop, false);
+}
+#ifdef _LIBC
+weak_alias (__re_search_2, re_search_2)
+#endif
+
+static regoff_t
+re_search_2_stub (struct re_pattern_buffer *bufp, const char *string1,
+ Idx length1, const char *string2, Idx length2, Idx start,
+ regoff_t range, struct re_registers *regs,
+ Idx stop, bool ret_len)
+{
+ const char *str;
+ regoff_t rval;
+ Idx len;
+ char *s = NULL;
+
+ if (__glibc_unlikely ((length1 < 0 || length2 < 0 || stop < 0
+ || INT_ADD_WRAPV (length1, length2, &len))))
+ return -2;
+
+ /* Concatenate the strings. */
+ if (length2 > 0)
+ if (length1 > 0)
+ {
+ s = re_malloc (char, len);
+
+ if (__glibc_unlikely (s == NULL))
+ return -2;
+#ifdef _LIBC
+ memcpy (__mempcpy (s, string1, length1), string2, length2);
+#else
+ memcpy (s, string1, length1);
+ memcpy (s + length1, string2, length2);
+#endif
+ str = s;
+ }
+ else
+ str = string2;
+ else
+ str = string1;
+
+ rval = re_search_stub (bufp, str, len, start, range, stop, regs,
+ ret_len);
+ re_free (s);
+ return rval;
+}
+
+/* The parameters have the same meaning as those of re_search.
+ Additional parameters:
+ If RET_LEN is true the length of the match is returned (re_match style);
+ otherwise the position of the match is returned. */
+
+static regoff_t
+re_search_stub (struct re_pattern_buffer *bufp, const char *string, Idx length,
+ Idx start, regoff_t range, Idx stop, struct re_registers *regs,
+ bool ret_len)
+{
+ reg_errcode_t result;
+ regmatch_t *pmatch;
+ Idx nregs;
+ regoff_t rval;
+ int eflags = 0;
+ re_dfa_t *dfa = bufp->buffer;
+ Idx last_start = start + range;
+
+ /* Check for out-of-range. */
+ if (__glibc_unlikely (start < 0 || start > length))
+ return -1;
+ if (__glibc_unlikely (length < last_start
+ || (0 <= range && last_start < start)))
+ last_start = length;
+ else if (__glibc_unlikely (last_start < 0
+ || (range < 0 && start <= last_start)))
+ last_start = 0;
+
+ lock_lock (dfa->lock);
+
+ eflags |= (bufp->not_bol) ? REG_NOTBOL : 0;
+ eflags |= (bufp->not_eol) ? REG_NOTEOL : 0;
+
+ /* Compile fastmap if we haven't yet. */
+ if (start < last_start && bufp->fastmap != NULL && !bufp->fastmap_accurate)
+ re_compile_fastmap (bufp);
+
+ if (__glibc_unlikely (bufp->no_sub))
+ regs = NULL;
+
+ /* We need at least 1 register. */
+ if (regs == NULL)
+ nregs = 1;
+ else if (__glibc_unlikely (bufp->regs_allocated == REGS_FIXED
+ && regs->num_regs <= bufp->re_nsub))
+ {
+ nregs = regs->num_regs;
+ if (__glibc_unlikely (nregs < 1))
+ {
+ /* Nothing can be copied to regs. */
+ regs = NULL;
+ nregs = 1;
+ }
+ }
+ else
+ nregs = bufp->re_nsub + 1;
+ pmatch = re_malloc (regmatch_t, nregs);
+ if (__glibc_unlikely (pmatch == NULL))
+ {
+ rval = -2;
+ goto out;
+ }
+
+ result = re_search_internal (bufp, string, length, start, last_start, stop,
+ nregs, pmatch, eflags);
+
+ rval = 0;
+
+ /* I hope we needn't fill their regs with -1's when no match was found. */
+ if (result != REG_NOERROR)
+ rval = result == REG_NOMATCH ? -1 : -2;
+ else if (regs != NULL)
+ {
+ /* If caller wants register contents data back, copy them. */
+ bufp->regs_allocated = re_copy_regs (regs, pmatch, nregs,
+ bufp->regs_allocated);
+ if (__glibc_unlikely (bufp->regs_allocated == REGS_UNALLOCATED))
+ rval = -2;
+ }
+
+ if (__glibc_likely (rval == 0))
+ {
+ if (ret_len)
+ {
+ DEBUG_ASSERT (pmatch[0].rm_so == start);
+ rval = pmatch[0].rm_eo - start;
+ }
+ else
+ rval = pmatch[0].rm_so;
+ }
+ re_free (pmatch);
+ out:
+ lock_unlock (dfa->lock);
+ return rval;
+}
+
+static unsigned
+re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, Idx nregs,
+ int regs_allocated)
+{
+ int rval = REGS_REALLOCATE;
+ Idx i;
+ Idx need_regs = nregs + 1;
+ /* We need one extra element beyond 'num_regs' for the '-1' marker GNU code
+ uses. */
+
+ /* Have the register data arrays been allocated? */
+ if (regs_allocated == REGS_UNALLOCATED)
+ { /* No. So allocate them with malloc. */
+ regs->start = re_malloc (regoff_t, need_regs);
+ if (__glibc_unlikely (regs->start == NULL))
+ return REGS_UNALLOCATED;
+ regs->end = re_malloc (regoff_t, need_regs);
+ if (__glibc_unlikely (regs->end == NULL))
+ {
+ re_free (regs->start);
+ return REGS_UNALLOCATED;
+ }
+ regs->num_regs = need_regs;
+ }
+ else if (regs_allocated == REGS_REALLOCATE)
+ { /* Yes. If we need more elements than were already
+ allocated, reallocate them. If we need fewer, just
+ leave it alone. */
+ if (__glibc_unlikely (need_regs > regs->num_regs))
+ {
+ regoff_t *new_start = re_realloc (regs->start, regoff_t, need_regs);
+ regoff_t *new_end;
+ if (__glibc_unlikely (new_start == NULL))
+ return REGS_UNALLOCATED;
+ new_end = re_realloc (regs->end, regoff_t, need_regs);
+ if (__glibc_unlikely (new_end == NULL))
+ {
+ re_free (new_start);
+ return REGS_UNALLOCATED;
+ }
+ regs->start = new_start;
+ regs->end = new_end;
+ regs->num_regs = need_regs;
+ }
+ }
+ else
+ {
+ DEBUG_ASSERT (regs_allocated == REGS_FIXED);
+ /* This function may not be called with REGS_FIXED and nregs too big. */
+ DEBUG_ASSERT (nregs <= regs->num_regs);
+ rval = REGS_FIXED;
+ }
+
+ /* Copy the regs. */
+ for (i = 0; i < nregs; ++i)
+ {
+ regs->start[i] = pmatch[i].rm_so;
+ regs->end[i] = pmatch[i].rm_eo;
+ }
+ for ( ; i < regs->num_regs; ++i)
+ regs->start[i] = regs->end[i] = -1;
+
+ return rval;
+}
+
+/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
+ ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use
+ this memory for recording register information. STARTS and ENDS
+ must be allocated using the malloc library routine, and must each
+ be at least NUM_REGS * sizeof (regoff_t) bytes long.
+
+ If NUM_REGS == 0, then subsequent matches should allocate their own
+ register data.
+
+ Unless this function is called, the first search or match using
+ PATTERN_BUFFER will allocate its own register data, without
+ freeing the old data. */
+
+void
+re_set_registers (struct re_pattern_buffer *bufp, struct re_registers *regs,
+ __re_size_t num_regs, regoff_t *starts, regoff_t *ends)
+{
+ if (num_regs)
+ {
+ bufp->regs_allocated = REGS_REALLOCATE;
+ regs->num_regs = num_regs;
+ regs->start = starts;
+ regs->end = ends;
+ }
+ else
+ {
+ bufp->regs_allocated = REGS_UNALLOCATED;
+ regs->num_regs = 0;
+ regs->start = regs->end = NULL;
+ }
+}
+#ifdef _LIBC
+weak_alias (__re_set_registers, re_set_registers)
+#endif
+
+/* Entry points compatible with 4.2 BSD regex library. We don't define
+ them unless specifically requested. */
+
+#if defined _REGEX_RE_COMP || defined _LIBC
+int
+# ifdef _LIBC
+weak_function
+# endif
+re_exec (const char *s)
+{
+ return 0 == regexec (&re_comp_buf, s, 0, NULL, 0);
+}
+#endif /* _REGEX_RE_COMP */
+
+/* Internal entry point. */
+
+/* Searches for a compiled pattern PREG in the string STRING, whose
+ length is LENGTH. NMATCH, PMATCH, and EFLAGS have the same
+ meaning as with regexec. LAST_START is START + RANGE, where
+ START and RANGE have the same meaning as with re_search.
+ Return REG_NOERROR if we find a match, and REG_NOMATCH if not,
+ otherwise return the error code.
+ Note: We assume front end functions already check ranges.
+ (0 <= LAST_START && LAST_START <= LENGTH) */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_search_internal (const regex_t *preg, const char *string, Idx length,
+ Idx start, Idx last_start, Idx stop, size_t nmatch,
+ regmatch_t pmatch[], int eflags)
+{
+ reg_errcode_t err;
+ const re_dfa_t *dfa = preg->buffer;
+ Idx left_lim, right_lim;
+ int incr;
+ bool fl_longest_match;
+ int match_kind;
+ Idx match_first;
+ Idx match_last = -1;
+ Idx extra_nmatch;
+ bool sb;
+ int ch;
+ re_match_context_t mctx = { .dfa = dfa };
+ char *fastmap = ((preg->fastmap != NULL && preg->fastmap_accurate
+ && start != last_start && !preg->can_be_null)
+ ? preg->fastmap : NULL);
+ RE_TRANSLATE_TYPE t = preg->translate;
+
+ extra_nmatch = (nmatch > preg->re_nsub) ? nmatch - (preg->re_nsub + 1) : 0;
+ nmatch -= extra_nmatch;
+
+ /* Check if the DFA haven't been compiled. */
+ if (__glibc_unlikely (preg->used == 0 || dfa->init_state == NULL
+ || dfa->init_state_word == NULL
+ || dfa->init_state_nl == NULL
+ || dfa->init_state_begbuf == NULL))
+ return REG_NOMATCH;
+
+ /* We assume front-end functions already check them. */
+ DEBUG_ASSERT (0 <= last_start && last_start <= length);
+
+ /* If initial states with non-begbuf contexts have no elements,
+ the regex must be anchored. If preg->newline_anchor is set,
+ we'll never use init_state_nl, so do not check it. */
+ if (dfa->init_state->nodes.nelem == 0
+ && dfa->init_state_word->nodes.nelem == 0
+ && (dfa->init_state_nl->nodes.nelem == 0
+ || !preg->newline_anchor))
+ {
+ if (start != 0 && last_start != 0)
+ return REG_NOMATCH;
+ start = last_start = 0;
+ }
+
+ /* We must check the longest matching, if nmatch > 0. */
+ fl_longest_match = (nmatch != 0 || dfa->nbackref);
+
+ err = re_string_allocate (&mctx.input, string, length, dfa->nodes_len + 1,
+ preg->translate, (preg->syntax & RE_ICASE) != 0,
+ dfa);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+ mctx.input.stop = stop;
+ mctx.input.raw_stop = stop;
+ mctx.input.newline_anchor = preg->newline_anchor;
+
+ err = match_ctx_init (&mctx, eflags, dfa->nbackref * 2);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+
+ /* We will log all the DFA states through which the dfa pass,
+ if nmatch > 1, or this dfa has "multibyte node", which is a
+ back-reference or a node which can accept multibyte character or
+ multi character collating element. */
+ if (nmatch > 1 || dfa->has_mb_node)
+ {
+ /* Avoid overflow. */
+ if (__glibc_unlikely ((MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *))
+ <= mctx.input.bufs_len)))
+ {
+ err = REG_ESPACE;
+ goto free_return;
+ }
+
+ mctx.state_log = re_malloc (re_dfastate_t *, mctx.input.bufs_len + 1);
+ if (__glibc_unlikely (mctx.state_log == NULL))
+ {
+ err = REG_ESPACE;
+ goto free_return;
+ }
+ }
+
+ match_first = start;
+ mctx.input.tip_context = (eflags & REG_NOTBOL) ? CONTEXT_BEGBUF
+ : CONTEXT_NEWLINE | CONTEXT_BEGBUF;
+
+ /* Check incrementally whether the input string matches. */
+ incr = (last_start < start) ? -1 : 1;
+ left_lim = (last_start < start) ? last_start : start;
+ right_lim = (last_start < start) ? start : last_start;
+ sb = dfa->mb_cur_max == 1;
+ match_kind =
+ (fastmap
+ ? ((sb || !(preg->syntax & RE_ICASE || t) ? 4 : 0)
+ | (start <= last_start ? 2 : 0)
+ | (t != NULL ? 1 : 0))
+ : 8);
+
+ for (;; match_first += incr)
+ {
+ err = REG_NOMATCH;
+ if (match_first < left_lim || right_lim < match_first)
+ goto free_return;
+
+ /* Advance as rapidly as possible through the string, until we
+ find a plausible place to start matching. This may be done
+ with varying efficiency, so there are various possibilities:
+ only the most common of them are specialized, in order to
+ save on code size. We use a switch statement for speed. */
+ switch (match_kind)
+ {
+ case 8:
+ /* No fastmap. */
+ break;
+
+ case 7:
+ /* Fastmap with single-byte translation, match forward. */
+ while (__glibc_likely (match_first < right_lim)
+ && !fastmap[t[(unsigned char) string[match_first]]])
+ ++match_first;
+ goto forward_match_found_start_or_reached_end;
+
+ case 6:
+ /* Fastmap without translation, match forward. */
+ while (__glibc_likely (match_first < right_lim)
+ && !fastmap[(unsigned char) string[match_first]])
+ ++match_first;
+
+ forward_match_found_start_or_reached_end:
+ if (__glibc_unlikely (match_first == right_lim))
+ {
+ ch = match_first >= length
+ ? 0 : (unsigned char) string[match_first];
+ if (!fastmap[t ? t[ch] : ch])
+ goto free_return;
+ }
+ break;
+
+ case 4:
+ case 5:
+ /* Fastmap without multi-byte translation, match backwards. */
+ while (match_first >= left_lim)
+ {
+ ch = match_first >= length
+ ? 0 : (unsigned char) string[match_first];
+ if (fastmap[t ? t[ch] : ch])
+ break;
+ --match_first;
+ }
+ if (match_first < left_lim)
+ goto free_return;
+ break;
+
+ default:
+ /* In this case, we can't determine easily the current byte,
+ since it might be a component byte of a multibyte
+ character. Then we use the constructed buffer instead. */
+ for (;;)
+ {
+ /* If MATCH_FIRST is out of the valid range, reconstruct the
+ buffers. */
+ __re_size_t offset = match_first - mctx.input.raw_mbs_idx;
+ if (__glibc_unlikely (offset
+ >= (__re_size_t) mctx.input.valid_raw_len))
+ {
+ err = re_string_reconstruct (&mctx.input, match_first,
+ eflags);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+
+ offset = match_first - mctx.input.raw_mbs_idx;
+ }
+ /* Use buffer byte if OFFSET is in buffer, otherwise '\0'. */
+ ch = (offset < mctx.input.valid_len
+ ? re_string_byte_at (&mctx.input, offset) : 0);
+ if (fastmap[ch])
+ break;
+ match_first += incr;
+ if (match_first < left_lim || match_first > right_lim)
+ {
+ err = REG_NOMATCH;
+ goto free_return;
+ }
+ }
+ break;
+ }
+
+ /* Reconstruct the buffers so that the matcher can assume that
+ the matching starts from the beginning of the buffer. */
+ err = re_string_reconstruct (&mctx.input, match_first, eflags);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+
+ /* Don't consider this char as a possible match start if it part,
+ yet isn't the head, of a multibyte character. */
+ if (!sb && !re_string_first_byte (&mctx.input, 0))
+ continue;
+
+ /* It seems to be appropriate one, then use the matcher. */
+ /* We assume that the matching starts from 0. */
+ mctx.state_log_top = mctx.nbkref_ents = mctx.max_mb_elem_len = 0;
+ match_last = check_matching (&mctx, fl_longest_match,
+ start <= last_start ? &match_first : NULL);
+ if (match_last != -1)
+ {
+ if (__glibc_unlikely (match_last == -2))
+ {
+ err = REG_ESPACE;
+ goto free_return;
+ }
+ else
+ {
+ mctx.match_last = match_last;
+ if ((!preg->no_sub && nmatch > 1) || dfa->nbackref)
+ {
+ re_dfastate_t *pstate = mctx.state_log[match_last];
+ mctx.last_node = check_halt_state_context (&mctx, pstate,
+ match_last);
+ }
+ if ((!preg->no_sub && nmatch > 1 && dfa->has_plural_match)
+ || dfa->nbackref)
+ {
+ err = prune_impossible_nodes (&mctx);
+ if (err == REG_NOERROR)
+ break;
+ if (__glibc_unlikely (err != REG_NOMATCH))
+ goto free_return;
+ match_last = -1;
+ }
+ else
+ break; /* We found a match. */
+ }
+ }
+
+ match_ctx_clean (&mctx);
+ }
+
+ DEBUG_ASSERT (match_last != -1);
+ DEBUG_ASSERT (err == REG_NOERROR);
+
+ /* Set pmatch[] if we need. */
+ if (nmatch > 0)
+ {
+ Idx reg_idx;
+
+ /* Initialize registers. */
+ for (reg_idx = 1; reg_idx < nmatch; ++reg_idx)
+ pmatch[reg_idx].rm_so = pmatch[reg_idx].rm_eo = -1;
+
+ /* Set the points where matching start/end. */
+ pmatch[0].rm_so = 0;
+ pmatch[0].rm_eo = mctx.match_last;
+ /* FIXME: This function should fail if mctx.match_last exceeds
+ the maximum possible regoff_t value. We need a new error
+ code REG_OVERFLOW. */
+
+ if (!preg->no_sub && nmatch > 1)
+ {
+ err = set_regs (preg, &mctx, nmatch, pmatch,
+ dfa->has_plural_match && dfa->nbackref > 0);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+ }
+
+ /* At last, add the offset to each register, since we slid
+ the buffers so that we could assume that the matching starts
+ from 0. */
+ for (reg_idx = 0; reg_idx < nmatch; ++reg_idx)
+ if (pmatch[reg_idx].rm_so != -1)
+ {
+ if (__glibc_unlikely (mctx.input.offsets_needed != 0))
+ {
+ pmatch[reg_idx].rm_so =
+ (pmatch[reg_idx].rm_so == mctx.input.valid_len
+ ? mctx.input.valid_raw_len
+ : mctx.input.offsets[pmatch[reg_idx].rm_so]);
+ pmatch[reg_idx].rm_eo =
+ (pmatch[reg_idx].rm_eo == mctx.input.valid_len
+ ? mctx.input.valid_raw_len
+ : mctx.input.offsets[pmatch[reg_idx].rm_eo]);
+ }
+ pmatch[reg_idx].rm_so += match_first;
+ pmatch[reg_idx].rm_eo += match_first;
+ }
+ for (reg_idx = 0; reg_idx < extra_nmatch; ++reg_idx)
+ {
+ pmatch[nmatch + reg_idx].rm_so = -1;
+ pmatch[nmatch + reg_idx].rm_eo = -1;
+ }
+
+ if (dfa->subexp_map)
+ for (reg_idx = 0; reg_idx + 1 < nmatch; reg_idx++)
+ if (dfa->subexp_map[reg_idx] != reg_idx)
+ {
+ pmatch[reg_idx + 1].rm_so
+ = pmatch[dfa->subexp_map[reg_idx] + 1].rm_so;
+ pmatch[reg_idx + 1].rm_eo
+ = pmatch[dfa->subexp_map[reg_idx] + 1].rm_eo;
+ }
+ }
+
+ free_return:
+ re_free (mctx.state_log);
+ if (dfa->nbackref)
+ match_ctx_free (&mctx);
+ re_string_destruct (&mctx.input);
+ return err;
+}
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+prune_impossible_nodes (re_match_context_t *mctx)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ Idx halt_node, match_last;
+ reg_errcode_t ret;
+ re_dfastate_t **sifted_states;
+ re_dfastate_t **lim_states = NULL;
+ re_sift_context_t sctx;
+ DEBUG_ASSERT (mctx->state_log != NULL);
+ match_last = mctx->match_last;
+ halt_node = mctx->last_node;
+
+ /* Avoid overflow. */
+ if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *))
+ <= match_last))
+ return REG_ESPACE;
+
+ sifted_states = re_malloc (re_dfastate_t *, match_last + 1);
+ if (__glibc_unlikely (sifted_states == NULL))
+ {
+ ret = REG_ESPACE;
+ goto free_return;
+ }
+ if (dfa->nbackref)
+ {
+ lim_states = re_malloc (re_dfastate_t *, match_last + 1);
+ if (__glibc_unlikely (lim_states == NULL))
+ {
+ ret = REG_ESPACE;
+ goto free_return;
+ }
+ while (1)
+ {
+ memset (lim_states, '\0',
+ sizeof (re_dfastate_t *) * (match_last + 1));
+ sift_ctx_init (&sctx, sifted_states, lim_states, halt_node,
+ match_last);
+ ret = sift_states_backward (mctx, &sctx);
+ re_node_set_free (&sctx.limits);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ goto free_return;
+ if (sifted_states[0] != NULL || lim_states[0] != NULL)
+ break;
+ do
+ {
+ --match_last;
+ if (match_last < 0)
+ {
+ ret = REG_NOMATCH;
+ goto free_return;
+ }
+ } while (mctx->state_log[match_last] == NULL
+ || !mctx->state_log[match_last]->halt);
+ halt_node = check_halt_state_context (mctx,
+ mctx->state_log[match_last],
+ match_last);
+ }
+ ret = merge_state_array (dfa, sifted_states, lim_states,
+ match_last + 1);
+ re_free (lim_states);
+ lim_states = NULL;
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ goto free_return;
+ }
+ else
+ {
+ sift_ctx_init (&sctx, sifted_states, lim_states, halt_node, match_last);
+ ret = sift_states_backward (mctx, &sctx);
+ re_node_set_free (&sctx.limits);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ goto free_return;
+ if (sifted_states[0] == NULL)
+ {
+ ret = REG_NOMATCH;
+ goto free_return;
+ }
+ }
+ re_free (mctx->state_log);
+ mctx->state_log = sifted_states;
+ sifted_states = NULL;
+ mctx->last_node = halt_node;
+ mctx->match_last = match_last;
+ ret = REG_NOERROR;
+ free_return:
+ re_free (sifted_states);
+ re_free (lim_states);
+ return ret;
+}
+
+/* Acquire an initial state and return it.
+ We must select appropriate initial state depending on the context,
+ since initial states may have constraints like "\<", "^", etc.. */
+
+static __always_inline re_dfastate_t *
+acquire_init_state_context (reg_errcode_t *err, const re_match_context_t *mctx,
+ Idx idx)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ if (dfa->init_state->has_constraint)
+ {
+ unsigned int context;
+ context = re_string_context_at (&mctx->input, idx - 1, mctx->eflags);
+ if (IS_WORD_CONTEXT (context))
+ return dfa->init_state_word;
+ else if (IS_ORDINARY_CONTEXT (context))
+ return dfa->init_state;
+ else if (IS_BEGBUF_CONTEXT (context) && IS_NEWLINE_CONTEXT (context))
+ return dfa->init_state_begbuf;
+ else if (IS_NEWLINE_CONTEXT (context))
+ return dfa->init_state_nl;
+ else if (IS_BEGBUF_CONTEXT (context))
+ {
+ /* It is relatively rare case, then calculate on demand. */
+ return re_acquire_state_context (err, dfa,
+ dfa->init_state->entrance_nodes,
+ context);
+ }
+ else
+ /* Must not happen? */
+ return dfa->init_state;
+ }
+ else
+ return dfa->init_state;
+}
+
+/* Check whether the regular expression match input string INPUT or not,
+ and return the index where the matching end. Return -1 if
+ there is no match, and return -2 in case of an error.
+ FL_LONGEST_MATCH means we want the POSIX longest matching.
+ If P_MATCH_FIRST is not NULL, and the match fails, it is set to the
+ next place where we may want to try matching.
+ Note that the matcher assumes that the matching starts from the current
+ index of the buffer. */
+
+static Idx
+__attribute_warn_unused_result__
+check_matching (re_match_context_t *mctx, bool fl_longest_match,
+ Idx *p_match_first)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ reg_errcode_t err;
+ Idx match = 0;
+ Idx match_last = -1;
+ Idx cur_str_idx = re_string_cur_idx (&mctx->input);
+ re_dfastate_t *cur_state;
+ bool at_init_state = p_match_first != NULL;
+ Idx next_start_idx = cur_str_idx;
+
+ err = REG_NOERROR;
+ cur_state = acquire_init_state_context (&err, mctx, cur_str_idx);
+ /* An initial state must not be NULL (invalid). */
+ if (__glibc_unlikely (cur_state == NULL))
+ {
+ DEBUG_ASSERT (err == REG_ESPACE);
+ return -2;
+ }
+
+ if (mctx->state_log != NULL)
+ {
+ mctx->state_log[cur_str_idx] = cur_state;
+
+ /* Check OP_OPEN_SUBEXP in the initial state in case that we use them
+ later. E.g. Processing back references. */
+ if (__glibc_unlikely (dfa->nbackref))
+ {
+ at_init_state = false;
+ err = check_subexp_matching_top (mctx, &cur_state->nodes, 0);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+
+ if (cur_state->has_backref)
+ {
+ err = transit_state_bkref (mctx, &cur_state->nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ }
+ }
+
+ /* If the RE accepts NULL string. */
+ if (__glibc_unlikely (cur_state->halt))
+ {
+ if (!cur_state->has_constraint
+ || check_halt_state_context (mctx, cur_state, cur_str_idx))
+ {
+ if (!fl_longest_match)
+ return cur_str_idx;
+ else
+ {
+ match_last = cur_str_idx;
+ match = 1;
+ }
+ }
+ }
+
+ while (!re_string_eoi (&mctx->input))
+ {
+ re_dfastate_t *old_state = cur_state;
+ Idx next_char_idx = re_string_cur_idx (&mctx->input) + 1;
+
+ if ((__glibc_unlikely (next_char_idx >= mctx->input.bufs_len)
+ && mctx->input.bufs_len < mctx->input.len)
+ || (__glibc_unlikely (next_char_idx >= mctx->input.valid_len)
+ && mctx->input.valid_len < mctx->input.len))
+ {
+ err = extend_buffers (mctx, next_char_idx + 1);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ DEBUG_ASSERT (err == REG_ESPACE);
+ return -2;
+ }
+ }
+
+ cur_state = transit_state (&err, mctx, cur_state);
+ if (mctx->state_log != NULL)
+ cur_state = merge_state_with_log (&err, mctx, cur_state);
+
+ if (cur_state == NULL)
+ {
+ /* Reached the invalid state or an error. Try to recover a valid
+ state using the state log, if available and if we have not
+ already found a valid (even if not the longest) match. */
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return -2;
+
+ if (mctx->state_log == NULL
+ || (match && !fl_longest_match)
+ || (cur_state = find_recover_state (&err, mctx)) == NULL)
+ break;
+ }
+
+ if (__glibc_unlikely (at_init_state))
+ {
+ if (old_state == cur_state)
+ next_start_idx = next_char_idx;
+ else
+ at_init_state = false;
+ }
+
+ if (cur_state->halt)
+ {
+ /* Reached a halt state.
+ Check the halt state can satisfy the current context. */
+ if (!cur_state->has_constraint
+ || check_halt_state_context (mctx, cur_state,
+ re_string_cur_idx (&mctx->input)))
+ {
+ /* We found an appropriate halt state. */
+ match_last = re_string_cur_idx (&mctx->input);
+ match = 1;
+
+ /* We found a match, do not modify match_first below. */
+ p_match_first = NULL;
+ if (!fl_longest_match)
+ break;
+ }
+ }
+ }
+
+ if (p_match_first)
+ *p_match_first += next_start_idx;
+
+ return match_last;
+}
+
+/* Check NODE match the current context. */
+
+static bool
+check_halt_node_context (const re_dfa_t *dfa, Idx node, unsigned int context)
+{
+ re_token_type_t type = dfa->nodes[node].type;
+ unsigned int constraint = dfa->nodes[node].constraint;
+ if (type != END_OF_RE)
+ return false;
+ if (!constraint)
+ return true;
+ if (NOT_SATISFY_NEXT_CONSTRAINT (constraint, context))
+ return false;
+ return true;
+}
+
+/* Check the halt state STATE match the current context.
+ Return 0 if not match, if the node, STATE has, is a halt node and
+ match the context, return the node. */
+
+static Idx
+check_halt_state_context (const re_match_context_t *mctx,
+ const re_dfastate_t *state, Idx idx)
+{
+ Idx i;
+ unsigned int context;
+ DEBUG_ASSERT (state->halt);
+ context = re_string_context_at (&mctx->input, idx, mctx->eflags);
+ for (i = 0; i < state->nodes.nelem; ++i)
+ if (check_halt_node_context (mctx->dfa, state->nodes.elems[i], context))
+ return state->nodes.elems[i];
+ return 0;
+}
+
+/* Compute the next node to which "NFA" transit from NODE("NFA" is a NFA
+ corresponding to the DFA).
+ Return the destination node, and update EPS_VIA_NODES;
+ return -1 on match failure, -2 on error. */
+
+static Idx
+proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs,
+ regmatch_t *prevregs,
+ Idx *pidx, Idx node, re_node_set *eps_via_nodes,
+ struct re_fail_stack_t *fs)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ if (IS_EPSILON_NODE (dfa->nodes[node].type))
+ {
+ re_node_set *cur_nodes = &mctx->state_log[*pidx]->nodes;
+ re_node_set *edests = &dfa->edests[node];
+
+ if (! re_node_set_contains (eps_via_nodes, node))
+ {
+ bool ok = re_node_set_insert (eps_via_nodes, node);
+ if (__glibc_unlikely (! ok))
+ return -2;
+ }
+
+ /* Pick a valid destination, or return -1 if none is found. */
+ Idx dest_node = -1;
+ for (Idx i = 0; i < edests->nelem; i++)
+ {
+ Idx candidate = edests->elems[i];
+ if (!re_node_set_contains (cur_nodes, candidate))
+ continue;
+ if (dest_node == -1)
+ dest_node = candidate;
+
+ else
+ {
+ /* In order to avoid infinite loop like "(a*)*", return the second
+ epsilon-transition if the first was already considered. */
+ if (re_node_set_contains (eps_via_nodes, dest_node))
+ return candidate;
+
+ /* Otherwise, push the second epsilon-transition on the fail stack. */
+ else if (fs != NULL
+ && push_fail_stack (fs, *pidx, candidate, nregs, regs,
+ prevregs, eps_via_nodes))
+ return -2;
+
+ /* We know we are going to exit. */
+ break;
+ }
+ }
+ return dest_node;
+ }
+ else
+ {
+ Idx naccepted = 0;
+ re_token_type_t type = dfa->nodes[node].type;
+
+ if (dfa->nodes[node].accept_mb)
+ naccepted = check_node_accept_bytes (dfa, node, &mctx->input, *pidx);
+ else if (type == OP_BACK_REF)
+ {
+ Idx subexp_idx = dfa->nodes[node].opr.idx + 1;
+ if (subexp_idx < nregs)
+ naccepted = regs[subexp_idx].rm_eo - regs[subexp_idx].rm_so;
+ if (fs != NULL)
+ {
+ if (subexp_idx >= nregs
+ || regs[subexp_idx].rm_so == -1
+ || regs[subexp_idx].rm_eo == -1)
+ return -1;
+ else if (naccepted)
+ {
+ char *buf = (char *) re_string_get_buffer (&mctx->input);
+ if (mctx->input.valid_len - *pidx < naccepted
+ || (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx,
+ naccepted)
+ != 0))
+ return -1;
+ }
+ }
+
+ if (naccepted == 0)
+ {
+ Idx dest_node;
+ bool ok = re_node_set_insert (eps_via_nodes, node);
+ if (__glibc_unlikely (! ok))
+ return -2;
+ dest_node = dfa->edests[node].elems[0];
+ if (re_node_set_contains (&mctx->state_log[*pidx]->nodes,
+ dest_node))
+ return dest_node;
+ }
+ }
+
+ if (naccepted != 0
+ || check_node_accept (mctx, dfa->nodes + node, *pidx))
+ {
+ Idx dest_node = dfa->nexts[node];
+ *pidx = (naccepted == 0) ? *pidx + 1 : *pidx + naccepted;
+ if (fs && (*pidx > mctx->match_last || mctx->state_log[*pidx] == NULL
+ || !re_node_set_contains (&mctx->state_log[*pidx]->nodes,
+ dest_node)))
+ return -1;
+ re_node_set_empty (eps_via_nodes);
+ return dest_node;
+ }
+ }
+ return -1;
+}
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+push_fail_stack (struct re_fail_stack_t *fs, Idx str_idx, Idx dest_node,
+ Idx nregs, regmatch_t *regs, regmatch_t *prevregs,
+ re_node_set *eps_via_nodes)
+{
+ reg_errcode_t err;
+ Idx num = fs->num;
+ if (num == fs->alloc)
+ {
+ struct re_fail_stack_ent_t *new_array;
+ new_array = re_realloc (fs->stack, struct re_fail_stack_ent_t,
+ fs->alloc * 2);
+ if (new_array == NULL)
+ return REG_ESPACE;
+ fs->alloc *= 2;
+ fs->stack = new_array;
+ }
+ fs->stack[num].idx = str_idx;
+ fs->stack[num].node = dest_node;
+ fs->stack[num].regs = re_malloc (regmatch_t, 2 * nregs);
+ if (fs->stack[num].regs == NULL)
+ return REG_ESPACE;
+ fs->num = num + 1;
+ memcpy (fs->stack[num].regs, regs, sizeof (regmatch_t) * nregs);
+ memcpy (fs->stack[num].regs + nregs, prevregs, sizeof (regmatch_t) * nregs);
+ err = re_node_set_init_copy (&fs->stack[num].eps_via_nodes, eps_via_nodes);
+ return err;
+}
+
+static Idx
+pop_fail_stack (struct re_fail_stack_t *fs, Idx *pidx, Idx nregs,
+ regmatch_t *regs, regmatch_t *prevregs,
+ re_node_set *eps_via_nodes)
+{
+ if (fs == NULL || fs->num == 0)
+ return -1;
+ Idx num = --fs->num;
+ *pidx = fs->stack[num].idx;
+ memcpy (regs, fs->stack[num].regs, sizeof (regmatch_t) * nregs);
+ memcpy (prevregs, fs->stack[num].regs + nregs, sizeof (regmatch_t) * nregs);
+ re_node_set_free (eps_via_nodes);
+ re_free (fs->stack[num].regs);
+ *eps_via_nodes = fs->stack[num].eps_via_nodes;
+ DEBUG_ASSERT (0 <= fs->stack[num].node);
+ return fs->stack[num].node;
+}
+
+
+#define DYNARRAY_STRUCT regmatch_list
+#define DYNARRAY_ELEMENT regmatch_t
+#define DYNARRAY_PREFIX regmatch_list_
+#include <malloc/dynarray-skeleton.c>
+
+/* Set the positions where the subexpressions are starts/ends to registers
+ PMATCH.
+ Note: We assume that pmatch[0] is already set, and
+ pmatch[i].rm_so == pmatch[i].rm_eo == -1 for 0 < i < nmatch. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+set_regs (const regex_t *preg, const re_match_context_t *mctx, size_t nmatch,
+ regmatch_t *pmatch, bool fl_backtrack)
+{
+ const re_dfa_t *dfa = preg->buffer;
+ Idx idx, cur_node;
+ re_node_set eps_via_nodes;
+ struct re_fail_stack_t *fs;
+ struct re_fail_stack_t fs_body = { 0, 2, NULL };
+ struct regmatch_list prev_match;
+ regmatch_list_init (&prev_match);
+
+ DEBUG_ASSERT (nmatch > 1);
+ DEBUG_ASSERT (mctx->state_log != NULL);
+ if (fl_backtrack)
+ {
+ fs = &fs_body;
+ fs->stack = re_malloc (struct re_fail_stack_ent_t, fs->alloc);
+ if (fs->stack == NULL)
+ return REG_ESPACE;
+ }
+ else
+ fs = NULL;
+
+ cur_node = dfa->init_node;
+ re_node_set_init_empty (&eps_via_nodes);
+
+ if (!regmatch_list_resize (&prev_match, nmatch))
+ {
+ regmatch_list_free (&prev_match);
+ free_fail_stack_return (fs);
+ return REG_ESPACE;
+ }
+ regmatch_t *prev_idx_match = regmatch_list_begin (&prev_match);
+ memcpy (prev_idx_match, pmatch, sizeof (regmatch_t) * nmatch);
+
+ for (idx = pmatch[0].rm_so; idx <= pmatch[0].rm_eo ;)
+ {
+ update_regs (dfa, pmatch, prev_idx_match, cur_node, idx, nmatch);
+
+ if ((idx == pmatch[0].rm_eo && cur_node == mctx->last_node)
+ || (fs && re_node_set_contains (&eps_via_nodes, cur_node)))
+ {
+ Idx reg_idx;
+ cur_node = -1;
+ if (fs)
+ {
+ for (reg_idx = 0; reg_idx < nmatch; ++reg_idx)
+ if (pmatch[reg_idx].rm_so > -1 && pmatch[reg_idx].rm_eo == -1)
+ {
+ cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
+ prev_idx_match, &eps_via_nodes);
+ break;
+ }
+ }
+ if (cur_node < 0)
+ {
+ re_node_set_free (&eps_via_nodes);
+ regmatch_list_free (&prev_match);
+ return free_fail_stack_return (fs);
+ }
+ }
+
+ /* Proceed to next node. */
+ cur_node = proceed_next_node (mctx, nmatch, pmatch, prev_idx_match,
+ &idx, cur_node,
+ &eps_via_nodes, fs);
+
+ if (__glibc_unlikely (cur_node < 0))
+ {
+ if (__glibc_unlikely (cur_node == -2))
+ {
+ re_node_set_free (&eps_via_nodes);
+ regmatch_list_free (&prev_match);
+ free_fail_stack_return (fs);
+ return REG_ESPACE;
+ }
+ cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
+ prev_idx_match, &eps_via_nodes);
+ if (cur_node < 0)
+ {
+ re_node_set_free (&eps_via_nodes);
+ regmatch_list_free (&prev_match);
+ free_fail_stack_return (fs);
+ return REG_NOMATCH;
+ }
+ }
+ }
+ re_node_set_free (&eps_via_nodes);
+ regmatch_list_free (&prev_match);
+ return free_fail_stack_return (fs);
+}
+
+static reg_errcode_t
+free_fail_stack_return (struct re_fail_stack_t *fs)
+{
+ if (fs)
+ {
+ Idx fs_idx;
+ for (fs_idx = 0; fs_idx < fs->num; ++fs_idx)
+ {
+ re_node_set_free (&fs->stack[fs_idx].eps_via_nodes);
+ re_free (fs->stack[fs_idx].regs);
+ }
+ re_free (fs->stack);
+ }
+ return REG_NOERROR;
+}
+
+static void
+update_regs (const re_dfa_t *dfa, regmatch_t *pmatch,
+ regmatch_t *prev_idx_match, Idx cur_node, Idx cur_idx, Idx nmatch)
+{
+ int type = dfa->nodes[cur_node].type;
+ if (type == OP_OPEN_SUBEXP)
+ {
+ Idx reg_num = dfa->nodes[cur_node].opr.idx + 1;
+
+ /* We are at the first node of this sub expression. */
+ if (reg_num < nmatch)
+ {
+ pmatch[reg_num].rm_so = cur_idx;
+ pmatch[reg_num].rm_eo = -1;
+ }
+ }
+ else if (type == OP_CLOSE_SUBEXP)
+ {
+ /* We are at the last node of this sub expression. */
+ Idx reg_num = dfa->nodes[cur_node].opr.idx + 1;
+ if (reg_num < nmatch)
+ {
+ if (pmatch[reg_num].rm_so < cur_idx)
+ {
+ pmatch[reg_num].rm_eo = cur_idx;
+ /* This is a non-empty match or we are not inside an optional
+ subexpression. Accept this right away. */
+ memcpy (prev_idx_match, pmatch, sizeof (regmatch_t) * nmatch);
+ }
+ else
+ {
+ if (dfa->nodes[cur_node].opt_subexp
+ && prev_idx_match[reg_num].rm_so != -1)
+ /* We transited through an empty match for an optional
+ subexpression, like (a?)*, and this is not the subexp's
+ first match. Copy back the old content of the registers
+ so that matches of an inner subexpression are undone as
+ well, like in ((a?))*. */
+ memcpy (pmatch, prev_idx_match, sizeof (regmatch_t) * nmatch);
+ else
+ /* We completed a subexpression, but it may be part of
+ an optional one, so do not update PREV_IDX_MATCH. */
+ pmatch[reg_num].rm_eo = cur_idx;
+ }
+ }
+ }
+}
+
+/* This function checks the STATE_LOG from the SCTX->last_str_idx to 0
+ and sift the nodes in each states according to the following rules.
+ Updated state_log will be wrote to STATE_LOG.
+
+ Rules: We throw away the Node 'a' in the STATE_LOG[STR_IDX] if...
+ 1. When STR_IDX == MATCH_LAST(the last index in the state_log):
+ If 'a' isn't the LAST_NODE and 'a' can't epsilon transit to
+ the LAST_NODE, we throw away the node 'a'.
+ 2. When 0 <= STR_IDX < MATCH_LAST and 'a' accepts
+ string 's' and transit to 'b':
+ i. If 'b' isn't in the STATE_LOG[STR_IDX+strlen('s')], we throw
+ away the node 'a'.
+ ii. If 'b' is in the STATE_LOG[STR_IDX+strlen('s')] but 'b' is
+ thrown away, we throw away the node 'a'.
+ 3. When 0 <= STR_IDX < MATCH_LAST and 'a' epsilon transit to 'b':
+ i. If 'b' isn't in the STATE_LOG[STR_IDX], we throw away the
+ node 'a'.
+ ii. If 'b' is in the STATE_LOG[STR_IDX] but 'b' is thrown away,
+ we throw away the node 'a'. */
+
+#define STATE_NODE_CONTAINS(state,node) \
+ ((state) != NULL && re_node_set_contains (&(state)->nodes, node))
+
+static reg_errcode_t
+sift_states_backward (const re_match_context_t *mctx, re_sift_context_t *sctx)
+{
+ reg_errcode_t err;
+ int null_cnt = 0;
+ Idx str_idx = sctx->last_str_idx;
+ re_node_set cur_dest;
+
+ DEBUG_ASSERT (mctx->state_log != NULL && mctx->state_log[str_idx] != NULL);
+
+ /* Build sifted state_log[str_idx]. It has the nodes which can epsilon
+ transit to the last_node and the last_node itself. */
+ err = re_node_set_init_1 (&cur_dest, sctx->last_node);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ err = update_cur_sifted_state (mctx, sctx, str_idx, &cur_dest);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+
+ /* Then check each states in the state_log. */
+ while (str_idx > 0)
+ {
+ /* Update counters. */
+ null_cnt = (sctx->sifted_states[str_idx] == NULL) ? null_cnt + 1 : 0;
+ if (null_cnt > mctx->max_mb_elem_len)
+ {
+ memset (sctx->sifted_states, '\0',
+ sizeof (re_dfastate_t *) * str_idx);
+ re_node_set_free (&cur_dest);
+ return REG_NOERROR;
+ }
+ re_node_set_empty (&cur_dest);
+ --str_idx;
+
+ if (mctx->state_log[str_idx])
+ {
+ err = build_sifted_states (mctx, sctx, str_idx, &cur_dest);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+ }
+
+ /* Add all the nodes which satisfy the following conditions:
+ - It can epsilon transit to a node in CUR_DEST.
+ - It is in CUR_SRC.
+ And update state_log. */
+ err = update_cur_sifted_state (mctx, sctx, str_idx, &cur_dest);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+ }
+ err = REG_NOERROR;
+ free_return:
+ re_node_set_free (&cur_dest);
+ return err;
+}
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+build_sifted_states (const re_match_context_t *mctx, re_sift_context_t *sctx,
+ Idx str_idx, re_node_set *cur_dest)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ const re_node_set *cur_src = &mctx->state_log[str_idx]->non_eps_nodes;
+ Idx i;
+
+ /* Then build the next sifted state.
+ We build the next sifted state on 'cur_dest', and update
+ 'sifted_states[str_idx]' with 'cur_dest'.
+ Note:
+ 'cur_dest' is the sifted state from 'state_log[str_idx + 1]'.
+ 'cur_src' points the node_set of the old 'state_log[str_idx]'
+ (with the epsilon nodes pre-filtered out). */
+ for (i = 0; i < cur_src->nelem; i++)
+ {
+ Idx prev_node = cur_src->elems[i];
+ int naccepted = 0;
+ bool ok;
+ DEBUG_ASSERT (!IS_EPSILON_NODE (dfa->nodes[prev_node].type));
+
+ /* If the node may accept "multi byte". */
+ if (dfa->nodes[prev_node].accept_mb)
+ naccepted = sift_states_iter_mb (mctx, sctx, prev_node,
+ str_idx, sctx->last_str_idx);
+
+ /* We don't check backreferences here.
+ See update_cur_sifted_state(). */
+ if (!naccepted
+ && check_node_accept (mctx, dfa->nodes + prev_node, str_idx)
+ && STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + 1],
+ dfa->nexts[prev_node]))
+ naccepted = 1;
+
+ if (naccepted == 0)
+ continue;
+
+ if (sctx->limits.nelem)
+ {
+ Idx to_idx = str_idx + naccepted;
+ if (check_dst_limits (mctx, &sctx->limits,
+ dfa->nexts[prev_node], to_idx,
+ prev_node, str_idx))
+ continue;
+ }
+ ok = re_node_set_insert (cur_dest, prev_node);
+ if (__glibc_unlikely (! ok))
+ return REG_ESPACE;
+ }
+
+ return REG_NOERROR;
+}
+
+/* Helper functions. */
+
+static reg_errcode_t
+clean_state_log_if_needed (re_match_context_t *mctx, Idx next_state_log_idx)
+{
+ Idx top = mctx->state_log_top;
+
+ if ((next_state_log_idx >= mctx->input.bufs_len
+ && mctx->input.bufs_len < mctx->input.len)
+ || (next_state_log_idx >= mctx->input.valid_len
+ && mctx->input.valid_len < mctx->input.len))
+ {
+ reg_errcode_t err;
+ err = extend_buffers (mctx, next_state_log_idx + 1);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+
+ if (top < next_state_log_idx)
+ {
+ DEBUG_ASSERT (mctx->state_log != NULL);
+ memset (mctx->state_log + top + 1, '\0',
+ sizeof (re_dfastate_t *) * (next_state_log_idx - top));
+ mctx->state_log_top = next_state_log_idx;
+ }
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+merge_state_array (const re_dfa_t *dfa, re_dfastate_t **dst,
+ re_dfastate_t **src, Idx num)
+{
+ Idx st_idx;
+ reg_errcode_t err;
+ for (st_idx = 0; st_idx < num; ++st_idx)
+ {
+ if (dst[st_idx] == NULL)
+ dst[st_idx] = src[st_idx];
+ else if (src[st_idx] != NULL)
+ {
+ re_node_set merged_set;
+ err = re_node_set_init_union (&merged_set, &dst[st_idx]->nodes,
+ &src[st_idx]->nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ dst[st_idx] = re_acquire_state (&err, dfa, &merged_set);
+ re_node_set_free (&merged_set);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ }
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+update_cur_sifted_state (const re_match_context_t *mctx,
+ re_sift_context_t *sctx, Idx str_idx,
+ re_node_set *dest_nodes)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ reg_errcode_t err = REG_NOERROR;
+ const re_node_set *candidates;
+ candidates = ((mctx->state_log[str_idx] == NULL) ? NULL
+ : &mctx->state_log[str_idx]->nodes);
+
+ if (dest_nodes->nelem == 0)
+ sctx->sifted_states[str_idx] = NULL;
+ else
+ {
+ if (candidates)
+ {
+ /* At first, add the nodes which can epsilon transit to a node in
+ DEST_NODE. */
+ err = add_epsilon_src_nodes (dfa, dest_nodes, candidates);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+
+ /* Then, check the limitations in the current sift_context. */
+ if (sctx->limits.nelem)
+ {
+ err = check_subexp_limits (dfa, dest_nodes, candidates, &sctx->limits,
+ mctx->bkref_ents, str_idx);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ }
+
+ sctx->sifted_states[str_idx] = re_acquire_state (&err, dfa, dest_nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+
+ if (candidates && mctx->state_log[str_idx]->has_backref)
+ {
+ err = sift_states_bkref (mctx, sctx, str_idx, candidates);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+add_epsilon_src_nodes (const re_dfa_t *dfa, re_node_set *dest_nodes,
+ const re_node_set *candidates)
+{
+ reg_errcode_t err = REG_NOERROR;
+ Idx i;
+
+ re_dfastate_t *state = re_acquire_state (&err, dfa, dest_nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+
+ if (!state->inveclosure.alloc)
+ {
+ err = re_node_set_alloc (&state->inveclosure, dest_nodes->nelem);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return REG_ESPACE;
+ for (i = 0; i < dest_nodes->nelem; i++)
+ {
+ err = re_node_set_merge (&state->inveclosure,
+ dfa->inveclosures + dest_nodes->elems[i]);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return REG_ESPACE;
+ }
+ }
+ return re_node_set_add_intersect (dest_nodes, candidates,
+ &state->inveclosure);
+}
+
+static reg_errcode_t
+sub_epsilon_src_nodes (const re_dfa_t *dfa, Idx node, re_node_set *dest_nodes,
+ const re_node_set *candidates)
+{
+ Idx ecl_idx;
+ reg_errcode_t err;
+ re_node_set *inv_eclosure = dfa->inveclosures + node;
+ re_node_set except_nodes;
+ re_node_set_init_empty (&except_nodes);
+ for (ecl_idx = 0; ecl_idx < inv_eclosure->nelem; ++ecl_idx)
+ {
+ Idx cur_node = inv_eclosure->elems[ecl_idx];
+ if (cur_node == node)
+ continue;
+ if (IS_EPSILON_NODE (dfa->nodes[cur_node].type))
+ {
+ Idx edst1 = dfa->edests[cur_node].elems[0];
+ Idx edst2 = ((dfa->edests[cur_node].nelem > 1)
+ ? dfa->edests[cur_node].elems[1] : -1);
+ if ((!re_node_set_contains (inv_eclosure, edst1)
+ && re_node_set_contains (dest_nodes, edst1))
+ || (edst2 > 0
+ && !re_node_set_contains (inv_eclosure, edst2)
+ && re_node_set_contains (dest_nodes, edst2)))
+ {
+ err = re_node_set_add_intersect (&except_nodes, candidates,
+ dfa->inveclosures + cur_node);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&except_nodes);
+ return err;
+ }
+ }
+ }
+ }
+ for (ecl_idx = 0; ecl_idx < inv_eclosure->nelem; ++ecl_idx)
+ {
+ Idx cur_node = inv_eclosure->elems[ecl_idx];
+ if (!re_node_set_contains (&except_nodes, cur_node))
+ {
+ Idx idx = re_node_set_contains (dest_nodes, cur_node) - 1;
+ re_node_set_remove_at (dest_nodes, idx);
+ }
+ }
+ re_node_set_free (&except_nodes);
+ return REG_NOERROR;
+}
+
+static bool
+check_dst_limits (const re_match_context_t *mctx, const re_node_set *limits,
+ Idx dst_node, Idx dst_idx, Idx src_node, Idx src_idx)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ Idx lim_idx, src_pos, dst_pos;
+
+ Idx dst_bkref_idx = search_cur_bkref_entry (mctx, dst_idx);
+ Idx src_bkref_idx = search_cur_bkref_entry (mctx, src_idx);
+ for (lim_idx = 0; lim_idx < limits->nelem; ++lim_idx)
+ {
+ Idx subexp_idx;
+ struct re_backref_cache_entry *ent;
+ ent = mctx->bkref_ents + limits->elems[lim_idx];
+ subexp_idx = dfa->nodes[ent->node].opr.idx;
+
+ dst_pos = check_dst_limits_calc_pos (mctx, limits->elems[lim_idx],
+ subexp_idx, dst_node, dst_idx,
+ dst_bkref_idx);
+ src_pos = check_dst_limits_calc_pos (mctx, limits->elems[lim_idx],
+ subexp_idx, src_node, src_idx,
+ src_bkref_idx);
+
+ /* In case of:
+ <src> <dst> ( <subexp> )
+ ( <subexp> ) <src> <dst>
+ ( <subexp1> <src> <subexp2> <dst> <subexp3> ) */
+ if (src_pos == dst_pos)
+ continue; /* This is unrelated limitation. */
+ else
+ return true;
+ }
+ return false;
+}
+
+static int
+check_dst_limits_calc_pos_1 (const re_match_context_t *mctx, int boundaries,
+ Idx subexp_idx, Idx from_node, Idx bkref_idx)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ const re_node_set *eclosures = dfa->eclosures + from_node;
+ Idx node_idx;
+
+ /* Else, we are on the boundary: examine the nodes on the epsilon
+ closure. */
+ for (node_idx = 0; node_idx < eclosures->nelem; ++node_idx)
+ {
+ Idx node = eclosures->elems[node_idx];
+ switch (dfa->nodes[node].type)
+ {
+ case OP_BACK_REF:
+ if (bkref_idx != -1)
+ {
+ struct re_backref_cache_entry *ent = mctx->bkref_ents + bkref_idx;
+ do
+ {
+ Idx dst;
+ int cpos;
+
+ if (ent->node != node)
+ continue;
+
+ if (subexp_idx < BITSET_WORD_BITS
+ && !(ent->eps_reachable_subexps_map
+ & ((bitset_word_t) 1 << subexp_idx)))
+ continue;
+
+ /* Recurse trying to reach the OP_OPEN_SUBEXP and
+ OP_CLOSE_SUBEXP cases below. But, if the
+ destination node is the same node as the source
+ node, don't recurse because it would cause an
+ infinite loop: a regex that exhibits this behavior
+ is ()\1*\1* */
+ dst = dfa->edests[node].elems[0];
+ if (dst == from_node)
+ {
+ if (boundaries & 1)
+ return -1;
+ else /* if (boundaries & 2) */
+ return 0;
+ }
+
+ cpos =
+ check_dst_limits_calc_pos_1 (mctx, boundaries, subexp_idx,
+ dst, bkref_idx);
+ if (cpos == -1 /* && (boundaries & 1) */)
+ return -1;
+ if (cpos == 0 && (boundaries & 2))
+ return 0;
+
+ if (subexp_idx < BITSET_WORD_BITS)
+ ent->eps_reachable_subexps_map
+ &= ~((bitset_word_t) 1 << subexp_idx);
+ }
+ while (ent++->more);
+ }
+ break;
+
+ case OP_OPEN_SUBEXP:
+ if ((boundaries & 1) && subexp_idx == dfa->nodes[node].opr.idx)
+ return -1;
+ break;
+
+ case OP_CLOSE_SUBEXP:
+ if ((boundaries & 2) && subexp_idx == dfa->nodes[node].opr.idx)
+ return 0;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ return (boundaries & 2) ? 1 : 0;
+}
+
+static int
+check_dst_limits_calc_pos (const re_match_context_t *mctx, Idx limit,
+ Idx subexp_idx, Idx from_node, Idx str_idx,
+ Idx bkref_idx)
+{
+ struct re_backref_cache_entry *lim = mctx->bkref_ents + limit;
+ int boundaries;
+
+ /* If we are outside the range of the subexpression, return -1 or 1. */
+ if (str_idx < lim->subexp_from)
+ return -1;
+
+ if (lim->subexp_to < str_idx)
+ return 1;
+
+ /* If we are within the subexpression, return 0. */
+ boundaries = (str_idx == lim->subexp_from);
+ boundaries |= (str_idx == lim->subexp_to) << 1;
+ if (boundaries == 0)
+ return 0;
+
+ /* Else, examine epsilon closure. */
+ return check_dst_limits_calc_pos_1 (mctx, boundaries, subexp_idx,
+ from_node, bkref_idx);
+}
+
+/* Check the limitations of sub expressions LIMITS, and remove the nodes
+ which are against limitations from DEST_NODES. */
+
+static reg_errcode_t
+check_subexp_limits (const re_dfa_t *dfa, re_node_set *dest_nodes,
+ const re_node_set *candidates, re_node_set *limits,
+ struct re_backref_cache_entry *bkref_ents, Idx str_idx)
+{
+ reg_errcode_t err;
+ Idx node_idx, lim_idx;
+
+ for (lim_idx = 0; lim_idx < limits->nelem; ++lim_idx)
+ {
+ Idx subexp_idx;
+ struct re_backref_cache_entry *ent;
+ ent = bkref_ents + limits->elems[lim_idx];
+
+ if (str_idx <= ent->subexp_from || ent->str_idx < str_idx)
+ continue; /* This is unrelated limitation. */
+
+ subexp_idx = dfa->nodes[ent->node].opr.idx;
+ if (ent->subexp_to == str_idx)
+ {
+ Idx ops_node = -1;
+ Idx cls_node = -1;
+ for (node_idx = 0; node_idx < dest_nodes->nelem; ++node_idx)
+ {
+ Idx node = dest_nodes->elems[node_idx];
+ re_token_type_t type = dfa->nodes[node].type;
+ if (type == OP_OPEN_SUBEXP
+ && subexp_idx == dfa->nodes[node].opr.idx)
+ ops_node = node;
+ else if (type == OP_CLOSE_SUBEXP
+ && subexp_idx == dfa->nodes[node].opr.idx)
+ cls_node = node;
+ }
+
+ /* Check the limitation of the open subexpression. */
+ /* Note that (ent->subexp_to = str_idx != ent->subexp_from). */
+ if (ops_node >= 0)
+ {
+ err = sub_epsilon_src_nodes (dfa, ops_node, dest_nodes,
+ candidates);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+
+ /* Check the limitation of the close subexpression. */
+ if (cls_node >= 0)
+ for (node_idx = 0; node_idx < dest_nodes->nelem; ++node_idx)
+ {
+ Idx node = dest_nodes->elems[node_idx];
+ if (!re_node_set_contains (dfa->inveclosures + node,
+ cls_node)
+ && !re_node_set_contains (dfa->eclosures + node,
+ cls_node))
+ {
+ /* It is against this limitation.
+ Remove it form the current sifted state. */
+ err = sub_epsilon_src_nodes (dfa, node, dest_nodes,
+ candidates);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ --node_idx;
+ }
+ }
+ }
+ else /* (ent->subexp_to != str_idx) */
+ {
+ for (node_idx = 0; node_idx < dest_nodes->nelem; ++node_idx)
+ {
+ Idx node = dest_nodes->elems[node_idx];
+ re_token_type_t type = dfa->nodes[node].type;
+ if (type == OP_CLOSE_SUBEXP || type == OP_OPEN_SUBEXP)
+ {
+ if (subexp_idx != dfa->nodes[node].opr.idx)
+ continue;
+ /* It is against this limitation.
+ Remove it form the current sifted state. */
+ err = sub_epsilon_src_nodes (dfa, node, dest_nodes,
+ candidates);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ }
+ }
+ }
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+sift_states_bkref (const re_match_context_t *mctx, re_sift_context_t *sctx,
+ Idx str_idx, const re_node_set *candidates)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ reg_errcode_t err;
+ Idx node_idx, node;
+ re_sift_context_t local_sctx;
+ Idx first_idx = search_cur_bkref_entry (mctx, str_idx);
+
+ if (first_idx == -1)
+ return REG_NOERROR;
+
+ local_sctx.sifted_states = NULL; /* Mark that it hasn't been initialized. */
+
+ for (node_idx = 0; node_idx < candidates->nelem; ++node_idx)
+ {
+ Idx enabled_idx;
+ re_token_type_t type;
+ struct re_backref_cache_entry *entry;
+ node = candidates->elems[node_idx];
+ type = dfa->nodes[node].type;
+ /* Avoid infinite loop for the REs like "()\1+". */
+ if (node == sctx->last_node && str_idx == sctx->last_str_idx)
+ continue;
+ if (type != OP_BACK_REF)
+ continue;
+
+ entry = mctx->bkref_ents + first_idx;
+ enabled_idx = first_idx;
+ do
+ {
+ Idx subexp_len;
+ Idx to_idx;
+ Idx dst_node;
+ bool ok;
+ re_dfastate_t *cur_state;
+
+ if (entry->node != node)
+ continue;
+ subexp_len = entry->subexp_to - entry->subexp_from;
+ to_idx = str_idx + subexp_len;
+ dst_node = (subexp_len ? dfa->nexts[node]
+ : dfa->edests[node].elems[0]);
+
+ if (to_idx > sctx->last_str_idx
+ || sctx->sifted_states[to_idx] == NULL
+ || !STATE_NODE_CONTAINS (sctx->sifted_states[to_idx], dst_node)
+ || check_dst_limits (mctx, &sctx->limits, node,
+ str_idx, dst_node, to_idx))
+ continue;
+
+ if (local_sctx.sifted_states == NULL)
+ {
+ local_sctx = *sctx;
+ err = re_node_set_init_copy (&local_sctx.limits, &sctx->limits);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+ }
+ local_sctx.last_node = node;
+ local_sctx.last_str_idx = str_idx;
+ ok = re_node_set_insert (&local_sctx.limits, enabled_idx);
+ if (__glibc_unlikely (! ok))
+ {
+ err = REG_ESPACE;
+ goto free_return;
+ }
+ cur_state = local_sctx.sifted_states[str_idx];
+ err = sift_states_backward (mctx, &local_sctx);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+ if (sctx->limited_states != NULL)
+ {
+ err = merge_state_array (dfa, sctx->limited_states,
+ local_sctx.sifted_states,
+ str_idx + 1);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+ }
+ local_sctx.sifted_states[str_idx] = cur_state;
+ re_node_set_remove (&local_sctx.limits, enabled_idx);
+
+ /* mctx->bkref_ents may have changed, reload the pointer. */
+ entry = mctx->bkref_ents + enabled_idx;
+ }
+ while (enabled_idx++, entry++->more);
+ }
+ err = REG_NOERROR;
+ free_return:
+ if (local_sctx.sifted_states != NULL)
+ {
+ re_node_set_free (&local_sctx.limits);
+ }
+
+ return err;
+}
+
+
+static int
+sift_states_iter_mb (const re_match_context_t *mctx, re_sift_context_t *sctx,
+ Idx node_idx, Idx str_idx, Idx max_str_idx)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ int naccepted;
+ /* Check the node can accept "multi byte". */
+ naccepted = check_node_accept_bytes (dfa, node_idx, &mctx->input, str_idx);
+ if (naccepted > 0 && str_idx + naccepted <= max_str_idx
+ && !STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + naccepted],
+ dfa->nexts[node_idx]))
+ /* The node can't accept the "multi byte", or the
+ destination was already thrown away, then the node
+ couldn't accept the current input "multi byte". */
+ naccepted = 0;
+ /* Otherwise, it is sure that the node could accept
+ 'naccepted' bytes input. */
+ return naccepted;
+}
+
+/* Functions for state transition. */
+
+/* Return the next state to which the current state STATE will transit by
+ accepting the current input byte, and update STATE_LOG if necessary.
+ Return NULL on failure.
+ If STATE can accept a multibyte char/collating element/back reference
+ update the destination of STATE_LOG. */
+
+static re_dfastate_t *
+__attribute_warn_unused_result__
+transit_state (reg_errcode_t *err, re_match_context_t *mctx,
+ re_dfastate_t *state)
+{
+ re_dfastate_t **trtable;
+ unsigned char ch;
+
+ /* If the current state can accept multibyte. */
+ if (__glibc_unlikely (state->accept_mb))
+ {
+ *err = transit_state_mb (mctx, state);
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ return NULL;
+ }
+
+ /* Then decide the next state with the single byte. */
+#if 0
+ if (0)
+ /* don't use transition table */
+ return transit_state_sb (err, mctx, state);
+#endif
+
+ /* Use transition table */
+ ch = re_string_fetch_byte (&mctx->input);
+ for (;;)
+ {
+ trtable = state->trtable;
+ if (__glibc_likely (trtable != NULL))
+ return trtable[ch];
+
+ trtable = state->word_trtable;
+ if (__glibc_likely (trtable != NULL))
+ {
+ unsigned int context;
+ context
+ = re_string_context_at (&mctx->input,
+ re_string_cur_idx (&mctx->input) - 1,
+ mctx->eflags);
+ if (IS_WORD_CONTEXT (context))
+ return trtable[ch + SBC_MAX];
+ else
+ return trtable[ch];
+ }
+
+ if (!build_trtable (mctx->dfa, state))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+
+ /* Retry, we now have a transition table. */
+ }
+}
+
+/* Update the state_log if we need */
+static re_dfastate_t *
+merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
+ re_dfastate_t *next_state)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ Idx cur_idx = re_string_cur_idx (&mctx->input);
+
+ if (cur_idx > mctx->state_log_top)
+ {
+ mctx->state_log[cur_idx] = next_state;
+ mctx->state_log_top = cur_idx;
+ }
+ else if (mctx->state_log[cur_idx] == 0)
+ {
+ mctx->state_log[cur_idx] = next_state;
+ }
+ else
+ {
+ re_dfastate_t *pstate;
+ unsigned int context;
+ re_node_set next_nodes, *log_nodes, *table_nodes = NULL;
+ /* If (state_log[cur_idx] != 0), it implies that cur_idx is
+ the destination of a multibyte char/collating element/
+ back reference. Then the next state is the union set of
+ these destinations and the results of the transition table. */
+ pstate = mctx->state_log[cur_idx];
+ log_nodes = pstate->entrance_nodes;
+ if (next_state != NULL)
+ {
+ table_nodes = next_state->entrance_nodes;
+ *err = re_node_set_init_union (&next_nodes, table_nodes,
+ log_nodes);
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ return NULL;
+ }
+ else
+ next_nodes = *log_nodes;
+ /* Note: We already add the nodes of the initial state,
+ then we don't need to add them here. */
+
+ context = re_string_context_at (&mctx->input,
+ re_string_cur_idx (&mctx->input) - 1,
+ mctx->eflags);
+ next_state = mctx->state_log[cur_idx]
+ = re_acquire_state_context (err, dfa, &next_nodes, context);
+ /* We don't need to check errors here, since the return value of
+ this function is next_state and ERR is already set. */
+
+ if (table_nodes != NULL)
+ re_node_set_free (&next_nodes);
+ }
+
+ if (__glibc_unlikely (dfa->nbackref) && next_state != NULL)
+ {
+ /* Check OP_OPEN_SUBEXP in the current state in case that we use them
+ later. We must check them here, since the back references in the
+ next state might use them. */
+ *err = check_subexp_matching_top (mctx, &next_state->nodes,
+ cur_idx);
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ return NULL;
+
+ /* If the next state has back references. */
+ if (next_state->has_backref)
+ {
+ *err = transit_state_bkref (mctx, &next_state->nodes);
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ return NULL;
+ next_state = mctx->state_log[cur_idx];
+ }
+ }
+
+ return next_state;
+}
+
+/* Skip bytes in the input that correspond to part of a
+ multi-byte match, then look in the log for a state
+ from which to restart matching. */
+static re_dfastate_t *
+find_recover_state (reg_errcode_t *err, re_match_context_t *mctx)
+{
+ re_dfastate_t *cur_state;
+ do
+ {
+ Idx max = mctx->state_log_top;
+ Idx cur_str_idx = re_string_cur_idx (&mctx->input);
+
+ do
+ {
+ if (++cur_str_idx > max)
+ return NULL;
+ re_string_skip_bytes (&mctx->input, 1);
+ }
+ while (mctx->state_log[cur_str_idx] == NULL);
+
+ cur_state = merge_state_with_log (err, mctx, NULL);
+ }
+ while (*err == REG_NOERROR && cur_state == NULL);
+ return cur_state;
+}
+
+/* Helper functions for transit_state. */
+
+/* From the node set CUR_NODES, pick up the nodes whose types are
+ OP_OPEN_SUBEXP and which have corresponding back references in the regular
+ expression. And register them to use them later for evaluating the
+ corresponding back references. */
+
+static reg_errcode_t
+check_subexp_matching_top (re_match_context_t *mctx, re_node_set *cur_nodes,
+ Idx str_idx)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ Idx node_idx;
+ reg_errcode_t err;
+
+ /* TODO: This isn't efficient.
+ Because there might be more than one nodes whose types are
+ OP_OPEN_SUBEXP and whose index is SUBEXP_IDX, we must check all
+ nodes.
+ E.g. RE: (a){2} */
+ for (node_idx = 0; node_idx < cur_nodes->nelem; ++node_idx)
+ {
+ Idx node = cur_nodes->elems[node_idx];
+ if (dfa->nodes[node].type == OP_OPEN_SUBEXP
+ && dfa->nodes[node].opr.idx < BITSET_WORD_BITS
+ && (dfa->used_bkref_map
+ & ((bitset_word_t) 1 << dfa->nodes[node].opr.idx)))
+ {
+ err = match_ctx_add_subtop (mctx, node, str_idx);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ }
+ return REG_NOERROR;
+}
+
+#if 0
+/* Return the next state to which the current state STATE will transit by
+ accepting the current input byte. Return NULL on failure. */
+
+static re_dfastate_t *
+transit_state_sb (reg_errcode_t *err, re_match_context_t *mctx,
+ re_dfastate_t *state)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ re_node_set next_nodes;
+ re_dfastate_t *next_state;
+ Idx node_cnt, cur_str_idx = re_string_cur_idx (&mctx->input);
+ unsigned int context;
+
+ *err = re_node_set_alloc (&next_nodes, state->nodes.nelem + 1);
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ return NULL;
+ for (node_cnt = 0; node_cnt < state->nodes.nelem; ++node_cnt)
+ {
+ Idx cur_node = state->nodes.elems[node_cnt];
+ if (check_node_accept (mctx, dfa->nodes + cur_node, cur_str_idx))
+ {
+ *err = re_node_set_merge (&next_nodes,
+ dfa->eclosures + dfa->nexts[cur_node]);
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ {
+ re_node_set_free (&next_nodes);
+ return NULL;
+ }
+ }
+ }
+ context = re_string_context_at (&mctx->input, cur_str_idx, mctx->eflags);
+ next_state = re_acquire_state_context (err, dfa, &next_nodes, context);
+ /* We don't need to check errors here, since the return value of
+ this function is next_state and ERR is already set. */
+
+ re_node_set_free (&next_nodes);
+ re_string_skip_bytes (&mctx->input, 1);
+ return next_state;
+}
+#endif
+
+static reg_errcode_t
+transit_state_mb (re_match_context_t *mctx, re_dfastate_t *pstate)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ reg_errcode_t err;
+ Idx i;
+
+ for (i = 0; i < pstate->nodes.nelem; ++i)
+ {
+ re_node_set dest_nodes, *new_nodes;
+ Idx cur_node_idx = pstate->nodes.elems[i];
+ int naccepted;
+ Idx dest_idx;
+ unsigned int context;
+ re_dfastate_t *dest_state;
+
+ if (!dfa->nodes[cur_node_idx].accept_mb)
+ continue;
+
+ if (dfa->nodes[cur_node_idx].constraint)
+ {
+ context = re_string_context_at (&mctx->input,
+ re_string_cur_idx (&mctx->input),
+ mctx->eflags);
+ if (NOT_SATISFY_NEXT_CONSTRAINT (dfa->nodes[cur_node_idx].constraint,
+ context))
+ continue;
+ }
+
+ /* How many bytes the node can accept? */
+ naccepted = check_node_accept_bytes (dfa, cur_node_idx, &mctx->input,
+ re_string_cur_idx (&mctx->input));
+ if (naccepted == 0)
+ continue;
+
+ /* The node can accepts 'naccepted' bytes. */
+ dest_idx = re_string_cur_idx (&mctx->input) + naccepted;
+ mctx->max_mb_elem_len = ((mctx->max_mb_elem_len < naccepted) ? naccepted
+ : mctx->max_mb_elem_len);
+ err = clean_state_log_if_needed (mctx, dest_idx);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ DEBUG_ASSERT (dfa->nexts[cur_node_idx] != -1);
+ new_nodes = dfa->eclosures + dfa->nexts[cur_node_idx];
+
+ dest_state = mctx->state_log[dest_idx];
+ if (dest_state == NULL)
+ dest_nodes = *new_nodes;
+ else
+ {
+ err = re_node_set_init_union (&dest_nodes,
+ dest_state->entrance_nodes, new_nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ context = re_string_context_at (&mctx->input, dest_idx - 1,
+ mctx->eflags);
+ mctx->state_log[dest_idx]
+ = re_acquire_state_context (&err, dfa, &dest_nodes, context);
+ if (dest_state != NULL)
+ re_node_set_free (&dest_nodes);
+ if (__glibc_unlikely (mctx->state_log[dest_idx] == NULL
+ && err != REG_NOERROR))
+ return err;
+ }
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+transit_state_bkref (re_match_context_t *mctx, const re_node_set *nodes)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ reg_errcode_t err;
+ Idx i;
+ Idx cur_str_idx = re_string_cur_idx (&mctx->input);
+
+ for (i = 0; i < nodes->nelem; ++i)
+ {
+ Idx dest_str_idx, prev_nelem, bkc_idx;
+ Idx node_idx = nodes->elems[i];
+ unsigned int context;
+ const re_token_t *node = dfa->nodes + node_idx;
+ re_node_set *new_dest_nodes;
+
+ /* Check whether 'node' is a backreference or not. */
+ if (node->type != OP_BACK_REF)
+ continue;
+
+ if (node->constraint)
+ {
+ context = re_string_context_at (&mctx->input, cur_str_idx,
+ mctx->eflags);
+ if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context))
+ continue;
+ }
+
+ /* 'node' is a backreference.
+ Check the substring which the substring matched. */
+ bkc_idx = mctx->nbkref_ents;
+ err = get_subexp (mctx, node_idx, cur_str_idx);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+
+ /* And add the epsilon closures (which is 'new_dest_nodes') of
+ the backreference to appropriate state_log. */
+ DEBUG_ASSERT (dfa->nexts[node_idx] != -1);
+ for (; bkc_idx < mctx->nbkref_ents; ++bkc_idx)
+ {
+ Idx subexp_len;
+ re_dfastate_t *dest_state;
+ struct re_backref_cache_entry *bkref_ent;
+ bkref_ent = mctx->bkref_ents + bkc_idx;
+ if (bkref_ent->node != node_idx || bkref_ent->str_idx != cur_str_idx)
+ continue;
+ subexp_len = bkref_ent->subexp_to - bkref_ent->subexp_from;
+ new_dest_nodes = (subexp_len == 0
+ ? dfa->eclosures + dfa->edests[node_idx].elems[0]
+ : dfa->eclosures + dfa->nexts[node_idx]);
+ dest_str_idx = (cur_str_idx + bkref_ent->subexp_to
+ - bkref_ent->subexp_from);
+ context = re_string_context_at (&mctx->input, dest_str_idx - 1,
+ mctx->eflags);
+ dest_state = mctx->state_log[dest_str_idx];
+ prev_nelem = ((mctx->state_log[cur_str_idx] == NULL) ? 0
+ : mctx->state_log[cur_str_idx]->nodes.nelem);
+ /* Add 'new_dest_node' to state_log. */
+ if (dest_state == NULL)
+ {
+ mctx->state_log[dest_str_idx]
+ = re_acquire_state_context (&err, dfa, new_dest_nodes,
+ context);
+ if (__glibc_unlikely (mctx->state_log[dest_str_idx] == NULL
+ && err != REG_NOERROR))
+ goto free_return;
+ }
+ else
+ {
+ re_node_set dest_nodes;
+ err = re_node_set_init_union (&dest_nodes,
+ dest_state->entrance_nodes,
+ new_dest_nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&dest_nodes);
+ goto free_return;
+ }
+ mctx->state_log[dest_str_idx]
+ = re_acquire_state_context (&err, dfa, &dest_nodes, context);
+ re_node_set_free (&dest_nodes);
+ if (__glibc_unlikely (mctx->state_log[dest_str_idx] == NULL
+ && err != REG_NOERROR))
+ goto free_return;
+ }
+ /* We need to check recursively if the backreference can epsilon
+ transit. */
+ if (subexp_len == 0
+ && mctx->state_log[cur_str_idx]->nodes.nelem > prev_nelem)
+ {
+ err = check_subexp_matching_top (mctx, new_dest_nodes,
+ cur_str_idx);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+ err = transit_state_bkref (mctx, new_dest_nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+ }
+ }
+ }
+ err = REG_NOERROR;
+ free_return:
+ return err;
+}
+
+/* Enumerate all the candidates which the backreference BKREF_NODE can match
+ at BKREF_STR_IDX, and register them by match_ctx_add_entry().
+ Note that we might collect inappropriate candidates here.
+ However, the cost of checking them strictly here is too high, then we
+ delay these checking for prune_impossible_nodes(). */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+get_subexp (re_match_context_t *mctx, Idx bkref_node, Idx bkref_str_idx)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ Idx subexp_num, sub_top_idx;
+ const char *buf = (const char *) re_string_get_buffer (&mctx->input);
+ /* Return if we have already checked BKREF_NODE at BKREF_STR_IDX. */
+ Idx cache_idx = search_cur_bkref_entry (mctx, bkref_str_idx);
+ if (cache_idx != -1)
+ {
+ const struct re_backref_cache_entry *entry
+ = mctx->bkref_ents + cache_idx;
+ do
+ if (entry->node == bkref_node)
+ return REG_NOERROR; /* We already checked it. */
+ while (entry++->more);
+ }
+
+ subexp_num = dfa->nodes[bkref_node].opr.idx;
+
+ /* For each sub expression */
+ for (sub_top_idx = 0; sub_top_idx < mctx->nsub_tops; ++sub_top_idx)
+ {
+ reg_errcode_t err;
+ re_sub_match_top_t *sub_top = mctx->sub_tops[sub_top_idx];
+ re_sub_match_last_t *sub_last;
+ Idx sub_last_idx, sl_str, bkref_str_off;
+
+ if (dfa->nodes[sub_top->node].opr.idx != subexp_num)
+ continue; /* It isn't related. */
+
+ sl_str = sub_top->str_idx;
+ bkref_str_off = bkref_str_idx;
+ /* At first, check the last node of sub expressions we already
+ evaluated. */
+ for (sub_last_idx = 0; sub_last_idx < sub_top->nlasts; ++sub_last_idx)
+ {
+ regoff_t sl_str_diff;
+ sub_last = sub_top->lasts[sub_last_idx];
+ sl_str_diff = sub_last->str_idx - sl_str;
+ /* The matched string by the sub expression match with the substring
+ at the back reference? */
+ if (sl_str_diff > 0)
+ {
+ if (__glibc_unlikely (bkref_str_off + sl_str_diff
+ > mctx->input.valid_len))
+ {
+ /* Not enough chars for a successful match. */
+ if (bkref_str_off + sl_str_diff > mctx->input.len)
+ break;
+
+ err = clean_state_log_if_needed (mctx,
+ bkref_str_off
+ + sl_str_diff);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ buf = (const char *) re_string_get_buffer (&mctx->input);
+ }
+ if (memcmp (buf + bkref_str_off, buf + sl_str, sl_str_diff) != 0)
+ /* We don't need to search this sub expression any more. */
+ break;
+ }
+ bkref_str_off += sl_str_diff;
+ sl_str += sl_str_diff;
+ err = get_subexp_sub (mctx, sub_top, sub_last, bkref_node,
+ bkref_str_idx);
+
+ /* Reload buf, since the preceding call might have reallocated
+ the buffer. */
+ buf = (const char *) re_string_get_buffer (&mctx->input);
+
+ if (err == REG_NOMATCH)
+ continue;
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+
+ if (sub_last_idx < sub_top->nlasts)
+ continue;
+ if (sub_last_idx > 0)
+ ++sl_str;
+ /* Then, search for the other last nodes of the sub expression. */
+ for (; sl_str <= bkref_str_idx; ++sl_str)
+ {
+ Idx cls_node;
+ regoff_t sl_str_off;
+ const re_node_set *nodes;
+ sl_str_off = sl_str - sub_top->str_idx;
+ /* The matched string by the sub expression match with the substring
+ at the back reference? */
+ if (sl_str_off > 0)
+ {
+ if (__glibc_unlikely (bkref_str_off >= mctx->input.valid_len))
+ {
+ /* If we are at the end of the input, we cannot match. */
+ if (bkref_str_off >= mctx->input.len)
+ break;
+
+ err = extend_buffers (mctx, bkref_str_off + 1);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+
+ buf = (const char *) re_string_get_buffer (&mctx->input);
+ }
+ if (buf [bkref_str_off++] != buf[sl_str - 1])
+ break; /* We don't need to search this sub expression
+ any more. */
+ }
+ if (mctx->state_log[sl_str] == NULL)
+ continue;
+ /* Does this state have a ')' of the sub expression? */
+ nodes = &mctx->state_log[sl_str]->nodes;
+ cls_node = find_subexp_node (dfa, nodes, subexp_num,
+ OP_CLOSE_SUBEXP);
+ if (cls_node == -1)
+ continue; /* No. */
+ if (sub_top->path == NULL)
+ {
+ sub_top->path = calloc (sizeof (state_array_t),
+ sl_str - sub_top->str_idx + 1);
+ if (sub_top->path == NULL)
+ return REG_ESPACE;
+ }
+ /* Can the OP_OPEN_SUBEXP node arrive the OP_CLOSE_SUBEXP node
+ in the current context? */
+ err = check_arrival (mctx, sub_top->path, sub_top->node,
+ sub_top->str_idx, cls_node, sl_str,
+ OP_CLOSE_SUBEXP);
+ if (err == REG_NOMATCH)
+ continue;
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ sub_last = match_ctx_add_sublast (sub_top, cls_node, sl_str);
+ if (__glibc_unlikely (sub_last == NULL))
+ return REG_ESPACE;
+ err = get_subexp_sub (mctx, sub_top, sub_last, bkref_node,
+ bkref_str_idx);
+ buf = (const char *) re_string_get_buffer (&mctx->input);
+ if (err == REG_NOMATCH)
+ continue;
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ }
+ return REG_NOERROR;
+}
+
+/* Helper functions for get_subexp(). */
+
+/* Check SUB_LAST can arrive to the back reference BKREF_NODE at BKREF_STR.
+ If it can arrive, register the sub expression expressed with SUB_TOP
+ and SUB_LAST. */
+
+static reg_errcode_t
+get_subexp_sub (re_match_context_t *mctx, const re_sub_match_top_t *sub_top,
+ re_sub_match_last_t *sub_last, Idx bkref_node, Idx bkref_str)
+{
+ reg_errcode_t err;
+ Idx to_idx;
+ /* Can the subexpression arrive the back reference? */
+ err = check_arrival (mctx, &sub_last->path, sub_last->node,
+ sub_last->str_idx, bkref_node, bkref_str,
+ OP_OPEN_SUBEXP);
+ if (err != REG_NOERROR)
+ return err;
+ err = match_ctx_add_entry (mctx, bkref_node, bkref_str, sub_top->str_idx,
+ sub_last->str_idx);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ to_idx = bkref_str + sub_last->str_idx - sub_top->str_idx;
+ return clean_state_log_if_needed (mctx, to_idx);
+}
+
+/* Find the first node which is '(' or ')' and whose index is SUBEXP_IDX.
+ Search '(' if FL_OPEN, or search ')' otherwise.
+ TODO: This function isn't efficient...
+ Because there might be more than one nodes whose types are
+ OP_OPEN_SUBEXP and whose index is SUBEXP_IDX, we must check all
+ nodes.
+ E.g. RE: (a){2} */
+
+static Idx
+find_subexp_node (const re_dfa_t *dfa, const re_node_set *nodes,
+ Idx subexp_idx, int type)
+{
+ Idx cls_idx;
+ for (cls_idx = 0; cls_idx < nodes->nelem; ++cls_idx)
+ {
+ Idx cls_node = nodes->elems[cls_idx];
+ const re_token_t *node = dfa->nodes + cls_node;
+ if (node->type == type
+ && node->opr.idx == subexp_idx)
+ return cls_node;
+ }
+ return -1;
+}
+
+/* Check whether the node TOP_NODE at TOP_STR can arrive to the node
+ LAST_NODE at LAST_STR. We record the path onto PATH since it will be
+ heavily reused.
+ Return REG_NOERROR if it can arrive, REG_NOMATCH if it cannot,
+ REG_ESPACE if memory is exhausted. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+check_arrival (re_match_context_t *mctx, state_array_t *path, Idx top_node,
+ Idx top_str, Idx last_node, Idx last_str, int type)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ reg_errcode_t err = REG_NOERROR;
+ Idx subexp_num, backup_cur_idx, str_idx, null_cnt;
+ re_dfastate_t *cur_state = NULL;
+ re_node_set *cur_nodes, next_nodes;
+ re_dfastate_t **backup_state_log;
+ unsigned int context;
+
+ subexp_num = dfa->nodes[top_node].opr.idx;
+ /* Extend the buffer if we need. */
+ if (__glibc_unlikely (path->alloc < last_str + mctx->max_mb_elem_len + 1))
+ {
+ re_dfastate_t **new_array;
+ Idx old_alloc = path->alloc;
+ Idx incr_alloc = last_str + mctx->max_mb_elem_len + 1;
+ Idx new_alloc;
+ if (__glibc_unlikely (IDX_MAX - old_alloc < incr_alloc))
+ return REG_ESPACE;
+ new_alloc = old_alloc + incr_alloc;
+ if (__glibc_unlikely (SIZE_MAX / sizeof (re_dfastate_t *) < new_alloc))
+ return REG_ESPACE;
+ new_array = re_realloc (path->array, re_dfastate_t *, new_alloc);
+ if (__glibc_unlikely (new_array == NULL))
+ return REG_ESPACE;
+ path->array = new_array;
+ path->alloc = new_alloc;
+ memset (new_array + old_alloc, '\0',
+ sizeof (re_dfastate_t *) * (path->alloc - old_alloc));
+ }
+
+ str_idx = path->next_idx ? path->next_idx : top_str;
+
+ /* Temporary modify MCTX. */
+ backup_state_log = mctx->state_log;
+ backup_cur_idx = mctx->input.cur_idx;
+ mctx->state_log = path->array;
+ mctx->input.cur_idx = str_idx;
+
+ /* Setup initial node set. */
+ context = re_string_context_at (&mctx->input, str_idx - 1, mctx->eflags);
+ if (str_idx == top_str)
+ {
+ err = re_node_set_init_1 (&next_nodes, top_node);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ err = check_arrival_expand_ecl (dfa, &next_nodes, subexp_num, type);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ }
+ else
+ {
+ cur_state = mctx->state_log[str_idx];
+ if (cur_state && cur_state->has_backref)
+ {
+ err = re_node_set_init_copy (&next_nodes, &cur_state->nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ else
+ re_node_set_init_empty (&next_nodes);
+ }
+ if (str_idx == top_str || (cur_state && cur_state->has_backref))
+ {
+ if (next_nodes.nelem)
+ {
+ err = expand_bkref_cache (mctx, &next_nodes, str_idx,
+ subexp_num, type);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ }
+ cur_state = re_acquire_state_context (&err, dfa, &next_nodes, context);
+ if (__glibc_unlikely (cur_state == NULL && err != REG_NOERROR))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ mctx->state_log[str_idx] = cur_state;
+ }
+
+ for (null_cnt = 0; str_idx < last_str && null_cnt <= mctx->max_mb_elem_len;)
+ {
+ re_node_set_empty (&next_nodes);
+ if (mctx->state_log[str_idx + 1])
+ {
+ err = re_node_set_merge (&next_nodes,
+ &mctx->state_log[str_idx + 1]->nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ }
+ if (cur_state)
+ {
+ err = check_arrival_add_next_nodes (mctx, str_idx,
+ &cur_state->non_eps_nodes,
+ &next_nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ }
+ ++str_idx;
+ if (next_nodes.nelem)
+ {
+ err = check_arrival_expand_ecl (dfa, &next_nodes, subexp_num, type);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ err = expand_bkref_cache (mctx, &next_nodes, str_idx,
+ subexp_num, type);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ }
+ context = re_string_context_at (&mctx->input, str_idx - 1, mctx->eflags);
+ cur_state = re_acquire_state_context (&err, dfa, &next_nodes, context);
+ if (__glibc_unlikely (cur_state == NULL && err != REG_NOERROR))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ mctx->state_log[str_idx] = cur_state;
+ null_cnt = cur_state == NULL ? null_cnt + 1 : 0;
+ }
+ re_node_set_free (&next_nodes);
+ cur_nodes = (mctx->state_log[last_str] == NULL ? NULL
+ : &mctx->state_log[last_str]->nodes);
+ path->next_idx = str_idx;
+
+ /* Fix MCTX. */
+ mctx->state_log = backup_state_log;
+ mctx->input.cur_idx = backup_cur_idx;
+
+ /* Then check the current node set has the node LAST_NODE. */
+ if (cur_nodes != NULL && re_node_set_contains (cur_nodes, last_node))
+ return REG_NOERROR;
+
+ return REG_NOMATCH;
+}
+
+/* Helper functions for check_arrival. */
+
+/* Calculate the destination nodes of CUR_NODES at STR_IDX, and append them
+ to NEXT_NODES.
+ TODO: This function is similar to the functions transit_state*(),
+ however this function has many additional works.
+ Can't we unify them? */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+check_arrival_add_next_nodes (re_match_context_t *mctx, Idx str_idx,
+ re_node_set *cur_nodes, re_node_set *next_nodes)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ bool ok;
+ Idx cur_idx;
+ reg_errcode_t err = REG_NOERROR;
+ re_node_set union_set;
+ re_node_set_init_empty (&union_set);
+ for (cur_idx = 0; cur_idx < cur_nodes->nelem; ++cur_idx)
+ {
+ int naccepted = 0;
+ Idx cur_node = cur_nodes->elems[cur_idx];
+ DEBUG_ASSERT (!IS_EPSILON_NODE (dfa->nodes[cur_node].type));
+
+ /* If the node may accept "multi byte". */
+ if (dfa->nodes[cur_node].accept_mb)
+ {
+ naccepted = check_node_accept_bytes (dfa, cur_node, &mctx->input,
+ str_idx);
+ if (naccepted > 1)
+ {
+ re_dfastate_t *dest_state;
+ Idx next_node = dfa->nexts[cur_node];
+ Idx next_idx = str_idx + naccepted;
+ dest_state = mctx->state_log[next_idx];
+ re_node_set_empty (&union_set);
+ if (dest_state)
+ {
+ err = re_node_set_merge (&union_set, &dest_state->nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&union_set);
+ return err;
+ }
+ }
+ ok = re_node_set_insert (&union_set, next_node);
+ if (__glibc_unlikely (! ok))
+ {
+ re_node_set_free (&union_set);
+ return REG_ESPACE;
+ }
+ mctx->state_log[next_idx] = re_acquire_state (&err, dfa,
+ &union_set);
+ if (__glibc_unlikely (mctx->state_log[next_idx] == NULL
+ && err != REG_NOERROR))
+ {
+ re_node_set_free (&union_set);
+ return err;
+ }
+ }
+ }
+
+ if (naccepted
+ || check_node_accept (mctx, dfa->nodes + cur_node, str_idx))
+ {
+ ok = re_node_set_insert (next_nodes, dfa->nexts[cur_node]);
+ if (__glibc_unlikely (! ok))
+ {
+ re_node_set_free (&union_set);
+ return REG_ESPACE;
+ }
+ }
+ }
+ re_node_set_free (&union_set);
+ return REG_NOERROR;
+}
+
+/* For all the nodes in CUR_NODES, add the epsilon closures of them to
+ CUR_NODES, however exclude the nodes which are:
+ - inside the sub expression whose number is EX_SUBEXP, if FL_OPEN.
+ - out of the sub expression whose number is EX_SUBEXP, if !FL_OPEN.
+*/
+
+static reg_errcode_t
+check_arrival_expand_ecl (const re_dfa_t *dfa, re_node_set *cur_nodes,
+ Idx ex_subexp, int type)
+{
+ reg_errcode_t err;
+ Idx idx, outside_node;
+ re_node_set new_nodes;
+ DEBUG_ASSERT (cur_nodes->nelem);
+ err = re_node_set_alloc (&new_nodes, cur_nodes->nelem);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ /* Create a new node set NEW_NODES with the nodes which are epsilon
+ closures of the node in CUR_NODES. */
+
+ for (idx = 0; idx < cur_nodes->nelem; ++idx)
+ {
+ Idx cur_node = cur_nodes->elems[idx];
+ const re_node_set *eclosure = dfa->eclosures + cur_node;
+ outside_node = find_subexp_node (dfa, eclosure, ex_subexp, type);
+ if (outside_node == -1)
+ {
+ /* There are no problematic nodes, just merge them. */
+ err = re_node_set_merge (&new_nodes, eclosure);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&new_nodes);
+ return err;
+ }
+ }
+ else
+ {
+ /* There are problematic nodes, re-calculate incrementally. */
+ err = check_arrival_expand_ecl_sub (dfa, &new_nodes, cur_node,
+ ex_subexp, type);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&new_nodes);
+ return err;
+ }
+ }
+ }
+ re_node_set_free (cur_nodes);
+ *cur_nodes = new_nodes;
+ return REG_NOERROR;
+}
+
+/* Helper function for check_arrival_expand_ecl.
+ Check incrementally the epsilon closure of TARGET, and if it isn't
+ problematic append it to DST_NODES. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+check_arrival_expand_ecl_sub (const re_dfa_t *dfa, re_node_set *dst_nodes,
+ Idx target, Idx ex_subexp, int type)
+{
+ Idx cur_node;
+ for (cur_node = target; !re_node_set_contains (dst_nodes, cur_node);)
+ {
+ bool ok;
+
+ if (dfa->nodes[cur_node].type == type
+ && dfa->nodes[cur_node].opr.idx == ex_subexp)
+ {
+ if (type == OP_CLOSE_SUBEXP)
+ {
+ ok = re_node_set_insert (dst_nodes, cur_node);
+ if (__glibc_unlikely (! ok))
+ return REG_ESPACE;
+ }
+ break;
+ }
+ ok = re_node_set_insert (dst_nodes, cur_node);
+ if (__glibc_unlikely (! ok))
+ return REG_ESPACE;
+ if (dfa->edests[cur_node].nelem == 0)
+ break;
+ if (dfa->edests[cur_node].nelem == 2)
+ {
+ reg_errcode_t err;
+ err = check_arrival_expand_ecl_sub (dfa, dst_nodes,
+ dfa->edests[cur_node].elems[1],
+ ex_subexp, type);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ cur_node = dfa->edests[cur_node].elems[0];
+ }
+ return REG_NOERROR;
+}
+
+
+/* For all the back references in the current state, calculate the
+ destination of the back references by the appropriate entry
+ in MCTX->BKREF_ENTS. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+expand_bkref_cache (re_match_context_t *mctx, re_node_set *cur_nodes,
+ Idx cur_str, Idx subexp_num, int type)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ reg_errcode_t err;
+ Idx cache_idx_start = search_cur_bkref_entry (mctx, cur_str);
+ struct re_backref_cache_entry *ent;
+
+ if (cache_idx_start == -1)
+ return REG_NOERROR;
+
+ restart:
+ ent = mctx->bkref_ents + cache_idx_start;
+ do
+ {
+ Idx to_idx, next_node;
+
+ /* Is this entry ENT is appropriate? */
+ if (!re_node_set_contains (cur_nodes, ent->node))
+ continue; /* No. */
+
+ to_idx = cur_str + ent->subexp_to - ent->subexp_from;
+ /* Calculate the destination of the back reference, and append it
+ to MCTX->STATE_LOG. */
+ if (to_idx == cur_str)
+ {
+ /* The backreference did epsilon transit, we must re-check all the
+ node in the current state. */
+ re_node_set new_dests;
+ reg_errcode_t err2, err3;
+ next_node = dfa->edests[ent->node].elems[0];
+ if (re_node_set_contains (cur_nodes, next_node))
+ continue;
+ err = re_node_set_init_1 (&new_dests, next_node);
+ err2 = check_arrival_expand_ecl (dfa, &new_dests, subexp_num, type);
+ err3 = re_node_set_merge (cur_nodes, &new_dests);
+ re_node_set_free (&new_dests);
+ if (__glibc_unlikely (err != REG_NOERROR || err2 != REG_NOERROR
+ || err3 != REG_NOERROR))
+ {
+ err = (err != REG_NOERROR ? err
+ : (err2 != REG_NOERROR ? err2 : err3));
+ return err;
+ }
+ /* TODO: It is still inefficient... */
+ goto restart;
+ }
+ else
+ {
+ re_node_set union_set;
+ next_node = dfa->nexts[ent->node];
+ if (mctx->state_log[to_idx])
+ {
+ bool ok;
+ if (re_node_set_contains (&mctx->state_log[to_idx]->nodes,
+ next_node))
+ continue;
+ err = re_node_set_init_copy (&union_set,
+ &mctx->state_log[to_idx]->nodes);
+ ok = re_node_set_insert (&union_set, next_node);
+ if (__glibc_unlikely (err != REG_NOERROR || ! ok))
+ {
+ re_node_set_free (&union_set);
+ err = err != REG_NOERROR ? err : REG_ESPACE;
+ return err;
+ }
+ }
+ else
+ {
+ err = re_node_set_init_1 (&union_set, next_node);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ mctx->state_log[to_idx] = re_acquire_state (&err, dfa, &union_set);
+ re_node_set_free (&union_set);
+ if (__glibc_unlikely (mctx->state_log[to_idx] == NULL
+ && err != REG_NOERROR))
+ return err;
+ }
+ }
+ while (ent++->more);
+ return REG_NOERROR;
+}
+
+/* Build transition table for the state.
+ Return true if successful. */
+
+static bool __attribute_noinline__
+build_trtable (const re_dfa_t *dfa, re_dfastate_t *state)
+{
+ reg_errcode_t err;
+ Idx i, j;
+ int ch;
+ bool need_word_trtable = false;
+ bitset_word_t elem, mask;
+ Idx ndests; /* Number of the destination states from 'state'. */
+ re_dfastate_t **trtable;
+ re_dfastate_t *dest_states[SBC_MAX];
+ re_dfastate_t *dest_states_word[SBC_MAX];
+ re_dfastate_t *dest_states_nl[SBC_MAX];
+ re_node_set follows;
+ bitset_t acceptable;
+
+ /* We build DFA states which corresponds to the destination nodes
+ from 'state'. 'dests_node[i]' represents the nodes which i-th
+ destination state contains, and 'dests_ch[i]' represents the
+ characters which i-th destination state accepts. */
+ re_node_set dests_node[SBC_MAX];
+ bitset_t dests_ch[SBC_MAX];
+
+ /* Initialize transition table. */
+ state->word_trtable = state->trtable = NULL;
+
+ /* At first, group all nodes belonging to 'state' into several
+ destinations. */
+ ndests = group_nodes_into_DFAstates (dfa, state, dests_node, dests_ch);
+ if (__glibc_unlikely (ndests <= 0))
+ {
+ /* Return false in case of an error, true otherwise. */
+ if (ndests == 0)
+ {
+ state->trtable = (re_dfastate_t **)
+ calloc (sizeof (re_dfastate_t *), SBC_MAX);
+ if (__glibc_unlikely (state->trtable == NULL))
+ return false;
+ return true;
+ }
+ return false;
+ }
+
+ err = re_node_set_alloc (&follows, ndests + 1);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ out_free:
+ re_node_set_free (&follows);
+ for (i = 0; i < ndests; ++i)
+ re_node_set_free (dests_node + i);
+ return false;
+ }
+
+ bitset_empty (acceptable);
+
+ /* Then build the states for all destinations. */
+ for (i = 0; i < ndests; ++i)
+ {
+ Idx next_node;
+ re_node_set_empty (&follows);
+ /* Merge the follows of this destination states. */
+ for (j = 0; j < dests_node[i].nelem; ++j)
+ {
+ next_node = dfa->nexts[dests_node[i].elems[j]];
+ if (next_node != -1)
+ {
+ err = re_node_set_merge (&follows, dfa->eclosures + next_node);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto out_free;
+ }
+ }
+ dest_states[i] = re_acquire_state_context (&err, dfa, &follows, 0);
+ if (__glibc_unlikely (dest_states[i] == NULL && err != REG_NOERROR))
+ goto out_free;
+ /* If the new state has context constraint,
+ build appropriate states for these contexts. */
+ if (dest_states[i]->has_constraint)
+ {
+ dest_states_word[i] = re_acquire_state_context (&err, dfa, &follows,
+ CONTEXT_WORD);
+ if (__glibc_unlikely (dest_states_word[i] == NULL
+ && err != REG_NOERROR))
+ goto out_free;
+
+ if (dest_states[i] != dest_states_word[i] && dfa->mb_cur_max > 1)
+ need_word_trtable = true;
+
+ dest_states_nl[i] = re_acquire_state_context (&err, dfa, &follows,
+ CONTEXT_NEWLINE);
+ if (__glibc_unlikely (dest_states_nl[i] == NULL && err != REG_NOERROR))
+ goto out_free;
+ }
+ else
+ {
+ dest_states_word[i] = dest_states[i];
+ dest_states_nl[i] = dest_states[i];
+ }
+ bitset_merge (acceptable, dests_ch[i]);
+ }
+
+ if (!__glibc_unlikely (need_word_trtable))
+ {
+ /* We don't care about whether the following character is a word
+ character, or we are in a single-byte character set so we can
+ discern by looking at the character code: allocate a
+ 256-entry transition table. */
+ trtable = state->trtable =
+ (re_dfastate_t **) calloc (sizeof (re_dfastate_t *), SBC_MAX);
+ if (__glibc_unlikely (trtable == NULL))
+ goto out_free;
+
+ /* For all characters ch...: */
+ for (i = 0; i < BITSET_WORDS; ++i)
+ for (ch = i * BITSET_WORD_BITS, elem = acceptable[i], mask = 1;
+ elem;
+ mask <<= 1, elem >>= 1, ++ch)
+ if (__glibc_unlikely (elem & 1))
+ {
+ /* There must be exactly one destination which accepts
+ character ch. See group_nodes_into_DFAstates. */
+ for (j = 0; (dests_ch[j][i] & mask) == 0; ++j)
+ ;
+
+ /* j-th destination accepts the word character ch. */
+ if (dfa->word_char[i] & mask)
+ trtable[ch] = dest_states_word[j];
+ else
+ trtable[ch] = dest_states[j];
+ }
+ }
+ else
+ {
+ /* We care about whether the following character is a word
+ character, and we are in a multi-byte character set: discern
+ by looking at the character code: build two 256-entry
+ transition tables, one starting at trtable[0] and one
+ starting at trtable[SBC_MAX]. */
+ trtable = state->word_trtable =
+ (re_dfastate_t **) calloc (sizeof (re_dfastate_t *), 2 * SBC_MAX);
+ if (__glibc_unlikely (trtable == NULL))
+ goto out_free;
+
+ /* For all characters ch...: */
+ for (i = 0; i < BITSET_WORDS; ++i)
+ for (ch = i * BITSET_WORD_BITS, elem = acceptable[i], mask = 1;
+ elem;
+ mask <<= 1, elem >>= 1, ++ch)
+ if (__glibc_unlikely (elem & 1))
+ {
+ /* There must be exactly one destination which accepts
+ character ch. See group_nodes_into_DFAstates. */
+ for (j = 0; (dests_ch[j][i] & mask) == 0; ++j)
+ ;
+
+ /* j-th destination accepts the word character ch. */
+ trtable[ch] = dest_states[j];
+ trtable[ch + SBC_MAX] = dest_states_word[j];
+ }
+ }
+
+ /* new line */
+ if (bitset_contain (acceptable, NEWLINE_CHAR))
+ {
+ /* The current state accepts newline character. */
+ for (j = 0; j < ndests; ++j)
+ if (bitset_contain (dests_ch[j], NEWLINE_CHAR))
+ {
+ /* k-th destination accepts newline character. */
+ trtable[NEWLINE_CHAR] = dest_states_nl[j];
+ if (need_word_trtable)
+ trtable[NEWLINE_CHAR + SBC_MAX] = dest_states_nl[j];
+ /* There must be only one destination which accepts
+ newline. See group_nodes_into_DFAstates. */
+ break;
+ }
+ }
+
+ re_node_set_free (&follows);
+ for (i = 0; i < ndests; ++i)
+ re_node_set_free (dests_node + i);
+ return true;
+}
+
+/* Group all nodes belonging to STATE into several destinations.
+ Then for all destinations, set the nodes belonging to the destination
+ to DESTS_NODE[i] and set the characters accepted by the destination
+ to DEST_CH[i]. Return the number of destinations if successful,
+ -1 on internal error. */
+
+static Idx
+group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
+ re_node_set *dests_node, bitset_t *dests_ch)
+{
+ reg_errcode_t err;
+ bool ok;
+ Idx i, j, k;
+ Idx ndests; /* Number of the destinations from 'state'. */
+ bitset_t accepts; /* Characters a node can accept. */
+ const re_node_set *cur_nodes = &state->nodes;
+ bitset_empty (accepts);
+ ndests = 0;
+
+ /* For all the nodes belonging to 'state', */
+ for (i = 0; i < cur_nodes->nelem; ++i)
+ {
+ re_token_t *node = &dfa->nodes[cur_nodes->elems[i]];
+ re_token_type_t type = node->type;
+ unsigned int constraint = node->constraint;
+
+ /* Enumerate all single byte character this node can accept. */
+ if (type == CHARACTER)
+ bitset_set (accepts, node->opr.c);
+ else if (type == SIMPLE_BRACKET)
+ {
+ bitset_merge (accepts, node->opr.sbcset);
+ }
+ else if (type == OP_PERIOD)
+ {
+ if (dfa->mb_cur_max > 1)
+ bitset_merge (accepts, dfa->sb_char);
+ else
+ bitset_set_all (accepts);
+ if (!(dfa->syntax & RE_DOT_NEWLINE))
+ bitset_clear (accepts, '\n');
+ if (dfa->syntax & RE_DOT_NOT_NULL)
+ bitset_clear (accepts, '\0');
+ }
+ else if (type == OP_UTF8_PERIOD)
+ {
+ if (ASCII_CHARS % BITSET_WORD_BITS == 0)
+ memset (accepts, -1, ASCII_CHARS / CHAR_BIT);
+ else
+ bitset_merge (accepts, utf8_sb_map);
+ if (!(dfa->syntax & RE_DOT_NEWLINE))
+ bitset_clear (accepts, '\n');
+ if (dfa->syntax & RE_DOT_NOT_NULL)
+ bitset_clear (accepts, '\0');
+ }
+ else
+ continue;
+
+ /* Check the 'accepts' and sift the characters which are not
+ match it the context. */
+ if (constraint)
+ {
+ if (constraint & NEXT_NEWLINE_CONSTRAINT)
+ {
+ bool accepts_newline = bitset_contain (accepts, NEWLINE_CHAR);
+ bitset_empty (accepts);
+ if (accepts_newline)
+ bitset_set (accepts, NEWLINE_CHAR);
+ else
+ continue;
+ }
+ if (constraint & NEXT_ENDBUF_CONSTRAINT)
+ {
+ bitset_empty (accepts);
+ continue;
+ }
+
+ if (constraint & NEXT_WORD_CONSTRAINT)
+ {
+ bitset_word_t any_set = 0;
+ if (type == CHARACTER && !node->word_char)
+ {
+ bitset_empty (accepts);
+ continue;
+ }
+ if (dfa->mb_cur_max > 1)
+ for (j = 0; j < BITSET_WORDS; ++j)
+ any_set |= (accepts[j] &= (dfa->word_char[j] | ~dfa->sb_char[j]));
+ else
+ for (j = 0; j < BITSET_WORDS; ++j)
+ any_set |= (accepts[j] &= dfa->word_char[j]);
+ if (!any_set)
+ continue;
+ }
+ if (constraint & NEXT_NOTWORD_CONSTRAINT)
+ {
+ bitset_word_t any_set = 0;
+ if (type == CHARACTER && node->word_char)
+ {
+ bitset_empty (accepts);
+ continue;
+ }
+ if (dfa->mb_cur_max > 1)
+ for (j = 0; j < BITSET_WORDS; ++j)
+ any_set |= (accepts[j] &= ~(dfa->word_char[j] & dfa->sb_char[j]));
+ else
+ for (j = 0; j < BITSET_WORDS; ++j)
+ any_set |= (accepts[j] &= ~dfa->word_char[j]);
+ if (!any_set)
+ continue;
+ }
+ }
+
+ /* Then divide 'accepts' into DFA states, or create a new
+ state. Above, we make sure that accepts is not empty. */
+ for (j = 0; j < ndests; ++j)
+ {
+ bitset_t intersec; /* Intersection sets, see below. */
+ bitset_t remains;
+ /* Flags, see below. */
+ bitset_word_t has_intersec, not_subset, not_consumed;
+
+ /* Optimization, skip if this state doesn't accept the character. */
+ if (type == CHARACTER && !bitset_contain (dests_ch[j], node->opr.c))
+ continue;
+
+ /* Enumerate the intersection set of this state and 'accepts'. */
+ has_intersec = 0;
+ for (k = 0; k < BITSET_WORDS; ++k)
+ has_intersec |= intersec[k] = accepts[k] & dests_ch[j][k];
+ /* And skip if the intersection set is empty. */
+ if (!has_intersec)
+ continue;
+
+ /* Then check if this state is a subset of 'accepts'. */
+ not_subset = not_consumed = 0;
+ for (k = 0; k < BITSET_WORDS; ++k)
+ {
+ not_subset |= remains[k] = ~accepts[k] & dests_ch[j][k];
+ not_consumed |= accepts[k] = accepts[k] & ~dests_ch[j][k];
+ }
+
+ /* If this state isn't a subset of 'accepts', create a
+ new group state, which has the 'remains'. */
+ if (not_subset)
+ {
+ bitset_copy (dests_ch[ndests], remains);
+ bitset_copy (dests_ch[j], intersec);
+ err = re_node_set_init_copy (dests_node + ndests, &dests_node[j]);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto error_return;
+ ++ndests;
+ }
+
+ /* Put the position in the current group. */
+ ok = re_node_set_insert (&dests_node[j], cur_nodes->elems[i]);
+ if (__glibc_unlikely (! ok))
+ goto error_return;
+
+ /* If all characters are consumed, go to next node. */
+ if (!not_consumed)
+ break;
+ }
+ /* Some characters remain, create a new group. */
+ if (j == ndests)
+ {
+ bitset_copy (dests_ch[ndests], accepts);
+ err = re_node_set_init_1 (dests_node + ndests, cur_nodes->elems[i]);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto error_return;
+ ++ndests;
+ bitset_empty (accepts);
+ }
+ }
+ assume (ndests <= SBC_MAX);
+ return ndests;
+ error_return:
+ for (j = 0; j < ndests; ++j)
+ re_node_set_free (dests_node + j);
+ return -1;
+}
+
+/* Check how many bytes the node 'dfa->nodes[node_idx]' accepts.
+ Return the number of the bytes the node accepts.
+ STR_IDX is the current index of the input string.
+
+ This function handles the nodes which can accept one character, or
+ one collating element like '.', '[a-z]', opposite to the other nodes
+ can only accept one byte. */
+
+#ifdef _LIBC
+# include <locale/weight.h>
+#endif
+
+static int
+check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx,
+ const re_string_t *input, Idx str_idx)
+{
+ const re_token_t *node = dfa->nodes + node_idx;
+ int char_len, elem_len;
+ Idx i;
+
+ if (__glibc_unlikely (node->type == OP_UTF8_PERIOD))
+ {
+ unsigned char c = re_string_byte_at (input, str_idx), d;
+ if (__glibc_likely (c < 0xc2))
+ return 0;
+
+ if (str_idx + 2 > input->len)
+ return 0;
+
+ d = re_string_byte_at (input, str_idx + 1);
+ if (c < 0xe0)
+ return (d < 0x80 || d > 0xbf) ? 0 : 2;
+ else if (c < 0xf0)
+ {
+ char_len = 3;
+ if (c == 0xe0 && d < 0xa0)
+ return 0;
+ }
+ else if (c < 0xf8)
+ {
+ char_len = 4;
+ if (c == 0xf0 && d < 0x90)
+ return 0;
+ }
+ else if (c < 0xfc)
+ {
+ char_len = 5;
+ if (c == 0xf8 && d < 0x88)
+ return 0;
+ }
+ else if (c < 0xfe)
+ {
+ char_len = 6;
+ if (c == 0xfc && d < 0x84)
+ return 0;
+ }
+ else
+ return 0;
+
+ if (str_idx + char_len > input->len)
+ return 0;
+
+ for (i = 1; i < char_len; ++i)
+ {
+ d = re_string_byte_at (input, str_idx + i);
+ if (d < 0x80 || d > 0xbf)
+ return 0;
+ }
+ return char_len;
+ }
+
+ char_len = re_string_char_size_at (input, str_idx);
+ if (node->type == OP_PERIOD)
+ {
+ if (char_len <= 1)
+ return 0;
+ /* FIXME: I don't think this if is needed, as both '\n'
+ and '\0' are char_len == 1. */
+ /* '.' accepts any one character except the following two cases. */
+ if ((!(dfa->syntax & RE_DOT_NEWLINE)
+ && re_string_byte_at (input, str_idx) == '\n')
+ || ((dfa->syntax & RE_DOT_NOT_NULL)
+ && re_string_byte_at (input, str_idx) == '\0'))
+ return 0;
+ return char_len;
+ }
+
+ elem_len = re_string_elem_size_at (input, str_idx);
+ if ((elem_len <= 1 && char_len <= 1) || char_len == 0)
+ return 0;
+
+ if (node->type == COMPLEX_BRACKET)
+ {
+ const re_charset_t *cset = node->opr.mbcset;
+#ifdef _LIBC
+ const unsigned char *pin
+ = ((const unsigned char *) re_string_get_buffer (input) + str_idx);
+ Idx j;
+ uint32_t nrules;
+#endif
+ int match_len = 0;
+ wchar_t wc = ((cset->nranges || cset->nchar_classes || cset->nmbchars)
+ ? re_string_wchar_at (input, str_idx) : 0);
+
+ /* match with multibyte character? */
+ for (i = 0; i < cset->nmbchars; ++i)
+ if (wc == cset->mbchars[i])
+ {
+ match_len = char_len;
+ goto check_node_accept_bytes_match;
+ }
+ /* match with character_class? */
+ for (i = 0; i < cset->nchar_classes; ++i)
+ {
+ wctype_t wt = cset->char_classes[i];
+ if (__iswctype (wc, wt))
+ {
+ match_len = char_len;
+ goto check_node_accept_bytes_match;
+ }
+ }
+
+#ifdef _LIBC
+ nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+ if (nrules != 0)
+ {
+ unsigned int in_collseq = 0;
+ const int32_t *table, *indirect;
+ const unsigned char *weights, *extra;
+ const char *collseqwc;
+
+ /* match with collating_symbol? */
+ if (cset->ncoll_syms)
+ extra = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB);
+ for (i = 0; i < cset->ncoll_syms; ++i)
+ {
+ const unsigned char *coll_sym = extra + cset->coll_syms[i];
+ /* Compare the length of input collating element and
+ the length of current collating element. */
+ if (*coll_sym != elem_len)
+ continue;
+ /* Compare each bytes. */
+ for (j = 0; j < *coll_sym; j++)
+ if (pin[j] != coll_sym[1 + j])
+ break;
+ if (j == *coll_sym)
+ {
+ /* Match if every bytes is equal. */
+ match_len = j;
+ goto check_node_accept_bytes_match;
+ }
+ }
+
+ if (cset->nranges)
+ {
+ if (elem_len <= char_len)
+ {
+ collseqwc = _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQWC);
+ in_collseq = __collseq_table_lookup (collseqwc, wc);
+ }
+ else
+ in_collseq = find_collation_sequence_value (pin, elem_len);
+ }
+ /* match with range expression? */
+ /* FIXME: Implement rational ranges here, too. */
+ for (i = 0; i < cset->nranges; ++i)
+ if (cset->range_starts[i] <= in_collseq
+ && in_collseq <= cset->range_ends[i])
+ {
+ match_len = elem_len;
+ goto check_node_accept_bytes_match;
+ }
+
+ /* match with equivalence_class? */
+ if (cset->nequiv_classes)
+ {
+ const unsigned char *cp = pin;
+ table = (const int32_t *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
+ weights = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTMB);
+ extra = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB);
+ indirect = (const int32_t *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB);
+ int32_t idx = findidx (table, indirect, extra, &cp, elem_len);
+ int32_t rule = idx >> 24;
+ idx &= 0xffffff;
+ if (idx > 0)
+ {
+ size_t weight_len = weights[idx];
+ for (i = 0; i < cset->nequiv_classes; ++i)
+ {
+ int32_t equiv_class_idx = cset->equiv_classes[i];
+ int32_t equiv_class_rule = equiv_class_idx >> 24;
+ equiv_class_idx &= 0xffffff;
+ if (weights[equiv_class_idx] == weight_len
+ && equiv_class_rule == rule
+ && memcmp (weights + idx + 1,
+ weights + equiv_class_idx + 1,
+ weight_len) == 0)
+ {
+ match_len = elem_len;
+ goto check_node_accept_bytes_match;
+ }
+ }
+ }
+ }
+ }
+ else
+#endif /* _LIBC */
+ {
+ /* match with range expression? */
+ for (i = 0; i < cset->nranges; ++i)
+ {
+ if (cset->range_starts[i] <= wc && wc <= cset->range_ends[i])
+ {
+ match_len = char_len;
+ goto check_node_accept_bytes_match;
+ }
+ }
+ }
+ check_node_accept_bytes_match:
+ if (!cset->non_match)
+ return match_len;
+ else
+ {
+ if (match_len > 0)
+ return 0;
+ else
+ return (elem_len > char_len) ? elem_len : char_len;
+ }
+ }
+ return 0;
+}
+
+#ifdef _LIBC
+static unsigned int
+find_collation_sequence_value (const unsigned char *mbs, size_t mbs_len)
+{
+ uint32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+ if (nrules == 0)
+ {
+ if (mbs_len == 1)
+ {
+ /* No valid character. Match it as a single byte character. */
+ const unsigned char *collseq = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQMB);
+ return collseq[mbs[0]];
+ }
+ return UINT_MAX;
+ }
+ else
+ {
+ int32_t idx;
+ const unsigned char *extra = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB);
+ int32_t extrasize = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB + 1) - extra;
+
+ for (idx = 0; idx < extrasize;)
+ {
+ int mbs_cnt;
+ bool found = false;
+ int32_t elem_mbs_len;
+ /* Skip the name of collating element name. */
+ idx = idx + extra[idx] + 1;
+ elem_mbs_len = extra[idx++];
+ if (mbs_len == elem_mbs_len)
+ {
+ for (mbs_cnt = 0; mbs_cnt < elem_mbs_len; ++mbs_cnt)
+ if (extra[idx + mbs_cnt] != mbs[mbs_cnt])
+ break;
+ if (mbs_cnt == elem_mbs_len)
+ /* Found the entry. */
+ found = true;
+ }
+ /* Skip the byte sequence of the collating element. */
+ idx += elem_mbs_len;
+ /* Adjust for the alignment. */
+ idx = (idx + 3) & ~3;
+ /* Skip the collation sequence value. */
+ idx += sizeof (uint32_t);
+ /* Skip the wide char sequence of the collating element. */
+ idx = idx + sizeof (uint32_t) * (*(int32_t *) (extra + idx) + 1);
+ /* If we found the entry, return the sequence value. */
+ if (found)
+ return *(uint32_t *) (extra + idx);
+ /* Skip the collation sequence value. */
+ idx += sizeof (uint32_t);
+ }
+ return UINT_MAX;
+ }
+}
+#endif /* _LIBC */
+
+/* Check whether the node accepts the byte which is IDX-th
+ byte of the INPUT. */
+
+static bool
+check_node_accept (const re_match_context_t *mctx, const re_token_t *node,
+ Idx idx)
+{
+ unsigned char ch;
+ ch = re_string_byte_at (&mctx->input, idx);
+ switch (node->type)
+ {
+ case CHARACTER:
+ if (node->opr.c != ch)
+ return false;
+ break;
+
+ case SIMPLE_BRACKET:
+ if (!bitset_contain (node->opr.sbcset, ch))
+ return false;
+ break;
+
+ case OP_UTF8_PERIOD:
+ if (ch >= ASCII_CHARS)
+ return false;
+ FALLTHROUGH;
+ case OP_PERIOD:
+ if ((ch == '\n' && !(mctx->dfa->syntax & RE_DOT_NEWLINE))
+ || (ch == '\0' && (mctx->dfa->syntax & RE_DOT_NOT_NULL)))
+ return false;
+ break;
+
+ default:
+ return false;
+ }
+
+ if (node->constraint)
+ {
+ /* The node has constraints. Check whether the current context
+ satisfies the constraints. */
+ unsigned int context = re_string_context_at (&mctx->input, idx,
+ mctx->eflags);
+ if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context))
+ return false;
+ }
+
+ return true;
+}
+
+/* Extend the buffers, if the buffers have run out. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+extend_buffers (re_match_context_t *mctx, int min_len)
+{
+ reg_errcode_t ret;
+ re_string_t *pstr = &mctx->input;
+
+ /* Avoid overflow. */
+ if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) / 2
+ <= pstr->bufs_len))
+ return REG_ESPACE;
+
+ /* Double the lengths of the buffers, but allocate at least MIN_LEN. */
+ ret = re_string_realloc_buffers (pstr,
+ MAX (min_len,
+ MIN (pstr->len, pstr->bufs_len * 2)));
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+
+ if (mctx->state_log != NULL)
+ {
+ /* And double the length of state_log. */
+ /* XXX We have no indication of the size of this buffer. If this
+ allocation fail we have no indication that the state_log array
+ does not have the right size. */
+ re_dfastate_t **new_array = re_realloc (mctx->state_log, re_dfastate_t *,
+ pstr->bufs_len + 1);
+ if (__glibc_unlikely (new_array == NULL))
+ return REG_ESPACE;
+ mctx->state_log = new_array;
+ }
+
+ /* Then reconstruct the buffers. */
+ if (pstr->icase)
+ {
+ if (pstr->mb_cur_max > 1)
+ {
+ ret = build_wcs_upper_buffer (pstr);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+ }
+ else
+ build_upper_buffer (pstr);
+ }
+ else
+ {
+ if (pstr->mb_cur_max > 1)
+ build_wcs_buffer (pstr);
+ else
+ {
+ if (pstr->trans != NULL)
+ re_string_translate_buffer (pstr);
+ }
+ }
+ return REG_NOERROR;
+}
+
+
+/* Functions for matching context. */
+
+/* Initialize MCTX. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+match_ctx_init (re_match_context_t *mctx, int eflags, Idx n)
+{
+ mctx->eflags = eflags;
+ mctx->match_last = -1;
+ if (n > 0)
+ {
+ /* Avoid overflow. */
+ size_t max_object_size =
+ MAX (sizeof (struct re_backref_cache_entry),
+ sizeof (re_sub_match_top_t *));
+ if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / max_object_size) < n))
+ return REG_ESPACE;
+
+ mctx->bkref_ents = re_malloc (struct re_backref_cache_entry, n);
+ mctx->sub_tops = re_malloc (re_sub_match_top_t *, n);
+ if (__glibc_unlikely (mctx->bkref_ents == NULL || mctx->sub_tops == NULL))
+ return REG_ESPACE;
+ }
+ /* Already zero-ed by the caller.
+ else
+ mctx->bkref_ents = NULL;
+ mctx->nbkref_ents = 0;
+ mctx->nsub_tops = 0; */
+ mctx->abkref_ents = n;
+ mctx->max_mb_elem_len = 1;
+ mctx->asub_tops = n;
+ return REG_NOERROR;
+}
+
+/* Clean the entries which depend on the current input in MCTX.
+ This function must be invoked when the matcher changes the start index
+ of the input, or changes the input string. */
+
+static void
+match_ctx_clean (re_match_context_t *mctx)
+{
+ Idx st_idx;
+ for (st_idx = 0; st_idx < mctx->nsub_tops; ++st_idx)
+ {
+ Idx sl_idx;
+ re_sub_match_top_t *top = mctx->sub_tops[st_idx];
+ for (sl_idx = 0; sl_idx < top->nlasts; ++sl_idx)
+ {
+ re_sub_match_last_t *last = top->lasts[sl_idx];
+ re_free (last->path.array);
+ re_free (last);
+ }
+ re_free (top->lasts);
+ if (top->path)
+ {
+ re_free (top->path->array);
+ re_free (top->path);
+ }
+ re_free (top);
+ }
+
+ mctx->nsub_tops = 0;
+ mctx->nbkref_ents = 0;
+}
+
+/* Free all the memory associated with MCTX. */
+
+static void
+match_ctx_free (re_match_context_t *mctx)
+{
+ /* First, free all the memory associated with MCTX->SUB_TOPS. */
+ match_ctx_clean (mctx);
+ re_free (mctx->sub_tops);
+ re_free (mctx->bkref_ents);
+}
+
+/* Add a new backreference entry to MCTX.
+ Note that we assume that caller never call this function with duplicate
+ entry, and call with STR_IDX which isn't smaller than any existing entry.
+*/
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+match_ctx_add_entry (re_match_context_t *mctx, Idx node, Idx str_idx, Idx from,
+ Idx to)
+{
+ if (mctx->nbkref_ents >= mctx->abkref_ents)
+ {
+ struct re_backref_cache_entry* new_entry;
+ new_entry = re_realloc (mctx->bkref_ents, struct re_backref_cache_entry,
+ mctx->abkref_ents * 2);
+ if (__glibc_unlikely (new_entry == NULL))
+ {
+ re_free (mctx->bkref_ents);
+ return REG_ESPACE;
+ }
+ mctx->bkref_ents = new_entry;
+ memset (mctx->bkref_ents + mctx->nbkref_ents, '\0',
+ sizeof (struct re_backref_cache_entry) * mctx->abkref_ents);
+ mctx->abkref_ents *= 2;
+ }
+ if (mctx->nbkref_ents > 0
+ && mctx->bkref_ents[mctx->nbkref_ents - 1].str_idx == str_idx)
+ mctx->bkref_ents[mctx->nbkref_ents - 1].more = 1;
+
+ mctx->bkref_ents[mctx->nbkref_ents].node = node;
+ mctx->bkref_ents[mctx->nbkref_ents].str_idx = str_idx;
+ mctx->bkref_ents[mctx->nbkref_ents].subexp_from = from;
+ mctx->bkref_ents[mctx->nbkref_ents].subexp_to = to;
+
+ /* This is a cache that saves negative results of check_dst_limits_calc_pos.
+ If bit N is clear, means that this entry won't epsilon-transition to
+ an OP_OPEN_SUBEXP or OP_CLOSE_SUBEXP for the N+1-th subexpression. If
+ it is set, check_dst_limits_calc_pos_1 will recurse and try to find one
+ such node.
+
+ A backreference does not epsilon-transition unless it is empty, so set
+ to all zeros if FROM != TO. */
+ mctx->bkref_ents[mctx->nbkref_ents].eps_reachable_subexps_map
+ = (from == to ? -1 : 0);
+
+ mctx->bkref_ents[mctx->nbkref_ents++].more = 0;
+ if (mctx->max_mb_elem_len < to - from)
+ mctx->max_mb_elem_len = to - from;
+ return REG_NOERROR;
+}
+
+/* Return the first entry with the same str_idx, or -1 if none is
+ found. Note that MCTX->BKREF_ENTS is already sorted by MCTX->STR_IDX. */
+
+static Idx
+search_cur_bkref_entry (const re_match_context_t *mctx, Idx str_idx)
+{
+ Idx left, right, mid, last;
+ last = right = mctx->nbkref_ents;
+ for (left = 0; left < right;)
+ {
+ mid = (left + right) / 2;
+ if (mctx->bkref_ents[mid].str_idx < str_idx)
+ left = mid + 1;
+ else
+ right = mid;
+ }
+ if (left < last && mctx->bkref_ents[left].str_idx == str_idx)
+ return left;
+ else
+ return -1;
+}
+
+/* Register the node NODE, whose type is OP_OPEN_SUBEXP, and which matches
+ at STR_IDX. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+match_ctx_add_subtop (re_match_context_t *mctx, Idx node, Idx str_idx)
+{
+ DEBUG_ASSERT (mctx->sub_tops != NULL);
+ DEBUG_ASSERT (mctx->asub_tops > 0);
+ if (__glibc_unlikely (mctx->nsub_tops == mctx->asub_tops))
+ {
+ Idx new_asub_tops = mctx->asub_tops * 2;
+ re_sub_match_top_t **new_array = re_realloc (mctx->sub_tops,
+ re_sub_match_top_t *,
+ new_asub_tops);
+ if (__glibc_unlikely (new_array == NULL))
+ return REG_ESPACE;
+ mctx->sub_tops = new_array;
+ mctx->asub_tops = new_asub_tops;
+ }
+ mctx->sub_tops[mctx->nsub_tops] = calloc (1, sizeof (re_sub_match_top_t));
+ if (__glibc_unlikely (mctx->sub_tops[mctx->nsub_tops] == NULL))
+ return REG_ESPACE;
+ mctx->sub_tops[mctx->nsub_tops]->node = node;
+ mctx->sub_tops[mctx->nsub_tops++]->str_idx = str_idx;
+ return REG_NOERROR;
+}
+
+/* Register the node NODE, whose type is OP_CLOSE_SUBEXP, and which matches
+ at STR_IDX, whose corresponding OP_OPEN_SUBEXP is SUB_TOP.
+ Return the new entry if successful, NULL if memory is exhausted. */
+
+static re_sub_match_last_t *
+match_ctx_add_sublast (re_sub_match_top_t *subtop, Idx node, Idx str_idx)
+{
+ re_sub_match_last_t *new_entry;
+ if (__glibc_unlikely (subtop->nlasts == subtop->alasts))
+ {
+ Idx new_alasts = 2 * subtop->alasts + 1;
+ re_sub_match_last_t **new_array = re_realloc (subtop->lasts,
+ re_sub_match_last_t *,
+ new_alasts);
+ if (__glibc_unlikely (new_array == NULL))
+ return NULL;
+ subtop->lasts = new_array;
+ subtop->alasts = new_alasts;
+ }
+ new_entry = calloc (1, sizeof (re_sub_match_last_t));
+ if (__glibc_likely (new_entry != NULL))
+ {
+ subtop->lasts[subtop->nlasts] = new_entry;
+ new_entry->node = node;
+ new_entry->str_idx = str_idx;
+ ++subtop->nlasts;
+ }
+ return new_entry;
+}
+
+static void
+sift_ctx_init (re_sift_context_t *sctx, re_dfastate_t **sifted_sts,
+ re_dfastate_t **limited_sts, Idx last_node, Idx last_str_idx)
+{
+ sctx->sifted_states = sifted_sts;
+ sctx->limited_states = limited_sts;
+ sctx->last_node = last_node;
+ sctx->last_str_idx = last_str_idx;
+ re_node_set_init_empty (&sctx->limits);
+}
diff --git a/gl/lib/rename.c b/gl/lib/rename.c
new file mode 100644
index 0000000..119abe5
--- /dev/null
+++ b/gl/lib/rename.c
@@ -0,0 +1,477 @@
+/* Work around rename bugs in some systems.
+
+ Copyright (C) 2001-2003, 2005-2006, 2009-2022 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 2.1 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 Volker Borchert, Eric Blake. */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#undef rename
+
+#if defined _WIN32 && ! defined __CYGWIN__
+/* The mingw rename has problems with trailing slashes; it also
+ requires use of native Windows calls to allow atomic renames over
+ existing files. */
+
+# include <errno.h>
+# include <stdbool.h>
+# include <stdlib.h>
+# include <sys/stat.h>
+# include <unistd.h>
+
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+
+# include "dirname.h"
+
+/* Don't assume that UNICODE is not defined. */
+# undef MoveFileEx
+# define MoveFileEx MoveFileExA
+
+/* Rename the file SRC to DST. This replacement is necessary on
+ Windows, on which the system rename function will not replace
+ an existing DST. */
+int
+rpl_rename (char const *src, char const *dst)
+{
+ int error;
+ size_t src_len = strlen (src);
+ size_t dst_len = strlen (dst);
+ char *src_base = last_component (src);
+ char *dst_base = last_component (dst);
+ bool src_slash;
+ bool dst_slash;
+ bool dst_exists;
+ struct stat src_st;
+ struct stat dst_st;
+
+ /* Filter out dot as last component. */
+ if (!src_len || !dst_len)
+ {
+ errno = ENOENT;
+ return -1;
+ }
+ if (*src_base == '.')
+ {
+ size_t len = base_len (src_base);
+ if (len == 1 || (len == 2 && src_base[1] == '.'))
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ }
+ if (*dst_base == '.')
+ {
+ size_t len = base_len (dst_base);
+ if (len == 1 || (len == 2 && dst_base[1] == '.'))
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ }
+
+ /* Presence of a trailing slash requires directory semantics. If
+ the source does not exist, or if the destination cannot be turned
+ into a directory, give up now. Otherwise, strip trailing slashes
+ before calling rename. There are no symlinks on mingw, so stat
+ works instead of lstat. */
+ src_slash = ISSLASH (src[src_len - 1]);
+ dst_slash = ISSLASH (dst[dst_len - 1]);
+ if (stat (src, &src_st))
+ return -1;
+ if (stat (dst, &dst_st))
+ {
+ if (errno != ENOENT || (!S_ISDIR (src_st.st_mode) && dst_slash))
+ return -1;
+ dst_exists = false;
+ }
+ else
+ {
+ if (S_ISDIR (dst_st.st_mode) != S_ISDIR (src_st.st_mode))
+ {
+ errno = S_ISDIR (dst_st.st_mode) ? EISDIR : ENOTDIR;
+ return -1;
+ }
+ dst_exists = true;
+ }
+
+ /* There are no symlinks, so if a file existed with a trailing
+ slash, it must be a directory, and we don't have to worry about
+ stripping strip trailing slash. However, mingw refuses to
+ replace an existing empty directory, so we have to help it out.
+ And canonicalize_file_name is not yet ported to mingw; however,
+ for directories, getcwd works as a viable alternative. Ensure
+ that we can get back to where we started before using it; later
+ attempts to return are fatal. Note that we can end up losing a
+ directory if rename then fails, but it was empty, so not much
+ damage was done. */
+ if (dst_exists && S_ISDIR (dst_st.st_mode))
+ {
+ char *cwd = getcwd (NULL, 0);
+ char *src_temp;
+ char *dst_temp;
+ if (!cwd || chdir (cwd))
+ return -1;
+ if (IS_ABSOLUTE_FILE_NAME (src))
+ {
+ dst_temp = chdir (dst) ? NULL : getcwd (NULL, 0);
+ src_temp = chdir (src) ? NULL : getcwd (NULL, 0);
+ }
+ else
+ {
+ src_temp = chdir (src) ? NULL : getcwd (NULL, 0);
+ if (!IS_ABSOLUTE_FILE_NAME (dst) && chdir (cwd))
+ abort ();
+ dst_temp = chdir (dst) ? NULL : getcwd (NULL, 0);
+ }
+ if (chdir (cwd))
+ abort ();
+ free (cwd);
+ if (!src_temp || !dst_temp)
+ {
+ free (src_temp);
+ free (dst_temp);
+ errno = ENOMEM;
+ return -1;
+ }
+ src_len = strlen (src_temp);
+ if (strncmp (src_temp, dst_temp, src_len) == 0
+ && (ISSLASH (dst_temp[src_len]) || dst_temp[src_len] == '\0'))
+ {
+ error = dst_temp[src_len];
+ free (src_temp);
+ free (dst_temp);
+ if (error)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ return 0;
+ }
+ if (rmdir (dst))
+ {
+ free (src_temp);
+ free (dst_temp);
+ return -1;
+ }
+ free (src_temp);
+ free (dst_temp);
+ }
+
+ /* MoveFileEx works if SRC is a directory without any flags, but
+ fails with MOVEFILE_REPLACE_EXISTING, so try without flags first.
+ Thankfully, MoveFileEx handles hard links correctly, even though
+ rename() does not. */
+ if (MoveFileEx (src, dst, 0))
+ return 0;
+
+ /* Retry with MOVEFILE_REPLACE_EXISTING if the move failed
+ due to the destination already existing. */
+ error = GetLastError ();
+ if (error == ERROR_FILE_EXISTS || error == ERROR_ALREADY_EXISTS)
+ {
+ if (MoveFileEx (src, dst, MOVEFILE_REPLACE_EXISTING))
+ return 0;
+
+ error = GetLastError ();
+ }
+
+ switch (error)
+ {
+ case ERROR_FILE_NOT_FOUND:
+ case ERROR_PATH_NOT_FOUND:
+ case ERROR_BAD_PATHNAME:
+ case ERROR_DIRECTORY:
+ errno = ENOENT;
+ break;
+
+ case ERROR_ACCESS_DENIED:
+ case ERROR_SHARING_VIOLATION:
+ errno = EACCES;
+ break;
+
+ case ERROR_OUTOFMEMORY:
+ errno = ENOMEM;
+ break;
+
+ case ERROR_CURRENT_DIRECTORY:
+ errno = EBUSY;
+ break;
+
+ case ERROR_NOT_SAME_DEVICE:
+ errno = EXDEV;
+ break;
+
+ case ERROR_WRITE_PROTECT:
+ errno = EROFS;
+ break;
+
+ case ERROR_WRITE_FAULT:
+ case ERROR_READ_FAULT:
+ case ERROR_GEN_FAILURE:
+ errno = EIO;
+ break;
+
+ case ERROR_HANDLE_DISK_FULL:
+ case ERROR_DISK_FULL:
+ case ERROR_DISK_TOO_FRAGMENTED:
+ errno = ENOSPC;
+ break;
+
+ case ERROR_FILE_EXISTS:
+ case ERROR_ALREADY_EXISTS:
+ errno = EEXIST;
+ break;
+
+ case ERROR_BUFFER_OVERFLOW:
+ case ERROR_FILENAME_EXCED_RANGE:
+ errno = ENAMETOOLONG;
+ break;
+
+ case ERROR_INVALID_NAME:
+ case ERROR_DELETE_PENDING:
+ errno = EPERM; /* ? */
+ break;
+
+# ifndef ERROR_FILE_TOO_LARGE
+/* This value is documented but not defined in all versions of windows.h. */
+# define ERROR_FILE_TOO_LARGE 223
+# endif
+ case ERROR_FILE_TOO_LARGE:
+ errno = EFBIG;
+ break;
+
+ default:
+ errno = EINVAL;
+ break;
+ }
+
+ return -1;
+}
+
+#else /* ! W32 platform */
+
+# include <errno.h>
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+# include <sys/stat.h>
+# include <unistd.h>
+
+# include "dirname.h"
+# include "same-inode.h"
+
+/* Rename the file SRC to DST, fixing any trailing slash bugs. */
+
+int
+rpl_rename (char const *src, char const *dst)
+{
+ size_t src_len = strlen (src);
+ size_t dst_len = strlen (dst);
+ char *src_temp = (char *) src;
+ char *dst_temp = (char *) dst;
+ bool src_slash;
+ bool dst_slash;
+ _GL_UNUSED bool dst_exists;
+ int ret_val = -1;
+ int rename_errno = ENOTDIR;
+ struct stat src_st;
+ struct stat dst_st;
+
+ if (!src_len || !dst_len)
+ return rename (src, dst); /* Let strace see the ENOENT failure. */
+
+# if RENAME_DEST_EXISTS_BUG
+ {
+ char *src_base = last_component (src);
+ char *dst_base = last_component (dst);
+ if (*src_base == '.')
+ {
+ size_t len = base_len (src_base);
+ if (len == 1 || (len == 2 && src_base[1] == '.'))
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ }
+ if (*dst_base == '.')
+ {
+ size_t len = base_len (dst_base);
+ if (len == 1 || (len == 2 && dst_base[1] == '.'))
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ }
+ }
+# endif /* RENAME_DEST_EXISTS_BUG */
+
+ src_slash = src[src_len - 1] == '/';
+ dst_slash = dst[dst_len - 1] == '/';
+
+# if !RENAME_HARD_LINK_BUG && !RENAME_DEST_EXISTS_BUG
+ /* If there are no trailing slashes, then trust the native
+ implementation unless we also suspect issues with hard link
+ detection or file/directory conflicts. */
+ if (!src_slash && !dst_slash)
+ return rename (src, dst);
+# endif /* !RENAME_HARD_LINK_BUG && !RENAME_DEST_EXISTS_BUG */
+
+ /* Presence of a trailing slash requires directory semantics. If
+ the source does not exist, or if the destination cannot be turned
+ into a directory, give up now. Otherwise, strip trailing slashes
+ before calling rename. */
+ if (lstat (src, &src_st))
+ return -1;
+ if (lstat (dst, &dst_st))
+ {
+ if (errno != ENOENT || (!S_ISDIR (src_st.st_mode) && dst_slash))
+ return -1;
+ dst_exists = false;
+ }
+ else
+ {
+ if (S_ISDIR (dst_st.st_mode) != S_ISDIR (src_st.st_mode))
+ {
+ errno = S_ISDIR (dst_st.st_mode) ? EISDIR : ENOTDIR;
+ return -1;
+ }
+# if RENAME_HARD_LINK_BUG
+ if (SAME_INODE (src_st, dst_st))
+ return 0;
+# endif /* RENAME_HARD_LINK_BUG */
+ dst_exists = true;
+ }
+
+# if (RENAME_TRAILING_SLASH_SOURCE_BUG || RENAME_DEST_EXISTS_BUG \
+ || RENAME_HARD_LINK_BUG)
+ /* If the only bug was that a trailing slash was allowed on a
+ non-existing file destination, as in Solaris 10, then we've
+ already covered that situation. But if there is any problem with
+ a trailing slash on an existing source or destination, as in
+ Solaris 9, or if a directory can overwrite a symlink, as on
+ Cygwin 1.5, or if directories cannot be created with trailing
+ slash, as on NetBSD 1.6, then we must strip the offending slash
+ and check that we have not encountered a symlink instead of a
+ directory.
+
+ Stripping a trailing slash interferes with POSIX semantics, where
+ rename behavior on a symlink with a trailing slash operates on
+ the corresponding target directory. We prefer the GNU semantics
+ of rejecting any use of a symlink with trailing slash, but do not
+ enforce them, since Solaris 10 is able to obey POSIX semantics
+ and there might be clients expecting it, as counter-intuitive as
+ those semantics are.
+
+ Technically, we could also follow the POSIX behavior by chasing a
+ readlink trail, but that is harder to implement. */
+ if (src_slash)
+ {
+ src_temp = strdup (src);
+ if (!src_temp)
+ {
+ /* Rather than rely on strdup-posix, we set errno ourselves. */
+ rename_errno = ENOMEM;
+ goto out;
+ }
+ strip_trailing_slashes (src_temp);
+ if (lstat (src_temp, &src_st))
+ {
+ rename_errno = errno;
+ goto out;
+ }
+ if (S_ISLNK (src_st.st_mode))
+ goto out;
+ }
+ if (dst_slash)
+ {
+ dst_temp = strdup (dst);
+ if (!dst_temp)
+ {
+ rename_errno = ENOMEM;
+ goto out;
+ }
+ strip_trailing_slashes (dst_temp);
+ if (lstat (dst_temp, &dst_st))
+ {
+ if (errno != ENOENT)
+ {
+ rename_errno = errno;
+ goto out;
+ }
+ }
+ else if (S_ISLNK (dst_st.st_mode))
+ goto out;
+ }
+# endif /* RENAME_TRAILING_SLASH_SOURCE_BUG || RENAME_DEST_EXISTS_BUG
+ || RENAME_HARD_LINK_BUG */
+
+# if RENAME_DEST_EXISTS_BUG
+ /* Cygwin 1.5 sometimes behaves oddly when moving a non-empty
+ directory on top of an empty one (the old directory name can
+ reappear if the new directory tree is removed). Work around this
+ by removing the target first, but don't remove the target if it
+ is a subdirectory of the source. Note that we can end up losing
+ a directory if rename then fails, but it was empty, so not much
+ damage was done. */
+ if (dst_exists && S_ISDIR (dst_st.st_mode))
+ {
+ if (src_st.st_dev != dst_st.st_dev)
+ {
+ rename_errno = EXDEV;
+ goto out;
+ }
+ if (src_temp != src)
+ free (src_temp);
+ src_temp = canonicalize_file_name (src);
+ if (dst_temp != dst)
+ free (dst_temp);
+ dst_temp = canonicalize_file_name (dst);
+ if (!src_temp || !dst_temp)
+ {
+ rename_errno = ENOMEM;
+ goto out;
+ }
+ src_len = strlen (src_temp);
+ if (strncmp (src_temp, dst_temp, src_len) == 0
+ && dst_temp[src_len] == '/')
+ {
+ rename_errno = EINVAL;
+ goto out;
+ }
+ if (rmdir (dst))
+ {
+ rename_errno = errno;
+ goto out;
+ }
+ }
+# endif /* RENAME_DEST_EXISTS_BUG */
+
+ ret_val = rename (src_temp, dst_temp);
+ rename_errno = errno;
+
+ out: _GL_UNUSED_LABEL;
+
+ if (src_temp != src)
+ free (src_temp);
+ if (dst_temp != dst)
+ free (dst_temp);
+ errno = rename_errno;
+ return ret_val;
+}
+#endif /* ! W32 platform */
diff --git a/gl/lib/renameat.c b/gl/lib/renameat.c
new file mode 100644
index 0000000..f08be7b
--- /dev/null
+++ b/gl/lib/renameat.c
@@ -0,0 +1,25 @@
+/* Rename a file relative to open directories.
+ Copyright 2017-2022 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 <stdio.h>
+#include "renameatu.h"
+
+int
+renameat (int fd1, char const *src, int fd2, char const *dst)
+{
+ return renameatu (fd1, src, fd2, dst, 0);
+}
diff --git a/gl/lib/renameatu.c b/gl/lib/renameatu.c
new file mode 100644
index 0000000..7ba186c
--- /dev/null
+++ b/gl/lib/renameatu.c
@@ -0,0 +1,255 @@
+/* Rename a file relative to open directories.
+ Copyright (C) 2009-2022 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 Eric Blake and Paul Eggert */
+
+#include <config.h>
+
+#include "renameatu.h"
+
+#include <errno.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#ifdef __linux__
+# include <sys/syscall.h>
+#endif
+
+static int
+errno_fail (int e)
+{
+ errno = e;
+ return -1;
+}
+
+#if HAVE_RENAMEAT
+
+# include <stdbool.h>
+# include <stdlib.h>
+# include <string.h>
+
+# include "dirname.h"
+# include "openat.h"
+
+#else
+# include "openat-priv.h"
+
+static int
+rename_noreplace (char const *src, char const *dst)
+{
+ /* This has a race between the call to lstat and the call to rename. */
+ struct stat st;
+ return (lstat (dst, &st) == 0 || errno == EOVERFLOW ? errno_fail (EEXIST)
+ : errno == ENOENT ? rename (src, dst)
+ : -1);
+}
+#endif
+
+#undef renameat
+
+#if HAVE_RENAMEAT
+
+/* Act like renameat (FD1, SRC, FD2, DST), except fail with EEXIST if
+ FLAGS is nonzero and it is easy to fail atomically if DST already exists.
+ This lets renameatu be atomic when it can be implemented in terms
+ of renameatx_np. */
+static int
+renameat2ish (int fd1, char const *src, int fd2, char const *dst,
+ unsigned int flags)
+{
+# ifdef RENAME_EXCL
+ if (flags)
+ {
+ int r = renameatx_np (fd1, src, fd2, dst, RENAME_EXCL);
+ if (r == 0 || errno != ENOTSUP)
+ return r;
+ }
+# endif
+
+ return renameat (fd1, src, fd2, dst);
+}
+#endif
+
+/* Rename FILE1, in the directory open on descriptor FD1, to FILE2, in
+ the directory open on descriptor FD2. If possible, do it without
+ changing the working directory. Otherwise, resort to using
+ save_cwd/fchdir, then rename/restore_cwd. If either the save_cwd or
+ the restore_cwd fails, then give a diagnostic and exit nonzero.
+
+ Obey FLAGS when doing the renaming. If FLAGS is zero, this
+ function is equivalent to renameat (FD1, SRC, FD2, DST).
+ Otherwise, attempt to implement FLAGS even if the implementation is
+ not atomic; this differs from the GNU/Linux native renameat2,
+ which fails if it cannot guarantee atomicity. */
+
+int
+renameatu (int fd1, char const *src, int fd2, char const *dst,
+ unsigned int flags)
+{
+ int ret_val = -1;
+ int err = EINVAL;
+
+#ifdef HAVE_RENAMEAT2
+ ret_val = renameat2 (fd1, src, fd2, dst, flags);
+ err = errno;
+#elif defined SYS_renameat2
+ ret_val = syscall (SYS_renameat2, fd1, src, fd2, dst, flags);
+ err = errno;
+#endif
+
+ if (! (ret_val < 0 && (err == EINVAL || err == ENOSYS || err == ENOTSUP)))
+ return ret_val;
+
+#if HAVE_RENAMEAT
+ {
+ size_t src_len;
+ size_t dst_len;
+ char *src_temp = (char *) src;
+ char *dst_temp = (char *) dst;
+ bool src_slash;
+ bool dst_slash;
+ int rename_errno = ENOTDIR;
+ struct stat src_st;
+ struct stat dst_st;
+ bool dst_found_nonexistent = false;
+
+ switch (flags)
+ {
+ case 0:
+ break;
+
+ case RENAME_NOREPLACE:
+ /* This has a race between the call to fstatat and the calls to
+ renameat below. This fstatat is needed even if RENAME_EXCL
+ is defined, because RENAME_EXCL is buggy on macOS 11.2:
+ renameatx_np (fd, "X", fd, "X", RENAME_EXCL) incorrectly
+ succeeds when X exists. */
+ if (fstatat (fd2, dst, &dst_st, AT_SYMLINK_NOFOLLOW) == 0
+ || errno == EOVERFLOW)
+ return errno_fail (EEXIST);
+ if (errno != ENOENT)
+ return -1;
+ dst_found_nonexistent = true;
+ break;
+
+ default:
+ return errno_fail (ENOTSUP);
+ }
+
+ /* Let strace see any ENOENT failure. */
+ src_len = strlen (src);
+ dst_len = strlen (dst);
+ if (!src_len || !dst_len)
+ return renameat2ish (fd1, src, fd2, dst, flags);
+
+ src_slash = src[src_len - 1] == '/';
+ dst_slash = dst[dst_len - 1] == '/';
+ if (!src_slash && !dst_slash)
+ return renameat2ish (fd1, src, fd2, dst, flags);
+
+ /* Presence of a trailing slash requires directory semantics. If
+ the source does not exist, or if the destination cannot be turned
+ into a directory, give up now. Otherwise, strip trailing slashes
+ before calling rename. */
+ if (fstatat (fd1, src, &src_st, AT_SYMLINK_NOFOLLOW))
+ return -1;
+ if (dst_found_nonexistent)
+ {
+ if (!S_ISDIR (src_st.st_mode))
+ return errno_fail (ENOENT);
+ }
+ else if (fstatat (fd2, dst, &dst_st, AT_SYMLINK_NOFOLLOW))
+ {
+ if (errno != ENOENT || !S_ISDIR (src_st.st_mode))
+ return -1;
+ }
+ else if (!S_ISDIR (dst_st.st_mode))
+ return errno_fail (ENOTDIR);
+ else if (!S_ISDIR (src_st.st_mode))
+ return errno_fail (EISDIR);
+
+# if RENAME_TRAILING_SLASH_SOURCE_BUG
+ /* See the lengthy comment in rename.c why Solaris 9 is forced to
+ GNU behavior, while Solaris 10 is left with POSIX behavior,
+ regarding symlinks with trailing slash. */
+ ret_val = -1;
+ if (src_slash)
+ {
+ src_temp = strdup (src);
+ if (!src_temp)
+ {
+ /* Rather than rely on strdup-posix, we set errno ourselves. */
+ rename_errno = ENOMEM;
+ goto out;
+ }
+ strip_trailing_slashes (src_temp);
+ if (fstatat (fd1, src_temp, &src_st, AT_SYMLINK_NOFOLLOW))
+ {
+ rename_errno = errno;
+ goto out;
+ }
+ if (S_ISLNK (src_st.st_mode))
+ goto out;
+ }
+ if (dst_slash)
+ {
+ dst_temp = strdup (dst);
+ if (!dst_temp)
+ {
+ rename_errno = ENOMEM;
+ goto out;
+ }
+ strip_trailing_slashes (dst_temp);
+ char readlink_buf[1];
+ if (readlinkat (fd2, dst_temp, readlink_buf, sizeof readlink_buf) < 0)
+ {
+ if (errno != ENOENT && errno != EINVAL)
+ {
+ rename_errno = errno;
+ goto out;
+ }
+ }
+ else
+ goto out;
+ }
+# endif /* RENAME_TRAILING_SLASH_SOURCE_BUG */
+
+ /* renameat does not honor trailing / on Solaris 10. Solve it in a
+ similar manner to rename. No need to worry about bugs not present
+ on Solaris, since all other systems either lack renameat or honor
+ trailing slash correctly. */
+
+ ret_val = renameat2ish (fd1, src_temp, fd2, dst_temp, flags);
+ rename_errno = errno;
+ goto out;
+ out:
+ if (src_temp != src)
+ free (src_temp);
+ if (dst_temp != dst)
+ free (dst_temp);
+ errno = rename_errno;
+ return ret_val;
+ }
+#else /* !HAVE_RENAMEAT */
+
+ /* RENAME_NOREPLACE is the only flag currently supported. */
+ if (flags & ~RENAME_NOREPLACE)
+ return errno_fail (ENOTSUP);
+ return at_func2 (fd1, src, fd2, dst, flags ? rename_noreplace : rename);
+
+#endif /* !HAVE_RENAMEAT */
+}
diff --git a/gl/lib/renameatu.h b/gl/lib/renameatu.h
new file mode 100644
index 0000000..239df4c
--- /dev/null
+++ b/gl/lib/renameatu.h
@@ -0,0 +1,28 @@
+/* Rename a file relative to open directories.
+ Copyright 2017-2022 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 */
+
+/* Get RENAME_* macros from <stdio.h> if present, otherwise supply
+ the traditional Linux values. */
+#include <stdio.h>
+#ifndef RENAME_NOREPLACE
+# define RENAME_NOREPLACE (1 << 0)
+# define RENAME_EXCHANGE (1 << 1)
+# define RENAME_WHITEOUT (1 << 2)
+#endif
+
+extern int renameatu (int, char const *, int, char const *, unsigned int);
diff --git a/gl/lib/rewinddir.c b/gl/lib/rewinddir.c
new file mode 100644
index 0000000..b07aaf9
--- /dev/null
+++ b/gl/lib/rewinddir.c
@@ -0,0 +1,53 @@
+/* Restart reading the entries of a directory from the beginning.
+ Copyright (C) 2011-2022 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <dirent.h>
+
+#include <errno.h>
+
+#include "dirent-private.h"
+
+/* Don't assume that UNICODE is not defined. */
+#undef FindFirstFile
+#define FindFirstFile FindFirstFileA
+
+void
+rewinddir (DIR *dirp)
+{
+ /* Like in closedir(). */
+ if (dirp->current != INVALID_HANDLE_VALUE)
+ FindClose (dirp->current);
+
+ /* Like in opendir(). */
+ dirp->status = -1;
+ dirp->current = FindFirstFile (dirp->dir_name_mask, &dirp->entry);
+ if (dirp->current == INVALID_HANDLE_VALUE)
+ {
+ switch (GetLastError ())
+ {
+ case ERROR_FILE_NOT_FOUND:
+ dirp->status = -2;
+ break;
+ default:
+ /* Save the error code for the next readdir() call. */
+ dirp->status = ENOENT;
+ break;
+ }
+ }
+}
diff --git a/gl/lib/rmdir.c b/gl/lib/rmdir.c
new file mode 100644
index 0000000..8c8b75e
--- /dev/null
+++ b/gl/lib/rmdir.c
@@ -0,0 +1,56 @@
+/* Work around rmdir bugs.
+
+ Copyright (C) 1988, 1990, 1999, 2003-2006, 2009-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include <errno.h>
+#include <string.h>
+
+#include "filename.h"
+
+#undef rmdir
+#if defined _WIN32 && !defined __CYGWIN__
+# define rmdir _rmdir
+#endif
+
+/* Remove directory DIR.
+ Return 0 if successful, -1 if not. */
+
+int
+rpl_rmdir (char const *dir)
+{
+ /* Work around cygwin 1.5.x bug where rmdir("dir/./") succeeds. */
+ size_t len = strlen (dir);
+ int result;
+ while (len && ISSLASH (dir[len - 1]))
+ len--;
+ if (len && dir[len - 1] == '.' && (1 == len || ISSLASH (dir[len - 2])))
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ result = rmdir (dir);
+ /* Work around mingw bug, where rmdir("file/") fails with EINVAL
+ instead of ENOTDIR. We've already filtered out trailing ., the
+ only reason allowed by POSIX for EINVAL. */
+ if (result == -1 && errno == EINVAL)
+ errno = ENOTDIR;
+ return result;
+}
diff --git a/gl/lib/same-inode.h b/gl/lib/same-inode.h
new file mode 100644
index 0000000..f65f3d0
--- /dev/null
+++ b/gl/lib/same-inode.h
@@ -0,0 +1,47 @@
+/* Determine whether two stat buffers are known to refer to the same file.
+
+ Copyright (C) 2006, 2009-2022 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 2.1 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/>. */
+
+#ifndef SAME_INODE_H
+# define SAME_INODE_H 1
+
+# include <sys/types.h>
+
+# if defined __VMS && __CRTL_VER < 80200000
+# define SAME_INODE(a, b) \
+ ((a).st_ino[0] == (b).st_ino[0] \
+ && (a).st_ino[1] == (b).st_ino[1] \
+ && (a).st_ino[2] == (b).st_ino[2] \
+ && (a).st_dev == (b).st_dev)
+# elif defined _WIN32 && ! defined __CYGWIN__
+ /* Native Windows. */
+# if _GL_WINDOWS_STAT_INODES
+ /* stat() and fstat() set st_dev and st_ino to 0 if information about
+ the inode is not available. */
+# define SAME_INODE(a, b) \
+ (!((a).st_ino == 0 && (a).st_dev == 0) \
+ && (a).st_ino == (b).st_ino && (a).st_dev == (b).st_dev)
+# else
+ /* stat() and fstat() set st_ino to 0 always. */
+# define SAME_INODE(a, b) 0
+# endif
+# else
+# define SAME_INODE(a, b) \
+ ((a).st_ino == (b).st_ino \
+ && (a).st_dev == (b).st_dev)
+# endif
+
+#endif
diff --git a/gl/lib/save-cwd.c b/gl/lib/save-cwd.c
new file mode 100644
index 0000000..ea487a4
--- /dev/null
+++ b/gl/lib/save-cwd.c
@@ -0,0 +1,97 @@
+/* save-cwd.c -- Save and restore current working directory.
+
+ Copyright (C) 1995, 1997-1998, 2003-2006, 2009-2022 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 "save-cwd.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "chdir-long.h"
+#include "unistd--.h"
+
+#if GNULIB_FCNTL_SAFER
+# include "fcntl--.h"
+#else
+# define GNULIB_FCNTL_SAFER 0
+#endif
+
+/* Record the location of the current working directory in CWD so that
+ the program may change to other directories and later use restore_cwd
+ to return to the recorded location. This function may allocate
+ space using malloc (via getcwd) or leave a file descriptor open;
+ use free_cwd to perform the necessary free or close. Upon failure,
+ no memory is allocated, any locally opened file descriptors are
+ closed; return non-zero -- in that case, free_cwd need not be
+ called, but doing so is ok. Otherwise, return zero.
+
+ The _raison d'etre_ for this interface is that the working directory
+ is sometimes inaccessible, and getcwd is not robust or as efficient.
+ So, we prefer to use the open/fchdir approach, but fall back on
+ getcwd if necessary. This module works for most cases with just
+ the getcwd-lgpl module, but to be truly robust, use the getcwd module.
+
+ Some systems lack fchdir altogether: e.g., OS/2, pre-2001 Cygwin,
+ SCO Xenix. Also, SunOS 4 and Irix 5.3 provide the function, yet it
+ doesn't work for partitions on which auditing is enabled. If
+ you're still using an obsolete system with these problems, please
+ send email to the maintainer of this code. */
+
+int
+save_cwd (struct saved_cwd *cwd)
+{
+ cwd->name = NULL;
+
+ cwd->desc = open (".", O_SEARCH | O_CLOEXEC);
+ if (!GNULIB_FCNTL_SAFER)
+ cwd->desc = fd_safer_flag (cwd->desc, O_CLOEXEC);
+ if (cwd->desc < 0)
+ {
+ cwd->name = getcwd (NULL, 0);
+ return cwd->name ? 0 : -1;
+ }
+
+ return 0;
+}
+
+/* Change to recorded location, CWD, in directory hierarchy.
+ Upon failure, return -1 (errno is set by chdir or fchdir).
+ Upon success, return zero. */
+
+int
+restore_cwd (const struct saved_cwd *cwd)
+{
+ if (0 <= cwd->desc)
+ return fchdir (cwd->desc);
+ else
+ return chdir_long (cwd->name);
+}
+
+void
+free_cwd (struct saved_cwd *cwd)
+{
+ if (cwd->desc >= 0)
+ close (cwd->desc);
+ free (cwd->name);
+}
diff --git a/gl/lib/save-cwd.h b/gl/lib/save-cwd.h
new file mode 100644
index 0000000..90e8a07
--- /dev/null
+++ b/gl/lib/save-cwd.h
@@ -0,0 +1,34 @@
+/* Save and restore current working directory.
+
+ Copyright (C) 1995, 1997-1998, 2003, 2009-2022 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. */
+
+#ifndef SAVE_CWD_H
+# define SAVE_CWD_H 1
+
+struct saved_cwd
+ {
+ int desc;
+ char *name;
+ };
+
+int save_cwd (struct saved_cwd *cwd);
+int restore_cwd (const struct saved_cwd *cwd);
+void free_cwd (struct saved_cwd *cwd);
+
+#endif /* SAVE_CWD_H */
diff --git a/gl/lib/scratch_buffer.h b/gl/lib/scratch_buffer.h
new file mode 100644
index 0000000..f4fe5e8
--- /dev/null
+++ b/gl/lib/scratch_buffer.h
@@ -0,0 +1,127 @@
+/* Variable-sized buffer with on-stack default allocation.
+ Copyright (C) 2017-2022 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 2.1 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 Paul Eggert, 2017. */
+
+#ifndef _GL_SCRATCH_BUFFER_H
+#define _GL_SCRATCH_BUFFER_H
+
+/* Scratch buffers with a default stack allocation and fallback to
+ heap allocation. It is expected that this function is used in this
+ way:
+
+ struct scratch_buffer tmpbuf;
+ scratch_buffer_init (&tmpbuf);
+
+ while (!function_that_uses_buffer (tmpbuf.data, tmpbuf.length))
+ if (!scratch_buffer_grow (&tmpbuf))
+ return -1;
+
+ scratch_buffer_free (&tmpbuf);
+ return 0;
+
+ The allocation functions (scratch_buffer_grow,
+ scratch_buffer_grow_preserve, scratch_buffer_set_array_size) make
+ sure that the heap allocation, if any, is freed, so that the code
+ above does not have a memory leak. The buffer still remains in a
+ state that can be deallocated using scratch_buffer_free, so a loop
+ like this is valid as well:
+
+ struct scratch_buffer tmpbuf;
+ scratch_buffer_init (&tmpbuf);
+
+ while (!function_that_uses_buffer (tmpbuf.data, tmpbuf.length))
+ if (!scratch_buffer_grow (&tmpbuf))
+ break;
+
+ scratch_buffer_free (&tmpbuf);
+
+ scratch_buffer_grow and scratch_buffer_grow_preserve are guaranteed
+ to grow the buffer by at least 512 bytes. This means that when
+ using the scratch buffer as a backing store for a non-character
+ array whose element size, in bytes, is 512 or smaller, the scratch
+ buffer only has to grow once to make room for at least one more
+ element.
+*/
+
+/* Scratch buffer. Must be initialized with scratch_buffer_init
+ before its use. */
+struct scratch_buffer;
+
+/* Initializes *BUFFER so that BUFFER->data points to BUFFER->__space
+ and BUFFER->length reflects the available space. */
+#if 0
+extern void scratch_buffer_init (struct scratch_buffer *buffer);
+#endif
+
+/* Deallocates *BUFFER (if it was heap-allocated). */
+#if 0
+extern void scratch_buffer_free (struct scratch_buffer *buffer);
+#endif
+
+/* Grow *BUFFER by some arbitrary amount. The buffer contents is NOT
+ preserved. Return true on success, false on allocation failure (in
+ which case the old buffer is freed). On success, the new buffer is
+ larger than the previous size. On failure, *BUFFER is deallocated,
+ but remains in a free-able state, and errno is set. */
+#if 0
+extern bool scratch_buffer_grow (struct scratch_buffer *buffer);
+#endif
+
+/* Like scratch_buffer_grow, but preserve the old buffer
+ contents on success, as a prefix of the new buffer. */
+#if 0
+extern bool scratch_buffer_grow_preserve (struct scratch_buffer *buffer);
+#endif
+
+/* Grow *BUFFER so that it can store at least NELEM elements of SIZE
+ bytes. The buffer contents are NOT preserved. Both NELEM and SIZE
+ can be zero. Return true on success, false on allocation failure
+ (in which case the old buffer is freed, but *BUFFER remains in a
+ free-able state, and errno is set). It is unspecified whether this
+ function can reduce the array size. */
+#if 0
+extern bool scratch_buffer_set_array_size (struct scratch_buffer *buffer,
+ size_t nelem, size_t size);
+#endif
+
+/* Return a copy of *BUFFER's first SIZE bytes as a heap-allocated block,
+ deallocating *BUFFER if it was heap-allocated. SIZE must be at
+ most *BUFFER's size. Return NULL (setting errno) on memory
+ exhaustion. */
+#if 0
+extern void *scratch_buffer_dupfree (struct scratch_buffer *buffer,
+ size_t size);
+#endif
+
+
+/* The implementation is imported from glibc. */
+
+/* Avoid possible conflicts with symbols exported by the GNU libc. */
+#define __libc_scratch_buffer_dupfree gl_scratch_buffer_dupfree
+#define __libc_scratch_buffer_grow gl_scratch_buffer_grow
+#define __libc_scratch_buffer_grow_preserve gl_scratch_buffer_grow_preserve
+#define __libc_scratch_buffer_set_array_size gl_scratch_buffer_set_array_size
+
+#ifndef _GL_LIKELY
+/* Rely on __builtin_expect, as provided by the module 'builtin-expect'. */
+# define _GL_LIKELY(cond) __builtin_expect ((cond), 1)
+# define _GL_UNLIKELY(cond) __builtin_expect ((cond), 0)
+#endif
+
+#include <malloc/scratch_buffer.gl.h>
+
+#endif /* _GL_SCRATCH_BUFFER_H */
diff --git a/gl/lib/select.c b/gl/lib/select.c
new file mode 100644
index 0000000..c242498
--- /dev/null
+++ b/gl/lib/select.c
@@ -0,0 +1,598 @@
+/* Emulation for select(2)
+ Contributed by Paolo Bonzini.
+
+ Copyright 2008-2022 Free Software Foundation, Inc.
+
+ This file is part of gnulib.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <sys/select.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+/* Native Windows. */
+
+#include <alloca.h>
+#include <assert.h>
+#include <sys/types.h>
+#include <errno.h>
+#include <limits.h>
+
+#include <winsock2.h>
+#include <windows.h>
+#include <io.h>
+#include <stdio.h>
+#include <conio.h>
+#include <time.h>
+
+/* Get the overridden 'struct timeval'. */
+#include <sys/time.h>
+
+#if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+#else
+# include <io.h>
+#endif
+
+#undef select
+
+/* Don't assume that UNICODE is not defined. */
+#undef GetModuleHandle
+#define GetModuleHandle GetModuleHandleA
+#undef PeekConsoleInput
+#define PeekConsoleInput PeekConsoleInputA
+#undef CreateEvent
+#define CreateEvent CreateEventA
+#undef PeekMessage
+#define PeekMessage PeekMessageA
+#undef DispatchMessage
+#define DispatchMessage DispatchMessageA
+
+/* Avoid warnings from gcc -Wcast-function-type. */
+#define GetProcAddress \
+ (void *) GetProcAddress
+
+struct bitset {
+ unsigned char in[FD_SETSIZE / CHAR_BIT];
+ unsigned char out[FD_SETSIZE / CHAR_BIT];
+};
+
+/* Declare data structures for ntdll functions. */
+typedef struct _FILE_PIPE_LOCAL_INFORMATION {
+ ULONG NamedPipeType;
+ ULONG NamedPipeConfiguration;
+ ULONG MaximumInstances;
+ ULONG CurrentInstances;
+ ULONG InboundQuota;
+ ULONG ReadDataAvailable;
+ ULONG OutboundQuota;
+ ULONG WriteQuotaAvailable;
+ ULONG NamedPipeState;
+ ULONG NamedPipeEnd;
+} FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION;
+
+typedef struct _IO_STATUS_BLOCK
+{
+ union {
+ DWORD Status;
+ PVOID Pointer;
+ } u;
+ ULONG_PTR Information;
+} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
+
+typedef enum _FILE_INFORMATION_CLASS {
+ FilePipeLocalInformation = 24
+} FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
+
+typedef DWORD (WINAPI *PNtQueryInformationFile)
+ (HANDLE, IO_STATUS_BLOCK *, VOID *, ULONG, FILE_INFORMATION_CLASS);
+
+#ifndef PIPE_BUF
+#define PIPE_BUF 512
+#endif
+
+static BOOL IsConsoleHandle (HANDLE h)
+{
+ DWORD mode;
+ return GetConsoleMode (h, &mode) != 0;
+}
+
+static BOOL
+IsSocketHandle (HANDLE h)
+{
+ WSANETWORKEVENTS ev;
+
+ if (IsConsoleHandle (h))
+ return FALSE;
+
+ /* Under Wine, it seems that getsockopt returns 0 for pipes too.
+ WSAEnumNetworkEvents instead distinguishes the two correctly. */
+ ev.lNetworkEvents = 0xDEADBEEF;
+ WSAEnumNetworkEvents ((SOCKET) h, NULL, &ev);
+ return ev.lNetworkEvents != 0xDEADBEEF;
+}
+
+/* Compute output fd_sets for libc descriptor FD (whose Windows handle is
+ H). */
+
+static int
+windows_poll_handle (HANDLE h, int fd,
+ struct bitset *rbits,
+ struct bitset *wbits,
+ struct bitset *xbits)
+{
+ BOOL read, write, except;
+ int i, ret;
+ INPUT_RECORD *irbuffer;
+ DWORD avail, nbuffer;
+ BOOL bRet;
+ IO_STATUS_BLOCK iosb;
+ FILE_PIPE_LOCAL_INFORMATION fpli;
+ static PNtQueryInformationFile NtQueryInformationFile;
+ static BOOL once_only;
+
+ read = write = except = FALSE;
+ switch (GetFileType (h))
+ {
+ case FILE_TYPE_DISK:
+ read = TRUE;
+ write = TRUE;
+ break;
+
+ case FILE_TYPE_PIPE:
+ if (!once_only)
+ {
+ NtQueryInformationFile = (PNtQueryInformationFile)
+ GetProcAddress (GetModuleHandle ("ntdll.dll"),
+ "NtQueryInformationFile");
+ once_only = TRUE;
+ }
+
+ if (PeekNamedPipe (h, NULL, 0, NULL, &avail, NULL) != 0)
+ {
+ if (avail)
+ read = TRUE;
+ }
+ else if (GetLastError () == ERROR_BROKEN_PIPE)
+ ;
+
+ else
+ {
+ /* It was the write-end of the pipe. Check if it is writable.
+ If NtQueryInformationFile fails, optimistically assume the pipe is
+ writable. This could happen on Windows 9x, where
+ NtQueryInformationFile is not available, or if we inherit a pipe
+ that doesn't permit FILE_READ_ATTRIBUTES access on the write end
+ (I think this should not happen since Windows XP SP2; WINE seems
+ fine too). Otherwise, ensure that enough space is available for
+ atomic writes. */
+ memset (&iosb, 0, sizeof (iosb));
+ memset (&fpli, 0, sizeof (fpli));
+
+ if (!NtQueryInformationFile
+ || NtQueryInformationFile (h, &iosb, &fpli, sizeof (fpli),
+ FilePipeLocalInformation)
+ || fpli.WriteQuotaAvailable >= PIPE_BUF
+ || (fpli.OutboundQuota < PIPE_BUF &&
+ fpli.WriteQuotaAvailable == fpli.OutboundQuota))
+ write = TRUE;
+ }
+ break;
+
+ case FILE_TYPE_CHAR:
+ write = TRUE;
+ if (!(rbits->in[fd / CHAR_BIT] & (1 << (fd & (CHAR_BIT - 1)))))
+ break;
+
+ ret = WaitForSingleObject (h, 0);
+ if (ret == WAIT_OBJECT_0)
+ {
+ if (!IsConsoleHandle (h))
+ {
+ read = TRUE;
+ break;
+ }
+
+ nbuffer = avail = 0;
+ bRet = GetNumberOfConsoleInputEvents (h, &nbuffer);
+
+ /* Screen buffers handles are filtered earlier. */
+ assert (bRet);
+ if (nbuffer == 0)
+ {
+ except = TRUE;
+ break;
+ }
+
+ irbuffer = (INPUT_RECORD *) alloca (nbuffer * sizeof (INPUT_RECORD));
+ bRet = PeekConsoleInput (h, irbuffer, nbuffer, &avail);
+ if (!bRet || avail == 0)
+ {
+ except = TRUE;
+ break;
+ }
+
+ for (i = 0; i < avail; i++)
+ if (irbuffer[i].EventType == KEY_EVENT)
+ read = TRUE;
+ }
+ break;
+
+ default:
+ ret = WaitForSingleObject (h, 0);
+ write = TRUE;
+ if (ret == WAIT_OBJECT_0)
+ read = TRUE;
+
+ break;
+ }
+
+ ret = 0;
+ if (read && (rbits->in[fd / CHAR_BIT] & (1 << (fd & (CHAR_BIT - 1)))))
+ {
+ rbits->out[fd / CHAR_BIT] |= (1 << (fd & (CHAR_BIT - 1)));
+ ret++;
+ }
+
+ if (write && (wbits->in[fd / CHAR_BIT] & (1 << (fd & (CHAR_BIT - 1)))))
+ {
+ wbits->out[fd / CHAR_BIT] |= (1 << (fd & (CHAR_BIT - 1)));
+ ret++;
+ }
+
+ if (except && (xbits->in[fd / CHAR_BIT] & (1 << (fd & (CHAR_BIT - 1)))))
+ {
+ xbits->out[fd / CHAR_BIT] |= (1 << (fd & (CHAR_BIT - 1)));
+ ret++;
+ }
+
+ return ret;
+}
+
+int
+rpl_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds,
+ struct timeval *timeout)
+#undef timeval
+{
+ static struct timeval tv0;
+ static HANDLE hEvent;
+ HANDLE h, handle_array[FD_SETSIZE + 2];
+ fd_set handle_rfds, handle_wfds, handle_xfds;
+ struct bitset rbits, wbits, xbits;
+ unsigned char anyfds_in[FD_SETSIZE / CHAR_BIT];
+ DWORD ret, wait_timeout, nhandles, nsock, nbuffer;
+ MSG msg;
+ int i, fd, rc;
+ clock_t tend;
+
+ if (nfds > FD_SETSIZE)
+ nfds = FD_SETSIZE;
+
+ if (!timeout)
+ wait_timeout = INFINITE;
+ else
+ {
+ wait_timeout = timeout->tv_sec * 1000 + timeout->tv_usec / 1000;
+
+ /* select is also used as a portable usleep. */
+ if (!rfds && !wfds && !xfds)
+ {
+ Sleep (wait_timeout);
+ return 0;
+ }
+ }
+
+ if (!hEvent)
+ hEvent = CreateEvent (NULL, FALSE, FALSE, NULL);
+
+ handle_array[0] = hEvent;
+ nhandles = 1;
+ nsock = 0;
+
+ /* Copy descriptors to bitsets. At the same time, eliminate
+ bits in the "wrong" direction for console input buffers
+ and screen buffers, because screen buffers are waitable
+ and they will block until a character is available. */
+ memset (&rbits, 0, sizeof (rbits));
+ memset (&wbits, 0, sizeof (wbits));
+ memset (&xbits, 0, sizeof (xbits));
+ memset (anyfds_in, 0, sizeof (anyfds_in));
+ if (rfds)
+ for (i = 0; i < rfds->fd_count; i++)
+ {
+ fd = rfds->fd_array[i];
+ h = (HANDLE) _get_osfhandle (fd);
+ if (IsConsoleHandle (h)
+ && !GetNumberOfConsoleInputEvents (h, &nbuffer))
+ continue;
+
+ rbits.in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1));
+ anyfds_in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1));
+ }
+ else
+ rfds = (fd_set *) alloca (sizeof (fd_set));
+
+ if (wfds)
+ for (i = 0; i < wfds->fd_count; i++)
+ {
+ fd = wfds->fd_array[i];
+ h = (HANDLE) _get_osfhandle (fd);
+ if (IsConsoleHandle (h)
+ && GetNumberOfConsoleInputEvents (h, &nbuffer))
+ continue;
+
+ wbits.in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1));
+ anyfds_in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1));
+ }
+ else
+ wfds = (fd_set *) alloca (sizeof (fd_set));
+
+ if (xfds)
+ for (i = 0; i < xfds->fd_count; i++)
+ {
+ fd = xfds->fd_array[i];
+ xbits.in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1));
+ anyfds_in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1));
+ }
+ else
+ xfds = (fd_set *) alloca (sizeof (fd_set));
+
+ /* Zero all the fd_sets, including the application's. */
+ FD_ZERO (rfds);
+ FD_ZERO (wfds);
+ FD_ZERO (xfds);
+ FD_ZERO (&handle_rfds);
+ FD_ZERO (&handle_wfds);
+ FD_ZERO (&handle_xfds);
+
+ /* Classify handles. Create fd sets for sockets, poll the others. */
+ for (i = 0; i < nfds; i++)
+ {
+ if ((anyfds_in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) == 0)
+ continue;
+
+ h = (HANDLE) _get_osfhandle (i);
+ if (!h)
+ {
+ errno = EBADF;
+ return -1;
+ }
+
+ if (IsSocketHandle (h))
+ {
+ int requested = FD_CLOSE;
+
+ /* See above; socket handles are mapped onto select, but we
+ need to map descriptors to handles. */
+ if (rbits.in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1))))
+ {
+ requested |= FD_READ | FD_ACCEPT;
+ FD_SET ((SOCKET) h, rfds);
+ FD_SET ((SOCKET) h, &handle_rfds);
+ }
+ if (wbits.in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1))))
+ {
+ requested |= FD_WRITE | FD_CONNECT;
+ FD_SET ((SOCKET) h, wfds);
+ FD_SET ((SOCKET) h, &handle_wfds);
+ }
+ if (xbits.in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1))))
+ {
+ requested |= FD_OOB;
+ FD_SET ((SOCKET) h, xfds);
+ FD_SET ((SOCKET) h, &handle_xfds);
+ }
+
+ WSAEventSelect ((SOCKET) h, hEvent, requested);
+ nsock++;
+ }
+ else
+ {
+ handle_array[nhandles++] = h;
+
+ /* Poll now. If we get an event, do not wait below. */
+ if (wait_timeout != 0
+ && windows_poll_handle (h, i, &rbits, &wbits, &xbits))
+ wait_timeout = 0;
+ }
+ }
+
+ /* Place a sentinel at the end of the array. */
+ handle_array[nhandles] = NULL;
+
+ /* When will the waiting period expire? */
+ if (wait_timeout != INFINITE)
+ tend = clock () + wait_timeout;
+
+restart:
+ if (wait_timeout == 0 || nsock == 0)
+ rc = 0;
+ else
+ {
+ /* See if we need to wait in the loop below. If any select is ready,
+ do MsgWaitForMultipleObjects anyway to dispatch messages, but
+ no need to call select again. */
+ rc = select (0, &handle_rfds, &handle_wfds, &handle_xfds, &tv0);
+ if (rc == 0)
+ {
+ /* Restore the fd_sets for the other select we do below. */
+ memcpy (&handle_rfds, rfds, sizeof (fd_set));
+ memcpy (&handle_wfds, wfds, sizeof (fd_set));
+ memcpy (&handle_xfds, xfds, sizeof (fd_set));
+ }
+ else
+ wait_timeout = 0;
+ }
+
+ /* How much is left to wait? */
+ if (wait_timeout != INFINITE)
+ {
+ clock_t tnow = clock ();
+ if (tend >= tnow)
+ wait_timeout = tend - tnow;
+ else
+ wait_timeout = 0;
+ }
+
+ for (;;)
+ {
+ ret = MsgWaitForMultipleObjects (nhandles, handle_array, FALSE,
+ wait_timeout, QS_ALLINPUT);
+
+ if (ret == WAIT_OBJECT_0 + nhandles)
+ {
+ /* new input of some other kind */
+ BOOL bRet;
+ while ((bRet = PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) != 0)
+ {
+ TranslateMessage (&msg);
+ DispatchMessage (&msg);
+ }
+ }
+ else
+ break;
+ }
+
+ /* If we haven't done it yet, check the status of the sockets. */
+ if (rc == 0 && nsock > 0)
+ rc = select (0, &handle_rfds, &handle_wfds, &handle_xfds, &tv0);
+
+ if (nhandles > 1)
+ {
+ /* Count results that are not counted in the return value of select. */
+ nhandles = 1;
+ for (i = 0; i < nfds; i++)
+ {
+ if ((anyfds_in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) == 0)
+ continue;
+
+ h = (HANDLE) _get_osfhandle (i);
+ if (h == handle_array[nhandles])
+ {
+ /* Not a socket. */
+ nhandles++;
+ windows_poll_handle (h, i, &rbits, &wbits, &xbits);
+ if (rbits.out[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))
+ || wbits.out[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))
+ || xbits.out[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1))))
+ rc++;
+ }
+ }
+
+ if (rc == 0
+ && (wait_timeout == INFINITE
+ /* If NHANDLES > 1, but no bits are set, it means we've
+ been told incorrectly that some handle was signaled.
+ This happens with anonymous pipes, which always cause
+ MsgWaitForMultipleObjects to exit immediately, but no
+ data is found ready to be read by windows_poll_handle.
+ To avoid a total failure (whereby we return zero and
+ don't wait at all), let's poll in a more busy loop. */
+ || (wait_timeout != 0 && nhandles > 1)))
+ {
+ /* Sleep 1 millisecond to avoid busy wait and retry with the
+ original fd_sets. */
+ memcpy (&handle_rfds, rfds, sizeof (fd_set));
+ memcpy (&handle_wfds, wfds, sizeof (fd_set));
+ memcpy (&handle_xfds, xfds, sizeof (fd_set));
+ SleepEx (1, TRUE);
+ goto restart;
+ }
+ if (timeout && wait_timeout == 0 && rc == 0)
+ timeout->tv_sec = timeout->tv_usec = 0;
+ }
+
+ /* Now fill in the results. */
+ FD_ZERO (rfds);
+ FD_ZERO (wfds);
+ FD_ZERO (xfds);
+ nhandles = 1;
+ for (i = 0; i < nfds; i++)
+ {
+ if ((anyfds_in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) == 0)
+ continue;
+
+ h = (HANDLE) _get_osfhandle (i);
+ if (h != handle_array[nhandles])
+ {
+ /* Perform handle->descriptor mapping. */
+ SOCKET s = (SOCKET) h;
+ WSAEventSelect (s, NULL, 0);
+ if (FD_ISSET (s, &handle_rfds))
+ FD_SET (i, rfds);
+ if (FD_ISSET (s, &handle_wfds))
+ FD_SET (i, wfds);
+ if (FD_ISSET (s, &handle_xfds))
+ FD_SET (i, xfds);
+ }
+ else
+ {
+ /* Not a socket. */
+ nhandles++;
+ if (rbits.out[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1))))
+ FD_SET (i, rfds);
+ if (wbits.out[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1))))
+ FD_SET (i, wfds);
+ if (xbits.out[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1))))
+ FD_SET (i, xfds);
+ }
+ }
+
+ return rc;
+}
+
+#else /* ! Native Windows. */
+
+#include <stddef.h> /* NULL */
+#include <errno.h>
+#include <unistd.h>
+
+#undef select
+
+int
+rpl_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds,
+ struct timeval *timeout)
+{
+ int i;
+
+ /* FreeBSD 8.2 has a bug: it does not always detect invalid fds. */
+ if (nfds < 0 || nfds > FD_SETSIZE)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ for (i = 0; i < nfds; i++)
+ {
+ if (((rfds && FD_ISSET (i, rfds))
+ || (wfds && FD_ISSET (i, wfds))
+ || (xfds && FD_ISSET (i, xfds)))
+ && dup2 (i, i) != i)
+ return -1;
+ }
+
+ /* Interix 3.5 has a bug: it does not support nfds == 0. */
+ if (nfds == 0)
+ {
+ nfds = 1;
+ rfds = NULL;
+ wfds = NULL;
+ xfds = NULL;
+ }
+ return select (nfds, rfds, wfds, xfds, timeout);
+}
+
+#endif
diff --git a/gl/lib/setenv.c b/gl/lib/setenv.c
new file mode 100644
index 0000000..ebfd4e5
--- /dev/null
+++ b/gl/lib/setenv.c
@@ -0,0 +1,390 @@
+/* Copyright (C) 1992, 1995-2003, 2005-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ 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 2.1 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 !_LIBC
+/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
+ optimizes away the name == NULL test below. */
+# define _GL_ARG_NONNULL(params)
+
+# define _GL_USE_STDLIB_ALLOC 1
+# include <config.h>
+#endif
+
+#include <alloca.h>
+
+/* Specification. */
+#include <stdlib.h>
+
+#include <errno.h>
+#ifndef __set_errno
+# define __set_errno(ev) ((errno) = (ev))
+#endif
+
+#include <string.h>
+#if _LIBC || HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#if !_LIBC
+# include "malloca.h"
+#endif
+
+#if _LIBC || !HAVE_SETENV
+
+#if !_LIBC
+# define __environ environ
+#endif
+
+#if _LIBC
+/* This lock protects against simultaneous modifications of 'environ'. */
+# include <bits/libc-lock.h>
+__libc_lock_define_initialized (static, envlock)
+# define LOCK __libc_lock_lock (envlock)
+# define UNLOCK __libc_lock_unlock (envlock)
+#else
+# define LOCK
+# define UNLOCK
+#endif
+
+/* In the GNU C library we must keep the namespace clean. */
+#ifdef _LIBC
+# define setenv __setenv
+# define clearenv __clearenv
+# define tfind __tfind
+# define tsearch __tsearch
+#endif
+
+/* In the GNU C library implementation we try to be more clever and
+ allow arbitrarily many changes of the environment given that the used
+ values are from a small set. Outside glibc this will eat up all
+ memory after a while. */
+#if defined _LIBC || (defined HAVE_SEARCH_H && defined HAVE_TSEARCH \
+ && (defined __GNUC__ || defined __clang__))
+# define USE_TSEARCH 1
+# include <search.h>
+typedef int (*compar_fn_t) (const void *, const void *);
+
+/* This is a pointer to the root of the search tree with the known
+ values. */
+static void *known_values;
+
+# define KNOWN_VALUE(Str) \
+ ({ \
+ void *value = tfind (Str, &known_values, (compar_fn_t) strcmp); \
+ value != NULL ? *(char **) value : NULL; \
+ })
+# define STORE_VALUE(Str) \
+ tsearch (Str, &known_values, (compar_fn_t) strcmp)
+
+#else
+# undef USE_TSEARCH
+
+# define KNOWN_VALUE(Str) NULL
+# define STORE_VALUE(Str) do { } while (0)
+
+#endif
+
+
+/* If this variable is not a null pointer we allocated the current
+ environment. */
+static char **last_environ;
+
+
+/* This function is used by 'setenv' and 'putenv'. The difference between
+ the two functions is that for the former must create a new string which
+ is then placed in the environment, while the argument of 'putenv'
+ must be used directly. This is all complicated by the fact that we try
+ to reuse values once generated for a 'setenv' call since we can never
+ free the strings. */
+int
+__add_to_environ (const char *name, const char *value, const char *combined,
+ int replace)
+{
+ char **ep;
+ size_t size;
+ const size_t namelen = strlen (name);
+ const size_t vallen = value != NULL ? strlen (value) + 1 : 0;
+
+ LOCK;
+
+ /* We have to get the pointer now that we have the lock and not earlier
+ since another thread might have created a new environment. */
+ ep = __environ;
+
+ size = 0;
+ if (ep != NULL)
+ {
+ for (; *ep != NULL; ++ep)
+ if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=')
+ break;
+ else
+ ++size;
+ }
+
+ if (ep == NULL || *ep == NULL)
+ {
+ char **new_environ;
+#ifdef USE_TSEARCH
+ char *new_value;
+#endif
+
+ /* We allocated this space; we can extend it. */
+ new_environ =
+ (char **) (last_environ == NULL
+ ? malloc ((size + 2) * sizeof (char *))
+ : realloc (last_environ, (size + 2) * sizeof (char *)));
+ if (new_environ == NULL)
+ {
+ /* It's easier to set errno to ENOMEM than to rely on the
+ 'malloc-posix' and 'realloc-posix' gnulib modules. */
+ __set_errno (ENOMEM);
+ UNLOCK;
+ return -1;
+ }
+
+ /* If the whole entry is given add it. */
+ if (combined != NULL)
+ /* We must not add the string to the search tree since it belongs
+ to the user. */
+ new_environ[size] = (char *) combined;
+ else
+ {
+ /* See whether the value is already known. */
+#ifdef USE_TSEARCH
+# ifdef _LIBC
+ new_value = (char *) alloca (namelen + 1 + vallen);
+ __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1),
+ value, vallen);
+# else
+ new_value = (char *) malloca (namelen + 1 + vallen);
+ if (new_value == NULL)
+ {
+ __set_errno (ENOMEM);
+ UNLOCK;
+ return -1;
+ }
+ memcpy (new_value, name, namelen);
+ new_value[namelen] = '=';
+ memcpy (&new_value[namelen + 1], value, vallen);
+# endif
+
+ new_environ[size] = KNOWN_VALUE (new_value);
+ if (new_environ[size] == NULL)
+#endif
+ {
+ new_environ[size] = (char *) malloc (namelen + 1 + vallen);
+ if (new_environ[size] == NULL)
+ {
+#if defined USE_TSEARCH && !defined _LIBC
+ freea (new_value);
+#endif
+ __set_errno (ENOMEM);
+ UNLOCK;
+ return -1;
+ }
+
+#ifdef USE_TSEARCH
+ memcpy (new_environ[size], new_value, namelen + 1 + vallen);
+#else
+ memcpy (new_environ[size], name, namelen);
+ new_environ[size][namelen] = '=';
+ memcpy (&new_environ[size][namelen + 1], value, vallen);
+#endif
+ /* And save the value now. We cannot do this when we remove
+ the string since then we cannot decide whether it is a
+ user string or not. */
+ STORE_VALUE (new_environ[size]);
+ }
+#if defined USE_TSEARCH && !defined _LIBC
+ freea (new_value);
+#endif
+ }
+
+ if (__environ != last_environ)
+ memcpy ((char *) new_environ, (char *) __environ,
+ size * sizeof (char *));
+
+ new_environ[size + 1] = NULL;
+
+ last_environ = __environ = new_environ;
+ }
+ else if (replace)
+ {
+ char *np;
+
+ /* Use the user string if given. */
+ if (combined != NULL)
+ np = (char *) combined;
+ else
+ {
+#ifdef USE_TSEARCH
+ char *new_value;
+# ifdef _LIBC
+ new_value = alloca (namelen + 1 + vallen);
+ __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1),
+ value, vallen);
+# else
+ new_value = malloca (namelen + 1 + vallen);
+ if (new_value == NULL)
+ {
+ __set_errno (ENOMEM);
+ UNLOCK;
+ return -1;
+ }
+ memcpy (new_value, name, namelen);
+ new_value[namelen] = '=';
+ memcpy (&new_value[namelen + 1], value, vallen);
+# endif
+
+ np = KNOWN_VALUE (new_value);
+ if (np == NULL)
+#endif
+ {
+ np = (char *) malloc (namelen + 1 + vallen);
+ if (np == NULL)
+ {
+#if defined USE_TSEARCH && !defined _LIBC
+ freea (new_value);
+#endif
+ __set_errno (ENOMEM);
+ UNLOCK;
+ return -1;
+ }
+
+#ifdef USE_TSEARCH
+ memcpy (np, new_value, namelen + 1 + vallen);
+#else
+ memcpy (np, name, namelen);
+ np[namelen] = '=';
+ memcpy (&np[namelen + 1], value, vallen);
+#endif
+ /* And remember the value. */
+ STORE_VALUE (np);
+ }
+#if defined USE_TSEARCH && !defined _LIBC
+ freea (new_value);
+#endif
+ }
+
+ *ep = np;
+ }
+
+ UNLOCK;
+
+ return 0;
+}
+
+int
+setenv (const char *name, const char *value, int replace)
+{
+ if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ return __add_to_environ (name, value, NULL, replace);
+}
+
+/* The 'clearenv' was planned to be added to POSIX.1 but probably
+ never made it. Nevertheless the POSIX.9 standard (POSIX bindings
+ for Fortran 77) requires this function. */
+int
+clearenv (void)
+{
+ LOCK;
+
+ if (__environ == last_environ && __environ != NULL)
+ {
+ /* We allocated this environment so we can free it. */
+ free (__environ);
+ last_environ = NULL;
+ }
+
+ /* Clear the environment pointer removes the whole environment. */
+ __environ = NULL;
+
+ UNLOCK;
+
+ return 0;
+}
+
+#ifdef _LIBC
+static void
+free_mem (void)
+{
+ /* Remove all traces. */
+ clearenv ();
+
+ /* Now remove the search tree. */
+ __tdestroy (known_values, free);
+ known_values = NULL;
+}
+text_set_element (__libc_subfreeres, free_mem);
+
+
+# undef setenv
+# undef clearenv
+weak_alias (__setenv, setenv)
+weak_alias (__clearenv, clearenv)
+#endif
+
+#endif /* _LIBC || !HAVE_SETENV */
+
+/* The rest of this file is called into use when replacing an existing
+ but buggy setenv. Known bugs include failure to diagnose invalid
+ name, and consuming a leading '=' from value. */
+#if HAVE_SETENV
+
+# undef setenv
+# if !HAVE_DECL_SETENV
+extern int setenv (const char *, const char *, int);
+# endif
+# define STREQ(a, b) (strcmp (a, b) == 0)
+
+int
+rpl_setenv (const char *name, const char *value, int replace)
+{
+ int result;
+ if (!name || !*name || strchr (name, '='))
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ /* Call the real setenv even if replace is 0, in case implementation
+ has underlying data to update, such as when environ changes. */
+ result = setenv (name, value, replace);
+ if (result == 0 && replace && *value == '=')
+ {
+ char *tmp = getenv (name);
+ if (!STREQ (tmp, value))
+ {
+ int saved_errno;
+ size_t len = strlen (value);
+ tmp = malloca (len + 2);
+ /* Since leading '=' is eaten, double it up. */
+ *tmp = '=';
+ memcpy (tmp + 1, value, len + 1);
+ result = setenv (name, tmp, replace);
+ saved_errno = errno;
+ freea (tmp);
+ errno = saved_errno;
+ }
+ }
+ return result;
+}
+
+#endif /* HAVE_SETENV */
diff --git a/gl/lib/setlocale-lock.c b/gl/lib/setlocale-lock.c
new file mode 100644
index 0000000..4e7540e
--- /dev/null
+++ b/gl/lib/setlocale-lock.c
@@ -0,0 +1,150 @@
+/* Return the internal lock used by setlocale_null_r.
+ Copyright (C) 2019-2022 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 2.1 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>
+
+/* When it is known that the gl_get_setlocale_null_lock function is defined
+ by a dependency library, it should not be defined here. */
+#if OMIT_SETLOCALE_LOCK
+
+/* This declaration is solely to ensure that after preprocessing
+ this file is never empty. */
+typedef int dummy;
+
+#else
+
+/* This file defines the internal lock used by setlocale_null_r.
+ It is a separate compilation unit, so that only one copy of it is
+ present when linking statically. */
+
+/* Prohibit renaming this symbol. */
+# undef gl_get_setlocale_null_lock
+
+/* Macro for exporting a symbol (function, not variable) defined in this file,
+ when compiled into a shared library. */
+# ifndef DLL_EXPORTED
+# if HAVE_VISIBILITY
+ /* Override the effect of the compiler option '-fvisibility=hidden'. */
+# define DLL_EXPORTED __attribute__((__visibility__("default")))
+# elif defined _WIN32 || defined __CYGWIN__
+# define DLL_EXPORTED __declspec(dllexport)
+# else
+# define DLL_EXPORTED
+# endif
+# endif
+
+# if defined _WIN32 && !defined __CYGWIN__
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# include "windows-initguard.h"
+
+/* The return type is a 'CRITICAL_SECTION *', not a 'glwthread_mutex_t *',
+ because the latter is not guaranteed to be a stable ABI in the future. */
+
+/* Make sure the function gets exported from DLLs. */
+DLL_EXPORTED CRITICAL_SECTION *gl_get_setlocale_null_lock (void);
+
+static glwthread_initguard_t guard = GLWTHREAD_INITGUARD_INIT;
+static CRITICAL_SECTION lock;
+
+/* Returns the internal lock used by setlocale_null_r. */
+CRITICAL_SECTION *
+gl_get_setlocale_null_lock (void)
+{
+ if (!guard.done)
+ {
+ if (InterlockedIncrement (&guard.started) == 0)
+ {
+ /* This thread is the first one to need the lock. Initialize it. */
+ InitializeCriticalSection (&lock);
+ guard.done = 1;
+ }
+ else
+ {
+ /* Don't let guard.started grow and wrap around. */
+ InterlockedDecrement (&guard.started);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this mutex. */
+ while (!guard.done)
+ Sleep (0);
+ }
+ }
+ return &lock;
+}
+
+# elif HAVE_PTHREAD_API
+
+# include <pthread.h>
+
+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+
+/* Make sure the function gets exported from shared libraries. */
+DLL_EXPORTED pthread_mutex_t *gl_get_setlocale_null_lock (void);
+
+/* Returns the internal lock used by setlocale_null_r. */
+pthread_mutex_t *
+gl_get_setlocale_null_lock (void)
+{
+ return &mutex;
+}
+
+# elif HAVE_THREADS_H
+
+# include <threads.h>
+# include <stdlib.h>
+
+static int volatile init_needed = 1;
+static once_flag init_once = ONCE_FLAG_INIT;
+static mtx_t mutex;
+
+static void
+atomic_init (void)
+{
+ if (mtx_init (&mutex, mtx_plain) != thrd_success)
+ abort ();
+ init_needed = 0;
+}
+
+/* Make sure the function gets exported from shared libraries. */
+DLL_EXPORTED mtx_t *gl_get_setlocale_null_lock (void);
+
+/* Returns the internal lock used by setlocale_null_r. */
+mtx_t *
+gl_get_setlocale_null_lock (void)
+{
+ if (init_needed)
+ call_once (&init_once, atomic_init);
+ return &mutex;
+}
+
+# endif
+
+# if (defined _WIN32 || defined __CYGWIN__) && !defined _MSC_VER
+/* Make sure the '__declspec(dllimport)' in setlocale_null.c does not cause
+ a link failure when no DLLs are involved. */
+# if defined _WIN64 || defined _LP64
+# define IMP(x) __imp_##x
+# else
+# define IMP(x) _imp__##x
+# endif
+void * IMP(gl_get_setlocale_null_lock) = &gl_get_setlocale_null_lock;
+# endif
+
+#endif
diff --git a/gl/lib/setlocale_null.c b/gl/lib/setlocale_null.c
new file mode 100644
index 0000000..778429b
--- /dev/null
+++ b/gl/lib/setlocale_null.c
@@ -0,0 +1,411 @@
+/* Query the name of the current global locale.
+ Copyright (C) 2019-2022 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 2.1 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>
+
+/* Specification. */
+#include "setlocale_null.h"
+
+#include <errno.h>
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#if defined _WIN32 && !defined __CYGWIN__
+# include <wchar.h>
+#endif
+
+#if !(SETLOCALE_NULL_ALL_MTSAFE && SETLOCALE_NULL_ONE_MTSAFE)
+# if defined _WIN32 && !defined __CYGWIN__
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# elif HAVE_PTHREAD_API
+
+# include <pthread.h>
+# if HAVE_THREADS_H && HAVE_WEAK_SYMBOLS
+# include <threads.h>
+# pragma weak thrd_exit
+# define c11_threads_in_use() (thrd_exit != NULL)
+# else
+# define c11_threads_in_use() 0
+# endif
+
+# elif HAVE_THREADS_H
+
+# include <threads.h>
+
+# endif
+#endif
+
+/* Use the system's setlocale() function, not the gnulib override, here. */
+#undef setlocale
+
+static const char *
+setlocale_null_androidfix (int category)
+{
+ const char *result = setlocale (category, NULL);
+
+#ifdef __ANDROID__
+ if (result == NULL)
+ switch (category)
+ {
+ case LC_CTYPE:
+ case LC_NUMERIC:
+ case LC_TIME:
+ case LC_COLLATE:
+ case LC_MONETARY:
+ case LC_MESSAGES:
+ case LC_ALL:
+ case LC_PAPER:
+ case LC_NAME:
+ case LC_ADDRESS:
+ case LC_TELEPHONE:
+ case LC_MEASUREMENT:
+ result = "C";
+ break;
+ default:
+ break;
+ }
+#endif
+
+ return result;
+}
+
+static int
+setlocale_null_unlocked (int category, char *buf, size_t bufsize)
+{
+#if defined _WIN32 && !defined __CYGWIN__ && defined _MSC_VER
+ /* On native Windows, nowadays, the setlocale() implementation is based
+ on _wsetlocale() and uses malloc() for the result. We are better off
+ using _wsetlocale() directly. */
+ const wchar_t *result = _wsetlocale (category, NULL);
+
+ if (result == NULL)
+ {
+ /* CATEGORY is invalid. */
+ if (bufsize > 0)
+ /* Return an empty string in BUF.
+ This is a convenience for callers that don't want to write explicit
+ code for handling EINVAL. */
+ buf[0] = '\0';
+ return EINVAL;
+ }
+ else
+ {
+ size_t length = wcslen (result);
+ if (length < bufsize)
+ {
+ size_t i;
+
+ /* Convert wchar_t[] -> char[], assuming plain ASCII. */
+ for (i = 0; i <= length; i++)
+ buf[i] = result[i];
+
+ return 0;
+ }
+ else
+ {
+ if (bufsize > 0)
+ {
+ /* Return a truncated result in BUF.
+ This is a convenience for callers that don't want to write
+ explicit code for handling ERANGE. */
+ size_t i;
+
+ /* Convert wchar_t[] -> char[], assuming plain ASCII. */
+ for (i = 0; i < bufsize; i++)
+ buf[i] = result[i];
+ buf[bufsize - 1] = '\0';
+ }
+ return ERANGE;
+ }
+ }
+#else
+ const char *result = setlocale_null_androidfix (category);
+
+ if (result == NULL)
+ {
+ /* CATEGORY is invalid. */
+ if (bufsize > 0)
+ /* Return an empty string in BUF.
+ This is a convenience for callers that don't want to write explicit
+ code for handling EINVAL. */
+ buf[0] = '\0';
+ return EINVAL;
+ }
+ else
+ {
+ size_t length = strlen (result);
+ if (length < bufsize)
+ {
+ memcpy (buf, result, length + 1);
+ return 0;
+ }
+ else
+ {
+ if (bufsize > 0)
+ {
+ /* Return a truncated result in BUF.
+ This is a convenience for callers that don't want to write
+ explicit code for handling ERANGE. */
+ memcpy (buf, result, bufsize - 1);
+ buf[bufsize - 1] = '\0';
+ }
+ return ERANGE;
+ }
+ }
+#endif
+}
+
+#if !(SETLOCALE_NULL_ALL_MTSAFE && SETLOCALE_NULL_ONE_MTSAFE) /* musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin */
+
+/* Use a lock, so that no two threads can invoke setlocale_null_unlocked
+ at the same time. */
+
+/* Prohibit renaming this symbol. */
+# undef gl_get_setlocale_null_lock
+
+# if defined _WIN32 && !defined __CYGWIN__
+
+extern __declspec(dllimport) CRITICAL_SECTION *gl_get_setlocale_null_lock (void);
+
+static int
+setlocale_null_with_lock (int category, char *buf, size_t bufsize)
+{
+ CRITICAL_SECTION *lock = gl_get_setlocale_null_lock ();
+ int ret;
+
+ EnterCriticalSection (lock);
+ ret = setlocale_null_unlocked (category, buf, bufsize);
+ LeaveCriticalSection (lock);
+
+ return ret;
+}
+
+# elif HAVE_PTHREAD_API /* musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin */
+
+extern
+# if defined _WIN32 || defined __CYGWIN__
+ __declspec(dllimport)
+# endif
+ pthread_mutex_t *gl_get_setlocale_null_lock (void);
+
+# if HAVE_WEAK_SYMBOLS /* musl libc, FreeBSD, NetBSD, OpenBSD, Haiku */
+
+ /* Avoid the need to link with '-lpthread'. */
+# pragma weak pthread_mutex_lock
+# pragma weak pthread_mutex_unlock
+
+ /* Determine whether libpthread is in use. */
+# pragma weak pthread_mutexattr_gettype
+ /* See the comments in lock.h. */
+# define pthread_in_use() \
+ (pthread_mutexattr_gettype != NULL || c11_threads_in_use ())
+
+# else
+# define pthread_in_use() 1
+# endif
+
+static int
+setlocale_null_with_lock (int category, char *buf, size_t bufsize)
+{
+ if (pthread_in_use())
+ {
+ pthread_mutex_t *lock = gl_get_setlocale_null_lock ();
+ int ret;
+
+ if (pthread_mutex_lock (lock))
+ abort ();
+ ret = setlocale_null_unlocked (category, buf, bufsize);
+ if (pthread_mutex_unlock (lock))
+ abort ();
+
+ return ret;
+ }
+ else
+ return setlocale_null_unlocked (category, buf, bufsize);
+}
+
+# elif HAVE_THREADS_H
+
+extern mtx_t *gl_get_setlocale_null_lock (void);
+
+static int
+setlocale_null_with_lock (int category, char *buf, size_t bufsize)
+{
+ mtx_t *lock = gl_get_setlocale_null_lock ();
+ int ret;
+
+ if (mtx_lock (lock) != thrd_success)
+ abort ();
+ ret = setlocale_null_unlocked (category, buf, bufsize);
+ if (mtx_unlock (lock) != thrd_success)
+ abort ();
+
+ return ret;
+}
+
+# endif
+
+#endif
+
+int
+setlocale_null_r (int category, char *buf, size_t bufsize)
+{
+#if SETLOCALE_NULL_ALL_MTSAFE
+# if SETLOCALE_NULL_ONE_MTSAFE
+
+ return setlocale_null_unlocked (category, buf, bufsize);
+
+# else
+
+ if (category == LC_ALL)
+ return setlocale_null_unlocked (category, buf, bufsize);
+ else
+ return setlocale_null_with_lock (category, buf, bufsize);
+
+# endif
+#else
+# if SETLOCALE_NULL_ONE_MTSAFE
+
+ if (category == LC_ALL)
+ return setlocale_null_with_lock (category, buf, bufsize);
+ else
+ return setlocale_null_unlocked (category, buf, bufsize);
+
+# else
+
+ return setlocale_null_with_lock (category, buf, bufsize);
+
+# endif
+#endif
+}
+
+const char *
+setlocale_null (int category)
+{
+#if SETLOCALE_NULL_ALL_MTSAFE && SETLOCALE_NULL_ONE_MTSAFE
+ return setlocale_null_androidfix (category);
+#else
+
+ /* This call must be multithread-safe. To achieve this without using
+ thread-local storage:
+ 1. We use a specific static buffer for each possible CATEGORY
+ argument. So that different threads can call setlocale_mtsafe
+ with different CATEGORY arguments, without interfering.
+ 2. We use a simple strcpy or memcpy to fill this static buffer.
+ Filling it through, for example, strcpy + strcat would not be
+ guaranteed to leave the buffer's contents intact if another thread
+ is currently accessing it. If necessary, the contents is first
+ assembled in a stack-allocated buffer. */
+ if (category == LC_ALL)
+ {
+# if SETLOCALE_NULL_ALL_MTSAFE
+ return setlocale_null_androidfix (LC_ALL);
+# else
+ char buf[SETLOCALE_NULL_ALL_MAX];
+ static char resultbuf[SETLOCALE_NULL_ALL_MAX];
+
+ if (setlocale_null_r (LC_ALL, buf, sizeof (buf)))
+ return "C";
+ strcpy (resultbuf, buf);
+ return resultbuf;
+# endif
+ }
+ else
+ {
+# if SETLOCALE_NULL_ONE_MTSAFE
+ return setlocale_null_androidfix (category);
+# else
+ enum
+ {
+ LC_CTYPE_INDEX,
+ LC_NUMERIC_INDEX,
+ LC_TIME_INDEX,
+ LC_COLLATE_INDEX,
+ LC_MONETARY_INDEX,
+ LC_MESSAGES_INDEX,
+# ifdef LC_PAPER
+ LC_PAPER_INDEX,
+# endif
+# ifdef LC_NAME
+ LC_NAME_INDEX,
+# endif
+# ifdef LC_ADDRESS
+ LC_ADDRESS_INDEX,
+# endif
+# ifdef LC_TELEPHONE
+ LC_TELEPHONE_INDEX,
+# endif
+# ifdef LC_MEASUREMENT
+ LC_MEASUREMENT_INDEX,
+# endif
+# ifdef LC_IDENTIFICATION
+ LC_IDENTIFICATION_INDEX,
+# endif
+ LC_INDICES_COUNT
+ }
+ i;
+ char buf[SETLOCALE_NULL_MAX];
+ static char resultbuf[LC_INDICES_COUNT][SETLOCALE_NULL_MAX];
+ int err;
+
+ err = setlocale_null_r (category, buf, sizeof (buf));
+ if (err == EINVAL)
+ return NULL;
+ if (err)
+ return "C";
+
+ switch (category)
+ {
+ case LC_CTYPE: i = LC_CTYPE_INDEX; break;
+ case LC_NUMERIC: i = LC_NUMERIC_INDEX; break;
+ case LC_TIME: i = LC_TIME_INDEX; break;
+ case LC_COLLATE: i = LC_COLLATE_INDEX; break;
+ case LC_MONETARY: i = LC_MONETARY_INDEX; break;
+ case LC_MESSAGES: i = LC_MESSAGES_INDEX; break;
+# ifdef LC_PAPER
+ case LC_PAPER: i = LC_PAPER_INDEX; break;
+# endif
+# ifdef LC_NAME
+ case LC_NAME: i = LC_NAME_INDEX; break;
+# endif
+# ifdef LC_ADDRESS
+ case LC_ADDRESS: i = LC_ADDRESS_INDEX; break;
+# endif
+# ifdef LC_TELEPHONE
+ case LC_TELEPHONE: i = LC_TELEPHONE_INDEX; break;
+# endif
+# ifdef LC_MEASUREMENT
+ case LC_MEASUREMENT: i = LC_MEASUREMENT_INDEX; break;
+# endif
+# ifdef LC_IDENTIFICATION
+ case LC_IDENTIFICATION: i = LC_IDENTIFICATION_INDEX; break;
+# endif
+ default:
+ /* If you get here, a #ifdef LC_xxx is missing. */
+ abort ();
+ }
+
+ strcpy (resultbuf[i], buf);
+ return resultbuf[i];
+# endif
+ }
+#endif
+}
diff --git a/gl/lib/setlocale_null.h b/gl/lib/setlocale_null.h
new file mode 100644
index 0000000..d1921b0
--- /dev/null
+++ b/gl/lib/setlocale_null.h
@@ -0,0 +1,82 @@
+/* Query the name of the current global locale.
+ Copyright (C) 2019-2022 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 2.1 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. */
+
+#ifndef _SETLOCALE_NULL_H
+#define _SETLOCALE_NULL_H
+
+#include <stddef.h>
+
+#include "arg-nonnull.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Recommended size of a buffer for a locale name for a single category.
+ On glibc systems, you can have locale names that are relative file names;
+ assume a maximum length 256.
+ In native Windows, in 2018 the longest locale name was of length 58
+ ("FYRO Macedonian_Former Yugoslav Republic of Macedonia.1251"). */
+#define SETLOCALE_NULL_MAX (256+1)
+
+/* Recommended size of a buffer for a locale name with all categories.
+ On glibc systems, you can have locale names that are relative file names;
+ assume maximum length 256 for each. There are 12 categories; so, the
+ maximum total length is 148+12*256.
+ In native Windows, there are 5 categories, and the maximum total length is
+ 55+5*58. */
+#define SETLOCALE_NULL_ALL_MAX (148+12*256+1)
+
+/* setlocale_null_r (CATEGORY, BUF, BUFSIZE) is like setlocale (CATEGORY, NULL),
+ except that
+ - it is guaranteed to be multithread-safe,
+ - it returns the resulting locale category name or locale name in the
+ user-supplied buffer BUF, which must be BUFSIZE bytes long.
+ The recommended minimum buffer size is
+ - SETLOCALE_NULL_MAX for CATEGORY != LC_ALL, and
+ - SETLOCALE_NULL_ALL_MAX for CATEGORY == LC_ALL.
+ The return value is an error code: 0 if the call is successful, EINVAL if
+ CATEGORY is invalid, or ERANGE if BUFSIZE is smaller than the length needed
+ size (including the trailing NUL byte). In the latter case, a truncated
+ result is returned in BUF, but still NUL-terminated if BUFSIZE > 0.
+ For this call to be multithread-safe, *all* calls to
+ setlocale (CATEGORY, NULL) in all other threads must have been converted
+ to use setlocale_null_r or setlocale_null as well, and the other threads
+ must not make other setlocale invocations (since changing the global locale
+ has side effects on all threads). */
+extern int setlocale_null_r (int category, char *buf, size_t bufsize)
+ _GL_ARG_NONNULL ((2));
+
+/* setlocale_null (CATEGORY) is like setlocale (CATEGORY, NULL), except that
+ it is guaranteed to be multithread-safe.
+ The return value is NULL if CATEGORY is invalid.
+ For this call to be multithread-safe, *all* calls to
+ setlocale (CATEGORY, NULL) in all other threads must have been converted
+ to use setlocale_null_r or setlocale_null as well, and the other threads
+ must not make other setlocale invocations (since changing the global locale
+ has side effects on all threads). */
+extern const char *setlocale_null (int category);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SETLOCALE_NULL_H */
diff --git a/gl/lib/sig-handler.c b/gl/lib/sig-handler.c
new file mode 100644
index 0000000..0ab63ec
--- /dev/null
+++ b/gl/lib/sig-handler.c
@@ -0,0 +1,21 @@
+/* Convenience declarations when working with <signal.h>.
+
+ Copyright (C) 2012-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+#define SIG_HANDLER_INLINE _GL_EXTERN_INLINE
+#include "sig-handler.h"
diff --git a/gl/lib/sig-handler.h b/gl/lib/sig-handler.h
new file mode 100644
index 0000000..1ca8d54
--- /dev/null
+++ b/gl/lib/sig-handler.h
@@ -0,0 +1,51 @@
+/* Convenience declarations when working with <signal.h>.
+
+ Copyright (C) 2008-2022 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 2.1 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/>. */
+
+#ifndef _GL_SIG_HANDLER_H
+#define _GL_SIG_HANDLER_H
+
+#include <signal.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef SIG_HANDLER_INLINE
+# define SIG_HANDLER_INLINE _GL_INLINE
+#endif
+
+/* Convenience type when working with signal handlers. */
+typedef void (*sa_handler_t) (int);
+
+/* Return the handler of a signal, as a sa_handler_t value regardless
+ of its true type. The resulting function can be compared to
+ special values like SIG_IGN but it is not portable to call it. */
+SIG_HANDLER_INLINE sa_handler_t _GL_ATTRIBUTE_PURE
+get_handler (struct sigaction const *a)
+{
+ /* POSIX says that special values like SIG_IGN can only occur when
+ action.sa_flags does not contain SA_SIGINFO. But in Linux 2.4,
+ for example, sa_sigaction and sa_handler are aliases and a signal
+ is ignored if sa_sigaction (after casting) equals SIG_IGN. In
+ this case, this implementation relies on the fact that the two
+ are aliases, and simply returns sa_handler. */
+ return a->sa_handler;
+}
+
+_GL_INLINE_HEADER_END
+
+#endif /* _GL_SIG_HANDLER_H */
diff --git a/gl/lib/sigaction.c b/gl/lib/sigaction.c
new file mode 100644
index 0000000..953a6ca
--- /dev/null
+++ b/gl/lib/sigaction.c
@@ -0,0 +1,204 @@
+/* POSIX compatible signal blocking.
+ Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Written by Eric Blake <ebb9@byu.net>, 2008.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <signal.h>
+
+#include <errno.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+/* This implementation of sigaction is tailored to native Windows behavior:
+ signal() has SysV semantics (ie. the handler is uninstalled before
+ it is invoked). This is an inherent data race if an asynchronous
+ signal is sent twice in a row before we can reinstall our handler,
+ but there's nothing we can do about it. Meanwhile, sigprocmask()
+ is not present, and while we can use the gnulib replacement to
+ provide critical sections, it too suffers from potential data races
+ in the face of an ill-timed asynchronous signal. And we compound
+ the situation by reading static storage in a signal handler, which
+ POSIX warns is not generically async-signal-safe. Oh well.
+
+ Additionally:
+ - We don't implement SA_NOCLDSTOP or SA_NOCLDWAIT, because SIGCHLD
+ is not defined.
+ - We don't implement SA_ONSTACK, because sigaltstack() is not present.
+ - We ignore SA_RESTART, because blocking native Windows API calls are
+ not interrupted anyway when an asynchronous signal occurs, and the
+ MSVCRT runtime never sets errno to EINTR.
+ - We don't implement SA_SIGINFO because it is impossible to do so
+ portably.
+
+ POSIX states that an application should not mix signal() and
+ sigaction(). We support the use of signal() within the gnulib
+ sigprocmask() substitute, but all other application code linked
+ with this module should stick with only sigaction(). */
+
+/* Check some of our assumptions. */
+#if defined SIGCHLD || defined HAVE_SIGALTSTACK || defined HAVE_SIGINTERRUPT
+# error "Revisit the assumptions made in the sigaction module"
+#endif
+
+/* Out-of-range substitutes make a good fallback for uncatchable
+ signals. */
+#ifndef SIGKILL
+# define SIGKILL (-1)
+#endif
+#ifndef SIGSTOP
+# define SIGSTOP (-1)
+#endif
+
+/* On native Windows, as of 2008, the signal SIGABRT_COMPAT is an alias
+ for the signal SIGABRT. Only one signal handler is stored for both
+ SIGABRT and SIGABRT_COMPAT. SIGABRT_COMPAT is not a signal of its own. */
+#if defined _WIN32 && ! defined __CYGWIN__
+# undef SIGABRT_COMPAT
+# define SIGABRT_COMPAT 6
+#endif
+
+/* A signal handler. */
+typedef void (*handler_t) (int signal);
+
+/* Set of current actions. If sa_handler for an entry is NULL, then
+ that signal is not currently handled by the sigaction handler. */
+static struct sigaction volatile action_array[NSIG] /* = 0 */;
+
+/* Signal handler that is installed for signals. */
+static void
+sigaction_handler (int sig)
+{
+ handler_t handler;
+ sigset_t mask;
+ sigset_t oldmask;
+ int saved_errno = errno;
+ if (sig < 0 || NSIG <= sig || !action_array[sig].sa_handler)
+ {
+ /* Unexpected situation; be careful to avoid recursive abort. */
+ if (sig == SIGABRT)
+ signal (SIGABRT, SIG_DFL);
+ abort ();
+ }
+
+ /* Reinstall the signal handler when required; otherwise update the
+ bookkeeping so that the user's handler may call sigaction and get
+ accurate results. We know the signal isn't currently blocked, or
+ we wouldn't be in its handler, therefore we know that we are not
+ interrupting a sigaction() call. There is a race where any
+ asynchronous instance of the same signal occurring before we
+ reinstall the handler will trigger the default handler; oh
+ well. */
+ handler = action_array[sig].sa_handler;
+ if ((action_array[sig].sa_flags & SA_RESETHAND) == 0)
+ signal (sig, sigaction_handler);
+ else
+ action_array[sig].sa_handler = NULL;
+
+ /* Block appropriate signals. */
+ mask = action_array[sig].sa_mask;
+ if ((action_array[sig].sa_flags & SA_NODEFER) == 0)
+ sigaddset (&mask, sig);
+ sigprocmask (SIG_BLOCK, &mask, &oldmask);
+
+ /* Invoke the user's handler, then restore prior mask. */
+ errno = saved_errno;
+ handler (sig);
+ saved_errno = errno;
+ sigprocmask (SIG_SETMASK, &oldmask, NULL);
+ errno = saved_errno;
+}
+
+/* Change and/or query the action that will be taken on delivery of
+ signal SIG. If not NULL, ACT describes the new behavior. If not
+ NULL, OACT is set to the prior behavior. Return 0 on success, or
+ set errno and return -1 on failure. */
+int
+sigaction (int sig, const struct sigaction *restrict act,
+ struct sigaction *restrict oact)
+{
+ sigset_t mask;
+ sigset_t oldmask;
+ int saved_errno;
+
+ if (sig < 0 || NSIG <= sig || sig == SIGKILL || sig == SIGSTOP
+ || (act && act->sa_handler == SIG_ERR))
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
+#ifdef SIGABRT_COMPAT
+ if (sig == SIGABRT_COMPAT)
+ sig = SIGABRT;
+#endif
+
+ /* POSIX requires sigaction() to be async-signal-safe. In other
+ words, if an asynchronous signal can occur while we are anywhere
+ inside this function, the user's handler could then call
+ sigaction() recursively and expect consistent results. We meet
+ this rule by using sigprocmask to block all signals before
+ modifying any data structure that could be read from a signal
+ handler; this works since we know that the gnulib sigprocmask
+ replacement does not try to use sigaction() from its handler. */
+ if (!act && !oact)
+ return 0;
+ sigfillset (&mask);
+ sigprocmask (SIG_BLOCK, &mask, &oldmask);
+ if (oact)
+ {
+ if (action_array[sig].sa_handler)
+ *oact = action_array[sig];
+ else
+ {
+ /* Safe to change the handler at will here, since all
+ signals are currently blocked. */
+ oact->sa_handler = signal (sig, SIG_DFL);
+ if (oact->sa_handler == SIG_ERR)
+ goto failure;
+ signal (sig, oact->sa_handler);
+ oact->sa_flags = SA_RESETHAND | SA_NODEFER;
+ sigemptyset (&oact->sa_mask);
+ }
+ }
+
+ if (act)
+ {
+ /* Safe to install the handler before updating action_array,
+ since all signals are currently blocked. */
+ if (act->sa_handler == SIG_DFL || act->sa_handler == SIG_IGN)
+ {
+ if (signal (sig, act->sa_handler) == SIG_ERR)
+ goto failure;
+ action_array[sig].sa_handler = NULL;
+ }
+ else
+ {
+ if (signal (sig, sigaction_handler) == SIG_ERR)
+ goto failure;
+ action_array[sig] = *act;
+ }
+ }
+ sigprocmask (SIG_SETMASK, &oldmask, NULL);
+ return 0;
+
+ failure:
+ saved_errno = errno;
+ sigprocmask (SIG_SETMASK, &oldmask, NULL);
+ errno = saved_errno;
+ return -1;
+}
diff --git a/gl/lib/signal.in.h b/gl/lib/signal.in.h
new file mode 100644
index 0000000..640b502
--- /dev/null
+++ b/gl/lib/signal.in.h
@@ -0,0 +1,487 @@
+/* A GNU-like <signal.h>.
+
+ Copyright (C) 2006-2022 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 2.1 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 __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined __need_sig_atomic_t || defined __need_sigset_t || defined _GL_ALREADY_INCLUDING_SIGNAL_H || (defined _SIGNAL_H && !defined __SIZEOF_PTHREAD_MUTEX_T)
+/* Special invocation convention:
+ - Inside glibc header files.
+ - On glibc systems we have a sequence of nested includes
+ <signal.h> -> <ucontext.h> -> <signal.h>.
+ In this situation, the functions are not yet declared, therefore we cannot
+ provide the C++ aliases.
+ - On glibc systems with GCC 4.3 we have a sequence of nested includes
+ <csignal> -> </usr/include/signal.h> -> <sys/ucontext.h> -> <signal.h>.
+ In this situation, some of the functions are not yet declared, therefore
+ we cannot provide the C++ aliases. */
+
+# @INCLUDE_NEXT@ @NEXT_SIGNAL_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_SIGNAL_H
+
+#define _GL_ALREADY_INCLUDING_SIGNAL_H
+
+/* Define pid_t, uid_t.
+ Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>.
+ On Solaris 10, <signal.h> includes <sys/types.h>, which eventually includes
+ us; so include <sys/types.h> now, before the second inclusion guard. */
+#include <sys/types.h>
+
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_SIGNAL_H@
+
+#undef _GL_ALREADY_INCLUDING_SIGNAL_H
+
+#ifndef _@GUARD_PREFIX@_SIGNAL_H
+#define _@GUARD_PREFIX@_SIGNAL_H
+
+/* Mac OS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6, Android,
+ OS/2 kLIBC declare pthread_sigmask in <pthread.h>, not in <signal.h>.
+ But avoid namespace pollution on glibc systems.*/
+#if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \
+ && ((defined __APPLE__ && defined __MACH__) \
+ || defined __FreeBSD__ || defined __OpenBSD__ || defined __osf__ \
+ || defined __sun || defined __ANDROID__ || defined __KLIBC__) \
+ && ! defined __GLIBC__
+# include <pthread.h>
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* On AIX, sig_atomic_t already includes volatile. C99 requires that
+ 'volatile sig_atomic_t' ignore the extra modifier, but C89 did not.
+ Hence, redefine this to a non-volatile type as needed. */
+#if ! @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
+# if !GNULIB_defined_sig_atomic_t
+typedef int rpl_sig_atomic_t;
+# undef sig_atomic_t
+# define sig_atomic_t rpl_sig_atomic_t
+# define GNULIB_defined_sig_atomic_t 1
+# endif
+#endif
+
+/* A set or mask of signals. */
+#if !@HAVE_SIGSET_T@
+# if !GNULIB_defined_sigset_t
+typedef unsigned int sigset_t;
+# define GNULIB_defined_sigset_t 1
+# endif
+#endif
+
+/* Define sighandler_t, the type of signal handlers. A GNU extension. */
+#if !@HAVE_SIGHANDLER_T@
+# ifdef __cplusplus
+extern "C" {
+# endif
+# if !GNULIB_defined_sighandler_t
+typedef void (*sighandler_t) (int);
+# define GNULIB_defined_sighandler_t 1
+# endif
+# ifdef __cplusplus
+}
+# endif
+#endif
+
+
+#if @GNULIB_SIGNAL_H_SIGPIPE@
+# ifndef SIGPIPE
+/* Define SIGPIPE to a value that does not overlap with other signals. */
+# define SIGPIPE 13
+# define GNULIB_defined_SIGPIPE 1
+/* To actually use SIGPIPE, you also need the gnulib modules 'sigprocmask',
+ 'write', 'stdio'. */
+# endif
+#endif
+
+
+/* Maximum signal number + 1. */
+#ifndef NSIG
+# if defined __TANDEM
+# define NSIG 32
+# endif
+#endif
+
+
+#if @GNULIB_PTHREAD_SIGMASK@
+# if @REPLACE_PTHREAD_SIGMASK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pthread_sigmask
+# define pthread_sigmask rpl_pthread_sigmask
+# endif
+_GL_FUNCDECL_RPL (pthread_sigmask, int,
+ (int how,
+ const sigset_t *restrict new_mask,
+ sigset_t *restrict old_mask));
+_GL_CXXALIAS_RPL (pthread_sigmask, int,
+ (int how,
+ const sigset_t *restrict new_mask,
+ sigset_t *restrict old_mask));
+# else
+# if !(@HAVE_PTHREAD_SIGMASK@ || defined pthread_sigmask)
+_GL_FUNCDECL_SYS (pthread_sigmask, int,
+ (int how,
+ const sigset_t *restrict new_mask,
+ sigset_t *restrict old_mask));
+# endif
+_GL_CXXALIAS_SYS (pthread_sigmask, int,
+ (int how,
+ const sigset_t *restrict new_mask,
+ sigset_t *restrict old_mask));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_sigmask);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_sigmask
+# if HAVE_RAW_DECL_PTHREAD_SIGMASK
+_GL_WARN_ON_USE (pthread_sigmask, "pthread_sigmask is not portable - "
+ "use gnulib module pthread_sigmask for portability");
+# endif
+#endif
+
+
+#if @GNULIB_RAISE@
+# if @REPLACE_RAISE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef raise
+# define raise rpl_raise
+# endif
+_GL_FUNCDECL_RPL (raise, int, (int sig));
+_GL_CXXALIAS_RPL (raise, int, (int sig));
+# else
+# if !@HAVE_RAISE@
+_GL_FUNCDECL_SYS (raise, int, (int sig));
+# endif
+_GL_CXXALIAS_SYS (raise, int, (int sig));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (raise);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef raise
+/* Assume raise is always declared. */
+_GL_WARN_ON_USE (raise, "raise can crash on native Windows - "
+ "use gnulib module raise for portability");
+#endif
+
+
+#if @GNULIB_SIGPROCMASK@
+# if !@HAVE_POSIX_SIGNALBLOCKING@
+
+# ifndef GNULIB_defined_signal_blocking
+# define GNULIB_defined_signal_blocking 1
+# endif
+
+/* Maximum signal number + 1. */
+# ifndef NSIG
+# define NSIG 32
+# endif
+
+/* This code supports only 32 signals. */
+# if !GNULIB_defined_verify_NSIG_constraint
+typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1];
+# define GNULIB_defined_verify_NSIG_constraint 1
+# endif
+
+# endif
+
+/* When also using extern inline, suppress the use of static inline in
+ standard headers of problematic Apple configurations, as Libc at
+ least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
+ <https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html>.
+ Perhaps Apple will fix this some day. */
+#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
+ && (defined __i386__ || defined __x86_64__))
+# undef sigaddset
+# undef sigdelset
+# undef sigemptyset
+# undef sigfillset
+# undef sigismember
+#endif
+
+/* Test whether a given signal is contained in a signal set. */
+# if @HAVE_POSIX_SIGNALBLOCKING@
+/* This function is defined as a macro on Mac OS X. */
+# if defined __cplusplus && defined GNULIB_NAMESPACE
+# undef sigismember
+# endif
+# else
+_GL_FUNCDECL_SYS (sigismember, int, (const sigset_t *set, int sig)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (sigismember, int, (const sigset_t *set, int sig));
+_GL_CXXALIASWARN (sigismember);
+
+/* Initialize a signal set to the empty set. */
+# if @HAVE_POSIX_SIGNALBLOCKING@
+/* This function is defined as a macro on Mac OS X. */
+# if defined __cplusplus && defined GNULIB_NAMESPACE
+# undef sigemptyset
+# endif
+# else
+_GL_FUNCDECL_SYS (sigemptyset, int, (sigset_t *set) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (sigemptyset, int, (sigset_t *set));
+_GL_CXXALIASWARN (sigemptyset);
+
+/* Add a signal to a signal set. */
+# if @HAVE_POSIX_SIGNALBLOCKING@
+/* This function is defined as a macro on Mac OS X. */
+# if defined __cplusplus && defined GNULIB_NAMESPACE
+# undef sigaddset
+# endif
+# else
+_GL_FUNCDECL_SYS (sigaddset, int, (sigset_t *set, int sig)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (sigaddset, int, (sigset_t *set, int sig));
+_GL_CXXALIASWARN (sigaddset);
+
+/* Remove a signal from a signal set. */
+# if @HAVE_POSIX_SIGNALBLOCKING@
+/* This function is defined as a macro on Mac OS X. */
+# if defined __cplusplus && defined GNULIB_NAMESPACE
+# undef sigdelset
+# endif
+# else
+_GL_FUNCDECL_SYS (sigdelset, int, (sigset_t *set, int sig)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (sigdelset, int, (sigset_t *set, int sig));
+_GL_CXXALIASWARN (sigdelset);
+
+/* Fill a signal set with all possible signals. */
+# if @HAVE_POSIX_SIGNALBLOCKING@
+/* This function is defined as a macro on Mac OS X. */
+# if defined __cplusplus && defined GNULIB_NAMESPACE
+# undef sigfillset
+# endif
+# else
+_GL_FUNCDECL_SYS (sigfillset, int, (sigset_t *set) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (sigfillset, int, (sigset_t *set));
+_GL_CXXALIASWARN (sigfillset);
+
+/* Return the set of those blocked signals that are pending. */
+# if !@HAVE_POSIX_SIGNALBLOCKING@
+_GL_FUNCDECL_SYS (sigpending, int, (sigset_t *set) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (sigpending, int, (sigset_t *set));
+_GL_CXXALIASWARN (sigpending);
+
+/* If OLD_SET is not NULL, put the current set of blocked signals in *OLD_SET.
+ Then, if SET is not NULL, affect the current set of blocked signals by
+ combining it with *SET as indicated in OPERATION.
+ In this implementation, you are not allowed to change a signal handler
+ while the signal is blocked. */
+# if !@HAVE_POSIX_SIGNALBLOCKING@
+# define SIG_BLOCK 0 /* blocked_set = blocked_set | *set; */
+# define SIG_SETMASK 1 /* blocked_set = *set; */
+# define SIG_UNBLOCK 2 /* blocked_set = blocked_set & ~*set; */
+_GL_FUNCDECL_SYS (sigprocmask, int,
+ (int operation,
+ const sigset_t *restrict set,
+ sigset_t *restrict old_set));
+# endif
+_GL_CXXALIAS_SYS (sigprocmask, int,
+ (int operation,
+ const sigset_t *restrict set,
+ sigset_t *restrict old_set));
+_GL_CXXALIASWARN (sigprocmask);
+
+/* Install the handler FUNC for signal SIG, and return the previous
+ handler. */
+# ifdef __cplusplus
+extern "C" {
+# endif
+# if !GNULIB_defined_function_taking_int_returning_void_t
+typedef void (*_gl_function_taking_int_returning_void_t) (int);
+# define GNULIB_defined_function_taking_int_returning_void_t 1
+# endif
+# ifdef __cplusplus
+}
+# endif
+# if !@HAVE_POSIX_SIGNALBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define signal rpl_signal
+# endif
+_GL_FUNCDECL_RPL (signal, _gl_function_taking_int_returning_void_t,
+ (int sig, _gl_function_taking_int_returning_void_t func));
+_GL_CXXALIAS_RPL (signal, _gl_function_taking_int_returning_void_t,
+ (int sig, _gl_function_taking_int_returning_void_t func));
+# else
+/* On OpenBSD, the declaration of 'signal' may not be present at this point,
+ because it occurs in <sys/signal.h>, not <signal.h> directly. */
+# if defined __OpenBSD__
+_GL_FUNCDECL_SYS (signal, _gl_function_taking_int_returning_void_t,
+ (int sig, _gl_function_taking_int_returning_void_t func));
+# endif
+_GL_CXXALIAS_SYS (signal, _gl_function_taking_int_returning_void_t,
+ (int sig, _gl_function_taking_int_returning_void_t func));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (signal);
+# endif
+
+# if !@HAVE_POSIX_SIGNALBLOCKING@ && GNULIB_defined_SIGPIPE
+/* Raise signal SIGPIPE. */
+_GL_EXTERN_C int _gl_raise_SIGPIPE (void);
+# endif
+
+#elif defined GNULIB_POSIXCHECK
+# undef sigaddset
+# if HAVE_RAW_DECL_SIGADDSET
+_GL_WARN_ON_USE (sigaddset, "sigaddset is unportable - "
+ "use the gnulib module sigprocmask for portability");
+# endif
+# undef sigdelset
+# if HAVE_RAW_DECL_SIGDELSET
+_GL_WARN_ON_USE (sigdelset, "sigdelset is unportable - "
+ "use the gnulib module sigprocmask for portability");
+# endif
+# undef sigemptyset
+# if HAVE_RAW_DECL_SIGEMPTYSET
+_GL_WARN_ON_USE (sigemptyset, "sigemptyset is unportable - "
+ "use the gnulib module sigprocmask for portability");
+# endif
+# undef sigfillset
+# if HAVE_RAW_DECL_SIGFILLSET
+_GL_WARN_ON_USE (sigfillset, "sigfillset is unportable - "
+ "use the gnulib module sigprocmask for portability");
+# endif
+# undef sigismember
+# if HAVE_RAW_DECL_SIGISMEMBER
+_GL_WARN_ON_USE (sigismember, "sigismember is unportable - "
+ "use the gnulib module sigprocmask for portability");
+# endif
+# undef sigpending
+# if HAVE_RAW_DECL_SIGPENDING
+_GL_WARN_ON_USE (sigpending, "sigpending is unportable - "
+ "use the gnulib module sigprocmask for portability");
+# endif
+# undef sigprocmask
+# if HAVE_RAW_DECL_SIGPROCMASK
+_GL_WARN_ON_USE (sigprocmask, "sigprocmask is unportable - "
+ "use the gnulib module sigprocmask for portability");
+# endif
+#endif /* @GNULIB_SIGPROCMASK@ */
+
+
+#if @GNULIB_SIGACTION@
+# if !@HAVE_SIGACTION@
+
+# if !@HAVE_SIGINFO_T@
+
+# if !GNULIB_defined_siginfo_types
+
+/* Present to allow compilation, but unsupported by gnulib. */
+union sigval
+{
+ int sival_int;
+ void *sival_ptr;
+};
+
+/* Present to allow compilation, but unsupported by gnulib. */
+struct siginfo_t
+{
+ int si_signo;
+ int si_code;
+ int si_errno;
+ pid_t si_pid;
+ uid_t si_uid;
+ void *si_addr;
+ int si_status;
+ long si_band;
+ union sigval si_value;
+};
+typedef struct siginfo_t siginfo_t;
+
+# define GNULIB_defined_siginfo_types 1
+# endif
+
+# endif /* !@HAVE_SIGINFO_T@ */
+
+/* We assume that platforms which lack the sigaction() function also lack
+ the 'struct sigaction' type, and vice versa. */
+
+# if !GNULIB_defined_struct_sigaction
+
+struct sigaction
+{
+ union
+ {
+ void (*_sa_handler) (int);
+ /* Present to allow compilation, but unsupported by gnulib. POSIX
+ says that implementations may, but not must, make sa_sigaction
+ overlap with sa_handler, but we know of no implementation where
+ they do not overlap. */
+ void (*_sa_sigaction) (int, siginfo_t *, void *);
+ } _sa_func;
+ sigset_t sa_mask;
+ /* Not all POSIX flags are supported. */
+ int sa_flags;
+};
+# define sa_handler _sa_func._sa_handler
+# define sa_sigaction _sa_func._sa_sigaction
+/* Unsupported flags are not present. */
+# define SA_RESETHAND 1
+# define SA_NODEFER 2
+# define SA_RESTART 4
+
+# define GNULIB_defined_struct_sigaction 1
+# endif
+
+_GL_FUNCDECL_SYS (sigaction, int, (int, const struct sigaction *restrict,
+ struct sigaction *restrict));
+
+# elif !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@
+
+# define sa_sigaction sa_handler
+
+# endif /* !@HAVE_SIGACTION@, !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@ */
+
+_GL_CXXALIAS_SYS (sigaction, int, (int, const struct sigaction *restrict,
+ struct sigaction *restrict));
+_GL_CXXALIASWARN (sigaction);
+
+#elif defined GNULIB_POSIXCHECK
+# undef sigaction
+# if HAVE_RAW_DECL_SIGACTION
+_GL_WARN_ON_USE (sigaction, "sigaction is unportable - "
+ "use the gnulib module sigaction for portability");
+# endif
+#endif
+
+/* Some systems don't have SA_NODEFER. */
+#ifndef SA_NODEFER
+# define SA_NODEFER 0
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_SIGNAL_H */
+#endif /* _@GUARD_PREFIX@_SIGNAL_H */
+#endif
diff --git a/gl/lib/sigprocmask.c b/gl/lib/sigprocmask.c
new file mode 100644
index 0000000..a805da6
--- /dev/null
+++ b/gl/lib/sigprocmask.c
@@ -0,0 +1,349 @@
+/* POSIX compatible signal blocking.
+ Copyright (C) 2006-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <signal.h>
+
+#include <errno.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+#endif
+
+/* We assume that a platform without POSIX signal blocking functions
+ also does not have the POSIX sigaction() function, only the
+ signal() function. We also assume signal() has SysV semantics,
+ where any handler is uninstalled prior to being invoked. This is
+ true for native Windows platforms. */
+
+/* We use raw signal(), but also provide a wrapper rpl_signal() so
+ that applications can query or change a blocked signal. */
+#undef signal
+
+/* Provide invalid signal numbers as fallbacks if the uncatchable
+ signals are not defined. */
+#ifndef SIGKILL
+# define SIGKILL (-1)
+#endif
+#ifndef SIGSTOP
+# define SIGSTOP (-1)
+#endif
+
+/* On native Windows, as of 2008, the signal SIGABRT_COMPAT is an alias
+ for the signal SIGABRT. Only one signal handler is stored for both
+ SIGABRT and SIGABRT_COMPAT. SIGABRT_COMPAT is not a signal of its own. */
+#if defined _WIN32 && ! defined __CYGWIN__
+# undef SIGABRT_COMPAT
+# define SIGABRT_COMPAT 6
+#endif
+#ifdef SIGABRT_COMPAT
+# define SIGABRT_COMPAT_MASK (1U << SIGABRT_COMPAT)
+#else
+# define SIGABRT_COMPAT_MASK 0
+#endif
+
+typedef void (*handler_t) (int);
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static handler_t
+signal_nothrow (int sig, handler_t handler)
+{
+ handler_t result;
+
+ TRY_MSVC_INVAL
+ {
+ result = signal (sig, handler);
+ }
+ CATCH_MSVC_INVAL
+ {
+ result = SIG_ERR;
+ errno = EINVAL;
+ }
+ DONE_MSVC_INVAL;
+
+ return result;
+}
+# define signal signal_nothrow
+#endif
+
+/* Handling of gnulib defined signals. */
+
+#if GNULIB_defined_SIGPIPE
+static handler_t SIGPIPE_handler = SIG_DFL;
+#endif
+
+#if GNULIB_defined_SIGPIPE
+static handler_t
+ext_signal (int sig, handler_t handler)
+{
+ switch (sig)
+ {
+ case SIGPIPE:
+ {
+ handler_t old_handler = SIGPIPE_handler;
+ SIGPIPE_handler = handler;
+ return old_handler;
+ }
+ default: /* System defined signal */
+ return signal (sig, handler);
+ }
+}
+# undef signal
+# define signal ext_signal
+#endif
+
+int
+sigismember (const sigset_t *set, int sig)
+{
+ if (sig >= 0 && sig < NSIG)
+ {
+ #ifdef SIGABRT_COMPAT
+ if (sig == SIGABRT_COMPAT)
+ sig = SIGABRT;
+ #endif
+
+ return (*set >> sig) & 1;
+ }
+ else
+ return 0;
+}
+
+int
+sigemptyset (sigset_t *set)
+{
+ *set = 0;
+ return 0;
+}
+
+int
+sigaddset (sigset_t *set, int sig)
+{
+ if (sig >= 0 && sig < NSIG)
+ {
+ #ifdef SIGABRT_COMPAT
+ if (sig == SIGABRT_COMPAT)
+ sig = SIGABRT;
+ #endif
+
+ *set |= 1U << sig;
+ return 0;
+ }
+ else
+ {
+ errno = EINVAL;
+ return -1;
+ }
+}
+
+int
+sigdelset (sigset_t *set, int sig)
+{
+ if (sig >= 0 && sig < NSIG)
+ {
+ #ifdef SIGABRT_COMPAT
+ if (sig == SIGABRT_COMPAT)
+ sig = SIGABRT;
+ #endif
+
+ *set &= ~(1U << sig);
+ return 0;
+ }
+ else
+ {
+ errno = EINVAL;
+ return -1;
+ }
+}
+
+
+int
+sigfillset (sigset_t *set)
+{
+ *set = ((2U << (NSIG - 1)) - 1) & ~ SIGABRT_COMPAT_MASK;
+ return 0;
+}
+
+/* Set of currently blocked signals. */
+static volatile sigset_t blocked_set /* = 0 */;
+
+/* Set of currently blocked and pending signals. */
+static volatile sig_atomic_t pending_array[NSIG] /* = { 0 } */;
+
+/* Signal handler that is installed for blocked signals. */
+static void
+blocked_handler (int sig)
+{
+ /* Reinstall the handler, in case the signal occurs multiple times
+ while blocked. There is an inherent race where an asynchronous
+ signal in between when the kernel uninstalled the handler and
+ when we reinstall it will trigger the default handler; oh
+ well. */
+ signal (sig, blocked_handler);
+ if (sig >= 0 && sig < NSIG)
+ pending_array[sig] = 1;
+}
+
+int
+sigpending (sigset_t *set)
+{
+ sigset_t pending = 0;
+ int sig;
+
+ for (sig = 0; sig < NSIG; sig++)
+ if (pending_array[sig])
+ pending |= 1U << sig;
+ *set = pending;
+ return 0;
+}
+
+/* The previous signal handlers.
+ Only the array elements corresponding to blocked signals are relevant. */
+static volatile handler_t old_handlers[NSIG];
+
+int
+sigprocmask (int operation, const sigset_t *set, sigset_t *old_set)
+{
+ if (old_set != NULL)
+ *old_set = blocked_set;
+
+ if (set != NULL)
+ {
+ sigset_t new_blocked_set;
+ sigset_t to_unblock;
+ sigset_t to_block;
+
+ switch (operation)
+ {
+ case SIG_BLOCK:
+ new_blocked_set = blocked_set | *set;
+ break;
+ case SIG_SETMASK:
+ new_blocked_set = *set;
+ break;
+ case SIG_UNBLOCK:
+ new_blocked_set = blocked_set & ~*set;
+ break;
+ default:
+ errno = EINVAL;
+ return -1;
+ }
+ to_unblock = blocked_set & ~new_blocked_set;
+ to_block = new_blocked_set & ~blocked_set;
+
+ if (to_block != 0)
+ {
+ int sig;
+
+ for (sig = 0; sig < NSIG; sig++)
+ if ((to_block >> sig) & 1)
+ {
+ pending_array[sig] = 0;
+ if ((old_handlers[sig] = signal (sig, blocked_handler)) != SIG_ERR)
+ blocked_set |= 1U << sig;
+ }
+ }
+
+ if (to_unblock != 0)
+ {
+ sig_atomic_t received[NSIG];
+ int sig;
+
+ for (sig = 0; sig < NSIG; sig++)
+ if ((to_unblock >> sig) & 1)
+ {
+ if (signal (sig, old_handlers[sig]) != blocked_handler)
+ /* The application changed a signal handler while the signal
+ was blocked, bypassing our rpl_signal replacement.
+ We don't support this. */
+ abort ();
+ received[sig] = pending_array[sig];
+ blocked_set &= ~(1U << sig);
+ pending_array[sig] = 0;
+ }
+ else
+ received[sig] = 0;
+
+ for (sig = 0; sig < NSIG; sig++)
+ if (received[sig])
+ raise (sig);
+ }
+ }
+ return 0;
+}
+
+/* Install the handler FUNC for signal SIG, and return the previous
+ handler. */
+handler_t
+rpl_signal (int sig, handler_t handler)
+{
+ /* We must provide a wrapper, so that a user can query what handler
+ they installed even if that signal is currently blocked. */
+ if (sig >= 0 && sig < NSIG && sig != SIGKILL && sig != SIGSTOP
+ && handler != SIG_ERR)
+ {
+ #ifdef SIGABRT_COMPAT
+ if (sig == SIGABRT_COMPAT)
+ sig = SIGABRT;
+ #endif
+
+ if (blocked_set & (1U << sig))
+ {
+ /* POSIX states that sigprocmask and signal are both
+ async-signal-safe. This is not true of our
+ implementation - there is a slight data race where an
+ asynchronous interrupt on signal A can occur after we
+ install blocked_handler but before we have updated
+ old_handlers for signal B, such that handler A can see
+ stale information if it calls signal(B). Oh well -
+ signal handlers really shouldn't try to manipulate the
+ installed handlers of unrelated signals. */
+ handler_t result = old_handlers[sig];
+ old_handlers[sig] = handler;
+ return result;
+ }
+ else
+ return signal (sig, handler);
+ }
+ else
+ {
+ errno = EINVAL;
+ return SIG_ERR;
+ }
+}
+
+#if GNULIB_defined_SIGPIPE
+/* Raise the signal SIGPIPE. */
+int
+_gl_raise_SIGPIPE (void)
+{
+ if (blocked_set & (1U << SIGPIPE))
+ pending_array[SIGPIPE] = 1;
+ else
+ {
+ handler_t handler = SIGPIPE_handler;
+ if (handler == SIG_DFL)
+ exit (128 + SIGPIPE);
+ else if (handler != SIG_IGN)
+ (*handler) (SIGPIPE);
+ }
+ return 0;
+}
+#endif
diff --git a/gl/lib/size_max.h b/gl/lib/size_max.h
new file mode 100644
index 0000000..dee2b8e
--- /dev/null
+++ b/gl/lib/size_max.h
@@ -0,0 +1,30 @@
+/* size_max.h -- declare SIZE_MAX through system headers
+ Copyright (C) 2005-2006, 2009-2022 Free Software Foundation, Inc.
+ Written by Simon Josefsson.
+
+ 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 2.1 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/>. */
+
+#ifndef GNULIB_SIZE_MAX_H
+#define GNULIB_SIZE_MAX_H
+
+/* Get SIZE_MAX declaration on systems like Solaris 7/8/9. */
+# include <limits.h>
+/* Get SIZE_MAX declaration on systems like glibc 2. */
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+/* On systems where these include files don't define it, SIZE_MAX is defined
+ in config.h. */
+
+#endif /* GNULIB_SIZE_MAX_H */
diff --git a/gl/lib/sleep.c b/gl/lib/sleep.c
new file mode 100644
index 0000000..7a6fb15
--- /dev/null
+++ b/gl/lib/sleep.c
@@ -0,0 +1,76 @@
+/* Pausing execution of the current thread.
+ Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2007.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#include <limits.h>
+
+#include "verify.h"
+
+#if defined _WIN32 && ! defined __CYGWIN__
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+unsigned int
+sleep (unsigned int seconds)
+{
+ unsigned int remaining;
+
+ /* Sleep for 1 second many times, because
+ 1. Sleep is not interruptible by Ctrl-C,
+ 2. we want to avoid arithmetic overflow while multiplying with 1000. */
+ for (remaining = seconds; remaining > 0; remaining--)
+ Sleep (1000);
+
+ return remaining;
+}
+
+#elif HAVE_SLEEP
+
+# undef sleep
+
+/* Guarantee unlimited sleep and a reasonable return value. Cygwin
+ 1.5.x rejects attempts to sleep more than 49.7 days (2**32
+ milliseconds), but uses uninitialized memory which results in a
+ garbage answer. Similarly, Linux 2.6.9 with glibc 2.3.4 has a too
+ small return value when asked to sleep more than 24.85 days. */
+unsigned int
+rpl_sleep (unsigned int seconds)
+{
+ /* This requires int larger than 16 bits. */
+ verify (UINT_MAX / 24 / 24 / 60 / 60);
+ const unsigned int limit = 24 * 24 * 60 * 60;
+ while (limit < seconds)
+ {
+ unsigned int result;
+ seconds -= limit;
+ result = sleep (limit);
+ if (result)
+ return seconds + result;
+ }
+ return sleep (seconds);
+}
+
+#else /* !HAVE_SLEEP */
+
+ #error "Please port gnulib sleep.c to your platform, possibly using usleep() or select(), then report this to bug-gnulib."
+
+#endif
diff --git a/gl/lib/sockets.c b/gl/lib/sockets.c
new file mode 100644
index 0000000..31b4302
--- /dev/null
+++ b/gl/lib/sockets.c
@@ -0,0 +1,161 @@
+/* sockets.c --- wrappers for Windows socket functions
+
+ Copyright (C) 2008-2022 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 2.1 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 Simon Josefsson */
+
+#include <config.h>
+
+/* Specification. */
+#include "sockets.h"
+
+#if WINDOWS_SOCKETS
+
+/* This includes winsock2.h on MinGW. */
+# include <sys/socket.h>
+
+# include "fd-hook.h"
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+# include "w32sock.h"
+
+static int
+close_fd_maybe_socket (const struct fd_hook *remaining_list,
+ gl_close_fn primary,
+ int fd)
+{
+ /* Note about multithread-safety: There is a race condition where, between
+ our calls to closesocket() and the primary close(), some other thread
+ could make system calls that allocate precisely the same HANDLE value
+ as sock; then the primary close() would call CloseHandle() on it. */
+ SOCKET sock;
+ WSANETWORKEVENTS ev;
+
+ /* Test whether fd refers to a socket. */
+ sock = FD_TO_SOCKET (fd);
+ ev.lNetworkEvents = 0xDEADBEEF;
+ WSAEnumNetworkEvents (sock, NULL, &ev);
+ if (ev.lNetworkEvents != 0xDEADBEEF)
+ {
+ /* fd refers to a socket. */
+ /* FIXME: other applications, like squid, use an undocumented
+ _free_osfhnd free function. But this is not enough: The 'osfile'
+ flags for fd also needs to be cleared, but it is hard to access it.
+ Instead, here we just close twice the file descriptor. */
+ if (closesocket (sock))
+ {
+ set_winsock_errno ();
+ return -1;
+ }
+ else
+ {
+ /* This call frees the file descriptor and does a
+ CloseHandle ((HANDLE) _get_osfhandle (fd)), which fails. */
+ _close (fd);
+ return 0;
+ }
+ }
+ else
+ /* Some other type of file descriptor. */
+ return execute_close_hooks (remaining_list, primary, fd);
+}
+
+static int
+ioctl_fd_maybe_socket (const struct fd_hook *remaining_list,
+ gl_ioctl_fn primary,
+ int fd, int request, void *arg)
+{
+ SOCKET sock;
+ WSANETWORKEVENTS ev;
+
+ /* Test whether fd refers to a socket. */
+ sock = FD_TO_SOCKET (fd);
+ ev.lNetworkEvents = 0xDEADBEEF;
+ WSAEnumNetworkEvents (sock, NULL, &ev);
+ if (ev.lNetworkEvents != 0xDEADBEEF)
+ {
+ /* fd refers to a socket. */
+ if (ioctlsocket (sock, request, arg) < 0)
+ {
+ set_winsock_errno ();
+ return -1;
+ }
+ else
+ return 0;
+ }
+ else
+ /* Some other type of file descriptor. */
+ return execute_ioctl_hooks (remaining_list, primary, fd, request, arg);
+}
+
+static struct fd_hook fd_sockets_hook;
+
+static int initialized_sockets_version /* = 0 */;
+
+#endif /* WINDOWS_SOCKETS */
+
+int
+gl_sockets_startup (_GL_UNUSED int version)
+{
+#if WINDOWS_SOCKETS
+ if (version > initialized_sockets_version)
+ {
+ WSADATA data;
+ int err;
+
+ err = WSAStartup (version, &data);
+ if (err != 0)
+ return 1;
+
+ if (data.wVersion != version)
+ {
+ WSACleanup ();
+ return 2;
+ }
+
+ if (initialized_sockets_version == 0)
+ register_fd_hook (close_fd_maybe_socket, ioctl_fd_maybe_socket,
+ &fd_sockets_hook);
+
+ initialized_sockets_version = version;
+ }
+#endif
+
+ return 0;
+}
+
+int
+gl_sockets_cleanup (void)
+{
+#if WINDOWS_SOCKETS
+ int err;
+
+ initialized_sockets_version = 0;
+
+ unregister_fd_hook (&fd_sockets_hook);
+
+ err = WSACleanup ();
+ if (err != 0)
+ return 1;
+#endif
+
+ return 0;
+}
diff --git a/gl/lib/sockets.h b/gl/lib/sockets.h
new file mode 100644
index 0000000..75e49fc
--- /dev/null
+++ b/gl/lib/sockets.h
@@ -0,0 +1,66 @@
+/* sockets.h - wrappers for Windows socket functions
+
+ Copyright (C) 2008-2022 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 2.1 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 Simon Josefsson */
+
+#ifndef SOCKETS_H
+#define SOCKETS_H 1
+
+#define SOCKETS_1_0 0x0001
+#define SOCKETS_1_1 0x0101
+#define SOCKETS_2_0 0x0002
+#define SOCKETS_2_1 0x0102
+#define SOCKETS_2_2 0x0202
+
+int gl_sockets_startup (int version)
+#ifndef WINDOWS_SOCKETS
+ _GL_ATTRIBUTE_CONST
+#endif
+ ;
+
+int gl_sockets_cleanup (void)
+#ifndef WINDOWS_SOCKETS
+ _GL_ATTRIBUTE_CONST
+#endif
+ ;
+
+/* This function is useful it you create a socket using gnulib's
+ Winsock wrappers but needs to pass on the socket handle to some
+ other library that only accepts sockets. */
+#ifdef WINDOWS_SOCKETS
+
+# include <sys/socket.h>
+
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+
+static inline SOCKET
+gl_fd_to_handle (int fd)
+{
+ return _get_osfhandle (fd);
+}
+
+#else
+
+# define gl_fd_to_handle(x) (x)
+
+#endif /* WINDOWS_SOCKETS */
+
+#endif /* SOCKETS_H */
diff --git a/gl/lib/stat-time.c b/gl/lib/stat-time.c
new file mode 100644
index 0000000..3d48a2b
--- /dev/null
+++ b/gl/lib/stat-time.c
@@ -0,0 +1,21 @@
+/* stat-related time functions.
+
+ Copyright (C) 2012-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+#define _GL_STAT_TIME_INLINE _GL_EXTERN_INLINE
+#include "stat-time.h"
diff --git a/gl/lib/stat-time.h b/gl/lib/stat-time.h
new file mode 100644
index 0000000..6b0088e
--- /dev/null
+++ b/gl/lib/stat-time.h
@@ -0,0 +1,252 @@
+/* stat-related time functions.
+
+ Copyright (C) 2005, 2007, 2009-2022 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 2.1 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 Paul Eggert. */
+
+#ifndef STAT_TIME_H
+#define STAT_TIME_H 1
+
+#include "intprops.h"
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+#include <time.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GL_STAT_TIME_INLINE
+# define _GL_STAT_TIME_INLINE _GL_INLINE
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type
+ struct timespec, if available. If not, then STAT_TIMESPEC_NS (ST,
+ ST_XTIM) is the nanosecond component of the ST_XTIM member for *ST,
+ if available. ST_XTIM can be st_atim, st_ctim, st_mtim, or st_birthtim
+ for access, status change, data modification, or birth (creation)
+ time respectively.
+
+ These macros are private to stat-time.h. */
+#if _GL_WINDOWS_STAT_TIMESPEC || defined HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
+# if _GL_WINDOWS_STAT_TIMESPEC || defined TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC
+# define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim)
+# else
+# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim.tv_nsec)
+# endif
+#elif defined HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC
+# define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim##espec)
+#elif defined HAVE_STRUCT_STAT_ST_ATIMENSEC
+# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim##ensec)
+#elif defined HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC
+# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim.st__tim.tv_nsec)
+#endif
+
+/* Return the nanosecond component of *ST's access time. */
+_GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE
+get_stat_atime_ns (struct stat const *st)
+{
+# if defined STAT_TIMESPEC
+ return STAT_TIMESPEC (st, st_atim).tv_nsec;
+# elif defined STAT_TIMESPEC_NS
+ return STAT_TIMESPEC_NS (st, st_atim);
+# else
+ return 0;
+# endif
+}
+
+/* Return the nanosecond component of *ST's status change time. */
+_GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE
+get_stat_ctime_ns (struct stat const *st)
+{
+# if defined STAT_TIMESPEC
+ return STAT_TIMESPEC (st, st_ctim).tv_nsec;
+# elif defined STAT_TIMESPEC_NS
+ return STAT_TIMESPEC_NS (st, st_ctim);
+# else
+ return 0;
+# endif
+}
+
+/* Return the nanosecond component of *ST's data modification time. */
+_GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE
+get_stat_mtime_ns (struct stat const *st)
+{
+# if defined STAT_TIMESPEC
+ return STAT_TIMESPEC (st, st_mtim).tv_nsec;
+# elif defined STAT_TIMESPEC_NS
+ return STAT_TIMESPEC_NS (st, st_mtim);
+# else
+ return 0;
+# endif
+}
+
+/* Return the nanosecond component of *ST's birth time. */
+_GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE
+get_stat_birthtime_ns (_GL_UNUSED struct stat const *st)
+{
+# if defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC
+ return STAT_TIMESPEC (st, st_birthtim).tv_nsec;
+# elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC
+ return STAT_TIMESPEC_NS (st, st_birthtim);
+# else
+ return 0;
+# endif
+}
+
+/* Return *ST's access time. */
+_GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE
+get_stat_atime (struct stat const *st)
+{
+#ifdef STAT_TIMESPEC
+ return STAT_TIMESPEC (st, st_atim);
+#else
+ struct timespec t;
+ t.tv_sec = st->st_atime;
+ t.tv_nsec = get_stat_atime_ns (st);
+ return t;
+#endif
+}
+
+/* Return *ST's status change time. */
+_GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE
+get_stat_ctime (struct stat const *st)
+{
+#ifdef STAT_TIMESPEC
+ return STAT_TIMESPEC (st, st_ctim);
+#else
+ struct timespec t;
+ t.tv_sec = st->st_ctime;
+ t.tv_nsec = get_stat_ctime_ns (st);
+ return t;
+#endif
+}
+
+/* Return *ST's data modification time. */
+_GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE
+get_stat_mtime (struct stat const *st)
+{
+#ifdef STAT_TIMESPEC
+ return STAT_TIMESPEC (st, st_mtim);
+#else
+ struct timespec t;
+ t.tv_sec = st->st_mtime;
+ t.tv_nsec = get_stat_mtime_ns (st);
+ return t;
+#endif
+}
+
+/* Return *ST's birth time, if available; otherwise return a value
+ with tv_sec and tv_nsec both equal to -1. */
+_GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE
+get_stat_birthtime (_GL_UNUSED struct stat const *st)
+{
+ struct timespec t;
+
+#if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \
+ || defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC)
+ t = STAT_TIMESPEC (st, st_birthtim);
+#elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC
+ t.tv_sec = st->st_birthtime;
+ t.tv_nsec = st->st_birthtimensec;
+#elif defined _WIN32 && ! defined __CYGWIN__
+ /* Native Windows platforms (but not Cygwin) put the "file creation
+ time" in st_ctime (!). See
+ <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/stat-functions>. */
+# if _GL_WINDOWS_STAT_TIMESPEC
+ t = st->st_ctim;
+# else
+ t.tv_sec = st->st_ctime;
+ t.tv_nsec = 0;
+# endif
+#else
+ /* Birth time is not supported. */
+ t.tv_sec = -1;
+ t.tv_nsec = -1;
+#endif
+
+#if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \
+ || defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC \
+ || defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC)
+ /* FreeBSD and NetBSD sometimes signal the absence of knowledge by
+ using zero. Attempt to work around this problem. Alas, this can
+ report failure even for valid timestamps. Also, NetBSD
+ sometimes returns junk in the birth time fields; work around this
+ bug if it is detected. */
+ if (! (t.tv_sec && 0 <= t.tv_nsec && t.tv_nsec < 1000000000))
+ {
+ t.tv_sec = -1;
+ t.tv_nsec = -1;
+ }
+#endif
+
+ return t;
+}
+
+/* If a stat-like function returned RESULT, normalize the timestamps
+ in *ST, in case this platform suffers from the Solaris 11 bug where
+ tv_nsec might be negative. Return the adjusted RESULT, setting
+ errno to EOVERFLOW if normalization overflowed. This function
+ is intended to be private to this .h file. */
+_GL_STAT_TIME_INLINE int
+stat_time_normalize (int result, _GL_UNUSED struct stat *st)
+{
+#if defined __sun && defined STAT_TIMESPEC
+ if (result == 0)
+ {
+ long int timespec_hz = 1000000000;
+ short int const ts_off[] = { offsetof (struct stat, st_atim),
+ offsetof (struct stat, st_mtim),
+ offsetof (struct stat, st_ctim) };
+ int i;
+ for (i = 0; i < sizeof ts_off / sizeof *ts_off; i++)
+ {
+ struct timespec *ts = (struct timespec *) ((char *) st + ts_off[i]);
+ long int q = ts->tv_nsec / timespec_hz;
+ long int r = ts->tv_nsec % timespec_hz;
+ if (r < 0)
+ {
+ r += timespec_hz;
+ q--;
+ }
+ ts->tv_nsec = r;
+ /* Overflow is possible, as Solaris 11 stat can yield
+ tv_sec == TYPE_MINIMUM (time_t) && tv_nsec == -1000000000.
+ INT_ADD_WRAPV is OK, since time_t is signed on Solaris. */
+ if (INT_ADD_WRAPV (q, ts->tv_sec, &ts->tv_sec))
+ {
+ errno = EOVERFLOW;
+ return -1;
+ }
+ }
+ }
+#endif
+ return result;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif
diff --git a/gl/lib/stat-w32.c b/gl/lib/stat-w32.c
new file mode 100644
index 0000000..c1a2923
--- /dev/null
+++ b/gl/lib/stat-w32.c
@@ -0,0 +1,461 @@
+/* Core of implementation of fstat and stat for native Windows.
+ Copyright (C) 2017-2022 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 2.1 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. */
+
+#include <config.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+
+/* Attempt to make <windows.h> define FILE_ID_INFO.
+ But ensure that the redefinition of _WIN32_WINNT does not make us assume
+ Windows Vista or newer when building for an older version of Windows. */
+#if HAVE_SDKDDKVER_H
+# include <sdkddkver.h>
+# if _WIN32_WINNT >= _WIN32_WINNT_VISTA
+# define WIN32_ASSUME_VISTA 1
+# else
+# define WIN32_ASSUME_VISTA 0
+# endif
+# if !defined _WIN32_WINNT || (_WIN32_WINNT < _WIN32_WINNT_WIN8)
+# undef _WIN32_WINNT
+# define _WIN32_WINNT _WIN32_WINNT_WIN8
+# endif
+#else
+# define WIN32_ASSUME_VISTA (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <limits.h>
+#include <string.h>
+#include <unistd.h>
+#include <windows.h>
+
+/* Specification. */
+#include "stat-w32.h"
+
+#include "pathmax.h"
+#include "verify.h"
+
+/* Don't assume that UNICODE is not defined. */
+#undef LoadLibrary
+#define LoadLibrary LoadLibraryA
+#undef GetFinalPathNameByHandle
+#define GetFinalPathNameByHandle GetFinalPathNameByHandleA
+
+/* Older mingw headers do not define VOLUME_NAME_NONE. */
+#ifndef VOLUME_NAME_NONE
+# define VOLUME_NAME_NONE 4
+#endif
+
+#if !WIN32_ASSUME_VISTA
+
+/* Avoid warnings from gcc -Wcast-function-type. */
+# define GetProcAddress \
+ (void *) GetProcAddress
+
+# if _GL_WINDOWS_STAT_INODES == 2
+/* GetFileInformationByHandleEx was introduced only in Windows Vista. */
+typedef DWORD (WINAPI * GetFileInformationByHandleExFuncType) (HANDLE hFile,
+ FILE_INFO_BY_HANDLE_CLASS fiClass,
+ LPVOID lpBuffer,
+ DWORD dwBufferSize);
+static GetFileInformationByHandleExFuncType GetFileInformationByHandleExFunc = NULL;
+# endif
+/* GetFinalPathNameByHandle was introduced only in Windows Vista. */
+typedef DWORD (WINAPI * GetFinalPathNameByHandleFuncType) (HANDLE hFile,
+ LPSTR lpFilePath,
+ DWORD lenFilePath,
+ DWORD dwFlags);
+static GetFinalPathNameByHandleFuncType GetFinalPathNameByHandleFunc = NULL;
+static BOOL initialized = FALSE;
+
+static void
+initialize (void)
+{
+ HMODULE kernel32 = LoadLibrary ("kernel32.dll");
+ if (kernel32 != NULL)
+ {
+# if _GL_WINDOWS_STAT_INODES == 2
+ GetFileInformationByHandleExFunc =
+ (GetFileInformationByHandleExFuncType) GetProcAddress (kernel32, "GetFileInformationByHandleEx");
+# endif
+ GetFinalPathNameByHandleFunc =
+ (GetFinalPathNameByHandleFuncType) GetProcAddress (kernel32, "GetFinalPathNameByHandleA");
+ }
+ initialized = TRUE;
+}
+
+#else
+
+# define GetFileInformationByHandleExFunc GetFileInformationByHandleEx
+# define GetFinalPathNameByHandleFunc GetFinalPathNameByHandle
+
+#endif
+
+/* Converts a FILETIME to GMT time since 1970-01-01 00:00:00. */
+#if _GL_WINDOWS_STAT_TIMESPEC
+struct timespec
+_gl_convert_FILETIME_to_timespec (const FILETIME *ft)
+{
+ struct timespec result;
+ /* FILETIME: <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-filetime> */
+ unsigned long long since_1601 =
+ ((unsigned long long) ft->dwHighDateTime << 32)
+ | (unsigned long long) ft->dwLowDateTime;
+ if (since_1601 == 0)
+ {
+ result.tv_sec = 0;
+ result.tv_nsec = 0;
+ }
+ else
+ {
+ /* Between 1601-01-01 and 1970-01-01 there were 280 normal years and 89
+ leap years, in total 134774 days. */
+ unsigned long long since_1970 =
+ since_1601 - (unsigned long long) 134774 * (unsigned long long) 86400 * (unsigned long long) 10000000;
+ result.tv_sec = since_1970 / (unsigned long long) 10000000;
+ result.tv_nsec = (unsigned long) (since_1970 % (unsigned long long) 10000000) * 100;
+ }
+ return result;
+}
+#else
+time_t
+_gl_convert_FILETIME_to_POSIX (const FILETIME *ft)
+{
+ /* FILETIME: <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-filetime> */
+ unsigned long long since_1601 =
+ ((unsigned long long) ft->dwHighDateTime << 32)
+ | (unsigned long long) ft->dwLowDateTime;
+ if (since_1601 == 0)
+ return 0;
+ else
+ {
+ /* Between 1601-01-01 and 1970-01-01 there were 280 normal years and 89
+ leap years, in total 134774 days. */
+ unsigned long long since_1970 =
+ since_1601 - (unsigned long long) 134774 * (unsigned long long) 86400 * (unsigned long long) 10000000;
+ return since_1970 / (unsigned long long) 10000000;
+ }
+}
+#endif
+
+/* Fill *BUF with information about the file designated by H.
+ PATH is the file name, if known, otherwise NULL.
+ Return 0 if successful, or -1 with errno set upon failure. */
+int
+_gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf)
+{
+ /* GetFileType
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfiletype> */
+ DWORD type = GetFileType (h);
+ if (type == FILE_TYPE_DISK)
+ {
+#if !WIN32_ASSUME_VISTA
+ if (!initialized)
+ initialize ();
+#endif
+
+ /* st_mode can be determined through
+ GetFileAttributesEx
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileattributesexa>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_win32_file_attribute_data>
+ or through
+ GetFileInformationByHandle
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_by_handle_file_information>
+ or through
+ GetFileInformationByHandleEx with argument FileBasicInfo
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_basic_info>
+ The latter requires -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher. */
+ BY_HANDLE_FILE_INFORMATION info;
+ if (! GetFileInformationByHandle (h, &info))
+ goto failed;
+
+ /* Test for error conditions before starting to fill *buf. */
+ if (sizeof (buf->st_size) <= 4 && info.nFileSizeHigh > 0)
+ {
+ errno = EOVERFLOW;
+ return -1;
+ }
+
+#if _GL_WINDOWS_STAT_INODES
+ /* st_ino can be determined through
+ GetFileInformationByHandle
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_by_handle_file_information>
+ as 64 bits, or through
+ GetFileInformationByHandleEx with argument FileIdInfo
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_id_info>
+ as 128 bits.
+ The latter requires -D_WIN32_WINNT=_WIN32_WINNT_WIN8 or higher. */
+ /* Experiments show that GetFileInformationByHandleEx does not provide
+ much more information than GetFileInformationByHandle:
+ * The dwVolumeSerialNumber from GetFileInformationByHandle is equal
+ to the low 32 bits of the 64-bit VolumeSerialNumber from
+ GetFileInformationByHandleEx, and is apparently sufficient for
+ identifying the device.
+ * The nFileIndex from GetFileInformationByHandle is equal to the low
+ 64 bits of the 128-bit FileId from GetFileInformationByHandleEx,
+ and the high 64 bits of this 128-bit FileId are zero.
+ * On a FAT file system, GetFileInformationByHandleEx fails with error
+ ERROR_INVALID_PARAMETER, whereas GetFileInformationByHandle
+ succeeds.
+ * On a CIFS/SMB file system, GetFileInformationByHandleEx fails with
+ error ERROR_INVALID_LEVEL, whereas GetFileInformationByHandle
+ succeeds. */
+# if _GL_WINDOWS_STAT_INODES == 2
+ if (GetFileInformationByHandleExFunc != NULL)
+ {
+ FILE_ID_INFO id;
+ if (GetFileInformationByHandleExFunc (h, FileIdInfo, &id, sizeof (id)))
+ {
+ buf->st_dev = id.VolumeSerialNumber;
+ verify (sizeof (ino_t) == sizeof (id.FileId));
+ memcpy (&buf->st_ino, &id.FileId, sizeof (ino_t));
+ goto ino_done;
+ }
+ else
+ {
+ switch (GetLastError ())
+ {
+ case ERROR_INVALID_PARAMETER: /* older Windows version, or FAT */
+ case ERROR_INVALID_LEVEL: /* CIFS/SMB file system */
+ goto fallback;
+ default:
+ goto failed;
+ }
+ }
+ }
+ fallback: ;
+ /* Fallback for older Windows versions. */
+ buf->st_dev = info.dwVolumeSerialNumber;
+ buf->st_ino._gl_ino[0] = ((ULONGLONG) info.nFileIndexHigh << 32) | (ULONGLONG) info.nFileIndexLow;
+ buf->st_ino._gl_ino[1] = 0;
+ ino_done: ;
+# else /* _GL_WINDOWS_STAT_INODES == 1 */
+ buf->st_dev = info.dwVolumeSerialNumber;
+ buf->st_ino = ((ULONGLONG) info.nFileIndexHigh << 32) | (ULONGLONG) info.nFileIndexLow;
+# endif
+#else
+ /* st_ino is not wide enough for identifying a file on a device.
+ Without st_ino, st_dev is pointless. */
+ buf->st_dev = 0;
+ buf->st_ino = 0;
+#endif
+
+ /* st_mode. */
+ unsigned int mode =
+ /* XXX How to handle FILE_ATTRIBUTE_REPARSE_POINT ? */
+ ((info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? _S_IFDIR | S_IEXEC_UGO : _S_IFREG)
+ | S_IREAD_UGO
+ | ((info.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? 0 : S_IWRITE_UGO);
+ if (!(info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
+ {
+ /* Determine whether the file is executable by looking at the file
+ name suffix.
+ If the file name is already known, use it. Otherwise, for
+ non-empty files, it can be determined through
+ GetFinalPathNameByHandle
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfinalpathnamebyhandlea>
+ or through
+ GetFileInformationByHandleEx with argument FileNameInfo
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_name_info>
+ Both require -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher. */
+ if (info.nFileSizeHigh > 0 || info.nFileSizeLow > 0)
+ {
+ char fpath[PATH_MAX];
+ if (path != NULL
+ || (GetFinalPathNameByHandleFunc != NULL
+ && GetFinalPathNameByHandleFunc (h, fpath, sizeof (fpath), VOLUME_NAME_NONE)
+ < sizeof (fpath)
+ && (path = fpath, 1)))
+ {
+ const char *last_dot = NULL;
+ const char *p;
+ for (p = path; *p != '\0'; p++)
+ if (*p == '.')
+ last_dot = p;
+ if (last_dot != NULL)
+ {
+ const char *suffix = last_dot + 1;
+ if (_stricmp (suffix, "exe") == 0
+ || _stricmp (suffix, "bat") == 0
+ || _stricmp (suffix, "cmd") == 0
+ || _stricmp (suffix, "com") == 0)
+ mode |= S_IEXEC_UGO;
+ }
+ }
+ else
+ /* Cannot determine file name. Pretend that it is executable. */
+ mode |= S_IEXEC_UGO;
+ }
+ }
+ buf->st_mode = mode;
+
+ /* st_nlink can be determined through
+ GetFileInformationByHandle
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_by_handle_file_information>
+ or through
+ GetFileInformationByHandleEx with argument FileStandardInfo
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_standard_info>
+ The latter requires -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher. */
+ buf->st_nlink = (info.nNumberOfLinks > SHRT_MAX ? SHRT_MAX : info.nNumberOfLinks);
+
+ /* There's no easy way to map the Windows SID concept to an integer. */
+ buf->st_uid = 0;
+ buf->st_gid = 0;
+
+ /* st_rdev is irrelevant for normal files and directories. */
+ buf->st_rdev = 0;
+
+ /* st_size can be determined through
+ GetFileSizeEx
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfilesizeex>
+ or through
+ GetFileAttributesEx
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileattributesexa>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_win32_file_attribute_data>
+ or through
+ GetFileInformationByHandle
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_by_handle_file_information>
+ or through
+ GetFileInformationByHandleEx with argument FileStandardInfo
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_standard_info>
+ The latter requires -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher. */
+ if (sizeof (buf->st_size) <= 4)
+ /* Range check already done above. */
+ buf->st_size = info.nFileSizeLow;
+ else
+ buf->st_size = ((long long) info.nFileSizeHigh << 32) | (long long) info.nFileSizeLow;
+
+ /* st_atime, st_mtime, st_ctime can be determined through
+ GetFileTime
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfiletime>
+ or through
+ GetFileAttributesEx
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileattributesexa>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_win32_file_attribute_data>
+ or through
+ GetFileInformationByHandle
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_by_handle_file_information>
+ or through
+ GetFileInformationByHandleEx with argument FileBasicInfo
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_basic_info>
+ The latter requires -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher. */
+#if _GL_WINDOWS_STAT_TIMESPEC
+ buf->st_atim = _gl_convert_FILETIME_to_timespec (&info.ftLastAccessTime);
+ buf->st_mtim = _gl_convert_FILETIME_to_timespec (&info.ftLastWriteTime);
+ buf->st_ctim = _gl_convert_FILETIME_to_timespec (&info.ftCreationTime);
+#else
+ buf->st_atime = _gl_convert_FILETIME_to_POSIX (&info.ftLastAccessTime);
+ buf->st_mtime = _gl_convert_FILETIME_to_POSIX (&info.ftLastWriteTime);
+ buf->st_ctime = _gl_convert_FILETIME_to_POSIX (&info.ftCreationTime);
+#endif
+
+ return 0;
+ }
+ else if (type == FILE_TYPE_CHAR || type == FILE_TYPE_PIPE)
+ {
+ buf->st_dev = 0;
+#if _GL_WINDOWS_STAT_INODES == 2
+ buf->st_ino._gl_ino[0] = buf->st_ino._gl_ino[1] = 0;
+#else
+ buf->st_ino = 0;
+#endif
+ buf->st_mode = (type == FILE_TYPE_PIPE ? _S_IFIFO : _S_IFCHR);
+ buf->st_nlink = 1;
+ buf->st_uid = 0;
+ buf->st_gid = 0;
+ buf->st_rdev = 0;
+ if (type == FILE_TYPE_PIPE)
+ {
+ /* PeekNamedPipe
+ <https://msdn.microsoft.com/en-us/library/aa365779.aspx> */
+ DWORD bytes_available;
+ if (PeekNamedPipe (h, NULL, 0, NULL, &bytes_available, NULL))
+ buf->st_size = bytes_available;
+ else
+ buf->st_size = 0;
+ }
+ else
+ buf->st_size = 0;
+#if _GL_WINDOWS_STAT_TIMESPEC
+ buf->st_atim.tv_sec = 0; buf->st_atim.tv_nsec = 0;
+ buf->st_mtim.tv_sec = 0; buf->st_mtim.tv_nsec = 0;
+ buf->st_ctim.tv_sec = 0; buf->st_ctim.tv_nsec = 0;
+#else
+ buf->st_atime = 0;
+ buf->st_mtime = 0;
+ buf->st_ctime = 0;
+#endif
+ return 0;
+ }
+ else
+ {
+ errno = ENOENT;
+ return -1;
+ }
+
+ failed:
+ {
+ DWORD error = GetLastError ();
+ #if 0
+ fprintf (stderr, "_gl_fstat_by_handle error 0x%x\n", (unsigned int) error);
+ #endif
+ switch (error)
+ {
+ case ERROR_ACCESS_DENIED:
+ case ERROR_SHARING_VIOLATION:
+ errno = EACCES;
+ break;
+
+ case ERROR_OUTOFMEMORY:
+ errno = ENOMEM;
+ break;
+
+ case ERROR_WRITE_FAULT:
+ case ERROR_READ_FAULT:
+ case ERROR_GEN_FAILURE:
+ errno = EIO;
+ break;
+
+ default:
+ errno = EINVAL;
+ break;
+ }
+ return -1;
+ }
+}
+
+#else
+
+/* This declaration is solely to ensure that after preprocessing
+ this file is never empty. */
+typedef int dummy;
+
+#endif
diff --git a/gl/lib/stat-w32.h b/gl/lib/stat-w32.h
new file mode 100644
index 0000000..0f79d61
--- /dev/null
+++ b/gl/lib/stat-w32.h
@@ -0,0 +1,37 @@
+/* Core of implementation of fstat and stat for native Windows.
+ Copyright (C) 2017-2022 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 2.1 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/>. */
+
+#ifndef _STAT_W32_H
+#define _STAT_W32_H 1
+
+/* Converts a FILETIME to GMT time since 1970-01-01 00:00:00. */
+#if _GL_WINDOWS_STAT_TIMESPEC
+extern struct timespec _gl_convert_FILETIME_to_timespec (const FILETIME *ft);
+#else
+extern time_t _gl_convert_FILETIME_to_POSIX (const FILETIME *ft);
+#endif
+
+/* Fill *BUF with information about the file designated by H.
+ PATH is the file name, if known, otherwise NULL.
+ Return 0 if successful, or -1 with errno set upon failure. */
+extern int _gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf);
+
+/* Bitmasks for st_mode. */
+#define S_IREAD_UGO (_S_IREAD | (_S_IREAD >> 3) | (_S_IREAD >> 6))
+#define S_IWRITE_UGO (_S_IWRITE | (_S_IWRITE >> 3) | (_S_IWRITE >> 6))
+#define S_IEXEC_UGO (_S_IEXEC | (_S_IEXEC >> 3) | (_S_IEXEC >> 6))
+
+#endif /* _STAT_W32_H */
diff --git a/gl/lib/stat.c b/gl/lib/stat.c
new file mode 100644
index 0000000..574489a
--- /dev/null
+++ b/gl/lib/stat.c
@@ -0,0 +1,440 @@
+/* Work around platform bugs in stat.
+ Copyright (C) 2009-2022 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 2.1 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 Eric Blake and Bruno Haible. */
+
+/* If the user's config.h happens to include <sys/stat.h>, let it include only
+ the system's <sys/stat.h> here, so that orig_stat doesn't recurse to
+ rpl_stat. */
+#define __need_system_sys_stat_h
+#include <config.h>
+
+/* Get the original definition of stat. It might be defined as a macro. */
+#include <sys/types.h>
+#include <sys/stat.h>
+#undef __need_system_sys_stat_h
+
+#if defined _WIN32 && ! defined __CYGWIN__
+# define WINDOWS_NATIVE
+#endif
+
+#if !defined WINDOWS_NATIVE
+
+static int
+orig_stat (const char *filename, struct stat *buf)
+{
+ return stat (filename, buf);
+}
+
+#endif
+
+/* Specification. */
+#ifdef __osf__
+/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc
+ eliminates this include because of the preliminary #include <sys/stat.h>
+ above. */
+# include "sys/stat.h"
+#else
+# include <sys/stat.h>
+#endif
+
+#include "stat-time.h"
+
+#include <errno.h>
+#include <limits.h>
+#include <stdbool.h>
+#include <string.h>
+#include "filename.h"
+#include "malloca.h"
+#include "verify.h"
+
+#ifdef WINDOWS_NATIVE
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# include "stat-w32.h"
+/* Don't assume that UNICODE is not defined. */
+# undef WIN32_FIND_DATA
+# define WIN32_FIND_DATA WIN32_FIND_DATAA
+# undef CreateFile
+# define CreateFile CreateFileA
+# undef FindFirstFile
+# define FindFirstFile FindFirstFileA
+#endif
+
+#ifdef WINDOWS_NATIVE
+/* Return TRUE if the given file name denotes an UNC root. */
+static BOOL
+is_unc_root (const char *rname)
+{
+ /* Test whether it has the syntax '\\server\share'. */
+ if (ISSLASH (rname[0]) && ISSLASH (rname[1]))
+ {
+ /* It starts with two slashes. Find the next slash. */
+ const char *p = rname + 2;
+ const char *q = p;
+ while (*q != '\0' && !ISSLASH (*q))
+ q++;
+ if (q > p && *q != '\0')
+ {
+ /* Found the next slash at q. */
+ q++;
+ const char *r = q;
+ while (*r != '\0' && !ISSLASH (*r))
+ r++;
+ if (r > q && *r == '\0')
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+#endif
+
+/* Store information about NAME into ST. Work around bugs with
+ trailing slashes. Mingw has other bugs (such as st_ino always
+ being 0 on success) which this wrapper does not work around. But
+ at least this implementation provides the ability to emulate fchdir
+ correctly. */
+
+int
+rpl_stat (char const *name, struct stat *buf)
+{
+#ifdef WINDOWS_NATIVE
+ /* Fill the fields ourselves, because the original stat function returns
+ values for st_atime, st_mtime, st_ctime that depend on the current time
+ zone. See
+ <https://lists.gnu.org/r/bug-gnulib/2017-04/msg00134.html> */
+ /* XXX Should we convert to wchar_t* and prepend '\\?\', in order to work
+ around length limitations
+ <https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file> ? */
+
+ /* POSIX <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>
+ specifies: "More than two leading <slash> characters shall be treated as
+ a single <slash> character." */
+ if (ISSLASH (name[0]) && ISSLASH (name[1]) && ISSLASH (name[2]))
+ {
+ name += 2;
+ while (ISSLASH (name[1]))
+ name++;
+ }
+
+ size_t len = strlen (name);
+ size_t drive_prefix_len = (HAS_DEVICE (name) ? 2 : 0);
+
+ /* Remove trailing slashes (except the very first one, at position
+ drive_prefix_len), but remember their presence. */
+ size_t rlen;
+ bool check_dir = false;
+
+ rlen = len;
+ while (rlen > drive_prefix_len && ISSLASH (name[rlen-1]))
+ {
+ check_dir = true;
+ if (rlen == drive_prefix_len + 1)
+ break;
+ rlen--;
+ }
+
+ /* Handle '' and 'C:'. */
+ if (!check_dir && rlen == drive_prefix_len)
+ {
+ errno = ENOENT;
+ return -1;
+ }
+
+ /* Handle '\\'. */
+ if (rlen == 1 && ISSLASH (name[0]) && len >= 2)
+ {
+ errno = ENOENT;
+ return -1;
+ }
+
+ const char *rname;
+ char *malloca_rname;
+ if (rlen == len)
+ {
+ rname = name;
+ malloca_rname = NULL;
+ }
+ else
+ {
+ malloca_rname = malloca (rlen + 1);
+ if (malloca_rname == NULL)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+ memcpy (malloca_rname, name, rlen);
+ malloca_rname[rlen] = '\0';
+ rname = malloca_rname;
+ }
+
+ /* There are two ways to get at the requested information:
+ - by scanning the parent directory and examining the relevant
+ directory entry,
+ - by opening the file directly.
+ The first approach fails for root directories (e.g. 'C:\') and
+ UNC root directories (e.g. '\\server\share').
+ The second approach fails for some system files (e.g. 'C:\pagefile.sys'
+ and 'C:\hiberfil.sys'): ERROR_SHARING_VIOLATION.
+ The second approach gives more information (in particular, correct
+ st_dev, st_ino, st_nlink fields).
+ So we use the second approach and, as a fallback except for root and
+ UNC root directories, also the first approach. */
+ {
+ int ret;
+
+ {
+ /* Approach based on the file. */
+
+ /* Open a handle to the file.
+ CreateFile
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-createfilea>
+ <https://docs.microsoft.com/en-us/windows/desktop/FileIO/creating-and-opening-files> */
+ HANDLE h =
+ CreateFile (rname,
+ FILE_READ_ATTRIBUTES,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ NULL,
+ OPEN_EXISTING,
+ /* FILE_FLAG_POSIX_SEMANTICS (treat file names that differ only
+ in case as different) makes sense only when applied to *all*
+ filesystem operations. */
+ FILE_FLAG_BACKUP_SEMANTICS /* | FILE_FLAG_POSIX_SEMANTICS */,
+ NULL);
+ if (h != INVALID_HANDLE_VALUE)
+ {
+ ret = _gl_fstat_by_handle (h, rname, buf);
+ CloseHandle (h);
+ goto done;
+ }
+ }
+
+ /* Test for root and UNC root directories. */
+ if ((rlen == drive_prefix_len + 1 && ISSLASH (rname[drive_prefix_len]))
+ || is_unc_root (rname))
+ goto failed;
+
+ /* Fallback. */
+ {
+ /* Approach based on the directory entry. */
+
+ if (strchr (rname, '?') != NULL || strchr (rname, '*') != NULL)
+ {
+ /* Other Windows API functions would fail with error
+ ERROR_INVALID_NAME. */
+ if (malloca_rname != NULL)
+ freea (malloca_rname);
+ errno = ENOENT;
+ return -1;
+ }
+
+ /* Get the details about the directory entry. This can be done through
+ FindFirstFile
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-findfirstfilea>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-_win32_find_dataa>
+ or through
+ FindFirstFileEx with argument FindExInfoBasic
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-findfirstfileexa>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ne-minwinbase-findex_info_levels>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-_win32_find_dataa> */
+ WIN32_FIND_DATA info;
+ HANDLE h = FindFirstFile (rname, &info);
+ if (h == INVALID_HANDLE_VALUE)
+ goto failed;
+
+ /* Test for error conditions before starting to fill *buf. */
+ if (sizeof (buf->st_size) <= 4 && info.nFileSizeHigh > 0)
+ {
+ FindClose (h);
+ if (malloca_rname != NULL)
+ freea (malloca_rname);
+ errno = EOVERFLOW;
+ return -1;
+ }
+
+# if _GL_WINDOWS_STAT_INODES
+ buf->st_dev = 0;
+# if _GL_WINDOWS_STAT_INODES == 2
+ buf->st_ino._gl_ino[0] = buf->st_ino._gl_ino[1] = 0;
+# else /* _GL_WINDOWS_STAT_INODES == 1 */
+ buf->st_ino = 0;
+# endif
+# else
+ /* st_ino is not wide enough for identifying a file on a device.
+ Without st_ino, st_dev is pointless. */
+ buf->st_dev = 0;
+ buf->st_ino = 0;
+# endif
+
+ /* st_mode. */
+ unsigned int mode =
+ /* XXX How to handle FILE_ATTRIBUTE_REPARSE_POINT ? */
+ ((info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? _S_IFDIR | S_IEXEC_UGO : _S_IFREG)
+ | S_IREAD_UGO
+ | ((info.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? 0 : S_IWRITE_UGO);
+ if (!(info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
+ {
+ /* Determine whether the file is executable by looking at the file
+ name suffix. */
+ if (info.nFileSizeHigh > 0 || info.nFileSizeLow > 0)
+ {
+ const char *last_dot = NULL;
+ const char *p;
+ for (p = info.cFileName; *p != '\0'; p++)
+ if (*p == '.')
+ last_dot = p;
+ if (last_dot != NULL)
+ {
+ const char *suffix = last_dot + 1;
+ if (_stricmp (suffix, "exe") == 0
+ || _stricmp (suffix, "bat") == 0
+ || _stricmp (suffix, "cmd") == 0
+ || _stricmp (suffix, "com") == 0)
+ mode |= S_IEXEC_UGO;
+ }
+ }
+ }
+ buf->st_mode = mode;
+
+ /* st_nlink. Ignore hard links here. */
+ buf->st_nlink = 1;
+
+ /* There's no easy way to map the Windows SID concept to an integer. */
+ buf->st_uid = 0;
+ buf->st_gid = 0;
+
+ /* st_rdev is irrelevant for normal files and directories. */
+ buf->st_rdev = 0;
+
+ /* st_size. */
+ if (sizeof (buf->st_size) <= 4)
+ /* Range check already done above. */
+ buf->st_size = info.nFileSizeLow;
+ else
+ buf->st_size = ((long long) info.nFileSizeHigh << 32) | (long long) info.nFileSizeLow;
+
+ /* st_atime, st_mtime, st_ctime. */
+# if _GL_WINDOWS_STAT_TIMESPEC
+ buf->st_atim = _gl_convert_FILETIME_to_timespec (&info.ftLastAccessTime);
+ buf->st_mtim = _gl_convert_FILETIME_to_timespec (&info.ftLastWriteTime);
+ buf->st_ctim = _gl_convert_FILETIME_to_timespec (&info.ftCreationTime);
+# else
+ buf->st_atime = _gl_convert_FILETIME_to_POSIX (&info.ftLastAccessTime);
+ buf->st_mtime = _gl_convert_FILETIME_to_POSIX (&info.ftLastWriteTime);
+ buf->st_ctime = _gl_convert_FILETIME_to_POSIX (&info.ftCreationTime);
+# endif
+
+ FindClose (h);
+
+ ret = 0;
+ }
+
+ done:
+ if (ret >= 0 && check_dir && !S_ISDIR (buf->st_mode))
+ {
+ errno = ENOTDIR;
+ ret = -1;
+ }
+ if (malloca_rname != NULL)
+ {
+ int saved_errno = errno;
+ freea (malloca_rname);
+ errno = saved_errno;
+ }
+ return ret;
+ }
+
+ failed:
+ {
+ DWORD error = GetLastError ();
+ #if 0
+ fprintf (stderr, "rpl_stat error 0x%x\n", (unsigned int) error);
+ #endif
+
+ if (malloca_rname != NULL)
+ freea (malloca_rname);
+
+ switch (error)
+ {
+ /* Some of these errors probably cannot happen with the specific flags
+ that we pass to CreateFile. But who knows... */
+ case ERROR_FILE_NOT_FOUND: /* The last component of rname does not exist. */
+ case ERROR_PATH_NOT_FOUND: /* Some directory component in rname does not exist. */
+ case ERROR_BAD_PATHNAME: /* rname is such as '\\server'. */
+ case ERROR_BAD_NET_NAME: /* rname is such as '\\server\nonexistentshare'. */
+ case ERROR_INVALID_NAME: /* rname contains wildcards, misplaced colon, etc. */
+ case ERROR_DIRECTORY:
+ errno = ENOENT;
+ break;
+
+ case ERROR_ACCESS_DENIED: /* rname is such as 'C:\System Volume Information\foo'. */
+ case ERROR_SHARING_VIOLATION: /* rname is such as 'C:\pagefile.sys' (second approach only). */
+ /* XXX map to EACCES or EPERM? */
+ errno = EACCES;
+ break;
+
+ case ERROR_OUTOFMEMORY:
+ errno = ENOMEM;
+ break;
+
+ case ERROR_WRITE_PROTECT:
+ errno = EROFS;
+ break;
+
+ case ERROR_WRITE_FAULT:
+ case ERROR_READ_FAULT:
+ case ERROR_GEN_FAILURE:
+ errno = EIO;
+ break;
+
+ case ERROR_BUFFER_OVERFLOW:
+ case ERROR_FILENAME_EXCED_RANGE:
+ errno = ENAMETOOLONG;
+ break;
+
+ case ERROR_DELETE_PENDING: /* XXX map to EACCES or EPERM? */
+ errno = EPERM;
+ break;
+
+ default:
+ errno = EINVAL;
+ break;
+ }
+
+ return -1;
+ }
+#else
+ int result = orig_stat (name, buf);
+ if (result == 0)
+ {
+# if REPLACE_FUNC_STAT_FILE
+ /* Solaris 9 mistakenly succeeds when given a non-directory with a
+ trailing slash. */
+ if (!S_ISDIR (buf->st_mode))
+ {
+ size_t len = strlen (name);
+ if (ISSLASH (name[len - 1]))
+ {
+ errno = ENOTDIR;
+ return -1;
+ }
+ }
+# endif /* REPLACE_FUNC_STAT_FILE */
+ result = stat_time_normalize (result, buf);
+ }
+ return result;
+#endif
+}
diff --git a/gl/lib/stdalign.in.h b/gl/lib/stdalign.in.h
new file mode 100644
index 0000000..3b117df
--- /dev/null
+++ b/gl/lib/stdalign.in.h
@@ -0,0 +1,127 @@
+/* A substitute for ISO C11 <stdalign.h>.
+
+ Copyright 2011-2022 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 2.1 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 Paul Eggert and Bruno Haible. */
+
+#ifndef _GL_STDALIGN_H
+#define _GL_STDALIGN_H
+
+/* ISO C11 <stdalign.h> for platforms that lack it.
+
+ References:
+ ISO C11 (latest free draft
+ <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf>)
+ sections 6.5.3.4, 6.7.5, 7.15.
+ C++11 (latest free draft
+ <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf>)
+ section 18.10. */
+
+/* alignof (TYPE), also known as _Alignof (TYPE), yields the alignment
+ requirement of a structure member (i.e., slot or field) that is of
+ type TYPE, as an integer constant expression.
+
+ This differs from GCC's and clang's __alignof__ operator, which can
+ yield a better-performing alignment for an object of that type. For
+ example, on x86 with GCC and on Linux/x86 with clang,
+ __alignof__ (double) and __alignof__ (long long) are 8, whereas
+ alignof (double) and alignof (long long) are 4 unless the option
+ '-malign-double' is used.
+
+ The result cannot be used as a value for an 'enum' constant, if you
+ want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc.
+
+ Include <stddef.h> for offsetof. */
+#include <stddef.h>
+
+/* FreeBSD 9.1 <sys/cdefs.h>, included by <stddef.h> and lots of other
+ standard headers, defines conflicting implementations of _Alignas
+ and _Alignof that are no better than ours; override them. */
+#undef _Alignas
+#undef _Alignof
+
+/* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.
+ clang versions < 8.0.0 have the same bug. */
+#if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
+ || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \
+ && !defined __clang__) \
+ || (defined __clang__ && __clang_major__ < 8))
+# ifdef __cplusplus
+# if 201103 <= __cplusplus
+# define _Alignof(type) alignof (type)
+# else
+ template <class __t> struct __alignof_helper { char __a; __t __b; };
+# define _Alignof(type) offsetof (__alignof_helper<type>, __b)
+# endif
+# else
+# define _Alignof(type) offsetof (struct { char __a; type __b; }, __b)
+# endif
+#endif
+#if ! (defined __cplusplus && 201103 <= __cplusplus)
+# define alignof _Alignof
+#endif
+#define __alignof_is_defined 1
+
+/* alignas (A), also known as _Alignas (A), aligns a variable or type
+ to the alignment A, where A is an integer constant expression. For
+ example:
+
+ int alignas (8) foo;
+ struct s { int a; int alignas (8) bar; };
+
+ aligns the address of FOO and the offset of BAR to be multiples of 8.
+
+ A should be a power of two that is at least the type's alignment
+ and at most the implementation's alignment limit. This limit is
+ 2**28 on typical GNUish hosts, and 2**13 on MSVC. To be portable
+ to MSVC through at least version 10.0, A should be an integer
+ constant, as MSVC does not support expressions such as 1 << 3.
+ To be portable to Sun C 5.11, do not align auto variables to
+ anything stricter than their default alignment.
+
+ The following C11 requirements are not supported here:
+
+ - If A is zero, alignas has no effect.
+ - alignas can be used multiple times; the strictest one wins.
+ - alignas (TYPE) is equivalent to alignas (alignof (TYPE)).
+
+ */
+
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
+# if defined __cplusplus && 201103 <= __cplusplus
+# define _Alignas(a) alignas (a)
+# elif (!defined __attribute__ \
+ && ((defined __APPLE__ && defined __MACH__ \
+ ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
+ : __GNUC__ && !defined __ibmxl__) \
+ || (4 <= __clang_major__) \
+ || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
+ || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__))
+# define _Alignas(a) __attribute__ ((__aligned__ (a)))
+# elif 1300 <= _MSC_VER
+# define _Alignas(a) __declspec (align (a))
+# endif
+#endif
+#if ((defined _Alignas && ! (defined __cplusplus && 201103 <= __cplusplus)) \
+ || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
+# define alignas _Alignas
+#endif
+#if defined alignas || (defined __cplusplus && 201103 <= __cplusplus)
+# define __alignas_is_defined 1
+#endif
+
+#endif /* _GL_STDALIGN_H */
diff --git a/gl/lib/stdarg.in.h b/gl/lib/stdarg.in.h
new file mode 100644
index 0000000..95306bf
--- /dev/null
+++ b/gl/lib/stdarg.in.h
@@ -0,0 +1,35 @@
+/* Substitute for and wrapper around <stdarg.h>.
+ Copyright (C) 2008-2022 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 2.1 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/>. */
+
+#ifndef _@GUARD_PREFIX@_STDARG_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_STDARG_H@
+
+#ifndef _@GUARD_PREFIX@_STDARG_H
+#define _@GUARD_PREFIX@_STDARG_H
+
+#ifndef va_copy
+# define va_copy(a,b) ((a) = (b))
+#endif
+
+#endif /* _@GUARD_PREFIX@_STDARG_H */
+#endif /* _@GUARD_PREFIX@_STDARG_H */
diff --git a/gl/lib/stdbool.in.h b/gl/lib/stdbool.in.h
new file mode 100644
index 0000000..03840f1
--- /dev/null
+++ b/gl/lib/stdbool.in.h
@@ -0,0 +1,132 @@
+/* Copyright (C) 2001-2003, 2006-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <haible@clisp.cons.org>, 2001.
+
+ 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 2.1 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/>. */
+
+#ifndef _GL_STDBOOL_H
+#define _GL_STDBOOL_H
+
+/* ISO C 99 <stdbool.h> for platforms that lack it. */
+
+/* Usage suggestions:
+
+ Programs that use <stdbool.h> should be aware of some limitations
+ and standards compliance issues.
+
+ Standards compliance:
+
+ - <stdbool.h> must be #included before 'bool', 'false', 'true'
+ can be used.
+
+ - You cannot assume that sizeof (bool) == 1.
+
+ - Programs should not undefine the macros bool, true, and false,
+ as C99 lists that as an "obsolescent feature".
+
+ Limitations of this substitute, when used in a C89 environment:
+
+ - <stdbool.h> must be #included before the '_Bool' type can be used.
+
+ - You cannot assume that _Bool is a typedef; it might be a macro.
+
+ - Bit-fields of type 'bool' are not supported. Portable code
+ should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'.
+
+ - In C99, casts and automatic conversions to '_Bool' or 'bool' are
+ performed in such a way that every nonzero value gets converted
+ to 'true', and zero gets converted to 'false'. This doesn't work
+ with this substitute. With this substitute, only the values 0 and 1
+ give the expected result when converted to _Bool' or 'bool'.
+
+ - C99 allows the use of (_Bool)0.0 in constant expressions, but
+ this substitute cannot always provide this property.
+
+ Also, it is suggested that programs use 'bool' rather than '_Bool';
+ this isn't required, but 'bool' is more common. */
+
+
+/* 7.16. Boolean type and values */
+
+/* BeOS <sys/socket.h> already #defines false 0, true 1. We use the same
+ definitions below, but temporarily we have to #undef them. */
+#if defined __BEOS__ && !defined __HAIKU__
+# include <OS.h> /* defines bool but not _Bool */
+# undef false
+# undef true
+#endif
+
+#ifdef __cplusplus
+# define _Bool bool
+# define bool bool
+#else
+# if defined __BEOS__ && !defined __HAIKU__
+ /* A compiler known to have 'bool'. */
+ /* If the compiler already has both 'bool' and '_Bool', we can assume they
+ are the same types. */
+# if !@HAVE__BOOL@
+typedef bool _Bool;
+# endif
+# else
+# if !defined __GNUC__
+ /* If @HAVE__BOOL@:
+ Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
+ the built-in _Bool type is used. See
+ https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
+ https://lists.gnu.org/r/bug-coreutils/2005-10/msg00086.html
+ Similar bugs are likely with other compilers as well; this file
+ wouldn't be used if <stdbool.h> was working.
+ So we override the _Bool type.
+ If !@HAVE__BOOL@:
+ Need to define _Bool ourselves. As 'signed char' or as an enum type?
+ Use of a typedef, with SunPRO C, leads to a stupid
+ "warning: _Bool is a keyword in ISO C99".
+ Use of an enum type, with IRIX cc, leads to a stupid
+ "warning(1185): enumerated type mixed with another type".
+ Even the existence of an enum type, without a typedef,
+ "Invalid enumerator. (badenum)" with HP-UX cc on Tru64.
+ The only benefit of the enum, debuggability, is not important
+ with these compilers. So use 'signed char' and no enum. */
+# define _Bool signed char
+# else
+ /* With this compiler, trust the _Bool type if the compiler has it. */
+# if !@HAVE__BOOL@
+ /* For the sake of symbolic names in gdb, define true and false as
+ enum constants, not only as macros.
+ It is tempting to write
+ typedef enum { false = 0, true = 1 } _Bool;
+ so that gdb prints values of type 'bool' symbolically. But then
+ values of type '_Bool' might promote to 'int' or 'unsigned int'
+ (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
+ (see ISO C 99 6.3.1.1.(2)). So add a negative value to the
+ enum; this ensures that '_Bool' promotes to 'int'. */
+typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
+# endif
+# endif
+# endif
+# define bool _Bool
+#endif
+
+/* The other macros must be usable in preprocessor directives. */
+#ifdef __cplusplus
+# define false false
+# define true true
+#else
+# define false 0
+# define true 1
+#endif
+
+#define __bool_true_false_are_defined 1
+
+#endif /* _GL_STDBOOL_H */
diff --git a/gl/lib/stddef.in.h b/gl/lib/stddef.in.h
new file mode 100644
index 0000000..5c9a747
--- /dev/null
+++ b/gl/lib/stddef.in.h
@@ -0,0 +1,147 @@
+/* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
+
+ Copyright (C) 2009-2022 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 2.1 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 Eric Blake. */
+
+/*
+ * POSIX 2008 <stddef.h> for platforms that have issues.
+ * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stddef.h.html>
+ */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined __need_wchar_t || defined __need_size_t \
+ || defined __need_ptrdiff_t || defined __need_NULL \
+ || defined __need_wint_t
+/* Special invocation convention inside gcc header files. In
+ particular, gcc provides a version of <stddef.h> that blindly
+ redefines NULL even when __need_wint_t was defined, even though
+ wint_t is not normally provided by <stddef.h>. Hence, we must
+ remember if special invocation has ever been used to obtain wint_t,
+ in which case we need to clean up NULL yet again. */
+
+# if !(defined _@GUARD_PREFIX@_STDDEF_H && defined _GL_STDDEF_WINT_T)
+# ifdef __need_wint_t
+# define _GL_STDDEF_WINT_T
+# endif
+# @INCLUDE_NEXT@ @NEXT_STDDEF_H@
+ /* On TinyCC, make sure that the macros that indicate the special invocation
+ convention get undefined. */
+# undef __need_wchar_t
+# undef __need_size_t
+# undef __need_ptrdiff_t
+# undef __need_NULL
+# undef __need_wint_t
+# endif
+
+#else
+/* Normal invocation convention. */
+
+# ifndef _@GUARD_PREFIX@_STDDEF_H
+
+/* On AIX 7.2, with xlc in 64-bit mode, <stddef.h> defines max_align_t to a
+ type with alignment 4, but 'long' has alignment 8. */
+# if defined _AIX && defined __LP64__
+# if !GNULIB_defined_max_align_t
+# ifdef _MAX_ALIGN_T
+/* /usr/include/stddef.h has already defined max_align_t. Override it. */
+typedef long rpl_max_align_t;
+# define max_align_t rpl_max_align_t
+# else
+/* Prevent /usr/include/stddef.h from defining max_align_t. */
+typedef long max_align_t;
+# define _MAX_ALIGN_T
+# endif
+# define GNULIB_defined_max_align_t 1
+# endif
+# endif
+
+/* The include_next requires a split double-inclusion guard. */
+
+# @INCLUDE_NEXT@ @NEXT_STDDEF_H@
+
+/* On NetBSD 5.0, the definition of NULL lacks proper parentheses. */
+# if (@REPLACE_NULL@ \
+ && (!defined _@GUARD_PREFIX@_STDDEF_H || defined _GL_STDDEF_WINT_T))
+# undef NULL
+# ifdef __cplusplus
+ /* ISO C++ says that the macro NULL must expand to an integer constant
+ expression, hence '((void *) 0)' is not allowed in C++. */
+# if __GNUG__ >= 3
+ /* GNU C++ has a __null macro that behaves like an integer ('int' or
+ 'long') but has the same size as a pointer. Use that, to avoid
+ warnings. */
+# define NULL __null
+# else
+# define NULL 0L
+# endif
+# else
+# define NULL ((void *) 0)
+# endif
+# endif
+
+# ifndef _@GUARD_PREFIX@_STDDEF_H
+# define _@GUARD_PREFIX@_STDDEF_H
+
+/* Some platforms lack wchar_t. */
+#if !@HAVE_WCHAR_T@
+# define wchar_t int
+#endif
+
+/* Some platforms lack max_align_t. The check for _GCC_MAX_ALIGN_T is
+ a hack in case the configure-time test was done with g++ even though
+ we are currently compiling with gcc.
+ On MSVC, max_align_t is defined only in C++ mode, after <cstddef> was
+ included. Its definition is good since it has an alignment of 8 (on x86
+ and x86_64).
+ Similarly on OS/2 kLIBC. */
+#if (defined _MSC_VER || (defined __KLIBC__ && !defined __LIBCN__)) \
+ && defined __cplusplus
+# include <cstddef>
+#else
+# if ! (@HAVE_MAX_ALIGN_T@ || (defined _GCC_MAX_ALIGN_T && !defined __clang__))
+# if !GNULIB_defined_max_align_t
+/* On the x86, the maximum storage alignment of double, long, etc. is 4,
+ but GCC's C11 ABI for x86 says that max_align_t has an alignment of 8,
+ and the C11 standard allows this. Work around this problem by
+ using __alignof__ (which returns 8 for double) rather than _Alignof
+ (which returns 4), and align each union member accordingly. */
+# if defined __GNUC__ || (__clang_major__ >= 4)
+# define _GL_STDDEF_ALIGNAS(type) \
+ __attribute__ ((__aligned__ (__alignof__ (type))))
+# else
+# define _GL_STDDEF_ALIGNAS(type) /* */
+# endif
+typedef union
+{
+ char *__p _GL_STDDEF_ALIGNAS (char *);
+ double __d _GL_STDDEF_ALIGNAS (double);
+ long double __ld _GL_STDDEF_ALIGNAS (long double);
+ long int __i _GL_STDDEF_ALIGNAS (long int);
+} rpl_max_align_t;
+# define max_align_t rpl_max_align_t
+# define GNULIB_defined_max_align_t 1
+# endif
+# endif
+#endif
+
+# endif /* _@GUARD_PREFIX@_STDDEF_H */
+# endif /* _@GUARD_PREFIX@_STDDEF_H */
+#endif /* __need_XXX */
diff --git a/gl/lib/stdint.in.h b/gl/lib/stdint.in.h
new file mode 100644
index 0000000..eaa7874
--- /dev/null
+++ b/gl/lib/stdint.in.h
@@ -0,0 +1,740 @@
+/* Copyright (C) 2001-2002, 2004-2022 Free Software Foundation, Inc.
+ Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
+ This file is part of gnulib.
+
+ 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 2.1 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/>. */
+
+/*
+ * ISO C 99 <stdint.h> for platforms that lack it.
+ * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdint.h.html>
+ */
+
+#ifndef _@GUARD_PREFIX@_STDINT_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* When including a system file that in turn includes <inttypes.h>,
+ use the system <inttypes.h>, not our substitute. This avoids
+ problems with (for example) VMS, whose <sys/bitypes.h> includes
+ <inttypes.h>. */
+#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+
+/* On Android (Bionic libc), <sys/types.h> includes this file before
+ having defined 'time_t'. Therefore in this case avoid including
+ other system header files; just include the system's <stdint.h>.
+ Ideally we should test __BIONIC__ here, but it is only defined after
+ <sys/cdefs.h> has been included; hence test __ANDROID__ instead. */
+#if defined __ANDROID__ && defined _GL_INCLUDING_SYS_TYPES_H
+# @INCLUDE_NEXT@ @NEXT_STDINT_H@
+#else
+
+/* Get those types that are already defined in other system include
+ files, so that we can "#define int8_t signed char" below without
+ worrying about a later system include file containing a "typedef
+ signed char int8_t;" that will get messed up by our macro. Our
+ macros should all be consistent with the system versions, except
+ for the "fast" types and macros, which we recommend against using
+ in public interfaces due to compiler differences. */
+
+#if @HAVE_STDINT_H@
+# if defined __sgi && ! defined __c99
+ /* Bypass IRIX's <stdint.h> if in C89 mode, since it merely annoys users
+ with "This header file is to be used only for c99 mode compilations"
+ diagnostics. */
+# define __STDINT_H__
+# endif
+
+ /* Some pre-C++11 <stdint.h> implementations need this. */
+# ifdef __cplusplus
+# ifndef __STDC_CONSTANT_MACROS
+# define __STDC_CONSTANT_MACROS 1
+# endif
+# ifndef __STDC_LIMIT_MACROS
+# define __STDC_LIMIT_MACROS 1
+# endif
+# endif
+
+ /* Other systems may have an incomplete or buggy <stdint.h>.
+ Include it before <inttypes.h>, since any "#include <stdint.h>"
+ in <inttypes.h> would reinclude us, skipping our contents because
+ _@GUARD_PREFIX@_STDINT_H is defined.
+ The include_next requires a split double-inclusion guard. */
+# @INCLUDE_NEXT@ @NEXT_STDINT_H@
+#endif
+
+#if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
+#define _@GUARD_PREFIX@_STDINT_H
+
+/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX,
+ LONG_MIN, LONG_MAX, ULONG_MAX, _GL_INTEGER_WIDTH. */
+#include <limits.h>
+
+/* Override WINT_MIN and WINT_MAX if gnulib's <wchar.h> or <wctype.h> overrides
+ wint_t. */
+#if @GNULIBHEADERS_OVERRIDE_WINT_T@
+# undef WINT_MIN
+# undef WINT_MAX
+# define WINT_MIN 0x0U
+# define WINT_MAX 0xffffffffU
+#endif
+
+#if ! @HAVE_C99_STDINT_H@
+
+/* <sys/types.h> defines some of the stdint.h types as well, on glibc,
+ IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
+ AIX 5.2 <sys/types.h> isn't needed and causes troubles.
+ Mac OS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
+ relies on the system <stdint.h> definitions, so include
+ <sys/types.h> after @NEXT_STDINT_H@. */
+# if @HAVE_SYS_TYPES_H@ && ! defined _AIX
+# include <sys/types.h>
+# endif
+
+# if @HAVE_INTTYPES_H@
+ /* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines
+ int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__.
+ <inttypes.h> also defines intptr_t and uintptr_t. */
+# include <inttypes.h>
+# elif @HAVE_SYS_INTTYPES_H@
+ /* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and
+ the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */
+# include <sys/inttypes.h>
+# endif
+
+# if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__
+ /* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines
+ int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is
+ included by <sys/types.h>. */
+# include <sys/bitypes.h>
+# endif
+
+# undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+
+/* Minimum and maximum values for an integer type under the usual assumption.
+ Return an unspecified value if BITS == 0, adding a check to pacify
+ picky compilers. */
+
+/* These are separate macros, because if you try to merge these macros into
+ a single one, HP-UX cc rejects the resulting expression in constant
+ expressions. */
+# define _STDINT_UNSIGNED_MIN(bits, zero) \
+ (zero)
+# define _STDINT_SIGNED_MIN(bits, zero) \
+ (~ _STDINT_MAX (1, bits, zero))
+
+# define _STDINT_MAX(signed, bits, zero) \
+ (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
+
+#if !GNULIB_defined_stdint_types
+
+/* 7.18.1.1. Exact-width integer types */
+
+/* Here we assume a standard architecture where the hardware integer
+ types have 8, 16, 32, optionally 64 bits. */
+
+# undef int8_t
+# undef uint8_t
+typedef signed char gl_int8_t;
+typedef unsigned char gl_uint8_t;
+# define int8_t gl_int8_t
+# define uint8_t gl_uint8_t
+
+# undef int16_t
+# undef uint16_t
+typedef short int gl_int16_t;
+typedef unsigned short int gl_uint16_t;
+# define int16_t gl_int16_t
+# define uint16_t gl_uint16_t
+
+# undef int32_t
+# undef uint32_t
+typedef int gl_int32_t;
+typedef unsigned int gl_uint32_t;
+# define int32_t gl_int32_t
+# define uint32_t gl_uint32_t
+
+/* If the system defines INT64_MAX, assume int64_t works. That way,
+ if the underlying platform defines int64_t to be a 64-bit long long
+ int, the code below won't mistakenly define it to be a 64-bit long
+ int, which would mess up C++ name mangling. We must use #ifdef
+ rather than #if, to avoid an error with HP-UX 10.20 cc. */
+
+# ifdef INT64_MAX
+# define GL_INT64_T
+# else
+/* Do not undefine int64_t if gnulib is not being used with 64-bit
+ types, since otherwise it breaks platforms like Tandem/NSK. */
+# if LONG_MAX >> 31 >> 31 == 1
+# undef int64_t
+typedef long int gl_int64_t;
+# define int64_t gl_int64_t
+# define GL_INT64_T
+# elif defined _MSC_VER
+# undef int64_t
+typedef __int64 gl_int64_t;
+# define int64_t gl_int64_t
+# define GL_INT64_T
+# else
+# undef int64_t
+typedef long long int gl_int64_t;
+# define int64_t gl_int64_t
+# define GL_INT64_T
+# endif
+# endif
+
+# ifdef UINT64_MAX
+# define GL_UINT64_T
+# else
+# if ULONG_MAX >> 31 >> 31 >> 1 == 1
+# undef uint64_t
+typedef unsigned long int gl_uint64_t;
+# define uint64_t gl_uint64_t
+# define GL_UINT64_T
+# elif defined _MSC_VER
+# undef uint64_t
+typedef unsigned __int64 gl_uint64_t;
+# define uint64_t gl_uint64_t
+# define GL_UINT64_T
+# else
+# undef uint64_t
+typedef unsigned long long int gl_uint64_t;
+# define uint64_t gl_uint64_t
+# define GL_UINT64_T
+# endif
+# endif
+
+/* Avoid collision with Solaris 2.5.1 <pthread.h> etc. */
+# define _UINT8_T
+# define _UINT32_T
+# define _UINT64_T
+
+
+/* 7.18.1.2. Minimum-width integer types */
+
+/* Here we assume a standard architecture where the hardware integer
+ types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
+ are the same as the corresponding N_t types. */
+
+# undef int_least8_t
+# undef uint_least8_t
+# undef int_least16_t
+# undef uint_least16_t
+# undef int_least32_t
+# undef uint_least32_t
+# undef int_least64_t
+# undef uint_least64_t
+# define int_least8_t int8_t
+# define uint_least8_t uint8_t
+# define int_least16_t int16_t
+# define uint_least16_t uint16_t
+# define int_least32_t int32_t
+# define uint_least32_t uint32_t
+# ifdef GL_INT64_T
+# define int_least64_t int64_t
+# endif
+# ifdef GL_UINT64_T
+# define uint_least64_t uint64_t
+# endif
+
+/* 7.18.1.3. Fastest minimum-width integer types */
+
+/* Note: Other <stdint.h> substitutes may define these types differently.
+ It is not recommended to use these types in public header files. */
+
+/* Here we assume a standard architecture where the hardware integer
+ types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
+ are taken from the same list of types. The following code normally
+ uses types consistent with glibc, as that lessens the chance of
+ incompatibility with older GNU hosts. */
+
+# undef int_fast8_t
+# undef uint_fast8_t
+# undef int_fast16_t
+# undef uint_fast16_t
+# undef int_fast32_t
+# undef uint_fast32_t
+# undef int_fast64_t
+# undef uint_fast64_t
+typedef signed char gl_int_fast8_t;
+typedef unsigned char gl_uint_fast8_t;
+
+# ifdef __sun
+/* Define types compatible with SunOS 5.10, so that code compiled under
+ earlier SunOS versions works with code compiled under SunOS 5.10. */
+typedef int gl_int_fast32_t;
+typedef unsigned int gl_uint_fast32_t;
+# else
+typedef long int gl_int_fast32_t;
+typedef unsigned long int gl_uint_fast32_t;
+# endif
+typedef gl_int_fast32_t gl_int_fast16_t;
+typedef gl_uint_fast32_t gl_uint_fast16_t;
+
+# define int_fast8_t gl_int_fast8_t
+# define uint_fast8_t gl_uint_fast8_t
+# define int_fast16_t gl_int_fast16_t
+# define uint_fast16_t gl_uint_fast16_t
+# define int_fast32_t gl_int_fast32_t
+# define uint_fast32_t gl_uint_fast32_t
+# ifdef GL_INT64_T
+# define int_fast64_t int64_t
+# endif
+# ifdef GL_UINT64_T
+# define uint_fast64_t uint64_t
+# endif
+
+/* 7.18.1.4. Integer types capable of holding object pointers */
+
+/* kLIBC's <stdint.h> defines _INTPTR_T_DECLARED and needs its own
+ definitions of intptr_t and uintptr_t (which use int and unsigned)
+ to avoid clashes with declarations of system functions like sbrk.
+ Similarly, MinGW WSL-5.4.1 <stdint.h> needs its own intptr_t and
+ uintptr_t to avoid conflicting declarations of system functions like
+ _findclose in <io.h>. */
+# if !((defined __KLIBC__ && defined _INTPTR_T_DECLARED) \
+ || defined __MINGW32__)
+# undef intptr_t
+# undef uintptr_t
+# ifdef _WIN64
+typedef long long int gl_intptr_t;
+typedef unsigned long long int gl_uintptr_t;
+# else
+typedef long int gl_intptr_t;
+typedef unsigned long int gl_uintptr_t;
+# endif
+# define intptr_t gl_intptr_t
+# define uintptr_t gl_uintptr_t
+# endif
+
+/* 7.18.1.5. Greatest-width integer types */
+
+/* Note: These types are compiler dependent. It may be unwise to use them in
+ public header files. */
+
+/* If the system defines INTMAX_MAX, assume that intmax_t works, and
+ similarly for UINTMAX_MAX and uintmax_t. This avoids problems with
+ assuming one type where another is used by the system. */
+
+# ifndef INTMAX_MAX
+# undef INTMAX_C
+# undef intmax_t
+# if LONG_MAX >> 30 == 1
+typedef long long int gl_intmax_t;
+# define intmax_t gl_intmax_t
+# elif defined GL_INT64_T
+# define intmax_t int64_t
+# else
+typedef long int gl_intmax_t;
+# define intmax_t gl_intmax_t
+# endif
+# endif
+
+# ifndef UINTMAX_MAX
+# undef UINTMAX_C
+# undef uintmax_t
+# if ULONG_MAX >> 31 == 1
+typedef unsigned long long int gl_uintmax_t;
+# define uintmax_t gl_uintmax_t
+# elif defined GL_UINT64_T
+# define uintmax_t uint64_t
+# else
+typedef unsigned long int gl_uintmax_t;
+# define uintmax_t gl_uintmax_t
+# endif
+# endif
+
+/* Verify that intmax_t and uintmax_t have the same size. Too much code
+ breaks if this is not the case. If this check fails, the reason is likely
+ to be found in the autoconf macros. */
+typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
+ ? 1 : -1];
+
+# define GNULIB_defined_stdint_types 1
+# endif /* !GNULIB_defined_stdint_types */
+
+/* 7.18.2. Limits of specified-width integer types */
+
+/* 7.18.2.1. Limits of exact-width integer types */
+
+/* Here we assume a standard architecture where the hardware integer
+ types have 8, 16, 32, optionally 64 bits. */
+
+# undef INT8_MIN
+# undef INT8_MAX
+# undef UINT8_MAX
+# define INT8_MIN (~ INT8_MAX)
+# define INT8_MAX 127
+# define UINT8_MAX 255
+
+# undef INT16_MIN
+# undef INT16_MAX
+# undef UINT16_MAX
+# define INT16_MIN (~ INT16_MAX)
+# define INT16_MAX 32767
+# define UINT16_MAX 65535
+
+# undef INT32_MIN
+# undef INT32_MAX
+# undef UINT32_MAX
+# define INT32_MIN (~ INT32_MAX)
+# define INT32_MAX 2147483647
+# define UINT32_MAX 4294967295U
+
+# if defined GL_INT64_T && ! defined INT64_MAX
+/* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0
+ evaluates the latter incorrectly in preprocessor expressions. */
+# define INT64_MIN (- INTMAX_C (1) << 63)
+# define INT64_MAX INTMAX_C (9223372036854775807)
+# endif
+
+# if defined GL_UINT64_T && ! defined UINT64_MAX
+# define UINT64_MAX UINTMAX_C (18446744073709551615)
+# endif
+
+/* 7.18.2.2. Limits of minimum-width integer types */
+
+/* Here we assume a standard architecture where the hardware integer
+ types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
+ are the same as the corresponding N_t types. */
+
+# undef INT_LEAST8_MIN
+# undef INT_LEAST8_MAX
+# undef UINT_LEAST8_MAX
+# define INT_LEAST8_MIN INT8_MIN
+# define INT_LEAST8_MAX INT8_MAX
+# define UINT_LEAST8_MAX UINT8_MAX
+
+# undef INT_LEAST16_MIN
+# undef INT_LEAST16_MAX
+# undef UINT_LEAST16_MAX
+# define INT_LEAST16_MIN INT16_MIN
+# define INT_LEAST16_MAX INT16_MAX
+# define UINT_LEAST16_MAX UINT16_MAX
+
+# undef INT_LEAST32_MIN
+# undef INT_LEAST32_MAX
+# undef UINT_LEAST32_MAX
+# define INT_LEAST32_MIN INT32_MIN
+# define INT_LEAST32_MAX INT32_MAX
+# define UINT_LEAST32_MAX UINT32_MAX
+
+# undef INT_LEAST64_MIN
+# undef INT_LEAST64_MAX
+# ifdef GL_INT64_T
+# define INT_LEAST64_MIN INT64_MIN
+# define INT_LEAST64_MAX INT64_MAX
+# endif
+
+# undef UINT_LEAST64_MAX
+# ifdef GL_UINT64_T
+# define UINT_LEAST64_MAX UINT64_MAX
+# endif
+
+/* 7.18.2.3. Limits of fastest minimum-width integer types */
+
+/* Here we assume a standard architecture where the hardware integer
+ types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
+ are taken from the same list of types. */
+
+# undef INT_FAST8_MIN
+# undef INT_FAST8_MAX
+# undef UINT_FAST8_MAX
+# define INT_FAST8_MIN SCHAR_MIN
+# define INT_FAST8_MAX SCHAR_MAX
+# define UINT_FAST8_MAX UCHAR_MAX
+
+# undef INT_FAST16_MIN
+# undef INT_FAST16_MAX
+# undef UINT_FAST16_MAX
+# define INT_FAST16_MIN INT_FAST32_MIN
+# define INT_FAST16_MAX INT_FAST32_MAX
+# define UINT_FAST16_MAX UINT_FAST32_MAX
+
+# undef INT_FAST32_MIN
+# undef INT_FAST32_MAX
+# undef UINT_FAST32_MAX
+# ifdef __sun
+# define INT_FAST32_MIN INT_MIN
+# define INT_FAST32_MAX INT_MAX
+# define UINT_FAST32_MAX UINT_MAX
+# else
+# define INT_FAST32_MIN LONG_MIN
+# define INT_FAST32_MAX LONG_MAX
+# define UINT_FAST32_MAX ULONG_MAX
+# endif
+
+# undef INT_FAST64_MIN
+# undef INT_FAST64_MAX
+# ifdef GL_INT64_T
+# define INT_FAST64_MIN INT64_MIN
+# define INT_FAST64_MAX INT64_MAX
+# endif
+
+# undef UINT_FAST64_MAX
+# ifdef GL_UINT64_T
+# define UINT_FAST64_MAX UINT64_MAX
+# endif
+
+/* 7.18.2.4. Limits of integer types capable of holding object pointers */
+
+# undef INTPTR_MIN
+# undef INTPTR_MAX
+# undef UINTPTR_MAX
+# ifdef _WIN64
+# define INTPTR_MIN LLONG_MIN
+# define INTPTR_MAX LLONG_MAX
+# define UINTPTR_MAX ULLONG_MAX
+# else
+# define INTPTR_MIN LONG_MIN
+# define INTPTR_MAX LONG_MAX
+# define UINTPTR_MAX ULONG_MAX
+# endif
+
+/* 7.18.2.5. Limits of greatest-width integer types */
+
+# ifndef INTMAX_MAX
+# undef INTMAX_MIN
+# ifdef INT64_MAX
+# define INTMAX_MIN INT64_MIN
+# define INTMAX_MAX INT64_MAX
+# else
+# define INTMAX_MIN INT32_MIN
+# define INTMAX_MAX INT32_MAX
+# endif
+# endif
+
+# ifndef UINTMAX_MAX
+# ifdef UINT64_MAX
+# define UINTMAX_MAX UINT64_MAX
+# else
+# define UINTMAX_MAX UINT32_MAX
+# endif
+# endif
+
+/* 7.18.3. Limits of other integer types */
+
+/* ptrdiff_t limits */
+# undef PTRDIFF_MIN
+# undef PTRDIFF_MAX
+# if @APPLE_UNIVERSAL_BUILD@
+# ifdef _LP64
+# define PTRDIFF_MIN _STDINT_SIGNED_MIN (64, 0l)
+# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l)
+# else
+# define PTRDIFF_MIN _STDINT_SIGNED_MIN (32, 0)
+# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0)
+# endif
+# else
+# define PTRDIFF_MIN \
+ _STDINT_SIGNED_MIN (@BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
+# define PTRDIFF_MAX \
+ _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
+# endif
+
+/* sig_atomic_t limits */
+# undef SIG_ATOMIC_MIN
+# undef SIG_ATOMIC_MAX
+# if @HAVE_SIGNED_SIG_ATOMIC_T@
+# define SIG_ATOMIC_MIN \
+ _STDINT_SIGNED_MIN (@BITSIZEOF_SIG_ATOMIC_T@, 0@SIG_ATOMIC_T_SUFFIX@)
+# else
+# define SIG_ATOMIC_MIN \
+ _STDINT_UNSIGNED_MIN (@BITSIZEOF_SIG_ATOMIC_T@, 0@SIG_ATOMIC_T_SUFFIX@)
+# endif
+# define SIG_ATOMIC_MAX \
+ _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
+ 0@SIG_ATOMIC_T_SUFFIX@)
+
+
+/* size_t limit */
+# undef SIZE_MAX
+# if @APPLE_UNIVERSAL_BUILD@
+# ifdef _LP64
+# define SIZE_MAX _STDINT_MAX (0, 64, 0ul)
+# else
+# define SIZE_MAX _STDINT_MAX (0, 32, 0ul)
+# endif
+# else
+# define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@)
+# endif
+
+/* wchar_t limits */
+/* Get WCHAR_MIN, WCHAR_MAX.
+ This include is not on the top, above, because on OSF/1 4.0 we have a
+ sequence of nested includes
+ <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
+ <stdint.h> and assumes its types are already defined. */
+# if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX)
+# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
+# include <wchar.h>
+# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
+# endif
+# undef WCHAR_MIN
+# undef WCHAR_MAX
+# if @HAVE_SIGNED_WCHAR_T@
+# define WCHAR_MIN \
+ _STDINT_SIGNED_MIN (@BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
+# else
+# define WCHAR_MIN \
+ _STDINT_UNSIGNED_MIN (@BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
+# endif
+# define WCHAR_MAX \
+ _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
+
+/* wint_t limits */
+/* If gnulib's <wchar.h> or <wctype.h> overrides wint_t, @WINT_T_SUFFIX@ is not
+ accurate, therefore use the definitions from above. */
+# if !@GNULIBHEADERS_OVERRIDE_WINT_T@
+# undef WINT_MIN
+# undef WINT_MAX
+# if @HAVE_SIGNED_WINT_T@
+# define WINT_MIN \
+ _STDINT_SIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
+# else
+# define WINT_MIN \
+ _STDINT_UNSIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
+# endif
+# define WINT_MAX \
+ _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
+# endif
+
+/* 7.18.4. Macros for integer constants */
+
+/* 7.18.4.1. Macros for minimum-width integer constants */
+/* According to ISO C 99 Technical Corrigendum 1 */
+
+/* Here we assume a standard architecture where the hardware integer
+ types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */
+
+# undef INT8_C
+# undef UINT8_C
+# define INT8_C(x) x
+# define UINT8_C(x) x
+
+# undef INT16_C
+# undef UINT16_C
+# define INT16_C(x) x
+# define UINT16_C(x) x
+
+# undef INT32_C
+# undef UINT32_C
+# define INT32_C(x) x
+# define UINT32_C(x) x ## U
+
+# undef INT64_C
+# undef UINT64_C
+# if LONG_MAX >> 31 >> 31 == 1
+# define INT64_C(x) x##L
+# elif defined _MSC_VER
+# define INT64_C(x) x##i64
+# else
+# define INT64_C(x) x##LL
+# endif
+# if ULONG_MAX >> 31 >> 31 >> 1 == 1
+# define UINT64_C(x) x##UL
+# elif defined _MSC_VER
+# define UINT64_C(x) x##ui64
+# else
+# define UINT64_C(x) x##ULL
+# endif
+
+/* 7.18.4.2. Macros for greatest-width integer constants */
+
+# ifndef INTMAX_C
+# if LONG_MAX >> 30 == 1
+# define INTMAX_C(x) x##LL
+# elif defined GL_INT64_T
+# define INTMAX_C(x) INT64_C(x)
+# else
+# define INTMAX_C(x) x##L
+# endif
+# endif
+
+# ifndef UINTMAX_C
+# if ULONG_MAX >> 31 == 1
+# define UINTMAX_C(x) x##ULL
+# elif defined GL_UINT64_T
+# define UINTMAX_C(x) UINT64_C(x)
+# else
+# define UINTMAX_C(x) x##UL
+# endif
+# endif
+
+#endif /* !@HAVE_C99_STDINT_H@ */
+
+/* Macros specified by ISO/IEC TS 18661-1:2014. */
+
+#if (!defined UINTMAX_WIDTH \
+ && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__))
+# ifdef INT8_MAX
+# define INT8_WIDTH _GL_INTEGER_WIDTH (INT8_MIN, INT8_MAX)
+# endif
+# ifdef UINT8_MAX
+# define UINT8_WIDTH _GL_INTEGER_WIDTH (0, UINT8_MAX)
+# endif
+# ifdef INT16_MAX
+# define INT16_WIDTH _GL_INTEGER_WIDTH (INT16_MIN, INT16_MAX)
+# endif
+# ifdef UINT16_MAX
+# define UINT16_WIDTH _GL_INTEGER_WIDTH (0, UINT16_MAX)
+# endif
+# ifdef INT32_MAX
+# define INT32_WIDTH _GL_INTEGER_WIDTH (INT32_MIN, INT32_MAX)
+# endif
+# ifdef UINT32_MAX
+# define UINT32_WIDTH _GL_INTEGER_WIDTH (0, UINT32_MAX)
+# endif
+# ifdef INT64_MAX
+# define INT64_WIDTH _GL_INTEGER_WIDTH (INT64_MIN, INT64_MAX)
+# endif
+# ifdef UINT64_MAX
+# define UINT64_WIDTH _GL_INTEGER_WIDTH (0, UINT64_MAX)
+# endif
+# define INT_LEAST8_WIDTH _GL_INTEGER_WIDTH (INT_LEAST8_MIN, INT_LEAST8_MAX)
+# define UINT_LEAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST8_MAX)
+# define INT_LEAST16_WIDTH _GL_INTEGER_WIDTH (INT_LEAST16_MIN, INT_LEAST16_MAX)
+# define UINT_LEAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST16_MAX)
+# define INT_LEAST32_WIDTH _GL_INTEGER_WIDTH (INT_LEAST32_MIN, INT_LEAST32_MAX)
+# define UINT_LEAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST32_MAX)
+# define INT_LEAST64_WIDTH _GL_INTEGER_WIDTH (INT_LEAST64_MIN, INT_LEAST64_MAX)
+# define UINT_LEAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST64_MAX)
+# define INT_FAST8_WIDTH _GL_INTEGER_WIDTH (INT_FAST8_MIN, INT_FAST8_MAX)
+# define UINT_FAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST8_MAX)
+# define INT_FAST16_WIDTH _GL_INTEGER_WIDTH (INT_FAST16_MIN, INT_FAST16_MAX)
+# define UINT_FAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST16_MAX)
+# define INT_FAST32_WIDTH _GL_INTEGER_WIDTH (INT_FAST32_MIN, INT_FAST32_MAX)
+# define UINT_FAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST32_MAX)
+# define INT_FAST64_WIDTH _GL_INTEGER_WIDTH (INT_FAST64_MIN, INT_FAST64_MAX)
+# define UINT_FAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST64_MAX)
+# define INTPTR_WIDTH _GL_INTEGER_WIDTH (INTPTR_MIN, INTPTR_MAX)
+# define UINTPTR_WIDTH _GL_INTEGER_WIDTH (0, UINTPTR_MAX)
+# define INTMAX_WIDTH _GL_INTEGER_WIDTH (INTMAX_MIN, INTMAX_MAX)
+# define UINTMAX_WIDTH _GL_INTEGER_WIDTH (0, UINTMAX_MAX)
+# define PTRDIFF_WIDTH _GL_INTEGER_WIDTH (PTRDIFF_MIN, PTRDIFF_MAX)
+# define SIZE_WIDTH _GL_INTEGER_WIDTH (0, SIZE_MAX)
+# define WCHAR_WIDTH _GL_INTEGER_WIDTH (WCHAR_MIN, WCHAR_MAX)
+# ifdef WINT_MAX
+# define WINT_WIDTH _GL_INTEGER_WIDTH (WINT_MIN, WINT_MAX)
+# endif
+# ifdef SIG_ATOMIC_MAX
+# define SIG_ATOMIC_WIDTH _GL_INTEGER_WIDTH (SIG_ATOMIC_MIN, SIG_ATOMIC_MAX)
+# endif
+#endif /* !WINT_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */
+
+#endif /* _@GUARD_PREFIX@_STDINT_H */
+#endif /* !(defined __ANDROID__ && ...) */
+#endif /* !defined _@GUARD_PREFIX@_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
diff --git a/gl/lib/stdio-read.c b/gl/lib/stdio-read.c
new file mode 100644
index 0000000..85efa0d
--- /dev/null
+++ b/gl/lib/stdio-read.c
@@ -0,0 +1,168 @@
+/* POSIX compatible FILE stream read function.
+ Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdio.h>
+
+/* Replace these functions only if module 'nonblocking' is requested. */
+#if GNULIB_NONBLOCKING
+
+/* On native Windows platforms, when read() is called on a non-blocking pipe
+ with an empty buffer, ReadFile() fails with error GetLastError() =
+ ERROR_NO_DATA, and read() in consequence fails with error EINVAL. This
+ read() function is at the basis of the function which fills the buffer of
+ a FILE stream. */
+
+# if defined _WIN32 && ! defined __CYGWIN__
+
+# include <errno.h>
+# include <io.h>
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+
+/* Don't assume that UNICODE is not defined. */
+# undef GetNamedPipeHandleState
+# define GetNamedPipeHandleState GetNamedPipeHandleStateA
+
+# define CALL_WITH_ERRNO_FIX(RETTYPE, EXPRESSION, FAILED) \
+ if (ferror (stream)) \
+ return (EXPRESSION); \
+ else \
+ { \
+ RETTYPE ret; \
+ SetLastError (0); \
+ ret = (EXPRESSION); \
+ if (FAILED) \
+ { \
+ if (GetLastError () == ERROR_NO_DATA && ferror (stream)) \
+ { \
+ int fd = fileno (stream); \
+ if (fd >= 0) \
+ { \
+ HANDLE h = (HANDLE) _get_osfhandle (fd); \
+ if (GetFileType (h) == FILE_TYPE_PIPE) \
+ { \
+ /* h is a pipe or socket. */ \
+ DWORD state; \
+ if (GetNamedPipeHandleState (h, &state, NULL, NULL, \
+ NULL, NULL, 0) \
+ && (state & PIPE_NOWAIT) != 0) \
+ /* h is a pipe in non-blocking mode. \
+ Change errno from EINVAL to EAGAIN. */ \
+ errno = EAGAIN; \
+ } \
+ } \
+ } \
+ } \
+ return ret; \
+ }
+
+/* Enable this function definition only if gnulib's <stdio.h> has prepared it.
+ Otherwise we get a function definition conflict with mingw64's <stdio.h>. */
+# if GNULIB_SCANF
+int
+scanf (const char *format, ...)
+{
+ int retval;
+ va_list args;
+
+ va_start (args, format);
+ retval = vfscanf (stdin, format, args);
+ va_end (args);
+
+ return retval;
+}
+# endif
+
+/* Enable this function definition only if gnulib's <stdio.h> has prepared it.
+ Otherwise we get a function definition conflict with mingw64's <stdio.h>. */
+# if GNULIB_FSCANF
+int
+fscanf (FILE *stream, const char *format, ...)
+{
+ int retval;
+ va_list args;
+
+ va_start (args, format);
+ retval = vfscanf (stream, format, args);
+ va_end (args);
+
+ return retval;
+}
+# endif
+
+/* Enable this function definition only if gnulib's <stdio.h> has prepared it.
+ Otherwise we get a function definition conflict with mingw64's <stdio.h>. */
+# if GNULIB_VSCANF
+int
+vscanf (const char *format, va_list args)
+{
+ return vfscanf (stdin, format, args);
+}
+# endif
+
+/* Enable this function definition only if gnulib's <stdio.h> has prepared it.
+ Otherwise we get a function definition conflict with mingw64's <stdio.h>. */
+# if GNULIB_VFSCANF
+int
+vfscanf (FILE *stream, const char *format, va_list args)
+#undef vfscanf
+{
+ CALL_WITH_ERRNO_FIX (int, vfscanf (stream, format, args), ret == EOF)
+}
+# endif
+
+int
+getchar (void)
+{
+ return fgetc (stdin);
+}
+
+int
+fgetc (FILE *stream)
+#undef fgetc
+{
+ CALL_WITH_ERRNO_FIX (int, fgetc (stream), ret == EOF)
+}
+
+char *
+fgets (char *s, int n, FILE *stream)
+#undef fgets
+{
+ CALL_WITH_ERRNO_FIX (char *, fgets (s, n, stream), ret == NULL)
+}
+
+/* We intentionally don't bother to fix gets. */
+
+size_t
+fread (void *ptr, size_t s, size_t n, FILE *stream)
+#undef fread
+{
+ CALL_WITH_ERRNO_FIX (size_t, fread (ptr, s, n, stream), ret < n)
+}
+
+# endif
+#endif
diff --git a/gl/lib/stdio-write.c b/gl/lib/stdio-write.c
new file mode 100644
index 0000000..82facf5
--- /dev/null
+++ b/gl/lib/stdio-write.c
@@ -0,0 +1,206 @@
+/* POSIX compatible FILE stream write function.
+ Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdio.h>
+
+/* Replace these functions only if module 'nonblocking' or module 'sigpipe' is
+ requested. */
+#if GNULIB_NONBLOCKING || GNULIB_SIGPIPE
+
+/* On native Windows platforms, SIGPIPE does not exist. When write() is
+ called on a pipe with no readers, WriteFile() fails with error
+ GetLastError() = ERROR_NO_DATA, and write() in consequence fails with
+ error EINVAL. This write() function is at the basis of the function
+ which flushes the buffer of a FILE stream. */
+
+# if defined _WIN32 && ! defined __CYGWIN__
+
+# include <errno.h>
+# include <signal.h>
+# include <io.h>
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+
+/* Don't assume that UNICODE is not defined. */
+# undef GetNamedPipeHandleState
+# define GetNamedPipeHandleState GetNamedPipeHandleStateA
+
+# if GNULIB_NONBLOCKING
+# define CLEAR_ERRNO \
+ errno = 0;
+# define HANDLE_ENOSPC \
+ if (errno == ENOSPC && ferror (stream)) \
+ { \
+ int fd = fileno (stream); \
+ if (fd >= 0) \
+ { \
+ HANDLE h = (HANDLE) _get_osfhandle (fd); \
+ if (GetFileType (h) == FILE_TYPE_PIPE) \
+ { \
+ /* h is a pipe or socket. */ \
+ DWORD state; \
+ if (GetNamedPipeHandleState (h, &state, NULL, NULL, \
+ NULL, NULL, 0) \
+ && (state & PIPE_NOWAIT) != 0) \
+ /* h is a pipe in non-blocking mode. \
+ Change errno from ENOSPC to EAGAIN. */ \
+ errno = EAGAIN; \
+ } \
+ } \
+ } \
+ else
+# else
+# define CLEAR_ERRNO
+# define HANDLE_ENOSPC
+# endif
+
+# if GNULIB_SIGPIPE
+# define CLEAR_LastError \
+ SetLastError (0);
+# define HANDLE_ERROR_NO_DATA \
+ if (GetLastError () == ERROR_NO_DATA && ferror (stream)) \
+ { \
+ int fd = fileno (stream); \
+ if (fd >= 0 \
+ && GetFileType ((HANDLE) _get_osfhandle (fd)) \
+ == FILE_TYPE_PIPE) \
+ { \
+ /* Try to raise signal SIGPIPE. */ \
+ raise (SIGPIPE); \
+ /* If it is currently blocked or ignored, change errno from \
+ EINVAL to EPIPE. */ \
+ errno = EPIPE; \
+ } \
+ } \
+ else
+# else
+# define CLEAR_LastError
+# define HANDLE_ERROR_NO_DATA
+# endif
+
+# define CALL_WITH_SIGPIPE_EMULATION(RETTYPE, EXPRESSION, FAILED) \
+ if (ferror (stream)) \
+ return (EXPRESSION); \
+ else \
+ { \
+ RETTYPE ret; \
+ CLEAR_ERRNO \
+ CLEAR_LastError \
+ ret = (EXPRESSION); \
+ if (FAILED) \
+ { \
+ HANDLE_ENOSPC \
+ HANDLE_ERROR_NO_DATA \
+ ; \
+ } \
+ return ret; \
+ }
+
+# if !REPLACE_PRINTF_POSIX /* avoid collision with printf.c */
+int
+printf (const char *format, ...)
+{
+ int retval;
+ va_list args;
+
+ va_start (args, format);
+ retval = vfprintf (stdout, format, args);
+ va_end (args);
+
+ return retval;
+}
+# endif
+
+# if !REPLACE_FPRINTF_POSIX /* avoid collision with fprintf.c */
+int
+fprintf (FILE *stream, const char *format, ...)
+{
+ int retval;
+ va_list args;
+
+ va_start (args, format);
+ retval = vfprintf (stream, format, args);
+ va_end (args);
+
+ return retval;
+}
+# endif
+
+# if !REPLACE_VPRINTF_POSIX /* avoid collision with vprintf.c */
+int
+vprintf (const char *format, va_list args)
+{
+ return vfprintf (stdout, format, args);
+}
+# endif
+
+# if !REPLACE_VFPRINTF_POSIX /* avoid collision with vfprintf.c */
+int
+vfprintf (FILE *stream, const char *format, va_list args)
+#undef vfprintf
+{
+ CALL_WITH_SIGPIPE_EMULATION (int, vfprintf (stream, format, args), ret == EOF)
+}
+# endif
+
+int
+putchar (int c)
+{
+ return fputc (c, stdout);
+}
+
+int
+fputc (int c, FILE *stream)
+#undef fputc
+{
+ CALL_WITH_SIGPIPE_EMULATION (int, fputc (c, stream), ret == EOF)
+}
+
+int
+fputs (const char *string, FILE *stream)
+#undef fputs
+{
+ CALL_WITH_SIGPIPE_EMULATION (int, fputs (string, stream), ret == EOF)
+}
+
+int
+puts (const char *string)
+#undef puts
+{
+ FILE *stream = stdout;
+ CALL_WITH_SIGPIPE_EMULATION (int, puts (string), ret == EOF)
+}
+
+size_t
+fwrite (const void *ptr, size_t s, size_t n, FILE *stream)
+#undef fwrite
+{
+ CALL_WITH_SIGPIPE_EMULATION (size_t, fwrite (ptr, s, n, stream), ret < n)
+}
+
+# endif
+#endif
diff --git a/gl/lib/stdio.in.h b/gl/lib/stdio.in.h
new file mode 100644
index 0000000..7b36dac
--- /dev/null
+++ b/gl/lib/stdio.in.h
@@ -0,0 +1,1711 @@
+/* A GNU-like <stdio.h>.
+
+ Copyright (C) 2004, 2007-2022 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 2.1 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 __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined __need_FILE || defined __need___FILE || defined _GL_ALREADY_INCLUDING_STDIO_H
+/* Special invocation convention:
+ - Inside glibc header files.
+ - On OSF/1 5.1 we have a sequence of nested includes
+ <stdio.h> -> <getopt.h> -> <ctype.h> -> <sys/localedef.h> ->
+ <sys/lc_core.h> -> <nl_types.h> -> <mesg.h> -> <stdio.h>.
+ In this situation, the functions are not yet declared, therefore we cannot
+ provide the C++ aliases. */
+
+#@INCLUDE_NEXT@ @NEXT_STDIO_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_STDIO_H
+
+#define _GL_ALREADY_INCLUDING_STDIO_H
+
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_STDIO_H@
+
+#undef _GL_ALREADY_INCLUDING_STDIO_H
+
+#ifndef _@GUARD_PREFIX@_STDIO_H
+#define _@GUARD_PREFIX@_STDIO_H
+
+/* Get va_list. Needed on many systems, including glibc 2.8. */
+#include <stdarg.h>
+
+#include <stddef.h>
+
+/* Get off_t and ssize_t. Needed on many systems, including glibc 2.8
+ and eglibc 2.11.2.
+ May also define off_t to a 64-bit type on native Windows. */
+#include <sys/types.h>
+
+/* Solaris 10 and NetBSD 7.0 declare renameat in <unistd.h>, not in <stdio.h>. */
+/* But in any case avoid namespace pollution on glibc systems. */
+#if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && (defined __sun || defined __NetBSD__) \
+ && ! defined __GLIBC__
+# include <unistd.h>
+#endif
+
+/* Android 4.3 declares renameat in <sys/stat.h>, not in <stdio.h>. */
+/* But in any case avoid namespace pollution on glibc systems. */
+#if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \
+ && ! defined __GLIBC__
+# include <sys/stat.h>
+#endif
+
+/* MSVC declares 'perror' in <stdlib.h>, not in <stdio.h>. We must include
+ it before we #define perror rpl_perror. */
+/* But in any case avoid namespace pollution on glibc systems. */
+#if (@GNULIB_PERROR@ || defined GNULIB_POSIXCHECK) \
+ && (defined _WIN32 && ! defined __CYGWIN__) \
+ && ! defined __GLIBC__
+# include <stdlib.h>
+#endif
+
+/* MSVC declares 'remove' in <io.h>, not in <stdio.h>. We must include
+ it before we #define remove rpl_remove. */
+/* MSVC declares 'rename' in <io.h>, not in <stdio.h>. We must include
+ it before we #define rename rpl_rename. */
+/* But in any case avoid namespace pollution on glibc systems. */
+#if (@GNULIB_REMOVE@ || @GNULIB_RENAME@ || defined GNULIB_POSIXCHECK) \
+ && (defined _WIN32 && ! defined __CYGWIN__) \
+ && ! defined __GLIBC__
+# include <io.h>
+#endif
+
+
+/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
+ that can be freed by passing them as the Ith argument to the
+ function F. */
+#ifndef _GL_ATTRIBUTE_DEALLOC
+# if __GNUC__ >= 11
+# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
+# else
+# define _GL_ATTRIBUTE_DEALLOC(f, i)
+# endif
+#endif
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The __-protected variants of the attributes 'format' and 'printf' are
+ accepted by gcc versions 2.6.4 (effectively 2.7) and later.
+ We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
+ gnulib and libintl do '#define printf __printf__' when they override
+ the 'printf' function. */
+#ifndef _GL_ATTRIBUTE_FORMAT
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || defined __clang__
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+# else
+# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
+# endif
+#endif
+
+/* An __attribute__ __format__ specifier for a function that takes a format
+ string and arguments, where the format string directives are the ones
+ standardized by ISO C99 and POSIX.
+ _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD */
+/* __gnu_printf__ is supported in GCC >= 4.4. */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+# define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __gnu_printf__
+#else
+# define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __printf__
+#endif
+
+/* An __attribute__ __format__ specifier for a function that takes a format
+ string and arguments, where the format string directives are the ones of the
+ system printf(), rather than the ones standardized by ISO C99 and POSIX.
+ _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM */
+/* On mingw, Gnulib sets __USE_MINGW_ANSI_STDIO in order to get closer to
+ the standards. The macro GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU indicates
+ whether this change is effective. On older mingw, it is not. */
+#if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU
+# define _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD
+#else
+# define _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM __printf__
+#endif
+
+/* _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD
+ indicates to GCC that the function takes a format string and arguments,
+ where the format string directives are the ones standardized by ISO C99
+ and POSIX. */
+#define _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, formatstring_parameter, first_argument))
+
+/* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD,
+ except that it indicates to GCC that the supported format string directives
+ are the ones of the system printf(), rather than the ones standardized by
+ ISO C99 and POSIX. */
+#define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, formatstring_parameter, first_argument))
+
+/* _GL_ATTRIBUTE_FORMAT_SCANF
+ indicates to GCC that the function takes a format string and arguments,
+ where the format string directives are the ones standardized by ISO C99
+ and POSIX. */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+# define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT ((__gnu_scanf__, formatstring_parameter, first_argument))
+#else
+# define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
+#endif
+
+/* _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_SCANF,
+ except that it indicates to GCC that the supported format string directives
+ are the ones of the system scanf(), rather than the ones standardized by
+ ISO C99 and POSIX. */
+#define _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* Macros for stringification. */
+#define _GL_STDIO_STRINGIZE(token) #token
+#define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
+
+/* When also using extern inline, suppress the use of static inline in
+ standard headers of problematic Apple configurations, as Libc at
+ least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
+ <https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html>.
+ Perhaps Apple will fix this some day. */
+#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
+ && defined __GNUC__ && defined __STDC__)
+# undef putc_unlocked
+#endif
+
+#if @GNULIB_DPRINTF@
+# if @REPLACE_DPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define dprintf rpl_dprintf
+# endif
+_GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *restrict format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *restrict format, ...));
+# else
+# if !@HAVE_DPRINTF@
+_GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *restrict format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *restrict format, ...));
+# endif
+_GL_CXXALIASWARN (dprintf);
+#elif defined GNULIB_POSIXCHECK
+# undef dprintf
+# if HAVE_RAW_DECL_DPRINTF
+_GL_WARN_ON_USE (dprintf, "dprintf is unportable - "
+ "use gnulib module dprintf for portability");
+# endif
+#endif
+
+#if @GNULIB_FCLOSE@
+/* Close STREAM and its underlying file descriptor. */
+# if @REPLACE_FCLOSE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define fclose rpl_fclose
+# endif
+_GL_FUNCDECL_RPL (fclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fclose, int, (FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fclose, int, (FILE *stream));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fclose);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef fclose
+/* Assume fclose is always declared. */
+_GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - "
+ "use gnulib module fclose for portable POSIX compliance");
+#endif
+
+#if @GNULIB_MDA_FCLOSEALL@
+/* On native Windows, map 'fcloseall' to '_fcloseall', so that -loldnames is
+ not required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::fcloseall on all platforms that have
+ it. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fcloseall
+# define fcloseall _fcloseall
+# endif
+_GL_CXXALIAS_MDA (fcloseall, int, (void));
+# else
+# if @HAVE_DECL_FCLOSEALL@
+# if defined __FreeBSD__ || defined __DragonFly__
+_GL_CXXALIAS_SYS (fcloseall, void, (void));
+# else
+_GL_CXXALIAS_SYS (fcloseall, int, (void));
+# endif
+# endif
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_FCLOSEALL@
+_GL_CXXALIASWARN (fcloseall);
+# endif
+#endif
+
+#if @GNULIB_FDOPEN@
+# if @REPLACE_FDOPEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fdopen
+# define fdopen rpl_fdopen
+# endif
+_GL_FUNCDECL_RPL (fdopen, FILE *,
+ (int fd, const char *mode)
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+_GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fdopen
+# define fdopen _fdopen
+# endif
+_GL_CXXALIAS_MDA (fdopen, FILE *, (int fd, const char *mode));
+# else
+# if __GNUC__ >= 11
+/* For -Wmismatched-dealloc: Associate fdopen with fclose or rpl_fclose. */
+_GL_FUNCDECL_SYS (fdopen, FILE *,
+ (int fd, const char *mode)
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+# endif
+_GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
+# endif
+_GL_CXXALIASWARN (fdopen);
+#else
+# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined fdopen
+/* For -Wmismatched-dealloc: Associate fdopen with fclose or rpl_fclose. */
+_GL_FUNCDECL_SYS (fdopen, FILE *,
+ (int fd, const char *mode)
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef fdopen
+/* Assume fdopen is always declared. */
+_GL_WARN_ON_USE (fdopen, "fdopen on native Windows platforms is not POSIX compliant - "
+ "use gnulib module fdopen for portability");
+# elif @GNULIB_MDA_FDOPEN@
+/* On native Windows, map 'fdopen' to '_fdopen', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::fdopen always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fdopen
+# define fdopen _fdopen
+# endif
+_GL_CXXALIAS_MDA (fdopen, FILE *, (int fd, const char *mode));
+# else
+_GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
+# endif
+_GL_CXXALIASWARN (fdopen);
+# endif
+#endif
+
+#if @GNULIB_FFLUSH@
+/* Flush all pending data on STREAM according to POSIX rules. Both
+ output and seekable input streams are supported.
+ Note! LOSS OF DATA can occur if fflush is applied on an input stream
+ that is _not_seekable_ or on an update stream that is _not_seekable_
+ and in which the most recent operation was input. Seekability can
+ be tested with lseek(fileno(fp),0,SEEK_CUR). */
+# if @REPLACE_FFLUSH@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define fflush rpl_fflush
+# endif
+_GL_FUNCDECL_RPL (fflush, int, (FILE *gl_stream));
+_GL_CXXALIAS_RPL (fflush, int, (FILE *gl_stream));
+# else
+_GL_CXXALIAS_SYS (fflush, int, (FILE *gl_stream));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fflush);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef fflush
+/* Assume fflush is always declared. */
+_GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - "
+ "use gnulib module fflush for portable POSIX compliance");
+#endif
+
+#if @GNULIB_FGETC@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fgetc
+# define fgetc rpl_fgetc
+# endif
+_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fgetc, int, (FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fgetc, int, (FILE *stream));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fgetc);
+# endif
+#endif
+
+#if @GNULIB_FGETS@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fgets
+# define fgets rpl_fgets
+# endif
+_GL_FUNCDECL_RPL (fgets, char *,
+ (char *restrict s, int n, FILE *restrict stream)
+ _GL_ARG_NONNULL ((1, 3)));
+_GL_CXXALIAS_RPL (fgets, char *,
+ (char *restrict s, int n, FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (fgets, char *,
+ (char *restrict s, int n, FILE *restrict stream));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fgets);
+# endif
+#endif
+
+#if @GNULIB_MDA_FILENO@
+/* On native Windows, map 'fileno' to '_fileno', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::fileno always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fileno
+# define fileno _fileno
+# endif
+_GL_CXXALIAS_MDA (fileno, int, (FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (fileno, int, (FILE *restrict stream));
+# endif
+_GL_CXXALIASWARN (fileno);
+#endif
+
+#if @GNULIB_FOPEN@
+# if (@GNULIB_FOPEN@ && @REPLACE_FOPEN@) \
+ || (@GNULIB_FOPEN_GNU@ && @REPLACE_FOPEN_FOR_FOPEN_GNU@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fopen
+# define fopen rpl_fopen
+# endif
+_GL_FUNCDECL_RPL (fopen, FILE *,
+ (const char *restrict filename, const char *restrict mode)
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+_GL_CXXALIAS_RPL (fopen, FILE *,
+ (const char *restrict filename, const char *restrict mode));
+# else
+# if __GNUC__ >= 11
+/* For -Wmismatched-dealloc: Associate fopen with fclose or rpl_fclose. */
+_GL_FUNCDECL_SYS (fopen, FILE *,
+ (const char *restrict filename, const char *restrict mode)
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+# endif
+_GL_CXXALIAS_SYS (fopen, FILE *,
+ (const char *restrict filename, const char *restrict mode));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fopen);
+# endif
+#else
+# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined fopen
+/* For -Wmismatched-dealloc: Associate fopen with fclose or rpl_fclose. */
+_GL_FUNCDECL_SYS (fopen, FILE *,
+ (const char *restrict filename, const char *restrict mode)
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef fopen
+/* Assume fopen is always declared. */
+_GL_WARN_ON_USE (fopen, "fopen on native Windows platforms is not POSIX compliant - "
+ "use gnulib module fopen for portability");
+# endif
+#endif
+
+#if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@
+# if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \
+ || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define fprintf rpl_fprintf
+# endif
+# define GNULIB_overrides_fprintf 1
+# if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
+_GL_FUNCDECL_RPL (fprintf, int,
+ (FILE *restrict fp, const char *restrict format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+# else
+_GL_FUNCDECL_RPL (fprintf, int,
+ (FILE *restrict fp, const char *restrict format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_RPL (fprintf, int,
+ (FILE *restrict fp, const char *restrict format, ...));
+# else
+_GL_CXXALIAS_SYS (fprintf, int,
+ (FILE *restrict fp, const char *restrict format, ...));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fprintf);
+# endif
+#endif
+#if !@GNULIB_FPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_fprintf
+# undef fprintf
+# endif
+/* Assume fprintf is always declared. */
+_GL_WARN_ON_USE (fprintf, "fprintf is not always POSIX compliant - "
+ "use gnulib module fprintf-posix for portable "
+ "POSIX compliance");
+#endif
+
+#if @GNULIB_FPURGE@
+/* Discard all pending buffered I/O data on STREAM.
+ STREAM must not be wide-character oriented.
+ When discarding pending output, the file position is set back to where it
+ was before the write calls. When discarding pending input, the file
+ position is advanced to match the end of the previously read input.
+ Return 0 if successful. Upon error, return -1 and set errno. */
+# if @REPLACE_FPURGE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define fpurge rpl_fpurge
+# endif
+_GL_FUNCDECL_RPL (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fpurge, int, (FILE *gl_stream));
+# else
+# if !@HAVE_DECL_FPURGE@
+_GL_FUNCDECL_SYS (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (fpurge, int, (FILE *gl_stream));
+# endif
+_GL_CXXALIASWARN (fpurge);
+#elif defined GNULIB_POSIXCHECK
+# undef fpurge
+# if HAVE_RAW_DECL_FPURGE
+_GL_WARN_ON_USE (fpurge, "fpurge is not always present - "
+ "use gnulib module fpurge for portability");
+# endif
+#endif
+
+#if @GNULIB_FPUTC@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fputc
+# define fputc rpl_fputc
+# endif
+_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (fputc, int, (int c, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fputc, int, (int c, FILE *stream));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fputc);
+# endif
+#endif
+
+#if @GNULIB_FPUTS@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fputs
+# define fputs rpl_fputs
+# endif
+_GL_FUNCDECL_RPL (fputs, int,
+ (const char *restrict string, FILE *restrict stream)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (fputs, int,
+ (const char *restrict string, FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (fputs, int,
+ (const char *restrict string, FILE *restrict stream));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fputs);
+# endif
+#endif
+
+#if @GNULIB_FREAD@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fread
+# define fread rpl_fread
+# endif
+_GL_FUNCDECL_RPL (fread, size_t,
+ (void *restrict ptr, size_t s, size_t n,
+ FILE *restrict stream)
+ _GL_ARG_NONNULL ((4)));
+_GL_CXXALIAS_RPL (fread, size_t,
+ (void *restrict ptr, size_t s, size_t n,
+ FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (fread, size_t,
+ (void *restrict ptr, size_t s, size_t n,
+ FILE *restrict stream));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fread);
+# endif
+#endif
+
+#if @GNULIB_FREOPEN@
+# if @REPLACE_FREOPEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef freopen
+# define freopen rpl_freopen
+# endif
+_GL_FUNCDECL_RPL (freopen, FILE *,
+ (const char *restrict filename, const char *restrict mode,
+ FILE *restrict stream)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (freopen, FILE *,
+ (const char *restrict filename, const char *restrict mode,
+ FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (freopen, FILE *,
+ (const char *restrict filename, const char *restrict mode,
+ FILE *restrict stream));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (freopen);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef freopen
+/* Assume freopen is always declared. */
+_GL_WARN_ON_USE (freopen,
+ "freopen on native Windows platforms is not POSIX compliant - "
+ "use gnulib module freopen for portability");
+#endif
+
+#if @GNULIB_FSCANF@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fscanf
+# define fscanf rpl_fscanf
+# endif
+_GL_FUNCDECL_RPL (fscanf, int,
+ (FILE *restrict stream, const char *restrict format, ...)
+ _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (fscanf, int,
+ (FILE *restrict stream, const char *restrict format, ...));
+# else
+_GL_CXXALIAS_SYS (fscanf, int,
+ (FILE *restrict stream, const char *restrict format, ...));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fscanf);
+# endif
+#endif
+
+
+/* Set up the following warnings, based on which modules are in use.
+ GNU Coding Standards discourage the use of fseek, since it imposes
+ an arbitrary limitation on some 32-bit hosts. Remember that the
+ fseek module depends on the fseeko module, so we only have three
+ cases to consider:
+
+ 1. The developer is not using either module. Issue a warning under
+ GNULIB_POSIXCHECK for both functions, to remind them that both
+ functions have bugs on some systems. _GL_NO_LARGE_FILES has no
+ impact on this warning.
+
+ 2. The developer is using both modules. They may be unaware of the
+ arbitrary limitations of fseek, so issue a warning under
+ GNULIB_POSIXCHECK. On the other hand, they may be using both
+ modules intentionally, so the developer can define
+ _GL_NO_LARGE_FILES in the compilation units where the use of fseek
+ is safe, to silence the warning.
+
+ 3. The developer is using the fseeko module, but not fseek. Gnulib
+ guarantees that fseek will still work around platform bugs in that
+ case, but we presume that the developer is aware of the pitfalls of
+ fseek and was trying to avoid it, so issue a warning even when
+ GNULIB_POSIXCHECK is undefined. Again, _GL_NO_LARGE_FILES can be
+ defined to silence the warning in particular compilation units.
+ In C++ compilations with GNULIB_NAMESPACE, in order to avoid that
+ fseek gets defined as a macro, it is recommended that the developer
+ uses the fseek module, even if he is not calling the fseek function.
+
+ Most gnulib clients that perform stream operations should fall into
+ category 3. */
+
+#if @GNULIB_FSEEK@
+# if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
+# define _GL_FSEEK_WARN /* Category 2, above. */
+# undef fseek
+# endif
+# if @REPLACE_FSEEK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fseek
+# define fseek rpl_fseek
+# endif
+_GL_FUNCDECL_RPL (fseek, int, (FILE *fp, long offset, int whence)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fseek, int, (FILE *fp, long offset, int whence));
+# else
+_GL_CXXALIAS_SYS (fseek, int, (FILE *fp, long offset, int whence));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fseek);
+# endif
+#endif
+
+#if @GNULIB_FSEEKO@
+# if !@GNULIB_FSEEK@ && !defined _GL_NO_LARGE_FILES
+# define _GL_FSEEK_WARN /* Category 3, above. */
+# undef fseek
+# endif
+# if @REPLACE_FSEEKO@
+/* Provide an fseeko function that is aware of a preceding fflush(), and which
+ detects pipes. */
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fseeko
+# define fseeko rpl_fseeko
+# endif
+_GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence));
+# else
+# if ! @HAVE_DECL_FSEEKO@
+_GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
+# endif
+_GL_CXXALIASWARN (fseeko);
+#elif defined GNULIB_POSIXCHECK
+# define _GL_FSEEK_WARN /* Category 1, above. */
+# undef fseek
+# undef fseeko
+# if HAVE_RAW_DECL_FSEEKO
+_GL_WARN_ON_USE (fseeko, "fseeko is unportable - "
+ "use gnulib module fseeko for portability");
+# endif
+#endif
+
+#ifdef _GL_FSEEK_WARN
+# undef _GL_FSEEK_WARN
+/* Here, either fseek is undefined (but C89 guarantees that it is
+ declared), or it is defined as rpl_fseek (declared above). */
+_GL_WARN_ON_USE (fseek, "fseek cannot handle files larger than 4 GB "
+ "on 32-bit platforms - "
+ "use fseeko function for handling of large files");
+#endif
+
+
+/* ftell, ftello. See the comments on fseek/fseeko. */
+
+#if @GNULIB_FTELL@
+# if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
+# define _GL_FTELL_WARN /* Category 2, above. */
+# undef ftell
+# endif
+# if @REPLACE_FTELL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ftell
+# define ftell rpl_ftell
+# endif
+_GL_FUNCDECL_RPL (ftell, long, (FILE *fp) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (ftell, long, (FILE *fp));
+# else
+_GL_CXXALIAS_SYS (ftell, long, (FILE *fp));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (ftell);
+# endif
+#endif
+
+#if @GNULIB_FTELLO@
+# if !@GNULIB_FTELL@ && !defined _GL_NO_LARGE_FILES
+# define _GL_FTELL_WARN /* Category 3, above. */
+# undef ftell
+# endif
+# if @REPLACE_FTELLO@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ftello
+# define ftello rpl_ftello
+# endif
+_GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
+# else
+# if ! @HAVE_DECL_FTELLO@
+_GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
+# endif
+_GL_CXXALIASWARN (ftello);
+#elif defined GNULIB_POSIXCHECK
+# define _GL_FTELL_WARN /* Category 1, above. */
+# undef ftell
+# undef ftello
+# if HAVE_RAW_DECL_FTELLO
+_GL_WARN_ON_USE (ftello, "ftello is unportable - "
+ "use gnulib module ftello for portability");
+# endif
+#endif
+
+#ifdef _GL_FTELL_WARN
+# undef _GL_FTELL_WARN
+/* Here, either ftell is undefined (but C89 guarantees that it is
+ declared), or it is defined as rpl_ftell (declared above). */
+_GL_WARN_ON_USE (ftell, "ftell cannot handle files larger than 4 GB "
+ "on 32-bit platforms - "
+ "use ftello function for handling of large files");
+#endif
+
+
+#if @GNULIB_FWRITE@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fwrite
+# define fwrite rpl_fwrite
+# endif
+_GL_FUNCDECL_RPL (fwrite, size_t,
+ (const void *restrict ptr, size_t s, size_t n,
+ FILE *restrict stream)
+ _GL_ARG_NONNULL ((1, 4)));
+_GL_CXXALIAS_RPL (fwrite, size_t,
+ (const void *restrict ptr, size_t s, size_t n,
+ FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (fwrite, size_t,
+ (const void *restrict ptr, size_t s, size_t n,
+ FILE *restrict stream));
+
+/* Work around bug 11959 when fortifying glibc 2.4 through 2.15
+ <https://sourceware.org/bugzilla/show_bug.cgi?id=11959>,
+ which sometimes causes an unwanted diagnostic for fwrite calls.
+ This affects only function declaration attributes under certain
+ versions of gcc and clang, and is not needed for C++. */
+# if (0 < __USE_FORTIFY_LEVEL \
+ && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
+ && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \
+ && !defined __cplusplus)
+# undef fwrite
+# undef fwrite_unlocked
+extern size_t __REDIRECT (rpl_fwrite,
+ (const void *__restrict, size_t, size_t,
+ FILE *__restrict),
+ fwrite);
+extern size_t __REDIRECT (rpl_fwrite_unlocked,
+ (const void *__restrict, size_t, size_t,
+ FILE *__restrict),
+ fwrite_unlocked);
+# define fwrite rpl_fwrite
+# define fwrite_unlocked rpl_fwrite_unlocked
+# endif
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fwrite);
+# endif
+#endif
+
+#if @GNULIB_GETC@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getc
+# define getc rpl_fgetc
+# endif
+_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL_1 (getc, rpl_fgetc, int, (FILE *stream));
+# else
+_GL_CXXALIAS_SYS (getc, int, (FILE *stream));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (getc);
+# endif
+#endif
+
+#if @GNULIB_GETCHAR@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getchar
+# define getchar rpl_getchar
+# endif
+_GL_FUNCDECL_RPL (getchar, int, (void));
+_GL_CXXALIAS_RPL (getchar, int, (void));
+# else
+_GL_CXXALIAS_SYS (getchar, int, (void));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (getchar);
+# endif
+#endif
+
+#if @GNULIB_GETDELIM@
+/* Read input, up to (and including) the next occurrence of DELIMITER, from
+ STREAM, store it in *LINEPTR (and NUL-terminate it).
+ *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
+ bytes of space. It is realloc'd as necessary.
+ Return the number of bytes read and stored at *LINEPTR (not including the
+ NUL terminator), or -1 on error or EOF. */
+# if @REPLACE_GETDELIM@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getdelim
+# define getdelim rpl_getdelim
+# endif
+_GL_FUNCDECL_RPL (getdelim, ssize_t,
+ (char **restrict lineptr, size_t *restrict linesize,
+ int delimiter,
+ FILE *restrict stream)
+ _GL_ARG_NONNULL ((1, 2, 4)));
+_GL_CXXALIAS_RPL (getdelim, ssize_t,
+ (char **restrict lineptr, size_t *restrict linesize,
+ int delimiter,
+ FILE *restrict stream));
+# else
+# if !@HAVE_DECL_GETDELIM@
+_GL_FUNCDECL_SYS (getdelim, ssize_t,
+ (char **restrict lineptr, size_t *restrict linesize,
+ int delimiter,
+ FILE *restrict stream)
+ _GL_ARG_NONNULL ((1, 2, 4)));
+# endif
+_GL_CXXALIAS_SYS (getdelim, ssize_t,
+ (char **restrict lineptr, size_t *restrict linesize,
+ int delimiter,
+ FILE *restrict stream));
+# endif
+_GL_CXXALIASWARN (getdelim);
+#elif defined GNULIB_POSIXCHECK
+# undef getdelim
+# if HAVE_RAW_DECL_GETDELIM
+_GL_WARN_ON_USE (getdelim, "getdelim is unportable - "
+ "use gnulib module getdelim for portability");
+# endif
+#endif
+
+#if @GNULIB_GETLINE@
+/* Read a line, up to (and including) the next newline, from STREAM, store it
+ in *LINEPTR (and NUL-terminate it).
+ *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
+ bytes of space. It is realloc'd as necessary.
+ Return the number of bytes read and stored at *LINEPTR (not including the
+ NUL terminator), or -1 on error or EOF. */
+# if @REPLACE_GETLINE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getline
+# define getline rpl_getline
+# endif
+_GL_FUNCDECL_RPL (getline, ssize_t,
+ (char **restrict lineptr, size_t *restrict linesize,
+ FILE *restrict stream)
+ _GL_ARG_NONNULL ((1, 2, 3)));
+_GL_CXXALIAS_RPL (getline, ssize_t,
+ (char **restrict lineptr, size_t *restrict linesize,
+ FILE *restrict stream));
+# else
+# if !@HAVE_DECL_GETLINE@
+_GL_FUNCDECL_SYS (getline, ssize_t,
+ (char **restrict lineptr, size_t *restrict linesize,
+ FILE *restrict stream)
+ _GL_ARG_NONNULL ((1, 2, 3)));
+# endif
+_GL_CXXALIAS_SYS (getline, ssize_t,
+ (char **restrict lineptr, size_t *restrict linesize,
+ FILE *restrict stream));
+# endif
+# if @HAVE_DECL_GETLINE@
+_GL_CXXALIASWARN (getline);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef getline
+# if HAVE_RAW_DECL_GETLINE
+_GL_WARN_ON_USE (getline, "getline is unportable - "
+ "use gnulib module getline for portability");
+# endif
+#endif
+
+/* It is very rare that the developer ever has full control of stdin,
+ so any use of gets warrants an unconditional warning; besides, C11
+ removed it. */
+#undef gets
+#if HAVE_RAW_DECL_GETS && !defined __cplusplus
+_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+#endif
+
+#if @GNULIB_MDA_GETW@
+/* On native Windows, map 'getw' to '_getw', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::getw always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getw
+# define getw _getw
+# endif
+_GL_CXXALIAS_MDA (getw, int, (FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (getw, int, (FILE *restrict stream));
+# endif
+_GL_CXXALIASWARN (getw);
+#endif
+
+#if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
+struct obstack;
+/* Grow an obstack with formatted output. Return the number of
+ bytes added to OBS. No trailing nul byte is added, and the
+ object should be closed with obstack_finish before use. Upon
+ memory allocation error, call obstack_alloc_failed_handler. Upon
+ other error, return -1. */
+# if @REPLACE_OBSTACK_PRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define obstack_printf rpl_obstack_printf
+# endif
+_GL_FUNCDECL_RPL (obstack_printf, int,
+ (struct obstack *obs, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (obstack_printf, int,
+ (struct obstack *obs, const char *format, ...));
+# else
+# if !@HAVE_DECL_OBSTACK_PRINTF@
+_GL_FUNCDECL_SYS (obstack_printf, int,
+ (struct obstack *obs, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (obstack_printf, int,
+ (struct obstack *obs, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (obstack_printf);
+# if @REPLACE_OBSTACK_PRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define obstack_vprintf rpl_obstack_vprintf
+# endif
+_GL_FUNCDECL_RPL (obstack_vprintf, int,
+ (struct obstack *obs, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (obstack_vprintf, int,
+ (struct obstack *obs, const char *format, va_list args));
+# else
+# if !@HAVE_DECL_OBSTACK_PRINTF@
+_GL_FUNCDECL_SYS (obstack_vprintf, int,
+ (struct obstack *obs, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (obstack_vprintf, int,
+ (struct obstack *obs, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (obstack_vprintf);
+#endif
+
+#if @GNULIB_PCLOSE@
+# if !@HAVE_PCLOSE@
+_GL_FUNCDECL_SYS (pclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pclose, int, (FILE *stream));
+_GL_CXXALIASWARN (pclose);
+#elif defined GNULIB_POSIXCHECK
+# undef pclose
+# if HAVE_RAW_DECL_PCLOSE
+_GL_WARN_ON_USE (pclose, "pclose is unportable - "
+ "use gnulib module pclose for more portability");
+# endif
+#endif
+
+#if @GNULIB_PERROR@
+/* Print a message to standard error, describing the value of ERRNO,
+ (if STRING is not NULL and not empty) prefixed with STRING and ": ",
+ and terminated with a newline. */
+# if @REPLACE_PERROR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define perror rpl_perror
+# endif
+_GL_FUNCDECL_RPL (perror, void, (const char *string));
+_GL_CXXALIAS_RPL (perror, void, (const char *string));
+# else
+_GL_CXXALIAS_SYS (perror, void, (const char *string));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (perror);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef perror
+/* Assume perror is always declared. */
+_GL_WARN_ON_USE (perror, "perror is not always POSIX compliant - "
+ "use gnulib module perror for portability");
+#endif
+
+#if @GNULIB_POPEN@
+# if @REPLACE_POPEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef popen
+# define popen rpl_popen
+# endif
+_GL_FUNCDECL_RPL (popen, FILE *,
+ (const char *cmd, const char *mode)
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1));
+_GL_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode));
+# else
+# if !@HAVE_POPEN@ || __GNUC__ >= 11
+_GL_FUNCDECL_SYS (popen, FILE *,
+ (const char *cmd, const char *mode)
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1));
+# endif
+_GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode));
+# endif
+_GL_CXXALIASWARN (popen);
+#else
+# if @GNULIB_PCLOSE@ && __GNUC__ >= 11 && !defined popen
+/* For -Wmismatched-dealloc: Associate popen with pclose or rpl_pclose. */
+_GL_FUNCDECL_SYS (popen, FILE *,
+ (const char *cmd, const char *mode)
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1));
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef popen
+# if HAVE_RAW_DECL_POPEN
+_GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
+ "use gnulib module popen or pipe for more portability");
+# endif
+# endif
+#endif
+
+#if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
+# if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
+ || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
+# if defined __GNUC__ || defined __clang__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+/* Don't break __attribute__((format(printf,M,N))). */
+# define printf __printf__
+# endif
+# if @GNULIB_PRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
+_GL_FUNCDECL_RPL_1 (__printf__, int,
+ (const char *restrict format, ...)
+ __asm__ (@ASM_SYMBOL_PREFIX@
+ _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
+ _GL_ARG_NONNULL ((1)));
+# else
+_GL_FUNCDECL_RPL_1 (__printf__, int,
+ (const char *restrict format, ...)
+ __asm__ (@ASM_SYMBOL_PREFIX@
+ _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
+ _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
+# else
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define printf rpl_printf
+# endif
+_GL_FUNCDECL_RPL (printf, int,
+ (const char *restrict format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (printf, int, (const char *restrict format, ...));
+# endif
+# define GNULIB_overrides_printf 1
+# else
+_GL_CXXALIAS_SYS (printf, int, (const char *restrict format, ...));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (printf);
+# endif
+#endif
+#if !@GNULIB_PRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_printf
+# undef printf
+# endif
+/* Assume printf is always declared. */
+_GL_WARN_ON_USE (printf, "printf is not always POSIX compliant - "
+ "use gnulib module printf-posix for portable "
+ "POSIX compliance");
+#endif
+
+#if @GNULIB_PUTC@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef putc
+# define putc rpl_fputc
+# endif
+_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL_1 (putc, rpl_fputc, int, (int c, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (putc, int, (int c, FILE *stream));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (putc);
+# endif
+#endif
+
+#if @GNULIB_PUTCHAR@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef putchar
+# define putchar rpl_putchar
+# endif
+_GL_FUNCDECL_RPL (putchar, int, (int c));
+_GL_CXXALIAS_RPL (putchar, int, (int c));
+# else
+_GL_CXXALIAS_SYS (putchar, int, (int c));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (putchar);
+# endif
+#endif
+
+#if @GNULIB_PUTS@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef puts
+# define puts rpl_puts
+# endif
+_GL_FUNCDECL_RPL (puts, int, (const char *string) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (puts, int, (const char *string));
+# else
+_GL_CXXALIAS_SYS (puts, int, (const char *string));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (puts);
+# endif
+#endif
+
+#if @GNULIB_MDA_PUTW@
+/* On native Windows, map 'putw' to '_putw', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::putw always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef putw
+# define putw _putw
+# endif
+_GL_CXXALIAS_MDA (putw, int, (int w, FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (putw, int, (int w, FILE *restrict stream));
+# endif
+_GL_CXXALIASWARN (putw);
+#endif
+
+#if @GNULIB_REMOVE@
+# if @REPLACE_REMOVE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef remove
+# define remove rpl_remove
+# endif
+_GL_FUNCDECL_RPL (remove, int, (const char *name) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (remove, int, (const char *name));
+# else
+_GL_CXXALIAS_SYS (remove, int, (const char *name));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (remove);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef remove
+/* Assume remove is always declared. */
+_GL_WARN_ON_USE (remove, "remove cannot handle directories on some platforms - "
+ "use gnulib module remove for more portability");
+#endif
+
+#if @GNULIB_RENAME@
+# if @REPLACE_RENAME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef rename
+# define rename rpl_rename
+# endif
+_GL_FUNCDECL_RPL (rename, int,
+ (const char *old_filename, const char *new_filename)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (rename, int,
+ (const char *old_filename, const char *new_filename));
+# else
+_GL_CXXALIAS_SYS (rename, int,
+ (const char *old_filename, const char *new_filename));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (rename);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef rename
+/* Assume rename is always declared. */
+_GL_WARN_ON_USE (rename, "rename is buggy on some platforms - "
+ "use gnulib module rename for more portability");
+#endif
+
+#if @GNULIB_RENAMEAT@
+# if @REPLACE_RENAMEAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef renameat
+# define renameat rpl_renameat
+# endif
+_GL_FUNCDECL_RPL (renameat, int,
+ (int fd1, char const *file1, int fd2, char const *file2)
+ _GL_ARG_NONNULL ((2, 4)));
+_GL_CXXALIAS_RPL (renameat, int,
+ (int fd1, char const *file1, int fd2, char const *file2));
+# else
+# if !@HAVE_RENAMEAT@
+_GL_FUNCDECL_SYS (renameat, int,
+ (int fd1, char const *file1, int fd2, char const *file2)
+ _GL_ARG_NONNULL ((2, 4)));
+# endif
+_GL_CXXALIAS_SYS (renameat, int,
+ (int fd1, char const *file1, int fd2, char const *file2));
+# endif
+_GL_CXXALIASWARN (renameat);
+#elif defined GNULIB_POSIXCHECK
+# undef renameat
+# if HAVE_RAW_DECL_RENAMEAT
+_GL_WARN_ON_USE (renameat, "renameat is not portable - "
+ "use gnulib module renameat for portability");
+# endif
+#endif
+
+#if @GNULIB_SCANF@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if defined __GNUC__ || defined __clang__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef scanf
+/* Don't break __attribute__((format(scanf,M,N))). */
+# define scanf __scanf__
+# endif
+_GL_FUNCDECL_RPL_1 (__scanf__, int,
+ (const char *restrict format, ...)
+ __asm__ (@ASM_SYMBOL_PREFIX@
+ _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf))
+ _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *restrict format, ...));
+# else
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef scanf
+# define scanf rpl_scanf
+# endif
+_GL_FUNCDECL_RPL (scanf, int, (const char *restrict format, ...)
+ _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (scanf, int, (const char *restrict format, ...));
+# endif
+# else
+_GL_CXXALIAS_SYS (scanf, int, (const char *restrict format, ...));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (scanf);
+# endif
+#endif
+
+#if @GNULIB_SNPRINTF@
+# if @REPLACE_SNPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define snprintf rpl_snprintf
+# endif
+# define GNULIB_overrides_snprintf 1
+_GL_FUNCDECL_RPL (snprintf, int,
+ (char *restrict str, size_t size,
+ const char *restrict format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
+ _GL_ARG_NONNULL ((3)));
+_GL_CXXALIAS_RPL (snprintf, int,
+ (char *restrict str, size_t size,
+ const char *restrict format, ...));
+# else
+# if !@HAVE_DECL_SNPRINTF@
+_GL_FUNCDECL_SYS (snprintf, int,
+ (char *restrict str, size_t size,
+ const char *restrict format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
+ _GL_ARG_NONNULL ((3)));
+# endif
+_GL_CXXALIAS_SYS (snprintf, int,
+ (char *restrict str, size_t size,
+ const char *restrict format, ...));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (snprintf);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef snprintf
+# if HAVE_RAW_DECL_SNPRINTF
+_GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
+ "use gnulib module snprintf for portability");
+# endif
+#endif
+
+/* Some people would argue that all sprintf uses should be warned about
+ (for example, OpenBSD issues a link warning for it),
+ since it can cause security holes due to buffer overruns.
+ However, we believe that sprintf can be used safely, and is more
+ efficient than snprintf in those safe cases; and as proof of our
+ belief, we use sprintf in several gnulib modules. So this header
+ intentionally avoids adding a warning to sprintf except when
+ GNULIB_POSIXCHECK is defined. */
+
+#if @GNULIB_SPRINTF_POSIX@
+# if @REPLACE_SPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define sprintf rpl_sprintf
+# endif
+# define GNULIB_overrides_sprintf 1
+_GL_FUNCDECL_RPL (sprintf, int,
+ (char *restrict str, const char *restrict format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (sprintf, int,
+ (char *restrict str, const char *restrict format, ...));
+# else
+_GL_CXXALIAS_SYS (sprintf, int,
+ (char *restrict str, const char *restrict format, ...));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (sprintf);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef sprintf
+/* Assume sprintf is always declared. */
+_GL_WARN_ON_USE (sprintf, "sprintf is not always POSIX compliant - "
+ "use gnulib module sprintf-posix for portable "
+ "POSIX compliance");
+#endif
+
+#if @GNULIB_MDA_TEMPNAM@
+/* On native Windows, map 'tempnam' to '_tempnam', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::tempnam always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef tempnam
+# define tempnam _tempnam
+# endif
+_GL_CXXALIAS_MDA (tempnam, char *, (const char *dir, const char *prefix));
+# else
+_GL_CXXALIAS_SYS (tempnam, char *, (const char *dir, const char *prefix));
+# endif
+_GL_CXXALIASWARN (tempnam);
+#endif
+
+#if @GNULIB_TMPFILE@
+# if @REPLACE_TMPFILE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define tmpfile rpl_tmpfile
+# endif
+_GL_FUNCDECL_RPL (tmpfile, FILE *, (void)
+ _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+_GL_CXXALIAS_RPL (tmpfile, FILE *, (void));
+# else
+# if __GNUC__ >= 11
+/* For -Wmismatched-dealloc: Associate tmpfile with fclose or rpl_fclose. */
+_GL_FUNCDECL_SYS (tmpfile, FILE *, (void)
+ _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+# endif
+_GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (tmpfile);
+# endif
+#else
+# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined tmpfile
+/* For -Wmismatched-dealloc: Associate tmpfile with fclose or rpl_fclose. */
+_GL_FUNCDECL_SYS (tmpfile, FILE *, (void)
+ _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef tmpfile
+# if HAVE_RAW_DECL_TMPFILE
+_GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
+ "use gnulib module tmpfile for portability");
+# endif
+# endif
+#endif
+
+#if @GNULIB_VASPRINTF@
+/* Write formatted output to a string dynamically allocated with malloc().
+ If the memory allocation succeeds, store the address of the string in
+ *RESULT and return the number of resulting bytes, excluding the trailing
+ NUL. Upon memory allocation error, or some other error, return -1. */
+# if @REPLACE_VASPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define asprintf rpl_asprintf
+# endif
+# define GNULIB_overrides_asprintf
+_GL_FUNCDECL_RPL (asprintf, int,
+ (char **result, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (asprintf, int,
+ (char **result, const char *format, ...));
+# else
+# if !@HAVE_VASPRINTF@
+_GL_FUNCDECL_SYS (asprintf, int,
+ (char **result, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (asprintf, int,
+ (char **result, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (asprintf);
+# if @REPLACE_VASPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define vasprintf rpl_vasprintf
+# endif
+# define GNULIB_overrides_vasprintf 1
+_GL_FUNCDECL_RPL (vasprintf, int,
+ (char **result, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (vasprintf, int,
+ (char **result, const char *format, va_list args));
+# else
+# if !@HAVE_VASPRINTF@
+_GL_FUNCDECL_SYS (vasprintf, int,
+ (char **result, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (vasprintf, int,
+ (char **result, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vasprintf);
+#endif
+
+#if @GNULIB_VDPRINTF@
+# if @REPLACE_VDPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define vdprintf rpl_vdprintf
+# endif
+_GL_FUNCDECL_RPL (vdprintf, int,
+ (int fd, const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (vdprintf, int,
+ (int fd, const char *restrict format, va_list args));
+# else
+# if !@HAVE_VDPRINTF@
+_GL_FUNCDECL_SYS (vdprintf, int,
+ (int fd, const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((2)));
+# endif
+/* Need to cast, because on Solaris, the third parameter will likely be
+ __va_list args. */
+_GL_CXXALIAS_SYS_CAST (vdprintf, int,
+ (int fd, const char *restrict format, va_list args));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (vdprintf);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef vdprintf
+# if HAVE_RAW_DECL_VDPRINTF
+_GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
+ "use gnulib module vdprintf for portability");
+# endif
+#endif
+
+#if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@
+# if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \
+ || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define vfprintf rpl_vfprintf
+# endif
+# define GNULIB_overrides_vfprintf 1
+# if @GNULIB_VFPRINTF_POSIX@
+_GL_FUNCDECL_RPL (vfprintf, int,
+ (FILE *restrict fp,
+ const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+# else
+_GL_FUNCDECL_RPL (vfprintf, int,
+ (FILE *restrict fp,
+ const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_RPL (vfprintf, int,
+ (FILE *restrict fp,
+ const char *restrict format, va_list args));
+# else
+/* Need to cast, because on Solaris, the third parameter is
+ __va_list args
+ and GCC's fixincludes did not change this to __gnuc_va_list. */
+_GL_CXXALIAS_SYS_CAST (vfprintf, int,
+ (FILE *restrict fp,
+ const char *restrict format, va_list args));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (vfprintf);
+# endif
+#endif
+#if !@GNULIB_VFPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_vfprintf
+# undef vfprintf
+# endif
+/* Assume vfprintf is always declared. */
+_GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
+ "use gnulib module vfprintf-posix for portable "
+ "POSIX compliance");
+#endif
+
+#if @GNULIB_VFSCANF@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef vfscanf
+# define vfscanf rpl_vfscanf
+# endif
+_GL_FUNCDECL_RPL (vfscanf, int,
+ (FILE *restrict stream,
+ const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (vfscanf, int,
+ (FILE *restrict stream,
+ const char *restrict format, va_list args));
+# else
+_GL_CXXALIAS_SYS (vfscanf, int,
+ (FILE *restrict stream,
+ const char *restrict format, va_list args));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (vfscanf);
+# endif
+#endif
+
+#if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
+# if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \
+ || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define vprintf rpl_vprintf
+# endif
+# define GNULIB_overrides_vprintf 1
+# if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
+_GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 0)
+ _GL_ARG_NONNULL ((1)));
+# else
+_GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_RPL (vprintf, int, (const char *restrict format, va_list args));
+# else
+/* Need to cast, because on Solaris, the second parameter is
+ __va_list args
+ and GCC's fixincludes did not change this to __gnuc_va_list. */
+_GL_CXXALIAS_SYS_CAST (vprintf, int,
+ (const char *restrict format, va_list args));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (vprintf);
+# endif
+#endif
+#if !@GNULIB_VPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_vprintf
+# undef vprintf
+# endif
+/* Assume vprintf is always declared. */
+_GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
+ "use gnulib module vprintf-posix for portable "
+ "POSIX compliance");
+#endif
+
+#if @GNULIB_VSCANF@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef vscanf
+# define vscanf rpl_vscanf
+# endif
+_GL_FUNCDECL_RPL (vscanf, int, (const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (vscanf, int, (const char *restrict format, va_list args));
+# else
+_GL_CXXALIAS_SYS (vscanf, int, (const char *restrict format, va_list args));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (vscanf);
+# endif
+#endif
+
+#if @GNULIB_VSNPRINTF@
+# if @REPLACE_VSNPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define vsnprintf rpl_vsnprintf
+# endif
+# define GNULIB_overrides_vsnprintf 1
+_GL_FUNCDECL_RPL (vsnprintf, int,
+ (char *restrict str, size_t size,
+ const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
+ _GL_ARG_NONNULL ((3)));
+_GL_CXXALIAS_RPL (vsnprintf, int,
+ (char *restrict str, size_t size,
+ const char *restrict format, va_list args));
+# else
+# if !@HAVE_DECL_VSNPRINTF@
+_GL_FUNCDECL_SYS (vsnprintf, int,
+ (char *restrict str, size_t size,
+ const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
+ _GL_ARG_NONNULL ((3)));
+# endif
+_GL_CXXALIAS_SYS (vsnprintf, int,
+ (char *restrict str, size_t size,
+ const char *restrict format, va_list args));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (vsnprintf);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef vsnprintf
+# if HAVE_RAW_DECL_VSNPRINTF
+_GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
+ "use gnulib module vsnprintf for portability");
+# endif
+#endif
+
+#if @GNULIB_VSPRINTF_POSIX@
+# if @REPLACE_VSPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define vsprintf rpl_vsprintf
+# endif
+# define GNULIB_overrides_vsprintf 1
+_GL_FUNCDECL_RPL (vsprintf, int,
+ (char *restrict str,
+ const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (vsprintf, int,
+ (char *restrict str,
+ const char *restrict format, va_list args));
+# else
+/* Need to cast, because on Solaris, the third parameter is
+ __va_list args
+ and GCC's fixincludes did not change this to __gnuc_va_list. */
+_GL_CXXALIAS_SYS_CAST (vsprintf, int,
+ (char *restrict str,
+ const char *restrict format, va_list args));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (vsprintf);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef vsprintf
+/* Assume vsprintf is always declared. */
+_GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX compliant - "
+ "use gnulib module vsprintf-posix for portable "
+ "POSIX compliance");
+#endif
+
+#endif /* _@GUARD_PREFIX@_STDIO_H */
+#endif /* _@GUARD_PREFIX@_STDIO_H */
+#endif
diff --git a/gl/lib/stdlib.in.h b/gl/lib/stdlib.in.h
new file mode 100644
index 0000000..a86643c
--- /dev/null
+++ b/gl/lib/stdlib.in.h
@@ -0,0 +1,1559 @@
+/* A GNU-like <stdlib.h>.
+
+ Copyright (C) 1995, 2001-2004, 2006-2022 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 2.1 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 __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined __need_system_stdlib_h || defined __need_malloc_and_calloc
+/* Special invocation conventions inside some gnulib header files,
+ and inside some glibc header files, respectively. */
+
+#@INCLUDE_NEXT@ @NEXT_STDLIB_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_STDLIB_H
+
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_STDLIB_H@
+
+#ifndef _@GUARD_PREFIX@_STDLIB_H
+#define _@GUARD_PREFIX@_STDLIB_H
+
+/* NetBSD 5.0 mis-defines NULL. */
+#include <stddef.h>
+
+/* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>. */
+#if @GNULIB_SYSTEM_POSIX@ && !defined WEXITSTATUS
+# include <sys/wait.h>
+#endif
+
+/* Solaris declares getloadavg() in <sys/loadavg.h>. */
+#if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@
+/* OpenIndiana has a bug: <sys/time.h> must be included before
+ <sys/loadavg.h>. */
+# include <sys/time.h>
+# include <sys/loadavg.h>
+#endif
+
+/* Native Windows platforms declare _mktemp() in <io.h>. */
+#if defined _WIN32 && !defined __CYGWIN__
+# include <io.h>
+#endif
+
+#if @GNULIB_RANDOM_R@
+
+/* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
+ from <stdlib.h> if _REENTRANT is defined. Include it whenever we need
+ 'struct random_data'. */
+# if @HAVE_RANDOM_H@
+# include <random.h>
+# endif
+
+# if !@HAVE_STRUCT_RANDOM_DATA@ || @REPLACE_RANDOM_R@ || !@HAVE_RANDOM_R@
+# include <stdint.h>
+# endif
+
+# if !@HAVE_STRUCT_RANDOM_DATA@
+/* Define 'struct random_data'.
+ But allow multiple gnulib generated <stdlib.h> replacements to coexist. */
+# if !GNULIB_defined_struct_random_data
+struct random_data
+{
+ int32_t *fptr; /* Front pointer. */
+ int32_t *rptr; /* Rear pointer. */
+ int32_t *state; /* Array of state values. */
+ int rand_type; /* Type of random number generator. */
+ int rand_deg; /* Degree of random number generator. */
+ int rand_sep; /* Distance between front and rear. */
+ int32_t *end_ptr; /* Pointer behind state table. */
+};
+# define GNULIB_defined_struct_random_data 1
+# endif
+# endif
+#endif
+
+#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_MKOSTEMP@ || @GNULIB_MKOSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !(defined _WIN32 && ! defined __CYGWIN__)
+/* On Mac OS X 10.3, only <unistd.h> declares mkstemp. */
+/* On Mac OS X 10.5, only <unistd.h> declares mkstemps. */
+/* On Mac OS X 10.13, only <unistd.h> declares mkostemp and mkostemps. */
+/* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */
+/* But avoid namespace pollution on glibc systems and native Windows. */
+# include <unistd.h>
+#endif
+
+/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
+ that can be freed by passing them as the Ith argument to the
+ function F. */
+#ifndef _GL_ATTRIBUTE_DEALLOC
+# if __GNUC__ >= 11
+# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
+# else
+# define _GL_ATTRIBUTE_DEALLOC(f, i)
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that
+ can be freed via 'free'; it can be used only after declaring 'free'. */
+/* Applies to: functions. Cannot be used on inline functions. */
+#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
+# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
+#endif
+
+/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
+ allocated memory. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_MALLOC
+# if __GNUC__ >= 3 || defined __clang__
+# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+# else
+# define _GL_ATTRIBUTE_MALLOC
+# endif
+#endif
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The attribute __pure__ was added in gcc 2.96. */
+#ifndef _GL_ATTRIBUTE_PURE
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+# define _GL_ATTRIBUTE_PURE /* empty */
+# endif
+#endif
+
+/* The definition of _Noreturn is copied here. */
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+/* Some systems do not define EXIT_*, despite otherwise supporting C89. */
+#ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
+#endif
+/* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere
+ with proper operation of xargs. */
+#ifndef EXIT_FAILURE
+# define EXIT_FAILURE 1
+#elif EXIT_FAILURE != 1
+# undef EXIT_FAILURE
+# define EXIT_FAILURE 1
+#endif
+
+
+#if @GNULIB__EXIT@
+/* Terminate the current process with the given return code, without running
+ the 'atexit' handlers. */
+# if !@HAVE__EXIT@
+_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status));
+# endif
+_GL_CXXALIAS_SYS (_Exit, void, (int status));
+_GL_CXXALIASWARN (_Exit);
+#elif defined GNULIB_POSIXCHECK
+# undef _Exit
+# if HAVE_RAW_DECL__EXIT
+_GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
+ "use gnulib module _Exit for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FREE_POSIX@
+# if @REPLACE_FREE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef free
+# define free rpl_free
+# endif
+# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
+_GL_FUNCDECL_RPL (free, void, (void *ptr) throw ());
+# else
+_GL_FUNCDECL_RPL (free, void, (void *ptr));
+# endif
+_GL_CXXALIAS_RPL (free, void, (void *ptr));
+# else
+_GL_CXXALIAS_SYS (free, void, (void *ptr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (free);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef free
+/* Assume free is always declared. */
+_GL_WARN_ON_USE (free, "free is not future POSIX compliant everywhere - "
+ "use gnulib module free for portability");
+#endif
+
+
+/* Allocate memory with indefinite extent and specified alignment. */
+#if @GNULIB_ALIGNED_ALLOC@
+# if @REPLACE_ALIGNED_ALLOC@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef aligned_alloc
+# define aligned_alloc rpl_aligned_alloc
+# endif
+_GL_FUNCDECL_RPL (aligned_alloc, void *,
+ (size_t alignment, size_t size)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+_GL_CXXALIAS_RPL (aligned_alloc, void *, (size_t alignment, size_t size));
+# else
+# if @HAVE_ALIGNED_ALLOC@
+# if __GNUC__ >= 11
+/* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */
+_GL_FUNCDECL_SYS (aligned_alloc, void *,
+ (size_t alignment, size_t size)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+_GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size));
+# endif
+# endif
+# if @HAVE_ALIGNED_ALLOC@
+_GL_CXXALIASWARN (aligned_alloc);
+# endif
+#else
+# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined aligned_alloc
+/* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */
+_GL_FUNCDECL_SYS (aligned_alloc, void *,
+ (size_t alignment, size_t size)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef aligned_alloc
+# if HAVE_RAW_DECL_ALIGNED_ALLOC
+_GL_WARN_ON_USE (aligned_alloc, "aligned_alloc is not portable - "
+ "use gnulib module aligned_alloc for portability");
+# endif
+# endif
+#endif
+
+#if @GNULIB_ATOLL@
+/* Parse a signed decimal integer.
+ Returns the value of the integer. Errors are not detected. */
+# if !@HAVE_ATOLL@
+_GL_FUNCDECL_SYS (atoll, long long, (const char *string)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (atoll, long long, (const char *string));
+_GL_CXXALIASWARN (atoll);
+#elif defined GNULIB_POSIXCHECK
+# undef atoll
+# if HAVE_RAW_DECL_ATOLL
+_GL_WARN_ON_USE (atoll, "atoll is unportable - "
+ "use gnulib module atoll for portability");
+# endif
+#endif
+
+#if @GNULIB_CALLOC_POSIX@
+# if (@GNULIB_CALLOC_POSIX@ && @REPLACE_CALLOC_FOR_CALLOC_POSIX@) \
+ || (@GNULIB_CALLOC_GNU@ && @REPLACE_CALLOC_FOR_CALLOC_GNU@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef calloc
+# define calloc rpl_calloc
+# endif
+_GL_FUNCDECL_RPL (calloc, void *,
+ (size_t nmemb, size_t size)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+_GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
+# else
+# if __GNUC__ >= 11
+/* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */
+_GL_FUNCDECL_SYS (calloc, void *,
+ (size_t nmemb, size_t size)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+_GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (calloc);
+# endif
+#else
+# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined calloc
+/* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */
+_GL_FUNCDECL_SYS (calloc, void *,
+ (size_t nmemb, size_t size)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef calloc
+/* Assume calloc is always declared. */
+_GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
+ "use gnulib module calloc-posix for portability");
+# endif
+#endif
+
+#if @GNULIB_CANONICALIZE_FILE_NAME@
+# if @REPLACE_CANONICALIZE_FILE_NAME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define canonicalize_file_name rpl_canonicalize_file_name
+# endif
+_GL_FUNCDECL_RPL (canonicalize_file_name, char *,
+ (const char *name)
+ _GL_ARG_NONNULL ((1))
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+_GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
+# else
+# if !@HAVE_CANONICALIZE_FILE_NAME@ || __GNUC__ >= 11
+_GL_FUNCDECL_SYS (canonicalize_file_name, char *,
+ (const char *name)
+ _GL_ARG_NONNULL ((1))
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+_GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
+# endif
+# ifndef GNULIB_defined_canonicalize_file_name
+# define GNULIB_defined_canonicalize_file_name \
+ (!@HAVE_CANONICALIZE_FILE_NAME@ || @REPLACE_CANONICALIZE_FILE_NAME@)
+# endif
+_GL_CXXALIASWARN (canonicalize_file_name);
+#else
+# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined canonicalize_file_name
+/* For -Wmismatched-dealloc: Associate canonicalize_file_name with free or
+ rpl_free. */
+_GL_FUNCDECL_SYS (canonicalize_file_name, char *,
+ (const char *name)
+ _GL_ARG_NONNULL ((1))
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef canonicalize_file_name
+# if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
+_GL_WARN_ON_USE (canonicalize_file_name,
+ "canonicalize_file_name is unportable - "
+ "use gnulib module canonicalize-lgpl for portability");
+# endif
+# endif
+#endif
+
+#if @GNULIB_MDA_ECVT@
+/* On native Windows, map 'ecvt' to '_ecvt', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::ecvt on all platforms that have
+ it. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ecvt
+# define ecvt _ecvt
+# endif
+_GL_CXXALIAS_MDA (ecvt, char *,
+ (double number, int ndigits, int *decptp, int *signp));
+# else
+# if @HAVE_DECL_ECVT@
+_GL_CXXALIAS_SYS (ecvt, char *,
+ (double number, int ndigits, int *decptp, int *signp));
+# endif
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_ECVT@
+_GL_CXXALIASWARN (ecvt);
+# endif
+#endif
+
+#if @GNULIB_MDA_FCVT@
+/* On native Windows, map 'fcvt' to '_fcvt', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::fcvt on all platforms that have
+ it. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fcvt
+# define fcvt _fcvt
+# endif
+_GL_CXXALIAS_MDA (fcvt, char *,
+ (double number, int ndigits, int *decptp, int *signp));
+# else
+# if @HAVE_DECL_FCVT@
+_GL_CXXALIAS_SYS (fcvt, char *,
+ (double number, int ndigits, int *decptp, int *signp));
+# endif
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_FCVT@
+_GL_CXXALIASWARN (fcvt);
+# endif
+#endif
+
+#if @GNULIB_MDA_GCVT@
+/* On native Windows, map 'gcvt' to '_gcvt', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::gcvt on all platforms that have
+ it. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef gcvt
+# define gcvt _gcvt
+# endif
+_GL_CXXALIAS_MDA (gcvt, char *, (double number, int ndigits, char *buf));
+# else
+# if @HAVE_DECL_GCVT@
+_GL_CXXALIAS_SYS (gcvt, char *, (double number, int ndigits, char *buf));
+# endif
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_GCVT@
+_GL_CXXALIASWARN (gcvt);
+# endif
+#endif
+
+#if @GNULIB_GETLOADAVG@
+/* Store max(NELEM,3) load average numbers in LOADAVG[].
+ The three numbers are the load average of the last 1 minute, the last 5
+ minutes, and the last 15 minutes, respectively.
+ LOADAVG is an array of NELEM numbers. */
+# if !@HAVE_DECL_GETLOADAVG@
+_GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
+_GL_CXXALIASWARN (getloadavg);
+#elif defined GNULIB_POSIXCHECK
+# undef getloadavg
+# if HAVE_RAW_DECL_GETLOADAVG
+_GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
+ "use gnulib module getloadavg for portability");
+# endif
+#endif
+
+#if @GNULIB_GETSUBOPT@
+/* Assuming *OPTIONP is a comma separated list of elements of the form
+ "token" or "token=value", getsubopt parses the first of these elements.
+ If the first element refers to a "token" that is member of the given
+ NULL-terminated array of tokens:
+ - It replaces the comma with a NUL byte, updates *OPTIONP to point past
+ the first option and the comma, sets *VALUEP to the value of the
+ element (or NULL if it doesn't contain an "=" sign),
+ - It returns the index of the "token" in the given array of tokens.
+ Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined.
+ For more details see the POSIX specification.
+ https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsubopt.html */
+# if !@HAVE_GETSUBOPT@
+_GL_FUNCDECL_SYS (getsubopt, int,
+ (char **optionp, char *const *tokens, char **valuep)
+ _GL_ARG_NONNULL ((1, 2, 3)));
+# endif
+_GL_CXXALIAS_SYS (getsubopt, int,
+ (char **optionp, char *const *tokens, char **valuep));
+_GL_CXXALIASWARN (getsubopt);
+#elif defined GNULIB_POSIXCHECK
+# undef getsubopt
+# if HAVE_RAW_DECL_GETSUBOPT
+_GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
+ "use gnulib module getsubopt for portability");
+# endif
+#endif
+
+#if @GNULIB_GRANTPT@
+/* Change the ownership and access permission of the slave side of the
+ pseudo-terminal whose master side is specified by FD. */
+# if !@HAVE_GRANTPT@
+_GL_FUNCDECL_SYS (grantpt, int, (int fd));
+# endif
+_GL_CXXALIAS_SYS (grantpt, int, (int fd));
+_GL_CXXALIASWARN (grantpt);
+#elif defined GNULIB_POSIXCHECK
+# undef grantpt
+# if HAVE_RAW_DECL_GRANTPT
+_GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
+ "use gnulib module grantpt for portability");
+# endif
+#endif
+
+/* If _GL_USE_STDLIB_ALLOC is nonzero, the including module does not
+ rely on GNU or POSIX semantics for malloc and realloc (for example,
+ by never specifying a zero size), so it does not need malloc or
+ realloc to be redefined. */
+#if @GNULIB_MALLOC_POSIX@
+# if (@GNULIB_MALLOC_POSIX@ && @REPLACE_MALLOC_FOR_MALLOC_POSIX@) \
+ || (@GNULIB_MALLOC_GNU@ && @REPLACE_MALLOC_FOR_MALLOC_GNU@)
+# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
+ || _GL_USE_STDLIB_ALLOC)
+# undef malloc
+# define malloc rpl_malloc
+# endif
+_GL_FUNCDECL_RPL (malloc, void *,
+ (size_t size)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+_GL_CXXALIAS_RPL (malloc, void *, (size_t size));
+# else
+# if __GNUC__ >= 11
+/* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */
+_GL_FUNCDECL_SYS (malloc, void *,
+ (size_t size)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+_GL_CXXALIAS_SYS (malloc, void *, (size_t size));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (malloc);
+# endif
+#else
+# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined malloc
+/* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */
+_GL_FUNCDECL_SYS (malloc, void *,
+ (size_t size)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+# if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
+# undef malloc
+/* Assume malloc is always declared. */
+_GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
+ "use gnulib module malloc-posix for portability");
+# endif
+#endif
+
+/* Convert a multibyte character to a wide character. */
+#if @GNULIB_MBTOWC@
+# if @REPLACE_MBTOWC@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mbtowc
+# define mbtowc rpl_mbtowc
+# endif
+_GL_FUNCDECL_RPL (mbtowc, int,
+ (wchar_t *restrict pwc, const char *restrict s, size_t n));
+_GL_CXXALIAS_RPL (mbtowc, int,
+ (wchar_t *restrict pwc, const char *restrict s, size_t n));
+# else
+# if !@HAVE_MBTOWC@
+_GL_FUNCDECL_SYS (mbtowc, int,
+ (wchar_t *restrict pwc, const char *restrict s, size_t n));
+# endif
+_GL_CXXALIAS_SYS (mbtowc, int,
+ (wchar_t *restrict pwc, const char *restrict s, size_t n));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (mbtowc);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbtowc
+# if HAVE_RAW_DECL_MBTOWC
+_GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - "
+ "use gnulib module mbtowc for portability");
+# endif
+#endif
+
+#if @GNULIB_MKDTEMP@
+/* Create a unique temporary directory from TEMPLATE.
+ The last six characters of TEMPLATE must be "XXXXXX";
+ they are replaced with a string that makes the directory name unique.
+ Returns TEMPLATE, or a null pointer if it cannot get a unique name.
+ The directory is created mode 700. */
+# if !@HAVE_MKDTEMP@
+_GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
+_GL_CXXALIASWARN (mkdtemp);
+#elif defined GNULIB_POSIXCHECK
+# undef mkdtemp
+# if HAVE_RAW_DECL_MKDTEMP
+_GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
+ "use gnulib module mkdtemp for portability");
+# endif
+#endif
+
+#if @GNULIB_MKOSTEMP@
+/* Create a unique temporary file from TEMPLATE.
+ The last six characters of TEMPLATE must be "XXXXXX";
+ they are replaced with a string that makes the file name unique.
+ The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
+ and O_TEXT, O_BINARY (defined in "binary-io.h").
+ The file is then created, with the specified flags, ensuring it didn't exist
+ before.
+ The file is created read-write (mask at least 0600 & ~umask), but it may be
+ world-readable and world-writable (mask 0666 & ~umask), depending on the
+ implementation.
+ Returns the open file descriptor if successful, otherwise -1 and errno
+ set. */
+# if !@HAVE_MKOSTEMP@
+_GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
+_GL_CXXALIASWARN (mkostemp);
+#elif defined GNULIB_POSIXCHECK
+# undef mkostemp
+# if HAVE_RAW_DECL_MKOSTEMP
+_GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
+ "use gnulib module mkostemp for portability");
+# endif
+#endif
+
+#if @GNULIB_MKOSTEMPS@
+/* Create a unique temporary file from TEMPLATE.
+ The last six characters of TEMPLATE before a suffix of length
+ SUFFIXLEN must be "XXXXXX";
+ they are replaced with a string that makes the file name unique.
+ The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
+ and O_TEXT, O_BINARY (defined in "binary-io.h").
+ The file is then created, with the specified flags, ensuring it didn't exist
+ before.
+ The file is created read-write (mask at least 0600 & ~umask), but it may be
+ world-readable and world-writable (mask 0666 & ~umask), depending on the
+ implementation.
+ Returns the open file descriptor if successful, otherwise -1 and errno
+ set. */
+# if !@HAVE_MKOSTEMPS@
+_GL_FUNCDECL_SYS (mkostemps, int,
+ (char * /*template*/, int /*suffixlen*/, int /*flags*/)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (mkostemps, int,
+ (char * /*template*/, int /*suffixlen*/, int /*flags*/));
+_GL_CXXALIASWARN (mkostemps);
+#elif defined GNULIB_POSIXCHECK
+# undef mkostemps
+# if HAVE_RAW_DECL_MKOSTEMPS
+_GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
+ "use gnulib module mkostemps for portability");
+# endif
+#endif
+
+#if @GNULIB_MKSTEMP@
+/* Create a unique temporary file from TEMPLATE.
+ The last six characters of TEMPLATE must be "XXXXXX";
+ they are replaced with a string that makes the file name unique.
+ The file is then created, ensuring it didn't exist before.
+ The file is created read-write (mask at least 0600 & ~umask), but it may be
+ world-readable and world-writable (mask 0666 & ~umask), depending on the
+ implementation.
+ Returns the open file descriptor if successful, otherwise -1 and errno
+ set. */
+# if @REPLACE_MKSTEMP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define mkstemp rpl_mkstemp
+# endif
+_GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/));
+# else
+# if ! @HAVE_MKSTEMP@
+_GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
+# endif
+_GL_CXXALIASWARN (mkstemp);
+#elif defined GNULIB_POSIXCHECK
+# undef mkstemp
+# if HAVE_RAW_DECL_MKSTEMP
+_GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
+ "use gnulib module mkstemp for portability");
+# endif
+#endif
+
+#if @GNULIB_MKSTEMPS@
+/* Create a unique temporary file from TEMPLATE.
+ The last six characters of TEMPLATE prior to a suffix of length
+ SUFFIXLEN must be "XXXXXX";
+ they are replaced with a string that makes the file name unique.
+ The file is then created, ensuring it didn't exist before.
+ The file is created read-write (mask at least 0600 & ~umask), but it may be
+ world-readable and world-writable (mask 0666 & ~umask), depending on the
+ implementation.
+ Returns the open file descriptor if successful, otherwise -1 and errno
+ set. */
+# if !@HAVE_MKSTEMPS@
+_GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
+_GL_CXXALIASWARN (mkstemps);
+#elif defined GNULIB_POSIXCHECK
+# undef mkstemps
+# if HAVE_RAW_DECL_MKSTEMPS
+_GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
+ "use gnulib module mkstemps for portability");
+# endif
+#endif
+
+#if @GNULIB_MDA_MKTEMP@
+/* On native Windows, map 'mktemp' to '_mktemp', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::mktemp always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mktemp
+# define mktemp _mktemp
+# endif
+_GL_CXXALIAS_MDA (mktemp, char *, (char * /*template*/));
+# else
+_GL_CXXALIAS_SYS (mktemp, char *, (char * /*template*/));
+# endif
+_GL_CXXALIASWARN (mktemp);
+#endif
+
+/* Allocate memory with indefinite extent and specified alignment. */
+#if @GNULIB_POSIX_MEMALIGN@
+# if @REPLACE_POSIX_MEMALIGN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef posix_memalign
+# define posix_memalign rpl_posix_memalign
+# endif
+_GL_FUNCDECL_RPL (posix_memalign, int,
+ (void **memptr, size_t alignment, size_t size)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (posix_memalign, int,
+ (void **memptr, size_t alignment, size_t size));
+# else
+# if @HAVE_POSIX_MEMALIGN@
+_GL_CXXALIAS_SYS (posix_memalign, int,
+ (void **memptr, size_t alignment, size_t size));
+# endif
+# endif
+# if @HAVE_POSIX_MEMALIGN@
+_GL_CXXALIASWARN (posix_memalign);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_memalign
+# if HAVE_RAW_DECL_POSIX_MEMALIGN
+_GL_WARN_ON_USE (posix_memalign, "posix_memalign is not portable - "
+ "use gnulib module posix_memalign for portability");
+# endif
+#endif
+
+#if @GNULIB_POSIX_OPENPT@
+/* Return an FD open to the master side of a pseudo-terminal. Flags should
+ include O_RDWR, and may also include O_NOCTTY. */
+# if !@HAVE_POSIX_OPENPT@
+_GL_FUNCDECL_SYS (posix_openpt, int, (int flags));
+# endif
+_GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
+_GL_CXXALIASWARN (posix_openpt);
+#elif defined GNULIB_POSIXCHECK
+# undef posix_openpt
+# if HAVE_RAW_DECL_POSIX_OPENPT
+_GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - "
+ "use gnulib module posix_openpt for portability");
+# endif
+#endif
+
+#if @GNULIB_PTSNAME@
+/* Return the pathname of the pseudo-terminal slave associated with
+ the master FD is open on, or NULL on errors. */
+# if @REPLACE_PTSNAME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ptsname
+# define ptsname rpl_ptsname
+# endif
+_GL_FUNCDECL_RPL (ptsname, char *, (int fd));
+_GL_CXXALIAS_RPL (ptsname, char *, (int fd));
+# else
+# if !@HAVE_PTSNAME@
+_GL_FUNCDECL_SYS (ptsname, char *, (int fd));
+# endif
+_GL_CXXALIAS_SYS (ptsname, char *, (int fd));
+# endif
+_GL_CXXALIASWARN (ptsname);
+#elif defined GNULIB_POSIXCHECK
+# undef ptsname
+# if HAVE_RAW_DECL_PTSNAME
+_GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
+ "use gnulib module ptsname for portability");
+# endif
+#endif
+
+#if @GNULIB_PTSNAME_R@
+/* Set the pathname of the pseudo-terminal slave associated with
+ the master FD is open on and return 0, or set errno and return
+ non-zero on errors. */
+# if @REPLACE_PTSNAME_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ptsname_r
+# define ptsname_r rpl_ptsname_r
+# endif
+_GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
+_GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
+# else
+# if !@HAVE_PTSNAME_R@
+_GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
+# endif
+_GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
+# endif
+# ifndef GNULIB_defined_ptsname_r
+# define GNULIB_defined_ptsname_r (!@HAVE_PTSNAME_R@ || @REPLACE_PTSNAME_R@)
+# endif
+_GL_CXXALIASWARN (ptsname_r);
+#elif defined GNULIB_POSIXCHECK
+# undef ptsname_r
+# if HAVE_RAW_DECL_PTSNAME_R
+_GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - "
+ "use gnulib module ptsname_r for portability");
+# endif
+#endif
+
+#if @GNULIB_PUTENV@
+# if @REPLACE_PUTENV@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef putenv
+# define putenv rpl_putenv
+# endif
+_GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (putenv, int, (char *string));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef putenv
+# define putenv _putenv
+# endif
+_GL_CXXALIAS_MDA (putenv, int, (char *string));
+# else
+_GL_CXXALIAS_SYS (putenv, int, (char *string));
+# endif
+_GL_CXXALIASWARN (putenv);
+#elif @GNULIB_MDA_PUTENV@
+/* On native Windows, map 'putenv' to '_putenv', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::putenv always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef putenv
+# define putenv _putenv
+# endif
+/* Need to cast, because on mingw, the parameter is either
+ 'const char *string' or 'char *string'. */
+_GL_CXXALIAS_MDA_CAST (putenv, int, (char *string));
+# else
+_GL_CXXALIAS_SYS (putenv, int, (char *string));
+# endif
+_GL_CXXALIASWARN (putenv);
+#endif
+
+#if @GNULIB_QSORT_R@
+/* Sort an array of NMEMB elements, starting at address BASE, each element
+ occupying SIZE bytes, in ascending order according to the comparison
+ function COMPARE. */
+# ifdef __cplusplus
+extern "C" {
+# endif
+# if !GNULIB_defined_qsort_r_fn_types
+typedef int (*_gl_qsort_r_compar_fn) (void const *, void const *, void *);
+# define GNULIB_defined_qsort_r_fn_types 1
+# endif
+# ifdef __cplusplus
+}
+# endif
+# if @REPLACE_QSORT_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef qsort_r
+# define qsort_r rpl_qsort_r
+# endif
+_GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
+ _gl_qsort_r_compar_fn compare,
+ void *arg) _GL_ARG_NONNULL ((1, 4)));
+_GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
+ _gl_qsort_r_compar_fn compare,
+ void *arg));
+# else
+# if !@HAVE_QSORT_R@
+_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
+ _gl_qsort_r_compar_fn compare,
+ void *arg) _GL_ARG_NONNULL ((1, 4)));
+# endif
+_GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
+ _gl_qsort_r_compar_fn compare,
+ void *arg));
+# endif
+_GL_CXXALIASWARN (qsort_r);
+#elif defined GNULIB_POSIXCHECK
+# undef qsort_r
+# if HAVE_RAW_DECL_QSORT_R
+_GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - "
+ "use gnulib module qsort_r for portability");
+# endif
+#endif
+
+
+#if @GNULIB_RANDOM_R@
+# if !@HAVE_RANDOM_R@
+# ifndef RAND_MAX
+# define RAND_MAX 2147483647
+# endif
+# endif
+#endif
+
+
+#if @GNULIB_RANDOM@
+# if @REPLACE_RANDOM@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef random
+# define random rpl_random
+# endif
+_GL_FUNCDECL_RPL (random, long, (void));
+_GL_CXXALIAS_RPL (random, long, (void));
+# else
+# if !@HAVE_RANDOM@
+_GL_FUNCDECL_SYS (random, long, (void));
+# endif
+/* Need to cast, because on Haiku, the return type is
+ int. */
+_GL_CXXALIAS_SYS_CAST (random, long, (void));
+# endif
+_GL_CXXALIASWARN (random);
+#elif defined GNULIB_POSIXCHECK
+# undef random
+# if HAVE_RAW_DECL_RANDOM
+_GL_WARN_ON_USE (random, "random is unportable - "
+ "use gnulib module random for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM@
+# if @REPLACE_RANDOM@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef srandom
+# define srandom rpl_srandom
+# endif
+_GL_FUNCDECL_RPL (srandom, void, (unsigned int seed));
+_GL_CXXALIAS_RPL (srandom, void, (unsigned int seed));
+# else
+# if !@HAVE_RANDOM@
+_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
+# endif
+/* Need to cast, because on FreeBSD, the first parameter is
+ unsigned long seed. */
+_GL_CXXALIAS_SYS_CAST (srandom, void, (unsigned int seed));
+# endif
+_GL_CXXALIASWARN (srandom);
+#elif defined GNULIB_POSIXCHECK
+# undef srandom
+# if HAVE_RAW_DECL_SRANDOM
+_GL_WARN_ON_USE (srandom, "srandom is unportable - "
+ "use gnulib module random for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM@
+# if @REPLACE_INITSTATE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef initstate
+# define initstate rpl_initstate
+# endif
+_GL_FUNCDECL_RPL (initstate, char *,
+ (unsigned int seed, char *buf, size_t buf_size)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (initstate, char *,
+ (unsigned int seed, char *buf, size_t buf_size));
+# else
+# if !@HAVE_INITSTATE@ || !@HAVE_DECL_INITSTATE@
+_GL_FUNCDECL_SYS (initstate, char *,
+ (unsigned int seed, char *buf, size_t buf_size)
+ _GL_ARG_NONNULL ((2)));
+# endif
+/* Need to cast, because on FreeBSD, the first parameter is
+ unsigned long seed. */
+_GL_CXXALIAS_SYS_CAST (initstate, char *,
+ (unsigned int seed, char *buf, size_t buf_size));
+# endif
+_GL_CXXALIASWARN (initstate);
+#elif defined GNULIB_POSIXCHECK
+# undef initstate
+# if HAVE_RAW_DECL_INITSTATE
+_GL_WARN_ON_USE (initstate, "initstate is unportable - "
+ "use gnulib module random for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM@
+# if @REPLACE_SETSTATE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef setstate
+# define setstate rpl_setstate
+# endif
+_GL_FUNCDECL_RPL (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (setstate, char *, (char *arg_state));
+# else
+# if !@HAVE_SETSTATE@ || !@HAVE_DECL_SETSTATE@
+_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
+# endif
+/* Need to cast, because on Mac OS X 10.13, HP-UX, Solaris the first parameter
+ is const char *arg_state. */
+_GL_CXXALIAS_SYS_CAST (setstate, char *, (char *arg_state));
+# endif
+_GL_CXXALIASWARN (setstate);
+#elif defined GNULIB_POSIXCHECK
+# undef setstate
+# if HAVE_RAW_DECL_SETSTATE
+_GL_WARN_ON_USE (setstate, "setstate is unportable - "
+ "use gnulib module random for portability");
+# endif
+#endif
+
+
+#if @GNULIB_RANDOM_R@
+# if @REPLACE_RANDOM_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef random_r
+# define random_r rpl_random_r
+# endif
+_GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result));
+# else
+# if !@HAVE_RANDOM_R@
+_GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
+# endif
+_GL_CXXALIASWARN (random_r);
+#elif defined GNULIB_POSIXCHECK
+# undef random_r
+# if HAVE_RAW_DECL_RANDOM_R
+_GL_WARN_ON_USE (random_r, "random_r is unportable - "
+ "use gnulib module random_r for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM_R@
+# if @REPLACE_RANDOM_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef srandom_r
+# define srandom_r rpl_srandom_r
+# endif
+_GL_FUNCDECL_RPL (srandom_r, int,
+ (unsigned int seed, struct random_data *rand_state)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (srandom_r, int,
+ (unsigned int seed, struct random_data *rand_state));
+# else
+# if !@HAVE_RANDOM_R@
+_GL_FUNCDECL_SYS (srandom_r, int,
+ (unsigned int seed, struct random_data *rand_state)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (srandom_r, int,
+ (unsigned int seed, struct random_data *rand_state));
+# endif
+_GL_CXXALIASWARN (srandom_r);
+#elif defined GNULIB_POSIXCHECK
+# undef srandom_r
+# if HAVE_RAW_DECL_SRANDOM_R
+_GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
+ "use gnulib module random_r for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM_R@
+# if @REPLACE_RANDOM_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef initstate_r
+# define initstate_r rpl_initstate_r
+# endif
+_GL_FUNCDECL_RPL (initstate_r, int,
+ (unsigned int seed, char *buf, size_t buf_size,
+ struct random_data *rand_state)
+ _GL_ARG_NONNULL ((2, 4)));
+_GL_CXXALIAS_RPL (initstate_r, int,
+ (unsigned int seed, char *buf, size_t buf_size,
+ struct random_data *rand_state));
+# else
+# if !@HAVE_RANDOM_R@
+_GL_FUNCDECL_SYS (initstate_r, int,
+ (unsigned int seed, char *buf, size_t buf_size,
+ struct random_data *rand_state)
+ _GL_ARG_NONNULL ((2, 4)));
+# endif
+/* Need to cast, because on Haiku, the third parameter is
+ unsigned long buf_size. */
+_GL_CXXALIAS_SYS_CAST (initstate_r, int,
+ (unsigned int seed, char *buf, size_t buf_size,
+ struct random_data *rand_state));
+# endif
+_GL_CXXALIASWARN (initstate_r);
+#elif defined GNULIB_POSIXCHECK
+# undef initstate_r
+# if HAVE_RAW_DECL_INITSTATE_R
+_GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
+ "use gnulib module random_r for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM_R@
+# if @REPLACE_RANDOM_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef setstate_r
+# define setstate_r rpl_setstate_r
+# endif
+_GL_FUNCDECL_RPL (setstate_r, int,
+ (char *arg_state, struct random_data *rand_state)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (setstate_r, int,
+ (char *arg_state, struct random_data *rand_state));
+# else
+# if !@HAVE_RANDOM_R@
+_GL_FUNCDECL_SYS (setstate_r, int,
+ (char *arg_state, struct random_data *rand_state)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+/* Need to cast, because on Haiku, the first parameter is
+ void *arg_state. */
+_GL_CXXALIAS_SYS_CAST (setstate_r, int,
+ (char *arg_state, struct random_data *rand_state));
+# endif
+_GL_CXXALIASWARN (setstate_r);
+#elif defined GNULIB_POSIXCHECK
+# undef setstate_r
+# if HAVE_RAW_DECL_SETSTATE_R
+_GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
+ "use gnulib module random_r for portability");
+# endif
+#endif
+
+
+#if @GNULIB_REALLOC_POSIX@
+# if (@GNULIB_REALLOC_POSIX@ && @REPLACE_REALLOC_FOR_REALLOC_POSIX@) \
+ || (@GNULIB_REALLOC_GNU@ && @REPLACE_REALLOC_FOR_REALLOC_GNU@)
+# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
+ || _GL_USE_STDLIB_ALLOC)
+# undef realloc
+# define realloc rpl_realloc
+# endif
+_GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size)
+ _GL_ATTRIBUTE_DEALLOC_FREE);
+_GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
+# else
+# if __GNUC__ >= 11
+/* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */
+_GL_FUNCDECL_SYS (realloc, void *, (void *ptr, size_t size)
+ _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+_GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (realloc);
+# endif
+#else
+# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined realloc
+/* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */
+_GL_FUNCDECL_SYS (realloc, void *, (void *ptr, size_t size)
+ _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+# if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
+# undef realloc
+/* Assume realloc is always declared. */
+_GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
+ "use gnulib module realloc-posix for portability");
+# endif
+#endif
+
+
+#if @GNULIB_REALLOCARRAY@
+# if @REPLACE_REALLOCARRAY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef reallocarray
+# define reallocarray rpl_reallocarray
+# endif
+_GL_FUNCDECL_RPL (reallocarray, void *,
+ (void *ptr, size_t nmemb, size_t size));
+_GL_CXXALIAS_RPL (reallocarray, void *,
+ (void *ptr, size_t nmemb, size_t size));
+# else
+# if ! @HAVE_REALLOCARRAY@
+_GL_FUNCDECL_SYS (reallocarray, void *,
+ (void *ptr, size_t nmemb, size_t size));
+# endif
+_GL_CXXALIAS_SYS (reallocarray, void *,
+ (void *ptr, size_t nmemb, size_t size));
+# endif
+_GL_CXXALIASWARN (reallocarray);
+#elif defined GNULIB_POSIXCHECK
+# undef reallocarray
+# if HAVE_RAW_DECL_REALLOCARRAY
+_GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - "
+ "use gnulib module reallocarray for portability");
+# endif
+#endif
+
+#if @GNULIB_REALPATH@
+# if @REPLACE_REALPATH@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define realpath rpl_realpath
+# endif
+_GL_FUNCDECL_RPL (realpath, char *,
+ (const char *restrict name, char *restrict resolved)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (realpath, char *,
+ (const char *restrict name, char *restrict resolved));
+# else
+# if !@HAVE_REALPATH@
+_GL_FUNCDECL_SYS (realpath, char *,
+ (const char *restrict name, char *restrict resolved)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (realpath, char *,
+ (const char *restrict name, char *restrict resolved));
+# endif
+_GL_CXXALIASWARN (realpath);
+#elif defined GNULIB_POSIXCHECK
+# undef realpath
+# if HAVE_RAW_DECL_REALPATH
+_GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module "
+ "canonicalize or canonicalize-lgpl for portability");
+# endif
+#endif
+
+#if @GNULIB_RPMATCH@
+/* Test a user response to a question.
+ Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */
+# if !@HAVE_RPMATCH@
+_GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
+_GL_CXXALIASWARN (rpmatch);
+#elif defined GNULIB_POSIXCHECK
+# undef rpmatch
+# if HAVE_RAW_DECL_RPMATCH
+_GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
+ "use gnulib module rpmatch for portability");
+# endif
+#endif
+
+#if @GNULIB_SECURE_GETENV@
+/* Look up NAME in the environment, returning 0 in insecure situations. */
+# if !@HAVE_SECURE_GETENV@
+_GL_FUNCDECL_SYS (secure_getenv, char *,
+ (char const *name) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name));
+_GL_CXXALIASWARN (secure_getenv);
+#elif defined GNULIB_POSIXCHECK
+# undef secure_getenv
+# if HAVE_RAW_DECL_SECURE_GETENV
+_GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - "
+ "use gnulib module secure_getenv for portability");
+# endif
+#endif
+
+#if @GNULIB_SETENV@
+/* Set NAME to VALUE in the environment.
+ If REPLACE is nonzero, overwrite an existing value. */
+# if @REPLACE_SETENV@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef setenv
+# define setenv rpl_setenv
+# endif
+_GL_FUNCDECL_RPL (setenv, int,
+ (const char *name, const char *value, int replace)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (setenv, int,
+ (const char *name, const char *value, int replace));
+# else
+# if !@HAVE_DECL_SETENV@
+_GL_FUNCDECL_SYS (setenv, int,
+ (const char *name, const char *value, int replace)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (setenv, int,
+ (const char *name, const char *value, int replace));
+# endif
+# if !(@REPLACE_SETENV@ && !@HAVE_DECL_SETENV@)
+_GL_CXXALIASWARN (setenv);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef setenv
+# if HAVE_RAW_DECL_SETENV
+_GL_WARN_ON_USE (setenv, "setenv is unportable - "
+ "use gnulib module setenv for portability");
+# endif
+#endif
+
+#if @GNULIB_STRTOD@
+ /* Parse a double from STRING, updating ENDP if appropriate. */
+# if @REPLACE_STRTOD@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strtod rpl_strtod
+# endif
+# define GNULIB_defined_strtod_function 1
+_GL_FUNCDECL_RPL (strtod, double,
+ (const char *restrict str, char **restrict endp)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtod, double,
+ (const char *restrict str, char **restrict endp));
+# else
+# if !@HAVE_STRTOD@
+_GL_FUNCDECL_SYS (strtod, double,
+ (const char *restrict str, char **restrict endp)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtod, double,
+ (const char *restrict str, char **restrict endp));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (strtod);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strtod
+# if HAVE_RAW_DECL_STRTOD
+_GL_WARN_ON_USE (strtod, "strtod is unportable - "
+ "use gnulib module strtod for portability");
+# endif
+#endif
+
+#if @GNULIB_STRTOLD@
+ /* Parse a 'long double' from STRING, updating ENDP if appropriate. */
+# if @REPLACE_STRTOLD@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strtold rpl_strtold
+# endif
+# define GNULIB_defined_strtold_function 1
+_GL_FUNCDECL_RPL (strtold, long double,
+ (const char *restrict str, char **restrict endp)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtold, long double,
+ (const char *restrict str, char **restrict endp));
+# else
+# if !@HAVE_STRTOLD@
+_GL_FUNCDECL_SYS (strtold, long double,
+ (const char *restrict str, char **restrict endp)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtold, long double,
+ (const char *restrict str, char **restrict endp));
+# endif
+_GL_CXXALIASWARN (strtold);
+#elif defined GNULIB_POSIXCHECK
+# undef strtold
+# if HAVE_RAW_DECL_STRTOLD
+_GL_WARN_ON_USE (strtold, "strtold is unportable - "
+ "use gnulib module strtold for portability");
+# endif
+#endif
+
+#if @GNULIB_STRTOL@
+/* Parse a signed integer whose textual representation starts at STRING.
+ The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
+ it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
+ "0x").
+ If ENDPTR is not NULL, the address of the first byte after the integer is
+ stored in *ENDPTR.
+ Upon overflow, the return value is LONG_MAX or LONG_MIN, and errno is set
+ to ERANGE. */
+# if @REPLACE_STRTOL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strtol rpl_strtol
+# endif
+# define GNULIB_defined_strtol_function 1
+_GL_FUNCDECL_RPL (strtol, long,
+ (const char *restrict string, char **restrict endptr,
+ int base)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtol, long,
+ (const char *restrict string, char **restrict endptr,
+ int base));
+# else
+# if !@HAVE_STRTOL@
+_GL_FUNCDECL_SYS (strtol, long,
+ (const char *restrict string, char **restrict endptr,
+ int base)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtol, long,
+ (const char *restrict string, char **restrict endptr,
+ int base));
+# endif
+_GL_CXXALIASWARN (strtol);
+#elif defined GNULIB_POSIXCHECK
+# undef strtol
+# if HAVE_RAW_DECL_STRTOL
+_GL_WARN_ON_USE (strtol, "strtol is unportable - "
+ "use gnulib module strtol for portability");
+# endif
+#endif
+
+#if @GNULIB_STRTOLL@
+/* Parse a signed integer whose textual representation starts at STRING.
+ The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
+ it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
+ "0x").
+ If ENDPTR is not NULL, the address of the first byte after the integer is
+ stored in *ENDPTR.
+ Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
+ to ERANGE. */
+# if @REPLACE_STRTOLL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strtoll rpl_strtoll
+# endif
+# define GNULIB_defined_strtoll_function 1
+_GL_FUNCDECL_RPL (strtoll, long long,
+ (const char *restrict string, char **restrict endptr,
+ int base)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtoll, long long,
+ (const char *restrict string, char **restrict endptr,
+ int base));
+# else
+# if !@HAVE_STRTOLL@
+_GL_FUNCDECL_SYS (strtoll, long long,
+ (const char *restrict string, char **restrict endptr,
+ int base)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtoll, long long,
+ (const char *restrict string, char **restrict endptr,
+ int base));
+# endif
+_GL_CXXALIASWARN (strtoll);
+#elif defined GNULIB_POSIXCHECK
+# undef strtoll
+# if HAVE_RAW_DECL_STRTOLL
+_GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
+ "use gnulib module strtoll for portability");
+# endif
+#endif
+
+#if @GNULIB_STRTOUL@
+/* Parse an unsigned integer whose textual representation starts at STRING.
+ The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
+ it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
+ "0x").
+ If ENDPTR is not NULL, the address of the first byte after the integer is
+ stored in *ENDPTR.
+ Upon overflow, the return value is ULONG_MAX, and errno is set to ERANGE. */
+# if @REPLACE_STRTOUL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strtoul rpl_strtoul
+# endif
+# define GNULIB_defined_strtoul_function 1
+_GL_FUNCDECL_RPL (strtoul, unsigned long,
+ (const char *restrict string, char **restrict endptr,
+ int base)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtoul, unsigned long,
+ (const char *restrict string, char **restrict endptr,
+ int base));
+# else
+# if !@HAVE_STRTOUL@
+_GL_FUNCDECL_SYS (strtoul, unsigned long,
+ (const char *restrict string, char **restrict endptr,
+ int base)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtoul, unsigned long,
+ (const char *restrict string, char **restrict endptr,
+ int base));
+# endif
+_GL_CXXALIASWARN (strtoul);
+#elif defined GNULIB_POSIXCHECK
+# undef strtoul
+# if HAVE_RAW_DECL_STRTOUL
+_GL_WARN_ON_USE (strtoul, "strtoul is unportable - "
+ "use gnulib module strtoul for portability");
+# endif
+#endif
+
+#if @GNULIB_STRTOULL@
+/* Parse an unsigned integer whose textual representation starts at STRING.
+ The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
+ it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
+ "0x").
+ If ENDPTR is not NULL, the address of the first byte after the integer is
+ stored in *ENDPTR.
+ Upon overflow, the return value is ULLONG_MAX, and errno is set to
+ ERANGE. */
+# if @REPLACE_STRTOULL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strtoull rpl_strtoull
+# endif
+# define GNULIB_defined_strtoull_function 1
+_GL_FUNCDECL_RPL (strtoull, unsigned long long,
+ (const char *restrict string, char **restrict endptr,
+ int base)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtoull, unsigned long long,
+ (const char *restrict string, char **restrict endptr,
+ int base));
+# else
+# if !@HAVE_STRTOULL@
+_GL_FUNCDECL_SYS (strtoull, unsigned long long,
+ (const char *restrict string, char **restrict endptr,
+ int base)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtoull, unsigned long long,
+ (const char *restrict string, char **restrict endptr,
+ int base));
+# endif
+_GL_CXXALIASWARN (strtoull);
+#elif defined GNULIB_POSIXCHECK
+# undef strtoull
+# if HAVE_RAW_DECL_STRTOULL
+_GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
+ "use gnulib module strtoull for portability");
+# endif
+#endif
+
+#if @GNULIB_UNLOCKPT@
+/* Unlock the slave side of the pseudo-terminal whose master side is specified
+ by FD, so that it can be opened. */
+# if !@HAVE_UNLOCKPT@
+_GL_FUNCDECL_SYS (unlockpt, int, (int fd));
+# endif
+_GL_CXXALIAS_SYS (unlockpt, int, (int fd));
+_GL_CXXALIASWARN (unlockpt);
+#elif defined GNULIB_POSIXCHECK
+# undef unlockpt
+# if HAVE_RAW_DECL_UNLOCKPT
+_GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - "
+ "use gnulib module unlockpt for portability");
+# endif
+#endif
+
+#if @GNULIB_UNSETENV@
+/* Remove the variable NAME from the environment. */
+# if @REPLACE_UNSETENV@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef unsetenv
+# define unsetenv rpl_unsetenv
+# endif
+_GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
+# else
+# if !@HAVE_DECL_UNSETENV@
+_GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
+# endif
+# if !(@REPLACE_UNSETENV@ && !@HAVE_DECL_UNSETENV@)
+_GL_CXXALIASWARN (unsetenv);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef unsetenv
+# if HAVE_RAW_DECL_UNSETENV
+_GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
+ "use gnulib module unsetenv for portability");
+# endif
+#endif
+
+/* Convert a wide character to a multibyte character. */
+#if @GNULIB_WCTOMB@
+# if @REPLACE_WCTOMB@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wctomb
+# define wctomb rpl_wctomb
+# endif
+_GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc));
+_GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc));
+# else
+_GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wctomb);
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_STDLIB_H */
+#endif /* _@GUARD_PREFIX@_STDLIB_H */
+#endif
diff --git a/gl/lib/stdopen.c b/gl/lib/stdopen.c
new file mode 100644
index 0000000..841e410
--- /dev/null
+++ b/gl/lib/stdopen.c
@@ -0,0 +1,66 @@
+/* stdopen.c - ensure that the three standard file descriptors are in use
+
+ Copyright (C) 2005-2006, 2019-2022 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 and Jim Meyering. */
+
+#include <config.h>
+
+#include "stdopen.h"
+
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+
+/* Try to ensure that all of the standard file numbers (0, 1, 2)
+ are in use. Without this, each application would have to guard
+ every call to open, dup, fopen, etc. with tests to ensure they
+ don't use one of the special file numbers when opening a file.
+ Return zero if successful, an errno value if at least one of
+ the file descriptors is initially closed and could not be opened. */
+
+int
+stdopen (void)
+{
+ int fd;
+ for (fd = STDIN_FILENO; fd <= STDERR_FILENO; fd++)
+ {
+ if (fcntl (fd, F_GETFD) < 0)
+ {
+ /* Open /dev/null with the contrary mode so that the typical
+ read (stdin) or write (stdout, stderr) operation will fail.
+ With descriptor 0, we can do even better on systems that
+ have /dev/full, by opening that write-only instead of
+ /dev/null. The only drawback is that a write-provoked
+ failure comes with a misleading errno value, ENOSPC. */
+ int mode = fd == STDIN_FILENO ? O_WRONLY : O_RDONLY;
+ int full_fd = fd == STDIN_FILENO ? open ("/dev/full", mode) : -1;
+ int new_fd = full_fd < 0 ? open ("/dev/null", mode) : full_fd;
+ if (new_fd < 0)
+ return errno;
+ if (STDERR_FILENO < new_fd)
+ {
+ /* 0, 1, and 2 are already open somehow.
+ Our is not to reason why. */
+ close (new_fd);
+ return 0;
+ }
+ }
+ }
+
+ return 0;
+}
diff --git a/gl/lib/stdopen.h b/gl/lib/stdopen.h
new file mode 100644
index 0000000..6a9d83c
--- /dev/null
+++ b/gl/lib/stdopen.h
@@ -0,0 +1,32 @@
+/* Arrange for stdin/stdout/stderr to be open.
+ Copyright (C) 2005-2022 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, 2005. */
+
+#ifndef STDOPEN_H
+# define STDOPEN_H 1
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int stdopen (void);
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
diff --git a/gl/lib/stpcpy.c b/gl/lib/stpcpy.c
new file mode 100644
index 0000000..434f84a
--- /dev/null
+++ b/gl/lib/stpcpy.c
@@ -0,0 +1,49 @@
+/* stpcpy.c -- copy a string and return pointer to end of new string
+ Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2022 Free Software
+ Foundation, Inc.
+
+ NOTE: The canonical source of this file is maintained with the GNU C Library.
+ Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+
+ This 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 2.1 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/>. */
+
+#include <config.h>
+
+#include <string.h>
+
+#undef __stpcpy
+#ifdef _LIBC
+# undef stpcpy
+#endif
+
+#ifndef weak_alias
+# define __stpcpy stpcpy
+#endif
+
+/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */
+char *
+__stpcpy (char *dest, const char *src)
+{
+ register char *d = dest;
+ register const char *s = src;
+
+ do
+ *d++ = *s;
+ while (*s++ != '\0');
+
+ return d - 1;
+}
+#ifdef weak_alias
+weak_alias (__stpcpy, stpcpy)
+#endif
diff --git a/gl/lib/str-two-way.h b/gl/lib/str-two-way.h
new file mode 100644
index 0000000..b00017c
--- /dev/null
+++ b/gl/lib/str-two-way.h
@@ -0,0 +1,452 @@
+/* Byte-wise substring search, using the Two-Way algorithm.
+ Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Written by Eric Blake <ebb9@byu.net>, 2008.
+
+ 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 2.1 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/>. */
+
+/* Before including this file, you need to include <config.h> and
+ <string.h>, and define:
+ RETURN_TYPE A macro that expands to the return type.
+ AVAILABLE(h, h_l, j, n_l)
+ A macro that returns nonzero if there are
+ at least N_L bytes left starting at H[J].
+ H is 'unsigned char *', H_L, J, and N_L
+ are 'size_t'; H_L is an lvalue. For
+ NUL-terminated searches, H_L can be
+ modified each iteration to avoid having
+ to compute the end of H up front.
+
+ For case-insensitivity, you may optionally define:
+ CMP_FUNC(p1, p2, l) A macro that returns 0 iff the first L
+ characters of P1 and P2 are equal.
+ CANON_ELEMENT(c) A macro that canonicalizes an element right after
+ it has been fetched from one of the two strings.
+ The argument is an 'unsigned char'; the result
+ must be an 'unsigned char' as well.
+
+ This file undefines the macros documented above, and defines
+ LONG_NEEDLE_THRESHOLD.
+*/
+
+#include <limits.h>
+#include <stdint.h>
+
+/* We use the Two-Way string matching algorithm (also known as
+ Chrochemore-Perrin), which guarantees linear complexity with
+ constant space. Additionally, for long needles, we also use a bad
+ character shift table similar to the Boyer-Moore algorithm to
+ achieve improved (potentially sub-linear) performance.
+
+ See https://www-igm.univ-mlv.fr/~lecroq/string/node26.html#SECTION00260,
+ https://en.wikipedia.org/wiki/Boyer-Moore_string_search_algorithm,
+ https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.34.6641&rep=rep1&type=pdf
+*/
+
+/* Point at which computing a bad-byte shift table is likely to be
+ worthwhile. Small needles should not compute a table, since it
+ adds (1 << CHAR_BIT) + NEEDLE_LEN computations of preparation for a
+ speedup no greater than a factor of NEEDLE_LEN. The larger the
+ needle, the better the potential performance gain. On the other
+ hand, on non-POSIX systems with CHAR_BIT larger than eight, the
+ memory required for the table is prohibitive. */
+#if CHAR_BIT < 10
+# define LONG_NEEDLE_THRESHOLD 32U
+#else
+# define LONG_NEEDLE_THRESHOLD SIZE_MAX
+#endif
+
+#ifndef MAX
+# define MAX(a, b) ((a < b) ? (b) : (a))
+#endif
+
+#ifndef CANON_ELEMENT
+# define CANON_ELEMENT(c) c
+#endif
+#ifndef CMP_FUNC
+# define CMP_FUNC memcmp
+#endif
+
+/* Perform a critical factorization of NEEDLE, of length NEEDLE_LEN.
+ Return the index of the first byte in the right half, and set
+ *PERIOD to the global period of the right half.
+
+ The global period of a string is the smallest index (possibly its
+ length) at which all remaining bytes in the string are repetitions
+ of the prefix (the last repetition may be a subset of the prefix).
+
+ When NEEDLE is factored into two halves, a local period is the
+ length of the smallest word that shares a suffix with the left half
+ and shares a prefix with the right half. All factorizations of a
+ non-empty NEEDLE have a local period of at least 1 and no greater
+ than NEEDLE_LEN.
+
+ A critical factorization has the property that the local period
+ equals the global period. All strings have at least one critical
+ factorization with the left half smaller than the global period.
+ And while some strings have more than one critical factorization,
+ it is provable that with an ordered alphabet, at least one of the
+ critical factorizations corresponds to a maximal suffix.
+
+ Given an ordered alphabet, a critical factorization can be computed
+ in linear time, with 2 * NEEDLE_LEN comparisons, by computing the
+ shorter of two ordered maximal suffixes. The ordered maximal
+ suffixes are determined by lexicographic comparison while tracking
+ periodicity. */
+static size_t
+critical_factorization (const unsigned char *needle, size_t needle_len,
+ size_t *period)
+{
+ /* Index of last byte of left half, or SIZE_MAX. */
+ size_t max_suffix, max_suffix_rev;
+ size_t j; /* Index into NEEDLE for current candidate suffix. */
+ size_t k; /* Offset into current period. */
+ size_t p; /* Intermediate period. */
+ unsigned char a, b; /* Current comparison bytes. */
+
+ /* Special case NEEDLE_LEN of 1 or 2 (all callers already filtered
+ out 0-length needles. */
+ if (needle_len < 3)
+ {
+ *period = 1;
+ return needle_len - 1;
+ }
+
+ /* Invariants:
+ 0 <= j < NEEDLE_LEN - 1
+ -1 <= max_suffix{,_rev} < j (treating SIZE_MAX as if it were signed)
+ min(max_suffix, max_suffix_rev) < global period of NEEDLE
+ 1 <= p <= global period of NEEDLE
+ p == global period of the substring NEEDLE[max_suffix{,_rev}+1...j]
+ 1 <= k <= p
+ */
+
+ /* Perform lexicographic search. */
+ max_suffix = SIZE_MAX;
+ j = 0;
+ k = p = 1;
+ while (j + k < needle_len)
+ {
+ a = CANON_ELEMENT (needle[j + k]);
+ b = CANON_ELEMENT (needle[max_suffix + k]);
+ if (a < b)
+ {
+ /* Suffix is smaller, period is entire prefix so far. */
+ j += k;
+ k = 1;
+ p = j - max_suffix;
+ }
+ else if (a == b)
+ {
+ /* Advance through repetition of the current period. */
+ if (k != p)
+ ++k;
+ else
+ {
+ j += p;
+ k = 1;
+ }
+ }
+ else /* b < a */
+ {
+ /* Suffix is larger, start over from current location. */
+ max_suffix = j++;
+ k = p = 1;
+ }
+ }
+ *period = p;
+
+ /* Perform reverse lexicographic search. */
+ max_suffix_rev = SIZE_MAX;
+ j = 0;
+ k = p = 1;
+ while (j + k < needle_len)
+ {
+ a = CANON_ELEMENT (needle[j + k]);
+ b = CANON_ELEMENT (needle[max_suffix_rev + k]);
+ if (b < a)
+ {
+ /* Suffix is smaller, period is entire prefix so far. */
+ j += k;
+ k = 1;
+ p = j - max_suffix_rev;
+ }
+ else if (a == b)
+ {
+ /* Advance through repetition of the current period. */
+ if (k != p)
+ ++k;
+ else
+ {
+ j += p;
+ k = 1;
+ }
+ }
+ else /* a < b */
+ {
+ /* Suffix is larger, start over from current location. */
+ max_suffix_rev = j++;
+ k = p = 1;
+ }
+ }
+
+ /* Choose the shorter suffix. Return the index of the first byte of
+ the right half, rather than the last byte of the left half.
+
+ For some examples, 'banana' has two critical factorizations, both
+ exposed by the two lexicographic extreme suffixes of 'anana' and
+ 'nana', where both suffixes have a period of 2. On the other
+ hand, with 'aab' and 'bba', both strings have a single critical
+ factorization of the last byte, with the suffix having a period
+ of 1. While the maximal lexicographic suffix of 'aab' is 'b',
+ the maximal lexicographic suffix of 'bba' is 'ba', which is not a
+ critical factorization. Conversely, the maximal reverse
+ lexicographic suffix of 'a' works for 'bba', but not 'ab' for
+ 'aab'. The shorter suffix of the two will always be a critical
+ factorization. */
+ if (max_suffix_rev + 1 < max_suffix + 1)
+ return max_suffix + 1;
+ *period = p;
+ return max_suffix_rev + 1;
+}
+
+/* Return the first location of non-empty NEEDLE within HAYSTACK, or
+ NULL. HAYSTACK_LEN is the minimum known length of HAYSTACK. This
+ method is optimized for NEEDLE_LEN < LONG_NEEDLE_THRESHOLD.
+ Performance is guaranteed to be linear, with an initialization cost
+ of 2 * NEEDLE_LEN comparisons.
+
+ If AVAILABLE does not modify HAYSTACK_LEN (as in memmem), then at
+ most 2 * HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching.
+ If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 *
+ HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching. */
+static RETURN_TYPE _GL_ATTRIBUTE_PURE
+two_way_short_needle (const unsigned char *haystack, size_t haystack_len,
+ const unsigned char *needle, size_t needle_len)
+{
+ size_t i; /* Index into current byte of NEEDLE. */
+ size_t j; /* Index into current window of HAYSTACK. */
+ size_t period; /* The period of the right half of needle. */
+ size_t suffix; /* The index of the right half of needle. */
+
+ /* Factor the needle into two halves, such that the left half is
+ smaller than the global period, and the right half is
+ periodic (with a period as large as NEEDLE_LEN - suffix). */
+ suffix = critical_factorization (needle, needle_len, &period);
+
+ /* Perform the search. Each iteration compares the right half
+ first. */
+ if (CMP_FUNC (needle, needle + period, suffix) == 0)
+ {
+ /* Entire needle is periodic; a mismatch in the left half can
+ only advance by the period, so use memory to avoid rescanning
+ known occurrences of the period in the right half. */
+ size_t memory = 0;
+ j = 0;
+ while (AVAILABLE (haystack, haystack_len, j, needle_len))
+ {
+ /* Scan for matches in right half. */
+ i = MAX (suffix, memory);
+ while (i < needle_len && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ ++i;
+ if (needle_len <= i)
+ {
+ /* Scan for matches in left half. */
+ i = suffix - 1;
+ while (memory < i + 1 && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ --i;
+ if (i + 1 < memory + 1)
+ return (RETURN_TYPE) (haystack + j);
+ /* No match, so remember how many repetitions of period
+ on the right half were scanned. */
+ j += period;
+ memory = needle_len - period;
+ }
+ else
+ {
+ j += i - suffix + 1;
+ memory = 0;
+ }
+ }
+ }
+ else
+ {
+ /* The two halves of needle are distinct; no extra memory is
+ required, and any mismatch results in a maximal shift. */
+ period = MAX (suffix, needle_len - suffix) + 1;
+ j = 0;
+ while (AVAILABLE (haystack, haystack_len, j, needle_len))
+ {
+ /* Scan for matches in right half. */
+ i = suffix;
+ while (i < needle_len && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ ++i;
+ if (needle_len <= i)
+ {
+ /* Scan for matches in left half. */
+ i = suffix - 1;
+ while (i != SIZE_MAX && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ --i;
+ if (i == SIZE_MAX)
+ return (RETURN_TYPE) (haystack + j);
+ j += period;
+ }
+ else
+ j += i - suffix + 1;
+ }
+ }
+ return NULL;
+}
+
+/* Return the first location of non-empty NEEDLE within HAYSTACK, or
+ NULL. HAYSTACK_LEN is the minimum known length of HAYSTACK. This
+ method is optimized for LONG_NEEDLE_THRESHOLD <= NEEDLE_LEN.
+ Performance is guaranteed to be linear, with an initialization cost
+ of 3 * NEEDLE_LEN + (1 << CHAR_BIT) operations.
+
+ If AVAILABLE does not modify HAYSTACK_LEN (as in memmem), then at
+ most 2 * HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching,
+ and sublinear performance O(HAYSTACK_LEN / NEEDLE_LEN) is possible.
+ If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 *
+ HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching, and
+ sublinear performance is not possible. */
+static RETURN_TYPE _GL_ATTRIBUTE_PURE
+two_way_long_needle (const unsigned char *haystack, size_t haystack_len,
+ const unsigned char *needle, size_t needle_len)
+{
+ size_t i; /* Index into current byte of NEEDLE. */
+ size_t j; /* Index into current window of HAYSTACK. */
+ size_t period; /* The period of the right half of needle. */
+ size_t suffix; /* The index of the right half of needle. */
+ size_t shift_table[1U << CHAR_BIT]; /* See below. */
+
+ /* Factor the needle into two halves, such that the left half is
+ smaller than the global period, and the right half is
+ periodic (with a period as large as NEEDLE_LEN - suffix). */
+ suffix = critical_factorization (needle, needle_len, &period);
+
+ /* Populate shift_table. For each possible byte value c,
+ shift_table[c] is the distance from the last occurrence of c to
+ the end of NEEDLE, or NEEDLE_LEN if c is absent from the NEEDLE.
+ shift_table[NEEDLE[NEEDLE_LEN - 1]] contains the only 0. */
+ for (i = 0; i < 1U << CHAR_BIT; i++)
+ shift_table[i] = needle_len;
+ for (i = 0; i < needle_len; i++)
+ shift_table[CANON_ELEMENT (needle[i])] = needle_len - i - 1;
+
+ /* Perform the search. Each iteration compares the right half
+ first. */
+ if (CMP_FUNC (needle, needle + period, suffix) == 0)
+ {
+ /* Entire needle is periodic; a mismatch in the left half can
+ only advance by the period, so use memory to avoid rescanning
+ known occurrences of the period in the right half. */
+ size_t memory = 0;
+ size_t shift;
+ j = 0;
+ while (AVAILABLE (haystack, haystack_len, j, needle_len))
+ {
+ /* Check the last byte first; if it does not match, then
+ shift to the next possible match location. */
+ shift = shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])];
+ if (0 < shift)
+ {
+ if (memory && shift < period)
+ {
+ /* Since needle is periodic, but the last period has
+ a byte out of place, there can be no match until
+ after the mismatch. */
+ shift = needle_len - period;
+ }
+ memory = 0;
+ j += shift;
+ continue;
+ }
+ /* Scan for matches in right half. The last byte has
+ already been matched, by virtue of the shift table. */
+ i = MAX (suffix, memory);
+ while (i < needle_len - 1 && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ ++i;
+ if (needle_len - 1 <= i)
+ {
+ /* Scan for matches in left half. */
+ i = suffix - 1;
+ while (memory < i + 1 && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ --i;
+ if (i + 1 < memory + 1)
+ return (RETURN_TYPE) (haystack + j);
+ /* No match, so remember how many repetitions of period
+ on the right half were scanned. */
+ j += period;
+ memory = needle_len - period;
+ }
+ else
+ {
+ j += i - suffix + 1;
+ memory = 0;
+ }
+ }
+ }
+ else
+ {
+ /* The two halves of needle are distinct; no extra memory is
+ required, and any mismatch results in a maximal shift. */
+ size_t shift;
+ period = MAX (suffix, needle_len - suffix) + 1;
+ j = 0;
+ while (AVAILABLE (haystack, haystack_len, j, needle_len))
+ {
+ /* Check the last byte first; if it does not match, then
+ shift to the next possible match location. */
+ shift = shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])];
+ if (0 < shift)
+ {
+ j += shift;
+ continue;
+ }
+ /* Scan for matches in right half. The last byte has
+ already been matched, by virtue of the shift table. */
+ i = suffix;
+ while (i < needle_len - 1 && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ ++i;
+ if (needle_len - 1 <= i)
+ {
+ /* Scan for matches in left half. */
+ i = suffix - 1;
+ while (i != SIZE_MAX && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ --i;
+ if (i == SIZE_MAX)
+ return (RETURN_TYPE) (haystack + j);
+ j += period;
+ }
+ else
+ j += i - suffix + 1;
+ }
+ }
+ return NULL;
+}
+
+#undef AVAILABLE
+#undef CANON_ELEMENT
+#undef CMP_FUNC
+#undef MAX
+#undef RETURN_TYPE
diff --git a/gl/lib/strcasecmp.c b/gl/lib/strcasecmp.c
new file mode 100644
index 0000000..a85a2b1
--- /dev/null
+++ b/gl/lib/strcasecmp.c
@@ -0,0 +1,62 @@
+/* Case-insensitive string comparison function.
+ Copyright (C) 1998-1999, 2005-2007, 2009-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <string.h>
+
+#include <ctype.h>
+#include <limits.h>
+
+#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
+
+/* Compare strings S1 and S2, ignoring case, returning less than, equal to or
+ greater than zero if S1 is lexicographically less than, equal to or greater
+ than S2.
+ Note: This function does not work with multibyte strings! */
+
+int
+strcasecmp (const char *s1, const char *s2)
+{
+ const unsigned char *p1 = (const unsigned char *) s1;
+ const unsigned char *p2 = (const unsigned char *) s2;
+ unsigned char c1, c2;
+
+ if (p1 == p2)
+ return 0;
+
+ do
+ {
+ c1 = TOLOWER (*p1);
+ c2 = TOLOWER (*p2);
+
+ if (c1 == '\0')
+ break;
+
+ ++p1;
+ ++p2;
+ }
+ while (c1 == c2);
+
+ if (UCHAR_MAX <= INT_MAX)
+ return c1 - c2;
+ else
+ /* On machines where 'char' and 'int' are types of the same size, the
+ difference of two 'unsigned char' values - including the sign bit -
+ doesn't fit in an 'int'. */
+ return _GL_CMP (c1, c2);
+}
diff --git a/gl/lib/strcasestr.c b/gl/lib/strcasestr.c
new file mode 100644
index 0000000..b36f409
--- /dev/null
+++ b/gl/lib/strcasestr.c
@@ -0,0 +1,82 @@
+/* Case-insensitive searching in a string.
+ Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2005.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <string.h>
+
+#include <ctype.h>
+#include <stdbool.h>
+#include <strings.h>
+
+#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
+
+/* Two-Way algorithm. */
+#define RETURN_TYPE char *
+#define AVAILABLE(h, h_l, j, n_l) \
+ (!memchr ((h) + (h_l), '\0', (j) + (n_l) - (h_l)) \
+ && ((h_l) = (j) + (n_l)))
+#define CANON_ELEMENT(c) TOLOWER (c)
+#define CMP_FUNC(p1, p2, l) \
+ strncasecmp ((const char *) (p1), (const char *) (p2), l)
+#include "str-two-way.h"
+
+/* Find the first occurrence of NEEDLE in HAYSTACK, using
+ case-insensitive comparison. This function gives unspecified
+ results in multibyte locales. */
+char *
+strcasestr (const char *haystack_start, const char *needle_start)
+{
+ const char *haystack = haystack_start;
+ const char *needle = needle_start;
+ size_t needle_len; /* Length of NEEDLE. */
+ size_t haystack_len; /* Known minimum length of HAYSTACK. */
+ bool ok = true; /* True if NEEDLE is prefix of HAYSTACK. */
+
+ /* Determine length of NEEDLE, and in the process, make sure
+ HAYSTACK is at least as long (no point processing all of a long
+ NEEDLE if HAYSTACK is too short). */
+ while (*haystack && *needle)
+ {
+ ok &= (TOLOWER ((unsigned char) *haystack)
+ == TOLOWER ((unsigned char) *needle));
+ haystack++;
+ needle++;
+ }
+ if (*needle)
+ return NULL;
+ if (ok)
+ return (char *) haystack_start;
+ needle_len = needle - needle_start;
+ haystack = haystack_start + 1;
+ haystack_len = needle_len - 1;
+
+ /* Perform the search. Abstract memory is considered to be an array
+ of 'unsigned char' values, not an array of 'char' values. See
+ ISO C 99 section 6.2.6.1. */
+ if (needle_len < LONG_NEEDLE_THRESHOLD)
+ return two_way_short_needle ((const unsigned char *) haystack,
+ haystack_len,
+ (const unsigned char *) needle_start,
+ needle_len);
+ return two_way_long_needle ((const unsigned char *) haystack, haystack_len,
+ (const unsigned char *) needle_start,
+ needle_len);
+}
+
+#undef LONG_NEEDLE_THRESHOLD
diff --git a/gl/lib/strchrnul.c b/gl/lib/strchrnul.c
new file mode 100644
index 0000000..2141b3e
--- /dev/null
+++ b/gl/lib/strchrnul.c
@@ -0,0 +1,142 @@
+/* Searching in a string.
+ Copyright (C) 2003, 2007-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <string.h>
+
+/* Find the first occurrence of C in S or the final NUL byte. */
+char *
+strchrnul (const char *s, int c_in)
+{
+ /* On 32-bit hardware, choosing longword to be a 32-bit unsigned
+ long instead of a 64-bit uintmax_t tends to give better
+ performance. On 64-bit hardware, unsigned long is generally 64
+ bits already. Change this typedef to experiment with
+ performance. */
+ typedef unsigned long int longword;
+
+ const unsigned char *char_ptr;
+ const longword *longword_ptr;
+ longword repeated_one;
+ longword repeated_c;
+ unsigned char c;
+
+ c = (unsigned char) c_in;
+ if (!c)
+ return rawmemchr (s, 0);
+
+ /* Handle the first few bytes by reading one byte at a time.
+ Do this until CHAR_PTR is aligned on a longword boundary. */
+ for (char_ptr = (const unsigned char *) s;
+ (size_t) char_ptr % sizeof (longword) != 0;
+ ++char_ptr)
+ if (!*char_ptr || *char_ptr == c)
+ return (char *) char_ptr;
+
+ longword_ptr = (const longword *) char_ptr;
+
+ /* All these elucidatory comments refer to 4-byte longwords,
+ but the theory applies equally well to any size longwords. */
+
+ /* Compute auxiliary longword values:
+ repeated_one is a value which has a 1 in every byte.
+ repeated_c has c in every byte. */
+ repeated_one = 0x01010101;
+ repeated_c = c | (c << 8);
+ repeated_c |= repeated_c << 16;
+ if (0xffffffffU < (longword) -1)
+ {
+ repeated_one |= repeated_one << 31 << 1;
+ repeated_c |= repeated_c << 31 << 1;
+ if (8 < sizeof (longword))
+ {
+ size_t i;
+
+ for (i = 64; i < sizeof (longword) * 8; i *= 2)
+ {
+ repeated_one |= repeated_one << i;
+ repeated_c |= repeated_c << i;
+ }
+ }
+ }
+
+ /* Instead of the traditional loop which tests each byte, we will
+ test a longword at a time. The tricky part is testing if *any of
+ the four* bytes in the longword in question are equal to NUL or
+ c. We first use an xor with repeated_c. This reduces the task
+ to testing whether *any of the four* bytes in longword1 or
+ longword2 is zero.
+
+ Let's consider longword1. We compute tmp =
+ ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7).
+ That is, we perform the following operations:
+ 1. Subtract repeated_one.
+ 2. & ~longword1.
+ 3. & a mask consisting of 0x80 in every byte.
+ Consider what happens in each byte:
+ - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff,
+ and step 3 transforms it into 0x80. A carry can also be propagated
+ to more significant bytes.
+ - If a byte of longword1 is nonzero, let its lowest 1 bit be at
+ position k (0 <= k <= 7); so the lowest k bits are 0. After step 1,
+ the byte ends in a single bit of value 0 and k bits of value 1.
+ After step 2, the result is just k bits of value 1: 2^k - 1. After
+ step 3, the result is 0. And no carry is produced.
+ So, if longword1 has only non-zero bytes, tmp is zero.
+ Whereas if longword1 has a zero byte, call j the position of the least
+ significant zero byte. Then the result has a zero at positions 0, ...,
+ j-1 and a 0x80 at position j. We cannot predict the result at the more
+ significant bytes (positions j+1..3), but it does not matter since we
+ already have a non-zero bit at position 8*j+7.
+
+ The test whether any byte in longword1 or longword2 is zero is equivalent
+ to testing whether tmp1 is nonzero or tmp2 is nonzero. We can combine
+ this into a single test, whether (tmp1 | tmp2) is nonzero.
+
+ This test can read more than one byte beyond the end of a string,
+ depending on where the terminating NUL is encountered. However,
+ this is considered safe since the initialization phase ensured
+ that the read will be aligned, therefore, the read will not cross
+ page boundaries and will not cause a fault. */
+
+ while (1)
+ {
+ longword longword1 = *longword_ptr ^ repeated_c;
+ longword longword2 = *longword_ptr;
+
+ if (((((longword1 - repeated_one) & ~longword1)
+ | ((longword2 - repeated_one) & ~longword2))
+ & (repeated_one << 7)) != 0)
+ break;
+ longword_ptr++;
+ }
+
+ char_ptr = (const unsigned char *) longword_ptr;
+
+ /* At this point, we know that one of the sizeof (longword) bytes
+ starting at char_ptr is == 0 or == c. On little-endian machines,
+ we could determine the first such byte without any further memory
+ accesses, just by looking at the tmp result from the last loop
+ iteration. But this does not work on big-endian machines.
+ Choose code that works in both cases. */
+
+ char_ptr = (unsigned char *) longword_ptr;
+ while (*char_ptr && (*char_ptr != c))
+ char_ptr++;
+ return (char *) char_ptr;
+}
diff --git a/gl/lib/strchrnul.valgrind b/gl/lib/strchrnul.valgrind
new file mode 100644
index 0000000..1cf50ec
--- /dev/null
+++ b/gl/lib/strchrnul.valgrind
@@ -0,0 +1,28 @@
+# Suppress a valgrind message about use of uninitialized memory in strchrnul().
+
+# Copyright (C) 2008-2022 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 2.1 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/>.
+
+# This use is OK because it provides only a speedup.
+{
+ strchrnul-value4
+ Memcheck:Value4
+ fun:strchrnul
+}
+{
+ strchrnul-value8
+ Memcheck:Value8
+ fun:strchrnul
+}
diff --git a/gl/lib/strdup.c b/gl/lib/strdup.c
new file mode 100644
index 0000000..2a0df02
--- /dev/null
+++ b/gl/lib/strdup.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2022 Free Software
+ Foundation, Inc.
+
+ This file is part of the GNU C Library.
+
+ 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 2.1 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/>. */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+/* Get specification. */
+#include <string.h>
+
+#include <stdlib.h>
+
+#undef __strdup
+#ifdef _LIBC
+# undef strdup
+#endif
+
+#ifndef weak_alias
+# define __strdup strdup
+#endif
+
+/* Duplicate S, returning an identical malloc'd string. */
+char *
+__strdup (const char *s)
+{
+ size_t len = strlen (s) + 1;
+ void *new = malloc (len);
+
+ if (new == NULL)
+ return NULL;
+
+ return (char *) memcpy (new, s, len);
+}
+#ifdef libc_hidden_def
+libc_hidden_def (__strdup)
+#endif
+#ifdef weak_alias
+weak_alias (__strdup, strdup)
+#endif
diff --git a/gl/lib/streq.h b/gl/lib/streq.h
new file mode 100644
index 0000000..49f73c1
--- /dev/null
+++ b/gl/lib/streq.h
@@ -0,0 +1,176 @@
+/* Optimized string comparison.
+ Copyright (C) 2001-2002, 2007, 2009-2022 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 2.1 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>. */
+
+#ifndef _GL_STREQ_H
+#define _GL_STREQ_H
+
+#include <string.h>
+
+/* STREQ_OPT allows to optimize string comparison with a small literal string.
+ STREQ_OPT (s, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
+ is semantically equivalent to
+ strcmp (s, "EUC-KR") == 0
+ just faster. */
+
+/* Help GCC to generate good code for string comparisons with
+ immediate strings. */
+#if (defined __GNUC__ || defined __clang__) && defined __OPTIMIZE__
+
+static inline int
+streq9 (const char *s1, const char *s2)
+{
+ return strcmp (s1 + 9, s2 + 9) == 0;
+}
+
+static inline int
+streq8 (const char *s1, const char *s2, char s28)
+{
+ if (s1[8] == s28)
+ {
+ if (s28 == 0)
+ return 1;
+ else
+ return streq9 (s1, s2);
+ }
+ else
+ return 0;
+}
+
+static inline int
+streq7 (const char *s1, const char *s2, char s27, char s28)
+{
+ if (s1[7] == s27)
+ {
+ if (s27 == 0)
+ return 1;
+ else
+ return streq8 (s1, s2, s28);
+ }
+ else
+ return 0;
+}
+
+static inline int
+streq6 (const char *s1, const char *s2, char s26, char s27, char s28)
+{
+ if (s1[6] == s26)
+ {
+ if (s26 == 0)
+ return 1;
+ else
+ return streq7 (s1, s2, s27, s28);
+ }
+ else
+ return 0;
+}
+
+static inline int
+streq5 (const char *s1, const char *s2, char s25, char s26, char s27, char s28)
+{
+ if (s1[5] == s25)
+ {
+ if (s25 == 0)
+ return 1;
+ else
+ return streq6 (s1, s2, s26, s27, s28);
+ }
+ else
+ return 0;
+}
+
+static inline int
+streq4 (const char *s1, const char *s2, char s24, char s25, char s26, char s27, char s28)
+{
+ if (s1[4] == s24)
+ {
+ if (s24 == 0)
+ return 1;
+ else
+ return streq5 (s1, s2, s25, s26, s27, s28);
+ }
+ else
+ return 0;
+}
+
+static inline int
+streq3 (const char *s1, const char *s2, char s23, char s24, char s25, char s26, char s27, char s28)
+{
+ if (s1[3] == s23)
+ {
+ if (s23 == 0)
+ return 1;
+ else
+ return streq4 (s1, s2, s24, s25, s26, s27, s28);
+ }
+ else
+ return 0;
+}
+
+static inline int
+streq2 (const char *s1, const char *s2, char s22, char s23, char s24, char s25, char s26, char s27, char s28)
+{
+ if (s1[2] == s22)
+ {
+ if (s22 == 0)
+ return 1;
+ else
+ return streq3 (s1, s2, s23, s24, s25, s26, s27, s28);
+ }
+ else
+ return 0;
+}
+
+static inline int
+streq1 (const char *s1, const char *s2, char s21, char s22, char s23, char s24, char s25, char s26, char s27, char s28)
+{
+ if (s1[1] == s21)
+ {
+ if (s21 == 0)
+ return 1;
+ else
+ return streq2 (s1, s2, s22, s23, s24, s25, s26, s27, s28);
+ }
+ else
+ return 0;
+}
+
+static inline int
+streq0 (const char *s1, const char *s2, char s20, char s21, char s22, char s23, char s24, char s25, char s26, char s27, char s28)
+{
+ if (s1[0] == s20)
+ {
+ if (s20 == 0)
+ return 1;
+ else
+ return streq1 (s1, s2, s21, s22, s23, s24, s25, s26, s27, s28);
+ }
+ else
+ return 0;
+}
+
+#define STREQ_OPT(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \
+ streq0 (s1, s2, s20, s21, s22, s23, s24, s25, s26, s27, s28)
+
+#else
+
+#define STREQ_OPT(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \
+ (strcmp (s1, s2) == 0)
+
+#endif
+
+#endif /* _GL_STREQ_H */
diff --git a/gl/lib/strerror-override.c b/gl/lib/strerror-override.c
new file mode 100644
index 0000000..6be1afd
--- /dev/null
+++ b/gl/lib/strerror-override.c
@@ -0,0 +1,306 @@
+/* strerror-override.c --- POSIX compatible system error routine
+
+ Copyright (C) 2010-2022 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 2.1 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>, 2010. */
+
+#include <config.h>
+
+#include "strerror-override.h"
+
+#include <errno.h>
+
+#if GNULIB_defined_EWINSOCK /* native Windows platforms */
+# if HAVE_WINSOCK2_H
+# include <winsock2.h>
+# endif
+#endif
+
+#if !GNULIB_defined_strerror_override_macro
+
+/* If ERRNUM maps to an errno value defined by gnulib, return a string
+ describing the error. Otherwise return NULL. */
+const char *
+strerror_override (int errnum)
+{
+ /* These error messages are taken from glibc/sysdeps/gnu/errlist.c. */
+ switch (errnum)
+ {
+# if REPLACE_STRERROR_0
+ case 0:
+ return "Success";
+# endif
+
+# if GNULIB_defined_ESOCK /* native Windows platforms with older <errno.h> */
+ case EINPROGRESS:
+ return "Operation now in progress";
+ case EALREADY:
+ return "Operation already in progress";
+ case ENOTSOCK:
+ return "Socket operation on non-socket";
+ case EDESTADDRREQ:
+ return "Destination address required";
+ case EMSGSIZE:
+ return "Message too long";
+ case EPROTOTYPE:
+ return "Protocol wrong type for socket";
+ case ENOPROTOOPT:
+ return "Protocol not available";
+ case EPROTONOSUPPORT:
+ return "Protocol not supported";
+ case EOPNOTSUPP:
+ return "Operation not supported";
+ case EAFNOSUPPORT:
+ return "Address family not supported by protocol";
+ case EADDRINUSE:
+ return "Address already in use";
+ case EADDRNOTAVAIL:
+ return "Cannot assign requested address";
+ case ENETDOWN:
+ return "Network is down";
+ case ENETUNREACH:
+ return "Network is unreachable";
+ case ECONNRESET:
+ return "Connection reset by peer";
+ case ENOBUFS:
+ return "No buffer space available";
+ case EISCONN:
+ return "Transport endpoint is already connected";
+ case ENOTCONN:
+ return "Transport endpoint is not connected";
+ case ETIMEDOUT:
+ return "Connection timed out";
+ case ECONNREFUSED:
+ return "Connection refused";
+ case ELOOP:
+ return "Too many levels of symbolic links";
+ case EHOSTUNREACH:
+ return "No route to host";
+ case EWOULDBLOCK:
+ return "Operation would block";
+# endif
+# if GNULIB_defined_ESTREAMS /* native Windows platforms with older <errno.h> */
+ case ETXTBSY:
+ return "Text file busy";
+ case ENODATA:
+ return "No data available";
+ case ENOSR:
+ return "Out of streams resources";
+ case ENOSTR:
+ return "Device not a stream";
+ case ETIME:
+ return "Timer expired";
+ case EOTHER:
+ return "Other error";
+# endif
+# if GNULIB_defined_EWINSOCK /* native Windows platforms */
+ case ESOCKTNOSUPPORT:
+ return "Socket type not supported";
+ case EPFNOSUPPORT:
+ return "Protocol family not supported";
+ case ESHUTDOWN:
+ return "Cannot send after transport endpoint shutdown";
+ case ETOOMANYREFS:
+ return "Too many references: cannot splice";
+ case EHOSTDOWN:
+ return "Host is down";
+ case EPROCLIM:
+ return "Too many processes";
+ case EUSERS:
+ return "Too many users";
+ case EDQUOT:
+ return "Disk quota exceeded";
+ case ESTALE:
+ return "Stale NFS file handle";
+ case EREMOTE:
+ return "Object is remote";
+# if HAVE_WINSOCK2_H
+ /* WSA_INVALID_HANDLE maps to EBADF */
+ /* WSA_NOT_ENOUGH_MEMORY maps to ENOMEM */
+ /* WSA_INVALID_PARAMETER maps to EINVAL */
+ case WSA_OPERATION_ABORTED:
+ return "Overlapped operation aborted";
+ case WSA_IO_INCOMPLETE:
+ return "Overlapped I/O event object not in signaled state";
+ case WSA_IO_PENDING:
+ return "Overlapped operations will complete later";
+ /* WSAEINTR maps to EINTR */
+ /* WSAEBADF maps to EBADF */
+ /* WSAEACCES maps to EACCES */
+ /* WSAEFAULT maps to EFAULT */
+ /* WSAEINVAL maps to EINVAL */
+ /* WSAEMFILE maps to EMFILE */
+ /* WSAEWOULDBLOCK maps to EWOULDBLOCK */
+ /* WSAEINPROGRESS maps to EINPROGRESS */
+ /* WSAEALREADY maps to EALREADY */
+ /* WSAENOTSOCK maps to ENOTSOCK */
+ /* WSAEDESTADDRREQ maps to EDESTADDRREQ */
+ /* WSAEMSGSIZE maps to EMSGSIZE */
+ /* WSAEPROTOTYPE maps to EPROTOTYPE */
+ /* WSAENOPROTOOPT maps to ENOPROTOOPT */
+ /* WSAEPROTONOSUPPORT maps to EPROTONOSUPPORT */
+ /* WSAESOCKTNOSUPPORT is ESOCKTNOSUPPORT */
+ /* WSAEOPNOTSUPP maps to EOPNOTSUPP */
+ /* WSAEPFNOSUPPORT is EPFNOSUPPORT */
+ /* WSAEAFNOSUPPORT maps to EAFNOSUPPORT */
+ /* WSAEADDRINUSE maps to EADDRINUSE */
+ /* WSAEADDRNOTAVAIL maps to EADDRNOTAVAIL */
+ /* WSAENETDOWN maps to ENETDOWN */
+ /* WSAENETUNREACH maps to ENETUNREACH */
+ /* WSAENETRESET maps to ENETRESET */
+ /* WSAECONNABORTED maps to ECONNABORTED */
+ /* WSAECONNRESET maps to ECONNRESET */
+ /* WSAENOBUFS maps to ENOBUFS */
+ /* WSAEISCONN maps to EISCONN */
+ /* WSAENOTCONN maps to ENOTCONN */
+ /* WSAESHUTDOWN is ESHUTDOWN */
+ /* WSAETOOMANYREFS is ETOOMANYREFS */
+ /* WSAETIMEDOUT maps to ETIMEDOUT */
+ /* WSAECONNREFUSED maps to ECONNREFUSED */
+ /* WSAELOOP maps to ELOOP */
+ /* WSAENAMETOOLONG maps to ENAMETOOLONG */
+ /* WSAEHOSTDOWN is EHOSTDOWN */
+ /* WSAEHOSTUNREACH maps to EHOSTUNREACH */
+ /* WSAENOTEMPTY maps to ENOTEMPTY */
+ /* WSAEPROCLIM is EPROCLIM */
+ /* WSAEUSERS is EUSERS */
+ /* WSAEDQUOT is EDQUOT */
+ /* WSAESTALE is ESTALE */
+ /* WSAEREMOTE is EREMOTE */
+ case WSASYSNOTREADY:
+ return "Network subsystem is unavailable";
+ case WSAVERNOTSUPPORTED:
+ return "Winsock.dll version out of range";
+ case WSANOTINITIALISED:
+ return "Successful WSAStartup not yet performed";
+ case WSAEDISCON:
+ return "Graceful shutdown in progress";
+ case WSAENOMORE: case WSA_E_NO_MORE:
+ return "No more results";
+ case WSAECANCELLED: case WSA_E_CANCELLED:
+ return "Call was canceled";
+ case WSAEINVALIDPROCTABLE:
+ return "Procedure call table is invalid";
+ case WSAEINVALIDPROVIDER:
+ return "Service provider is invalid";
+ case WSAEPROVIDERFAILEDINIT:
+ return "Service provider failed to initialize";
+ case WSASYSCALLFAILURE:
+ return "System call failure";
+ case WSASERVICE_NOT_FOUND:
+ return "Service not found";
+ case WSATYPE_NOT_FOUND:
+ return "Class type not found";
+ case WSAEREFUSED:
+ return "Database query was refused";
+ case WSAHOST_NOT_FOUND:
+ return "Host not found";
+ case WSATRY_AGAIN:
+ return "Nonauthoritative host not found";
+ case WSANO_RECOVERY:
+ return "Nonrecoverable error";
+ case WSANO_DATA:
+ return "Valid name, no data record of requested type";
+ /* WSA_QOS_* omitted */
+# endif
+# endif
+
+# if GNULIB_defined_ENOMSG
+ case ENOMSG:
+ return "No message of desired type";
+# endif
+
+# if GNULIB_defined_EIDRM
+ case EIDRM:
+ return "Identifier removed";
+# endif
+
+# if GNULIB_defined_ENOLINK
+ case ENOLINK:
+ return "Link has been severed";
+# endif
+
+# if GNULIB_defined_EPROTO
+ case EPROTO:
+ return "Protocol error";
+# endif
+
+# if GNULIB_defined_EMULTIHOP
+ case EMULTIHOP:
+ return "Multihop attempted";
+# endif
+
+# if GNULIB_defined_EBADMSG
+ case EBADMSG:
+ return "Bad message";
+# endif
+
+# if GNULIB_defined_EOVERFLOW
+ case EOVERFLOW:
+ return "Value too large for defined data type";
+# endif
+
+# if GNULIB_defined_ENOTSUP
+ case ENOTSUP:
+ return "Not supported";
+# endif
+
+# if GNULIB_defined_ENETRESET
+ case ENETRESET:
+ return "Network dropped connection on reset";
+# endif
+
+# if GNULIB_defined_ECONNABORTED
+ case ECONNABORTED:
+ return "Software caused connection abort";
+# endif
+
+# if GNULIB_defined_ESTALE
+ case ESTALE:
+ return "Stale NFS file handle";
+# endif
+
+# if GNULIB_defined_EDQUOT
+ case EDQUOT:
+ return "Disk quota exceeded";
+# endif
+
+# if GNULIB_defined_ECANCELED
+ case ECANCELED:
+ return "Operation canceled";
+# endif
+
+# if GNULIB_defined_EOWNERDEAD
+ case EOWNERDEAD:
+ return "Owner died";
+# endif
+
+# if GNULIB_defined_ENOTRECOVERABLE
+ case ENOTRECOVERABLE:
+ return "State not recoverable";
+# endif
+
+# if GNULIB_defined_EILSEQ
+ case EILSEQ:
+ return "Invalid or incomplete multibyte or wide character";
+# endif
+
+ default:
+ return NULL;
+ }
+}
+
+#endif
diff --git a/gl/lib/strerror-override.h b/gl/lib/strerror-override.h
new file mode 100644
index 0000000..d010d27
--- /dev/null
+++ b/gl/lib/strerror-override.h
@@ -0,0 +1,57 @@
+/* strerror-override.h --- POSIX compatible system error routine
+
+ Copyright (C) 2010-2022 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 2.1 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/>. */
+
+#ifndef _GL_STRERROR_OVERRIDE_H
+# define _GL_STRERROR_OVERRIDE_H
+
+# include <errno.h>
+# include <stddef.h>
+
+/* Reasonable buffer size that should never trigger ERANGE; if this
+ proves too small, we intentionally abort(), to remind us to fix
+ this value. */
+# define STACKBUF_LEN 256
+
+/* If ERRNUM maps to an errno value defined by gnulib, return a string
+ describing the error. Otherwise return NULL. */
+# if REPLACE_STRERROR_0 \
+ || GNULIB_defined_ESOCK \
+ || GNULIB_defined_ESTREAMS \
+ || GNULIB_defined_EWINSOCK \
+ || GNULIB_defined_ENOMSG \
+ || GNULIB_defined_EIDRM \
+ || GNULIB_defined_ENOLINK \
+ || GNULIB_defined_EPROTO \
+ || GNULIB_defined_EMULTIHOP \
+ || GNULIB_defined_EBADMSG \
+ || GNULIB_defined_EOVERFLOW \
+ || GNULIB_defined_ENOTSUP \
+ || GNULIB_defined_ENETRESET \
+ || GNULIB_defined_ECONNABORTED \
+ || GNULIB_defined_ESTALE \
+ || GNULIB_defined_EDQUOT \
+ || GNULIB_defined_ECANCELED \
+ || GNULIB_defined_EOWNERDEAD \
+ || GNULIB_defined_ENOTRECOVERABLE \
+ || GNULIB_defined_EILSEQ
+extern const char *strerror_override (int errnum) _GL_ATTRIBUTE_CONST;
+# else
+# define strerror_override(ignored) NULL
+# define GNULIB_defined_strerror_override_macro 1
+# endif
+
+#endif /* _GL_STRERROR_OVERRIDE_H */
diff --git a/gl/lib/strerror.c b/gl/lib/strerror.c
new file mode 100644
index 0000000..67c5216
--- /dev/null
+++ b/gl/lib/strerror.c
@@ -0,0 +1,71 @@
+/* strerror.c --- POSIX compatible system error routine
+
+ Copyright (C) 2007-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <string.h>
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "intprops.h"
+#include "strerror-override.h"
+#include "verify.h"
+
+/* Use the system functions, not the gnulib overrides in this file. */
+#undef sprintf
+
+char *
+strerror (int n)
+#undef strerror
+{
+ static char buf[STACKBUF_LEN];
+ size_t len;
+
+ /* Cast away const, due to the historical signature of strerror;
+ callers should not be modifying the string. */
+ const char *msg = strerror_override (n);
+ if (msg)
+ return (char *) msg;
+
+ msg = strerror (n);
+
+ /* Our strerror_r implementation might use the system's strerror
+ buffer, so all other clients of strerror have to see the error
+ copied into a buffer that we manage. This is not thread-safe,
+ even if the system strerror is, but portable programs shouldn't
+ be using strerror if they care about thread-safety. */
+ if (!msg || !*msg)
+ {
+ static char const fmt[] = "Unknown error %d";
+ verify (sizeof buf >= sizeof (fmt) + INT_STRLEN_BOUND (n));
+ sprintf (buf, fmt, n);
+ errno = EINVAL;
+ return buf;
+ }
+
+ /* Fix STACKBUF_LEN if this ever aborts. */
+ len = strlen (msg);
+ if (sizeof buf <= len)
+ abort ();
+
+ memcpy (buf, msg, len + 1);
+ return buf;
+}
diff --git a/gl/lib/string.in.h b/gl/lib/string.in.h
new file mode 100644
index 0000000..3996da9
--- /dev/null
+++ b/gl/lib/string.in.h
@@ -0,0 +1,1296 @@
+/* A GNU-like <string.h>.
+
+ Copyright (C) 1995-1996, 2001-2022 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 2.1 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 __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined _GL_ALREADY_INCLUDING_STRING_H
+/* Special invocation convention:
+ - On OS X/NetBSD we have a sequence of nested includes
+ <string.h> -> <strings.h> -> "string.h"
+ In this situation system _chk variants due to -D_FORTIFY_SOURCE
+ might be used after any replacements defined here. */
+
+#@INCLUDE_NEXT@ @NEXT_STRING_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_STRING_H
+
+#define _GL_ALREADY_INCLUDING_STRING_H
+
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_STRING_H@
+
+#undef _GL_ALREADY_INCLUDING_STRING_H
+
+#ifndef _@GUARD_PREFIX@_STRING_H
+#define _@GUARD_PREFIX@_STRING_H
+
+/* NetBSD 5.0 mis-defines NULL. */
+#include <stddef.h>
+
+/* MirBSD defines mbslen as a macro. */
+#if @GNULIB_MBSLEN@ && defined __MirBSD__
+# include <wchar.h>
+#endif
+
+/* NetBSD 5.0 declares strsignal in <unistd.h>, not in <string.h>. */
+/* But in any case avoid namespace pollution on glibc systems. */
+#if (@GNULIB_STRSIGNAL@ || defined GNULIB_POSIXCHECK) && defined __NetBSD__ \
+ && ! defined __GLIBC__
+# include <unistd.h>
+#endif
+
+/* AIX 7.2 declares ffsl and ffsll in <strings.h>, not in <string.h>. */
+/* But in any case avoid namespace pollution on glibc systems. */
+#if ((@GNULIB_FFSL@ || @GNULIB_FFSLL@ || defined GNULIB_POSIXCHECK) \
+ && defined _AIX) \
+ && ! defined __GLIBC__
+# include <strings.h>
+#endif
+
+/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
+ that can be freed by passing them as the Ith argument to the
+ function F. */
+#ifndef _GL_ATTRIBUTE_DEALLOC
+# if __GNUC__ >= 11
+# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
+# else
+# define _GL_ATTRIBUTE_DEALLOC(f, i)
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that
+ can be freed via 'free'; it can be used only after declaring 'free'. */
+/* Applies to: functions. Cannot be used on inline functions. */
+#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
+# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
+#endif
+
+/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
+ allocated memory. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_MALLOC
+# if __GNUC__ >= 3 || defined __clang__
+# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+# else
+# define _GL_ATTRIBUTE_MALLOC
+# endif
+#endif
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The attribute __pure__ was added in gcc 2.96. */
+#ifndef _GL_ATTRIBUTE_PURE
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+# define _GL_ATTRIBUTE_PURE /* empty */
+# endif
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* Make _GL_ATTRIBUTE_DEALLOC_FREE work, even though <stdlib.h> may not have
+ been included yet. */
+#if @GNULIB_FREE_POSIX@
+# if (@REPLACE_FREE@ && !defined free \
+ && !(defined __cplusplus && defined GNULIB_NAMESPACE))
+/* We can't do '#define free rpl_free' here. */
+_GL_EXTERN_C void rpl_free (void *);
+# undef _GL_ATTRIBUTE_DEALLOC_FREE
+# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (rpl_free, 1)
+# else
+# if defined _MSC_VER && !defined free
+_GL_EXTERN_C
+# if defined _DLL
+ __declspec (dllimport)
+# endif
+ void __cdecl free (void *);
+# else
+# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
+_GL_EXTERN_C void free (void *) throw ();
+# else
+_GL_EXTERN_C void free (void *);
+# endif
+# endif
+# endif
+#else
+# if defined _MSC_VER && !defined free
+_GL_EXTERN_C
+# if defined _DLL
+ __declspec (dllimport)
+# endif
+ void __cdecl free (void *);
+# else
+# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
+_GL_EXTERN_C void free (void *) throw ();
+# else
+_GL_EXTERN_C void free (void *);
+# endif
+# endif
+#endif
+
+/* Clear a block of memory. The compiler will not delete a call to
+ this function, even if the block is dead after the call. */
+#if @GNULIB_EXPLICIT_BZERO@
+# if ! @HAVE_EXPLICIT_BZERO@
+_GL_FUNCDECL_SYS (explicit_bzero, void,
+ (void *__dest, size_t __n) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (explicit_bzero, void, (void *__dest, size_t __n));
+_GL_CXXALIASWARN (explicit_bzero);
+#elif defined GNULIB_POSIXCHECK
+# undef explicit_bzero
+# if HAVE_RAW_DECL_EXPLICIT_BZERO
+_GL_WARN_ON_USE (explicit_bzero, "explicit_bzero is unportable - "
+ "use gnulib module explicit_bzero for portability");
+# endif
+#endif
+
+/* Find the index of the least-significant set bit. */
+#if @GNULIB_FFSL@
+# if !@HAVE_FFSL@
+_GL_FUNCDECL_SYS (ffsl, int, (long int i));
+# endif
+_GL_CXXALIAS_SYS (ffsl, int, (long int i));
+_GL_CXXALIASWARN (ffsl);
+#elif defined GNULIB_POSIXCHECK
+# undef ffsl
+# if HAVE_RAW_DECL_FFSL
+_GL_WARN_ON_USE (ffsl, "ffsl is not portable - use the ffsl module");
+# endif
+#endif
+
+
+/* Find the index of the least-significant set bit. */
+#if @GNULIB_FFSLL@
+# if @REPLACE_FFSLL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define ffsll rpl_ffsll
+# endif
+_GL_FUNCDECL_RPL (ffsll, int, (long long int i));
+_GL_CXXALIAS_RPL (ffsll, int, (long long int i));
+# else
+# if !@HAVE_FFSLL@
+_GL_FUNCDECL_SYS (ffsll, int, (long long int i));
+# endif
+_GL_CXXALIAS_SYS (ffsll, int, (long long int i));
+# endif
+_GL_CXXALIASWARN (ffsll);
+#elif defined GNULIB_POSIXCHECK
+# undef ffsll
+# if HAVE_RAW_DECL_FFSLL
+_GL_WARN_ON_USE (ffsll, "ffsll is not portable - use the ffsll module");
+# endif
+#endif
+
+
+#if @GNULIB_MDA_MEMCCPY@
+/* On native Windows, map 'memccpy' to '_memccpy', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::memccpy always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef memccpy
+# define memccpy _memccpy
+# endif
+_GL_CXXALIAS_MDA (memccpy, void *,
+ (void *dest, const void *src, int c, size_t n));
+# else
+_GL_CXXALIAS_SYS (memccpy, void *,
+ (void *dest, const void *src, int c, size_t n));
+# endif
+_GL_CXXALIASWARN (memccpy);
+#endif
+
+
+/* Return the first instance of C within N bytes of S, or NULL. */
+#if @GNULIB_MEMCHR@
+# if @REPLACE_MEMCHR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef memchr
+# define memchr rpl_memchr
+# endif
+_GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n));
+# else
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C" { const void * std::memchr (const void *, int, size_t); }
+ extern "C++" { void * std::memchr (void *, int, size_t); } */
+_GL_CXXALIAS_SYS_CAST2 (memchr,
+ void *, (void const *__s, int __c, size_t __n),
+ void const *, (void const *__s, int __c, size_t __n));
+# endif
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \
+ || defined __clang__)
+_GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n) throw ());
+_GL_CXXALIASWARN1 (memchr, void const *,
+ (void const *__s, int __c, size_t __n) throw ());
+# elif __GLIBC__ >= 2
+_GL_CXXALIASWARN (memchr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef memchr
+/* Assume memchr is always declared. */
+_GL_WARN_ON_USE (memchr, "memchr has platform-specific bugs - "
+ "use gnulib module memchr for portability" );
+#endif
+
+/* Return the first occurrence of NEEDLE in HAYSTACK. */
+#if @GNULIB_MEMMEM@
+# if @REPLACE_MEMMEM@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define memmem rpl_memmem
+# endif
+_GL_FUNCDECL_RPL (memmem, void *,
+ (void const *__haystack, size_t __haystack_len,
+ void const *__needle, size_t __needle_len)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 3)));
+_GL_CXXALIAS_RPL (memmem, void *,
+ (void const *__haystack, size_t __haystack_len,
+ void const *__needle, size_t __needle_len));
+# else
+# if ! @HAVE_DECL_MEMMEM@
+_GL_FUNCDECL_SYS (memmem, void *,
+ (void const *__haystack, size_t __haystack_len,
+ void const *__needle, size_t __needle_len)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 3)));
+# endif
+_GL_CXXALIAS_SYS (memmem, void *,
+ (void const *__haystack, size_t __haystack_len,
+ void const *__needle, size_t __needle_len));
+# endif
+_GL_CXXALIASWARN (memmem);
+#elif defined GNULIB_POSIXCHECK
+# undef memmem
+# if HAVE_RAW_DECL_MEMMEM
+_GL_WARN_ON_USE (memmem, "memmem is unportable and often quadratic - "
+ "use gnulib module memmem-simple for portability, "
+ "and module memmem for speed" );
+# endif
+#endif
+
+/* Copy N bytes of SRC to DEST, return pointer to bytes after the
+ last written byte. */
+#if @GNULIB_MEMPCPY@
+# if ! @HAVE_MEMPCPY@
+_GL_FUNCDECL_SYS (mempcpy, void *,
+ (void *restrict __dest, void const *restrict __src,
+ size_t __n)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (mempcpy, void *,
+ (void *restrict __dest, void const *restrict __src,
+ size_t __n));
+_GL_CXXALIASWARN (mempcpy);
+#elif defined GNULIB_POSIXCHECK
+# undef mempcpy
+# if HAVE_RAW_DECL_MEMPCPY
+_GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - "
+ "use gnulib module mempcpy for portability");
+# endif
+#endif
+
+/* Search backwards through a block for a byte (specified as an int). */
+#if @GNULIB_MEMRCHR@
+# if ! @HAVE_DECL_MEMRCHR@
+_GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" { const void * std::memrchr (const void *, int, size_t); }
+ extern "C++" { void * std::memrchr (void *, int, size_t); } */
+_GL_CXXALIAS_SYS_CAST2 (memrchr,
+ void *, (void const *, int, size_t),
+ void const *, (void const *, int, size_t));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \
+ || defined __clang__)
+_GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t) throw ());
+_GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t) throw ());
+# else
+_GL_CXXALIASWARN (memrchr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef memrchr
+# if HAVE_RAW_DECL_MEMRCHR
+_GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
+ "use gnulib module memrchr for portability");
+# endif
+#endif
+
+/* Find the first occurrence of C in S. More efficient than
+ memchr(S,C,N), at the expense of undefined behavior if C does not
+ occur within N bytes. */
+#if @GNULIB_RAWMEMCHR@
+# if ! @HAVE_RAWMEMCHR@
+_GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" { const void * std::rawmemchr (const void *, int); }
+ extern "C++" { void * std::rawmemchr (void *, int); } */
+_GL_CXXALIAS_SYS_CAST2 (rawmemchr,
+ void *, (void const *__s, int __c_in),
+ void const *, (void const *__s, int __c_in));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \
+ || defined __clang__)
+_GL_CXXALIASWARN1 (rawmemchr, void *, (void *__s, int __c_in) throw ());
+_GL_CXXALIASWARN1 (rawmemchr, void const *,
+ (void const *__s, int __c_in) throw ());
+# else
+_GL_CXXALIASWARN (rawmemchr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef rawmemchr
+# if HAVE_RAW_DECL_RAWMEMCHR
+_GL_WARN_ON_USE (rawmemchr, "rawmemchr is unportable - "
+ "use gnulib module rawmemchr for portability");
+# endif
+#endif
+
+/* Copy SRC to DST, returning the address of the terminating '\0' in DST. */
+#if @GNULIB_STPCPY@
+# if ! @HAVE_STPCPY@
+_GL_FUNCDECL_SYS (stpcpy, char *,
+ (char *restrict __dst, char const *restrict __src)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (stpcpy, char *,
+ (char *restrict __dst, char const *restrict __src));
+_GL_CXXALIASWARN (stpcpy);
+#elif defined GNULIB_POSIXCHECK
+# undef stpcpy
+# if HAVE_RAW_DECL_STPCPY
+_GL_WARN_ON_USE (stpcpy, "stpcpy is unportable - "
+ "use gnulib module stpcpy for portability");
+# endif
+#endif
+
+/* Copy no more than N bytes of SRC to DST, returning a pointer past the
+ last non-NUL byte written into DST. */
+#if @GNULIB_STPNCPY@
+# if @REPLACE_STPNCPY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef stpncpy
+# define stpncpy rpl_stpncpy
+# endif
+_GL_FUNCDECL_RPL (stpncpy, char *,
+ (char *restrict __dst, char const *restrict __src,
+ size_t __n)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (stpncpy, char *,
+ (char *restrict __dst, char const *restrict __src,
+ size_t __n));
+# else
+# if ! @HAVE_STPNCPY@
+_GL_FUNCDECL_SYS (stpncpy, char *,
+ (char *restrict __dst, char const *restrict __src,
+ size_t __n)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (stpncpy, char *,
+ (char *restrict __dst, char const *restrict __src,
+ size_t __n));
+# endif
+_GL_CXXALIASWARN (stpncpy);
+#elif defined GNULIB_POSIXCHECK
+# undef stpncpy
+# if HAVE_RAW_DECL_STPNCPY
+_GL_WARN_ON_USE (stpncpy, "stpncpy is unportable - "
+ "use gnulib module stpncpy for portability");
+# endif
+#endif
+
+#if defined GNULIB_POSIXCHECK
+/* strchr() does not work with multibyte strings if the locale encoding is
+ GB18030 and the character to be searched is a digit. */
+# undef strchr
+/* Assume strchr is always declared. */
+_GL_WARN_ON_USE_CXX (strchr,
+ const char *, char *, (const char *, int),
+ "strchr cannot work correctly on character strings "
+ "in some multibyte locales - "
+ "use mbschr if you care about internationalization");
+#endif
+
+/* Find the first occurrence of C in S or the final NUL byte. */
+#if @GNULIB_STRCHRNUL@
+# if @REPLACE_STRCHRNUL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strchrnul rpl_strchrnul
+# endif
+_GL_FUNCDECL_RPL (strchrnul, char *, (const char *__s, int __c_in)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strchrnul, char *,
+ (const char *str, int ch));
+# else
+# if ! @HAVE_STRCHRNUL@
+_GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" { const char * std::strchrnul (const char *, int); }
+ extern "C++" { char * std::strchrnul (char *, int); } */
+_GL_CXXALIAS_SYS_CAST2 (strchrnul,
+ char *, (char const *__s, int __c_in),
+ char const *, (char const *__s, int __c_in));
+# endif
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \
+ || defined __clang__)
+_GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in) throw ());
+_GL_CXXALIASWARN1 (strchrnul, char const *,
+ (char const *__s, int __c_in) throw ());
+# else
+_GL_CXXALIASWARN (strchrnul);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strchrnul
+# if HAVE_RAW_DECL_STRCHRNUL
+_GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - "
+ "use gnulib module strchrnul for portability");
+# endif
+#endif
+
+/* Duplicate S, returning an identical malloc'd string. */
+#if @GNULIB_STRDUP@
+# if @REPLACE_STRDUP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strdup
+# define strdup rpl_strdup
+# endif
+_GL_FUNCDECL_RPL (strdup, char *,
+ (char const *__s)
+ _GL_ARG_NONNULL ((1))
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+_GL_CXXALIAS_RPL (strdup, char *, (char const *__s));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strdup
+# define strdup _strdup
+# endif
+_GL_CXXALIAS_MDA (strdup, char *, (char const *__s));
+# else
+# if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup
+ /* strdup exists as a function and as a macro. Get rid of the macro. */
+# undef strdup
+# endif
+# if (!@HAVE_DECL_STRDUP@ || __GNUC__ >= 11) && !defined strdup
+_GL_FUNCDECL_SYS (strdup, char *,
+ (char const *__s)
+ _GL_ARG_NONNULL ((1))
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+_GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
+# endif
+_GL_CXXALIASWARN (strdup);
+#else
+# if __GNUC__ >= 11 && !defined strdup
+/* For -Wmismatched-dealloc: Associate strdup with free or rpl_free. */
+_GL_FUNCDECL_SYS (strdup, char *,
+ (char const *__s)
+ _GL_ARG_NONNULL ((1))
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef strdup
+# if HAVE_RAW_DECL_STRDUP
+_GL_WARN_ON_USE (strdup, "strdup is unportable - "
+ "use gnulib module strdup for portability");
+# endif
+# elif @GNULIB_MDA_STRDUP@
+/* On native Windows, map 'creat' to '_creat', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::strdup always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strdup
+# define strdup _strdup
+# endif
+_GL_CXXALIAS_MDA (strdup, char *, (char const *__s));
+# else
+# if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup
+# undef strdup
+# endif
+_GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
+# endif
+_GL_CXXALIASWARN (strdup);
+# endif
+#endif
+
+/* Append no more than N characters from SRC onto DEST. */
+#if @GNULIB_STRNCAT@
+# if @REPLACE_STRNCAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strncat
+# define strncat rpl_strncat
+# endif
+_GL_FUNCDECL_RPL (strncat, char *,
+ (char *restrict dest, const char *restrict src, size_t n)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (strncat, char *,
+ (char *restrict dest, const char *restrict src, size_t n));
+# else
+_GL_CXXALIAS_SYS (strncat, char *,
+ (char *restrict dest, const char *restrict src, size_t n));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (strncat);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strncat
+# if HAVE_RAW_DECL_STRNCAT
+_GL_WARN_ON_USE (strncat, "strncat is unportable - "
+ "use gnulib module strncat for portability");
+# endif
+#endif
+
+/* Return a newly allocated copy of at most N bytes of STRING. */
+#if @GNULIB_STRNDUP@
+# if @REPLACE_STRNDUP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strndup
+# define strndup rpl_strndup
+# endif
+_GL_FUNCDECL_RPL (strndup, char *,
+ (char const *__s, size_t __n)
+ _GL_ARG_NONNULL ((1))
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+_GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n));
+# else
+# if !@HAVE_DECL_STRNDUP@ || (__GNUC__ >= 11 && !defined strndup)
+_GL_FUNCDECL_SYS (strndup, char *,
+ (char const *__s, size_t __n)
+ _GL_ARG_NONNULL ((1))
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+_GL_CXXALIAS_SYS (strndup, char *, (char const *__s, size_t __n));
+# endif
+_GL_CXXALIASWARN (strndup);
+#else
+# if __GNUC__ >= 11 && !defined strndup
+/* For -Wmismatched-dealloc: Associate strndup with free or rpl_free. */
+_GL_FUNCDECL_SYS (strndup, char *,
+ (char const *__s, size_t __n)
+ _GL_ARG_NONNULL ((1))
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef strndup
+# if HAVE_RAW_DECL_STRNDUP
+_GL_WARN_ON_USE (strndup, "strndup is unportable - "
+ "use gnulib module strndup for portability");
+# endif
+# endif
+#endif
+
+/* Find the length (number of bytes) of STRING, but scan at most
+ MAXLEN bytes. If no '\0' terminator is found in that many bytes,
+ return MAXLEN. */
+#if @GNULIB_STRNLEN@
+# if @REPLACE_STRNLEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strnlen
+# define strnlen rpl_strnlen
+# endif
+_GL_FUNCDECL_RPL (strnlen, size_t, (char const *__s, size_t __maxlen)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__s, size_t __maxlen));
+# else
+# if ! @HAVE_DECL_STRNLEN@
+_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__s, size_t __maxlen)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strnlen, size_t, (char const *__s, size_t __maxlen));
+# endif
+_GL_CXXALIASWARN (strnlen);
+#elif defined GNULIB_POSIXCHECK
+# undef strnlen
+# if HAVE_RAW_DECL_STRNLEN
+_GL_WARN_ON_USE (strnlen, "strnlen is unportable - "
+ "use gnulib module strnlen for portability");
+# endif
+#endif
+
+#if defined GNULIB_POSIXCHECK
+/* strcspn() assumes the second argument is a list of single-byte characters.
+ Even in this simple case, it does not work with multibyte strings if the
+ locale encoding is GB18030 and one of the characters to be searched is a
+ digit. */
+# undef strcspn
+/* Assume strcspn is always declared. */
+_GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on character strings "
+ "in multibyte locales - "
+ "use mbscspn if you care about internationalization");
+#endif
+
+/* Find the first occurrence in S of any character in ACCEPT. */
+#if @GNULIB_STRPBRK@
+# if ! @HAVE_STRPBRK@
+_GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C" { const char * strpbrk (const char *, const char *); }
+ extern "C++" { char * strpbrk (char *, const char *); } */
+_GL_CXXALIAS_SYS_CAST2 (strpbrk,
+ char *, (char const *__s, char const *__accept),
+ const char *, (char const *__s, char const *__accept));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \
+ || defined __clang__)
+_GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept) throw ());
+_GL_CXXALIASWARN1 (strpbrk, char const *,
+ (char const *__s, char const *__accept) throw ());
+# elif __GLIBC__ >= 2
+_GL_CXXALIASWARN (strpbrk);
+# endif
+# if defined GNULIB_POSIXCHECK
+/* strpbrk() assumes the second argument is a list of single-byte characters.
+ Even in this simple case, it does not work with multibyte strings if the
+ locale encoding is GB18030 and one of the characters to be searched is a
+ digit. */
+# undef strpbrk
+_GL_WARN_ON_USE_CXX (strpbrk,
+ const char *, char *, (const char *, const char *),
+ "strpbrk cannot work correctly on character strings "
+ "in multibyte locales - "
+ "use mbspbrk if you care about internationalization");
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strpbrk
+# if HAVE_RAW_DECL_STRPBRK
+_GL_WARN_ON_USE_CXX (strpbrk,
+ const char *, char *, (const char *, const char *),
+ "strpbrk is unportable - "
+ "use gnulib module strpbrk for portability");
+# endif
+#endif
+
+#if defined GNULIB_POSIXCHECK
+/* strspn() assumes the second argument is a list of single-byte characters.
+ Even in this simple case, it cannot work with multibyte strings. */
+# undef strspn
+/* Assume strspn is always declared. */
+_GL_WARN_ON_USE (strspn, "strspn cannot work correctly on character strings "
+ "in multibyte locales - "
+ "use mbsspn if you care about internationalization");
+#endif
+
+#if defined GNULIB_POSIXCHECK
+/* strrchr() does not work with multibyte strings if the locale encoding is
+ GB18030 and the character to be searched is a digit. */
+# undef strrchr
+/* Assume strrchr is always declared. */
+_GL_WARN_ON_USE_CXX (strrchr,
+ const char *, char *, (const char *, int),
+ "strrchr cannot work correctly on character strings "
+ "in some multibyte locales - "
+ "use mbsrchr if you care about internationalization");
+#endif
+
+/* Search the next delimiter (char listed in DELIM) starting at *STRINGP.
+ If one is found, overwrite it with a NUL, and advance *STRINGP
+ to point to the next char after it. Otherwise, set *STRINGP to NULL.
+ If *STRINGP was already NULL, nothing happens.
+ Return the old value of *STRINGP.
+
+ This is a variant of strtok() that is multithread-safe and supports
+ empty fields.
+
+ Caveat: It modifies the original string.
+ Caveat: These functions cannot be used on constant strings.
+ Caveat: The identity of the delimiting character is lost.
+ Caveat: It doesn't work with multibyte strings unless all of the delimiter
+ characters are ASCII characters < 0x30.
+
+ See also strtok_r(). */
+#if @GNULIB_STRSEP@
+# if ! @HAVE_STRSEP@
+_GL_FUNCDECL_SYS (strsep, char *,
+ (char **restrict __stringp, char const *restrict __delim)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (strsep, char *,
+ (char **restrict __stringp, char const *restrict __delim));
+_GL_CXXALIASWARN (strsep);
+# if defined GNULIB_POSIXCHECK
+# undef strsep
+_GL_WARN_ON_USE (strsep, "strsep cannot work correctly on character strings "
+ "in multibyte locales - "
+ "use mbssep if you care about internationalization");
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strsep
+# if HAVE_RAW_DECL_STRSEP
+_GL_WARN_ON_USE (strsep, "strsep is unportable - "
+ "use gnulib module strsep for portability");
+# endif
+#endif
+
+#if @GNULIB_STRSTR@
+# if @REPLACE_STRSTR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strstr rpl_strstr
+# endif
+_GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle));
+# else
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" { const char * strstr (const char *, const char *); }
+ extern "C++" { char * strstr (char *, const char *); } */
+_GL_CXXALIAS_SYS_CAST2 (strstr,
+ char *, (const char *haystack, const char *needle),
+ const char *, (const char *haystack, const char *needle));
+# endif
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \
+ || defined __clang__)
+_GL_CXXALIASWARN1 (strstr, char *,
+ (char *haystack, const char *needle) throw ());
+_GL_CXXALIASWARN1 (strstr, const char *,
+ (const char *haystack, const char *needle) throw ());
+# elif __GLIBC__ >= 2
+_GL_CXXALIASWARN (strstr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+/* strstr() does not work with multibyte strings if the locale encoding is
+ different from UTF-8:
+ POSIX says that it operates on "strings", and "string" in POSIX is defined
+ as a sequence of bytes, not of characters. */
+# undef strstr
+/* Assume strstr is always declared. */
+_GL_WARN_ON_USE (strstr, "strstr is quadratic on many systems, and cannot "
+ "work correctly on character strings in most "
+ "multibyte locales - "
+ "use mbsstr if you care about internationalization, "
+ "or use strstr if you care about speed");
+#endif
+
+/* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive
+ comparison. */
+#if @GNULIB_STRCASESTR@
+# if @REPLACE_STRCASESTR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strcasestr rpl_strcasestr
+# endif
+_GL_FUNCDECL_RPL (strcasestr, char *,
+ (const char *haystack, const char *needle)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (strcasestr, char *,
+ (const char *haystack, const char *needle));
+# else
+# if ! @HAVE_STRCASESTR@
+_GL_FUNCDECL_SYS (strcasestr, char *,
+ (const char *haystack, const char *needle)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" { const char * strcasestr (const char *, const char *); }
+ extern "C++" { char * strcasestr (char *, const char *); } */
+_GL_CXXALIAS_SYS_CAST2 (strcasestr,
+ char *, (const char *haystack, const char *needle),
+ const char *, (const char *haystack, const char *needle));
+# endif
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \
+ || defined __clang__)
+_GL_CXXALIASWARN1 (strcasestr, char *,
+ (char *haystack, const char *needle) throw ());
+_GL_CXXALIASWARN1 (strcasestr, const char *,
+ (const char *haystack, const char *needle) throw ());
+# else
+_GL_CXXALIASWARN (strcasestr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+/* strcasestr() does not work with multibyte strings:
+ It is a glibc extension, and glibc implements it only for unibyte
+ locales. */
+# undef strcasestr
+# if HAVE_RAW_DECL_STRCASESTR
+_GL_WARN_ON_USE (strcasestr, "strcasestr does work correctly on character "
+ "strings in multibyte locales - "
+ "use mbscasestr if you care about "
+ "internationalization, or use c-strcasestr if you want "
+ "a locale independent function");
+# endif
+#endif
+
+/* Parse S into tokens separated by characters in DELIM.
+ If S is NULL, the saved pointer in SAVE_PTR is used as
+ the next starting point. For example:
+ char s[] = "-abc-=-def";
+ char *sp;
+ x = strtok_r(s, "-", &sp); // x = "abc", sp = "=-def"
+ x = strtok_r(NULL, "-=", &sp); // x = "def", sp = NULL
+ x = strtok_r(NULL, "=", &sp); // x = NULL
+ // s = "abc\0-def\0"
+
+ This is a variant of strtok() that is multithread-safe.
+
+ For the POSIX documentation for this function, see:
+ https://pubs.opengroup.org/onlinepubs/9699919799/functions/strtok.html
+
+ Caveat: It modifies the original string.
+ Caveat: These functions cannot be used on constant strings.
+ Caveat: The identity of the delimiting character is lost.
+ Caveat: It doesn't work with multibyte strings unless all of the delimiter
+ characters are ASCII characters < 0x30.
+
+ See also strsep(). */
+#if @GNULIB_STRTOK_R@
+# if @REPLACE_STRTOK_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strtok_r
+# define strtok_r rpl_strtok_r
+# endif
+_GL_FUNCDECL_RPL (strtok_r, char *,
+ (char *restrict s, char const *restrict delim,
+ char **restrict save_ptr)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (strtok_r, char *,
+ (char *restrict s, char const *restrict delim,
+ char **restrict save_ptr));
+# else
+# if @UNDEFINE_STRTOK_R@ || defined GNULIB_POSIXCHECK
+# undef strtok_r
+# endif
+# if ! @HAVE_DECL_STRTOK_R@
+_GL_FUNCDECL_SYS (strtok_r, char *,
+ (char *restrict s, char const *restrict delim,
+ char **restrict save_ptr)
+ _GL_ARG_NONNULL ((2, 3)));
+# endif
+_GL_CXXALIAS_SYS (strtok_r, char *,
+ (char *restrict s, char const *restrict delim,
+ char **restrict save_ptr));
+# endif
+_GL_CXXALIASWARN (strtok_r);
+# if defined GNULIB_POSIXCHECK
+_GL_WARN_ON_USE (strtok_r, "strtok_r cannot work correctly on character "
+ "strings in multibyte locales - "
+ "use mbstok_r if you care about internationalization");
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strtok_r
+# if HAVE_RAW_DECL_STRTOK_R
+_GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - "
+ "use gnulib module strtok_r for portability");
+# endif
+#endif
+
+
+/* The following functions are not specified by POSIX. They are gnulib
+ extensions. */
+
+#if @GNULIB_MBSLEN@
+/* Return the number of multibyte characters in the character string STRING.
+ This considers multibyte characters, unlike strlen, which counts bytes. */
+# ifdef __MirBSD__ /* MirBSD defines mbslen as a macro. Override it. */
+# undef mbslen
+# endif
+# if @HAVE_MBSLEN@ /* AIX, OSF/1, MirBSD define mbslen already in libc. */
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define mbslen rpl_mbslen
+# endif
+_GL_FUNCDECL_RPL (mbslen, size_t, (const char *string)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mbslen, size_t, (const char *string));
+# else
+_GL_FUNCDECL_SYS (mbslen, size_t, (const char *string)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (mbslen, size_t, (const char *string));
+# endif
+_GL_CXXALIASWARN (mbslen);
+#endif
+
+#if @GNULIB_MBSNLEN@
+/* Return the number of multibyte characters in the character string starting
+ at STRING and ending at STRING + LEN. */
+_GL_EXTERN_C size_t mbsnlen (const char *string, size_t len)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1));
+#endif
+
+#if @GNULIB_MBSCHR@
+/* Locate the first single-byte character C in the character string STRING,
+ and return a pointer to it. Return NULL if C is not found in STRING.
+ Unlike strchr(), this function works correctly in multibyte locales with
+ encodings such as GB18030. */
+# if defined __hpux
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define mbschr rpl_mbschr /* avoid collision with HP-UX function */
+# endif
+_GL_FUNCDECL_RPL (mbschr, char *, (const char *string, int c)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mbschr, char *, (const char *string, int c));
+# else
+_GL_FUNCDECL_SYS (mbschr, char *, (const char *string, int c)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (mbschr, char *, (const char *string, int c));
+# endif
+_GL_CXXALIASWARN (mbschr);
+#endif
+
+#if @GNULIB_MBSRCHR@
+/* Locate the last single-byte character C in the character string STRING,
+ and return a pointer to it. Return NULL if C is not found in STRING.
+ Unlike strrchr(), this function works correctly in multibyte locales with
+ encodings such as GB18030. */
+# if defined __hpux || defined __INTERIX
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define mbsrchr rpl_mbsrchr /* avoid collision with system function */
+# endif
+_GL_FUNCDECL_RPL (mbsrchr, char *, (const char *string, int c)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mbsrchr, char *, (const char *string, int c));
+# else
+_GL_FUNCDECL_SYS (mbsrchr, char *, (const char *string, int c)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (mbsrchr, char *, (const char *string, int c));
+# endif
+_GL_CXXALIASWARN (mbsrchr);
+#endif
+
+#if @GNULIB_MBSSTR@
+/* Find the first occurrence of the character string NEEDLE in the character
+ string HAYSTACK. Return NULL if NEEDLE is not found in HAYSTACK.
+ Unlike strstr(), this function works correctly in multibyte locales with
+ encodings different from UTF-8. */
+_GL_EXTERN_C char * mbsstr (const char *haystack, const char *needle)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSCASECMP@
+/* Compare the character strings S1 and S2, ignoring case, returning less than,
+ equal to or greater than zero if S1 is lexicographically less than, equal to
+ or greater than S2.
+ Note: This function may, in multibyte locales, return 0 for strings of
+ different lengths!
+ Unlike strcasecmp(), this function works correctly in multibyte locales. */
+_GL_EXTERN_C int mbscasecmp (const char *s1, const char *s2)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSNCASECMP@
+/* Compare the initial segment of the character string S1 consisting of at most
+ N characters with the initial segment of the character string S2 consisting
+ of at most N characters, ignoring case, returning less than, equal to or
+ greater than zero if the initial segment of S1 is lexicographically less
+ than, equal to or greater than the initial segment of S2.
+ Note: This function may, in multibyte locales, return 0 for initial segments
+ of different lengths!
+ Unlike strncasecmp(), this function works correctly in multibyte locales.
+ But beware that N is not a byte count but a character count! */
+_GL_EXTERN_C int mbsncasecmp (const char *s1, const char *s2, size_t n)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSPCASECMP@
+/* Compare the initial segment of the character string STRING consisting of
+ at most mbslen (PREFIX) characters with the character string PREFIX,
+ ignoring case. If the two match, return a pointer to the first byte
+ after this prefix in STRING. Otherwise, return NULL.
+ Note: This function may, in multibyte locales, return non-NULL if STRING
+ is of smaller length than PREFIX!
+ Unlike strncasecmp(), this function works correctly in multibyte
+ locales. */
+_GL_EXTERN_C char * mbspcasecmp (const char *string, const char *prefix)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSCASESTR@
+/* Find the first occurrence of the character string NEEDLE in the character
+ string HAYSTACK, using case-insensitive comparison.
+ Note: This function may, in multibyte locales, return success even if
+ strlen (haystack) < strlen (needle) !
+ Unlike strcasestr(), this function works correctly in multibyte locales. */
+_GL_EXTERN_C char * mbscasestr (const char *haystack, const char *needle)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSCSPN@
+/* Find the first occurrence in the character string STRING of any character
+ in the character string ACCEPT. Return the number of bytes from the
+ beginning of the string to this occurrence, or to the end of the string
+ if none exists.
+ Unlike strcspn(), this function works correctly in multibyte locales. */
+_GL_EXTERN_C size_t mbscspn (const char *string, const char *accept)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSPBRK@
+/* Find the first occurrence in the character string STRING of any character
+ in the character string ACCEPT. Return the pointer to it, or NULL if none
+ exists.
+ Unlike strpbrk(), this function works correctly in multibyte locales. */
+# if defined __hpux
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */
+# endif
+_GL_FUNCDECL_RPL (mbspbrk, char *, (const char *string, const char *accept)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (mbspbrk, char *, (const char *string, const char *accept));
+# else
+_GL_FUNCDECL_SYS (mbspbrk, char *, (const char *string, const char *accept)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_SYS (mbspbrk, char *, (const char *string, const char *accept));
+# endif
+_GL_CXXALIASWARN (mbspbrk);
+#endif
+
+#if @GNULIB_MBSSPN@
+/* Find the first occurrence in the character string STRING of any character
+ not in the character string REJECT. Return the number of bytes from the
+ beginning of the string to this occurrence, or to the end of the string
+ if none exists.
+ Unlike strspn(), this function works correctly in multibyte locales. */
+_GL_EXTERN_C size_t mbsspn (const char *string, const char *reject)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSSEP@
+/* Search the next delimiter (multibyte character listed in the character
+ string DELIM) starting at the character string *STRINGP.
+ If one is found, overwrite it with a NUL, and advance *STRINGP to point
+ to the next multibyte character after it. Otherwise, set *STRINGP to NULL.
+ If *STRINGP was already NULL, nothing happens.
+ Return the old value of *STRINGP.
+
+ This is a variant of mbstok_r() that supports empty fields.
+
+ Caveat: It modifies the original string.
+ Caveat: These functions cannot be used on constant strings.
+ Caveat: The identity of the delimiting character is lost.
+
+ See also mbstok_r(). */
+_GL_EXTERN_C char * mbssep (char **stringp, const char *delim)
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSTOK_R@
+/* Parse the character string STRING into tokens separated by characters in
+ the character string DELIM.
+ If STRING is NULL, the saved pointer in SAVE_PTR is used as
+ the next starting point. For example:
+ char s[] = "-abc-=-def";
+ char *sp;
+ x = mbstok_r(s, "-", &sp); // x = "abc", sp = "=-def"
+ x = mbstok_r(NULL, "-=", &sp); // x = "def", sp = NULL
+ x = mbstok_r(NULL, "=", &sp); // x = NULL
+ // s = "abc\0-def\0"
+
+ Caveat: It modifies the original string.
+ Caveat: These functions cannot be used on constant strings.
+ Caveat: The identity of the delimiting character is lost.
+
+ See also mbssep(). */
+_GL_EXTERN_C char * mbstok_r (char *restrict string, const char *delim,
+ char **save_ptr)
+ _GL_ARG_NONNULL ((2, 3));
+#endif
+
+/* Map any int, typically from errno, into an error message. */
+#if @GNULIB_STRERROR@
+# if @REPLACE_STRERROR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strerror
+# define strerror rpl_strerror
+# endif
+_GL_FUNCDECL_RPL (strerror, char *, (int));
+_GL_CXXALIAS_RPL (strerror, char *, (int));
+# else
+_GL_CXXALIAS_SYS (strerror, char *, (int));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (strerror);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strerror
+/* Assume strerror is always declared. */
+_GL_WARN_ON_USE (strerror, "strerror is unportable - "
+ "use gnulib module strerror to guarantee non-NULL result");
+#endif
+
+/* Map any int, typically from errno, into an error message. Multithread-safe.
+ Uses the POSIX declaration, not the glibc declaration. */
+#if @GNULIB_STRERROR_R@
+# if @REPLACE_STRERROR_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strerror_r
+# define strerror_r rpl_strerror_r
+# endif
+_GL_FUNCDECL_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen));
+# else
+# if !@HAVE_DECL_STRERROR_R@
+_GL_FUNCDECL_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen));
+# endif
+# if @HAVE_DECL_STRERROR_R@
+_GL_CXXALIASWARN (strerror_r);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strerror_r
+# if HAVE_RAW_DECL_STRERROR_R
+_GL_WARN_ON_USE (strerror_r, "strerror_r is unportable - "
+ "use gnulib module strerror_r-posix for portability");
+# endif
+#endif
+
+/* Return the name of the system error code ERRNUM. */
+#if @GNULIB_STRERRORNAME_NP@
+# if @REPLACE_STRERRORNAME_NP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strerrorname_np
+# define strerrorname_np rpl_strerrorname_np
+# endif
+_GL_FUNCDECL_RPL (strerrorname_np, const char *, (int errnum));
+_GL_CXXALIAS_RPL (strerrorname_np, const char *, (int errnum));
+# else
+# if !@HAVE_STRERRORNAME_NP@
+_GL_FUNCDECL_SYS (strerrorname_np, const char *, (int errnum));
+# endif
+_GL_CXXALIAS_SYS (strerrorname_np, const char *, (int errnum));
+# endif
+_GL_CXXALIASWARN (strerrorname_np);
+#elif defined GNULIB_POSIXCHECK
+# undef strerrorname_np
+# if HAVE_RAW_DECL_STRERRORNAME_NP
+_GL_WARN_ON_USE (strerrorname_np, "strerrorname_np is unportable - "
+ "use gnulib module strerrorname_np for portability");
+# endif
+#endif
+
+/* Return an abbreviation string for the signal number SIG. */
+#if @GNULIB_SIGABBREV_NP@
+# if ! @HAVE_SIGABBREV_NP@
+_GL_FUNCDECL_SYS (sigabbrev_np, const char *, (int sig));
+# endif
+_GL_CXXALIAS_SYS (sigabbrev_np, const char *, (int sig));
+_GL_CXXALIASWARN (sigabbrev_np);
+#elif defined GNULIB_POSIXCHECK
+# undef sigabbrev_np
+# if HAVE_RAW_DECL_SIGABBREV_NP
+_GL_WARN_ON_USE (sigabbrev_np, "sigabbrev_np is unportable - "
+ "use gnulib module sigabbrev_np for portability");
+# endif
+#endif
+
+/* Return an English description string for the signal number SIG. */
+#if @GNULIB_SIGDESCR_NP@
+# if ! @HAVE_SIGDESCR_NP@
+_GL_FUNCDECL_SYS (sigdescr_np, const char *, (int sig));
+# endif
+_GL_CXXALIAS_SYS (sigdescr_np, const char *, (int sig));
+_GL_CXXALIASWARN (sigdescr_np);
+#elif defined GNULIB_POSIXCHECK
+# undef sigdescr_np
+# if HAVE_RAW_DECL_SIGDESCR_NP
+_GL_WARN_ON_USE (sigdescr_np, "sigdescr_np is unportable - "
+ "use gnulib module sigdescr_np for portability");
+# endif
+#endif
+
+#if @GNULIB_STRSIGNAL@
+# if @REPLACE_STRSIGNAL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strsignal rpl_strsignal
+# endif
+_GL_FUNCDECL_RPL (strsignal, char *, (int __sig));
+_GL_CXXALIAS_RPL (strsignal, char *, (int __sig));
+# else
+# if ! @HAVE_DECL_STRSIGNAL@
+_GL_FUNCDECL_SYS (strsignal, char *, (int __sig));
+# endif
+/* Need to cast, because on Cygwin 1.5.x systems, the return type is
+ 'const char *'. */
+_GL_CXXALIAS_SYS_CAST (strsignal, char *, (int __sig));
+# endif
+_GL_CXXALIASWARN (strsignal);
+#elif defined GNULIB_POSIXCHECK
+# undef strsignal
+# if HAVE_RAW_DECL_STRSIGNAL
+_GL_WARN_ON_USE (strsignal, "strsignal is unportable - "
+ "use gnulib module strsignal for portability");
+# endif
+#endif
+
+#if @GNULIB_STRVERSCMP@
+# if !@HAVE_STRVERSCMP@
+_GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (strverscmp, int, (const char *, const char *));
+_GL_CXXALIASWARN (strverscmp);
+#elif defined GNULIB_POSIXCHECK
+# undef strverscmp
+# if HAVE_RAW_DECL_STRVERSCMP
+_GL_WARN_ON_USE (strverscmp, "strverscmp is unportable - "
+ "use gnulib module strverscmp for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_STRING_H */
+#endif /* _@GUARD_PREFIX@_STRING_H */
+#endif
diff --git a/gl/lib/strings.in.h b/gl/lib/strings.in.h
new file mode 100644
index 0000000..2c31d2e
--- /dev/null
+++ b/gl/lib/strings.in.h
@@ -0,0 +1,122 @@
+/* A substitute <strings.h>.
+
+ Copyright (C) 2007-2022 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 2.1 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/>. */
+
+#ifndef _@GUARD_PREFIX@_STRINGS_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* Minix 3.1.8 has a bug: <sys/types.h> must be included before <strings.h>.
+ But avoid namespace pollution on glibc systems. */
+#if defined __minix && !defined __GLIBC__
+# include <sys/types.h>
+#endif
+
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_STRINGS_H@
+# @INCLUDE_NEXT@ @NEXT_STRINGS_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_STRINGS_H
+#define _@GUARD_PREFIX@_STRINGS_H
+
+#if ! @HAVE_DECL_STRNCASECMP@
+/* Get size_t. */
+# include <stddef.h>
+#endif
+
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /* Find the index of the least-significant set bit. */
+#if @GNULIB_FFS@
+# if !@HAVE_FFS@
+_GL_FUNCDECL_SYS (ffs, int, (int i));
+# endif
+_GL_CXXALIAS_SYS (ffs, int, (int i));
+_GL_CXXALIASWARN (ffs);
+#elif defined GNULIB_POSIXCHECK
+# undef ffs
+# if HAVE_RAW_DECL_FFS
+_GL_WARN_ON_USE (ffs, "ffs is not portable - use the ffs module");
+# endif
+#endif
+
+/* Compare strings S1 and S2, ignoring case, returning less than, equal to or
+ greater than zero if S1 is lexicographically less than, equal to or greater
+ than S2.
+ Note: This function does not work in multibyte locales. */
+#if ! @HAVE_STRCASECMP@
+extern int strcasecmp (char const *s1, char const *s2)
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+#if defined GNULIB_POSIXCHECK
+/* strcasecmp() does not work with multibyte strings:
+ POSIX says that it operates on "strings", and "string" in POSIX is defined
+ as a sequence of bytes, not of characters. */
+# undef strcasecmp
+# if HAVE_RAW_DECL_STRCASECMP
+_GL_WARN_ON_USE (strcasecmp, "strcasecmp cannot work correctly on character "
+ "strings in multibyte locales - "
+ "use mbscasecmp if you care about "
+ "internationalization, or use c_strcasecmp , "
+ "gnulib module c-strcase) if you want a locale "
+ "independent function");
+# endif
+#endif
+
+/* Compare no more than N bytes of strings S1 and S2, ignoring case,
+ returning less than, equal to or greater than zero if S1 is
+ lexicographically less than, equal to or greater than S2.
+ Note: This function cannot work correctly in multibyte locales. */
+#if ! @HAVE_DECL_STRNCASECMP@
+extern int strncasecmp (char const *s1, char const *s2, size_t n)
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+#if defined GNULIB_POSIXCHECK
+/* strncasecmp() does not work with multibyte strings:
+ POSIX says that it operates on "strings", and "string" in POSIX is defined
+ as a sequence of bytes, not of characters. */
+# undef strncasecmp
+# if HAVE_RAW_DECL_STRNCASECMP
+_GL_WARN_ON_USE (strncasecmp, "strncasecmp cannot work correctly on character "
+ "strings in multibyte locales - "
+ "use mbsncasecmp or mbspcasecmp if you care about "
+ "internationalization, or use c_strncasecmp , "
+ "gnulib module c-strcase) if you want a locale "
+ "independent function");
+# endif
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _@GUARD_PREFIX@_STRING_H */
+#endif /* _@GUARD_PREFIX@_STRING_H */
diff --git a/gl/lib/stripslash.c b/gl/lib/stripslash.c
new file mode 100644
index 0000000..aee89b7
--- /dev/null
+++ b/gl/lib/stripslash.c
@@ -0,0 +1,45 @@
+/* stripslash.c -- remove redundant trailing slashes from a file name
+
+ Copyright (C) 1990, 2001, 2003-2006, 2009-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+#include "dirname.h"
+
+/* Remove trailing slashes from FILE. Return true if a trailing slash
+ was removed. This is useful when using file name completion from a
+ shell that adds a "/" after directory names (such as tcsh and
+ bash), because on symlinks to directories, several system calls
+ have different semantics according to whether a trailing slash is
+ present. */
+
+bool
+strip_trailing_slashes (char *file)
+{
+ char *base = last_component (file);
+ char *base_lim;
+ bool had_slash;
+
+ /* last_component returns "" for file system roots, but we need to turn
+ "///" into "/". */
+ if (! *base)
+ base = file;
+ base_lim = base + base_len (base);
+ had_slash = (*base_lim != '\0');
+ *base_lim = '\0';
+ return had_slash;
+}
diff --git a/gl/lib/strncasecmp.c b/gl/lib/strncasecmp.c
new file mode 100644
index 0000000..35d215b
--- /dev/null
+++ b/gl/lib/strncasecmp.c
@@ -0,0 +1,62 @@
+/* strncasecmp.c -- case insensitive string comparator
+ Copyright (C) 1998-1999, 2005-2007, 2009-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <string.h>
+
+#include <ctype.h>
+#include <limits.h>
+
+#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
+
+/* Compare no more than N bytes of strings S1 and S2, ignoring case,
+ returning less than, equal to or greater than zero if S1 is
+ lexicographically less than, equal to or greater than S2.
+ Note: This function cannot work correctly in multibyte locales. */
+
+int
+strncasecmp (const char *s1, const char *s2, size_t n)
+{
+ register const unsigned char *p1 = (const unsigned char *) s1;
+ register const unsigned char *p2 = (const unsigned char *) s2;
+ unsigned char c1, c2;
+
+ if (p1 == p2 || n == 0)
+ return 0;
+
+ do
+ {
+ c1 = TOLOWER (*p1);
+ c2 = TOLOWER (*p2);
+
+ if (--n == 0 || c1 == '\0')
+ break;
+
+ ++p1;
+ ++p2;
+ }
+ while (c1 == c2);
+
+ if (UCHAR_MAX <= INT_MAX)
+ return c1 - c2;
+ else
+ /* On machines where 'char' and 'int' are types of the same size, the
+ difference of two 'unsigned char' values - including the sign bit -
+ doesn't fit in an 'int'. */
+ return _GL_CMP (c1, c2);
+}
diff --git a/gl/lib/strndup.c b/gl/lib/strndup.c
new file mode 100644
index 0000000..72cbc57
--- /dev/null
+++ b/gl/lib/strndup.c
@@ -0,0 +1,36 @@
+/* A replacement function, for systems that lack strndup.
+
+ Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+#include <string.h>
+
+#include <stdlib.h>
+
+char *
+strndup (char const *s, size_t n)
+{
+ size_t len = strnlen (s, n);
+ char *new = malloc (len + 1);
+
+ if (new == NULL)
+ return NULL;
+
+ new[len] = '\0';
+ return memcpy (new, s, len);
+}
diff --git a/gl/lib/strnlen.c b/gl/lib/strnlen.c
new file mode 100644
index 0000000..c8fc69c
--- /dev/null
+++ b/gl/lib/strnlen.c
@@ -0,0 +1,30 @@
+/* Find the length of STRING, but scan at most MAXLEN characters.
+ Copyright (C) 2005-2007, 2009-2022 Free Software Foundation, Inc.
+ Written by Simon Josefsson.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+#include <string.h>
+
+/* Find the length of STRING, but scan at most MAXLEN characters.
+ If no '\0' terminator is found in that many characters, return MAXLEN. */
+
+size_t
+strnlen (const char *string, size_t maxlen)
+{
+ const char *end = memchr (string, '\0', maxlen);
+ return end ? (size_t) (end - string) : maxlen;
+}
diff --git a/gl/lib/strnlen1.c b/gl/lib/strnlen1.c
new file mode 100644
index 0000000..c22f96b
--- /dev/null
+++ b/gl/lib/strnlen1.c
@@ -0,0 +1,35 @@
+/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
+ Copyright (C) 2005-2006, 2009-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "strnlen1.h"
+
+#include <string.h>
+
+/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
+ If no '\0' terminator is found in that many characters, return MAXLEN. */
+/* This is the same as strnlen (string, maxlen - 1) + 1. */
+size_t
+strnlen1 (const char *string, size_t maxlen)
+{
+ const char *end = (const char *) memchr (string, '\0', maxlen);
+ if (end != NULL)
+ return end - string + 1;
+ else
+ return maxlen;
+}
diff --git a/gl/lib/strnlen1.h b/gl/lib/strnlen1.h
new file mode 100644
index 0000000..d45dd91
--- /dev/null
+++ b/gl/lib/strnlen1.h
@@ -0,0 +1,40 @@
+/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
+ Copyright (C) 2005, 2009-2022 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 2.1 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/>. */
+
+#ifndef _STRNLEN1_H
+#define _STRNLEN1_H
+
+#include <stddef.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
+ If no '\0' terminator is found in that many characters, return MAXLEN. */
+/* This is the same as strnlen (string, maxlen - 1) + 1. */
+extern size_t strnlen1 (const char *string, size_t maxlen)
+ _GL_ATTRIBUTE_PURE;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _STRNLEN1_H */
diff --git a/gl/lib/strsep.c b/gl/lib/strsep.c
new file mode 100644
index 0000000..c05d7eb
--- /dev/null
+++ b/gl/lib/strsep.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 2004, 2007, 2009-2022 Free Software Foundation, Inc.
+
+ Written by Yoann Vandoorselaere <yoann@prelude-ids.org>.
+
+ 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 2.1 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/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Specification. */
+#include <string.h>
+
+char *
+strsep (char **stringp, const char *delim)
+{
+ char *start = *stringp;
+ char *ptr;
+
+ if (start == NULL)
+ return NULL;
+
+ /* Optimize the case of no delimiters. */
+ if (delim[0] == '\0')
+ {
+ *stringp = NULL;
+ return start;
+ }
+
+ /* Optimize the case of one delimiter. */
+ if (delim[1] == '\0')
+ ptr = strchr (start, delim[0]);
+ else
+ /* The general case. */
+ ptr = strpbrk (start, delim);
+ if (ptr == NULL)
+ {
+ *stringp = NULL;
+ return start;
+ }
+
+ *ptr = '\0';
+ *stringp = ptr + 1;
+
+ return start;
+}
diff --git a/gl/lib/sys_file.in.h b/gl/lib/sys_file.in.h
new file mode 100644
index 0000000..1ae54f8
--- /dev/null
+++ b/gl/lib/sys_file.in.h
@@ -0,0 +1,63 @@
+/* Provide a more complete sys/file.h.
+
+ Copyright (C) 2007-2022 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 2.1 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 Richard W.M. Jones. */
+
+#ifndef _@GUARD_PREFIX@_SYS_FILE_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_SYS_FILE_H@
+# @INCLUDE_NEXT@ @NEXT_SYS_FILE_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_SYS_FILE_H
+#define _@GUARD_PREFIX@_SYS_FILE_H
+
+#ifndef LOCK_SH
+/* Operations for the 'flock' call (same as Linux kernel constants). */
+# define LOCK_SH 1 /* Shared lock. */
+# define LOCK_EX 2 /* Exclusive lock. */
+# define LOCK_UN 8 /* Unlock. */
+
+/* Can be OR'd in to one of the above. */
+# define LOCK_NB 4 /* Don't block when locking. */
+#endif
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+#if @GNULIB_FLOCK@
+/* Apply or remove advisory locks on an open file.
+ Return 0 if successful, otherwise -1 and errno set. */
+# if !@HAVE_FLOCK@
+extern int flock (int fd, int operation);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef flock
+# if HAVE_RAW_DECL_FLOCK
+_GL_WARN_ON_USE (flock, "flock is unportable - "
+ "use gnulib module flock for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_SYS_FILE_H */
+#endif /* _@GUARD_PREFIX@_SYS_FILE_H */
diff --git a/gl/lib/sys_ioctl.in.h b/gl/lib/sys_ioctl.in.h
new file mode 100644
index 0000000..7f1cdc8
--- /dev/null
+++ b/gl/lib/sys_ioctl.in.h
@@ -0,0 +1,79 @@
+/* Substitute for and wrapper around <sys/ioctl.h>.
+ Copyright (C) 2008-2022 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 2.1 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/>. */
+
+#ifndef _@GUARD_PREFIX@_SYS_IOCTL_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_SYS_IOCTL_H@
+# @INCLUDE_NEXT@ @NEXT_SYS_IOCTL_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_SYS_IOCTL_H
+#define _@GUARD_PREFIX@_SYS_IOCTL_H
+
+/* AIX 5.1 and Solaris 10 declare ioctl() in <unistd.h> and in <stropts.h>,
+ but not in <sys/ioctl.h>.
+ Haiku declares ioctl() in <unistd.h>, but not in <sys/ioctl.h>.
+ But avoid namespace pollution on glibc systems. */
+#ifndef __GLIBC__
+# include <unistd.h>
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+/* Declare overridden functions. */
+
+#if @GNULIB_IOCTL@
+# if @REPLACE_IOCTL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ioctl
+# define ioctl rpl_ioctl
+# endif
+_GL_FUNCDECL_RPL (ioctl, int,
+ (int fd, int request, ... /* {void *,char *} arg */));
+_GL_CXXALIAS_RPL (ioctl, int,
+ (int fd, int request, ... /* {void *,char *} arg */));
+# else
+# if @SYS_IOCTL_H_HAVE_WINSOCK2_H@ || 1
+_GL_FUNCDECL_SYS (ioctl, int,
+ (int fd, int request, ... /* {void *,char *} arg */));
+# endif
+_GL_CXXALIAS_SYS (ioctl, int,
+ (int fd, int request, ... /* {void *,char *} arg */));
+# endif
+_GL_CXXALIASWARN (ioctl);
+#elif @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+# undef ioctl
+# define ioctl ioctl_used_without_requesting_gnulib_module_ioctl
+#elif defined GNULIB_POSIXCHECK
+# undef ioctl
+# if HAVE_RAW_DECL_IOCTL
+_GL_WARN_ON_USE (ioctl, "ioctl does not portably work on sockets - "
+ "use gnulib module ioctl for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_SYS_IOCTL_H */
+#endif /* _@GUARD_PREFIX@_SYS_IOCTL_H */
diff --git a/gl/lib/sys_random.in.h b/gl/lib/sys_random.in.h
new file mode 100644
index 0000000..e730e61
--- /dev/null
+++ b/gl/lib/sys_random.in.h
@@ -0,0 +1,98 @@
+/* Substitute for <sys/random.h>.
+ Copyright (C) 2020-2022 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 2.1 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 __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+# endif
+@PRAGMA_COLUMNS@
+
+#ifndef _@GUARD_PREFIX@_SYS_RANDOM_H
+
+#if @HAVE_SYS_RANDOM_H@
+
+/* On uClibc < 1.0.35, <sys/random.h> assumes prior inclusion of <stddef.h>.
+ Do not use __UCLIBC__ here, as it might not be defined yet.
+ But avoid namespace pollution on glibc systems. */
+# ifndef __GLIBC__
+# include <stddef.h>
+# endif
+/* On Mac OS X 10.5, <sys/random.h> assumes prior inclusion of <sys/types.h>.
+ On Max OS X 10.13, <sys/random.h> assumes prior inclusion of a file that
+ includes <Availability.h>, such as <stdlib.h> or <unistd.h>. */
+# if defined __APPLE__ && defined __MACH__ /* Mac OS X */
+# include <sys/types.h>
+# include <stdlib.h>
+# endif
+
+/* The include_next requires a split double-inclusion guard. */
+# @INCLUDE_NEXT@ @NEXT_SYS_RANDOM_H@
+
+#endif
+
+#ifndef _@GUARD_PREFIX@_SYS_RANDOM_H
+#define _@GUARD_PREFIX@_SYS_RANDOM_H
+
+#include <sys/types.h>
+
+/* Define the GRND_* constants. */
+#ifndef GRND_NONBLOCK
+# define GRND_NONBLOCK 1
+# define GRND_RANDOM 2
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+/* Declare overridden functions. */
+
+
+#if @GNULIB_GETRANDOM@
+/* Fill a buffer with random bytes. */
+# if @REPLACE_GETRANDOM@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getrandom
+# define getrandom rpl_getrandom
+# endif
+_GL_FUNCDECL_RPL (getrandom, ssize_t,
+ (void *buffer, size_t length, unsigned int flags)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (getrandom, ssize_t,
+ (void *buffer, size_t length, unsigned int flags));
+# else
+# if !@HAVE_GETRANDOM@
+_GL_FUNCDECL_SYS (getrandom, ssize_t,
+ (void *buffer, size_t length, unsigned int flags)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (getrandom, ssize_t,
+ (void *buffer, size_t length, unsigned int flags));
+# endif
+_GL_CXXALIASWARN (getrandom);
+#elif defined GNULIB_POSIXCHECK
+# undef getrandom
+# if HAVE_RAW_DECL_GETRANDOM
+_GL_WARN_ON_USE (getrandom, "getrandom is unportable - "
+ "use gnulib module getrandom for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_SYS_RANDOM_H */
+#endif /* _@GUARD_PREFIX@_SYS_RANDOM_H */
diff --git a/gl/lib/sys_select.in.h b/gl/lib/sys_select.in.h
new file mode 100644
index 0000000..2bd0e0f
--- /dev/null
+++ b/gl/lib/sys_select.in.h
@@ -0,0 +1,331 @@
+/* Substitute for <sys/select.h>.
+ Copyright (C) 2007-2022 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 2.1 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 __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+# endif
+@PRAGMA_COLUMNS@
+
+/* On OSF/1 and Solaris 2.6, <sys/types.h> and <sys/time.h>
+ both include <sys/select.h>.
+ On Cygwin and OpenBSD, <sys/time.h> includes <sys/select.h>.
+ Simply delegate to the system's header in this case. */
+#if (@HAVE_SYS_SELECT_H@ \
+ && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H \
+ && ((defined __osf__ && defined _SYS_TYPES_H_ \
+ && defined _OSF_SOURCE) \
+ || (defined __sun && defined _SYS_TYPES_H \
+ && (! (defined _XOPEN_SOURCE || defined _POSIX_C_SOURCE) \
+ || defined __EXTENSIONS__))))
+
+# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H
+# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
+
+#elif (@HAVE_SYS_SELECT_H@ \
+ && (defined _CYGWIN_SYS_TIME_H \
+ || (!defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H \
+ && ((defined __osf__ && defined _SYS_TIME_H_ \
+ && defined _OSF_SOURCE) \
+ || (defined __OpenBSD__ && defined _SYS_TIME_H_) \
+ || (defined __sun && defined _SYS_TIME_H \
+ && (! (defined _XOPEN_SOURCE \
+ || defined _POSIX_C_SOURCE) \
+ || defined __EXTENSIONS__))))))
+
+# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H
+# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
+
+/* On IRIX 6.5, <sys/timespec.h> includes <sys/types.h>, which includes
+ <sys/bsd_types.h>, which includes <sys/select.h>. At this point we cannot
+ include <signal.h>, because that includes <internal/signal_core.h>, which
+ gives a syntax error because <sys/timespec.h> has not been completely
+ processed. Simply delegate to the system's header in this case. */
+#elif @HAVE_SYS_SELECT_H@ && defined __sgi && (defined _SYS_BSD_TYPES_H && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_BSD_TYPES_H)
+
+# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_BSD_TYPES_H
+# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
+
+/* On OpenBSD 5.0, <pthread.h> includes <sys/types.h>, which includes
+ <sys/select.h>. At this point we cannot include <signal.h>, because that
+ includes gnulib's pthread.h override, which gives a syntax error because
+ /usr/include/pthread.h has not been completely processed. Simply delegate
+ to the system's header in this case. */
+#elif @HAVE_SYS_SELECT_H@ && defined __OpenBSD__ && (defined _PTHREAD_H_ && !defined PTHREAD_MUTEX_INITIALIZER)
+
+# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
+
+#else
+
+#ifndef _@GUARD_PREFIX@_SYS_SELECT_H
+
+/* On many platforms, <sys/select.h> assumes prior inclusion of
+ <sys/types.h>. Also, mingw defines sigset_t there, instead of
+ in <signal.h> where it belongs. */
+#include <sys/types.h>
+
+#if @HAVE_SYS_SELECT_H@
+
+/* On OSF/1 4.0, <sys/select.h> provides only a forward declaration
+ of 'struct timeval', and no definition of this type.
+ Also, Mac OS X, AIX, HP-UX, IRIX, Solaris, Interix declare select()
+ in <sys/time.h>.
+ But avoid namespace pollution on glibc systems and "unknown type
+ name" problems on Cygwin. */
+# if !(defined __GLIBC__ || defined __CYGWIN__)
+# include <sys/time.h>
+# endif
+
+/* On AIX 7 and Solaris 10, <sys/select.h> provides an FD_ZERO implementation
+ that relies on memset(), but without including <string.h>.
+ But in any case avoid namespace pollution on glibc systems. */
+# if (defined __OpenBSD__ || defined _AIX || defined __sun || defined __osf__ || defined __BEOS__) \
+ && ! defined __GLIBC__
+# include <string.h>
+# endif
+
+/* The include_next requires a split double-inclusion guard. */
+# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
+
+#endif
+
+/* Get definition of 'sigset_t'.
+ But avoid namespace pollution on glibc systems and "unknown type
+ name" problems on Cygwin.
+ On OS/2 kLIBC, sigset_t is defined in <sys/select.h>, too. In addition,
+ if <sys/param.h> is included, <types.h> -> <sys/types.h> -> <sys/select.h>
+ are included. Then <signal.h> -> <pthread.h> are included by GNULIB. By the
+ way, <pthread.h> requires PAGE_SIZE defined in <sys/param.h>. However,
+ <sys/param.h> has not been processed, yet. As a result, 'PAGE_SIZE'
+ undeclared error occurs in <pthread.h>.
+ Do this after the include_next (for the sake of OpenBSD 5.0) but before
+ the split double-inclusion guard (for the sake of Solaris). */
+#if !((defined __GLIBC__ || defined __CYGWIN__ || defined __KLIBC__) \
+ && !defined __UCLIBC__)
+# include <signal.h>
+#endif
+
+#ifndef _@GUARD_PREFIX@_SYS_SELECT_H
+#define _@GUARD_PREFIX@_SYS_SELECT_H
+
+#if !@HAVE_SYS_SELECT_H@
+/* A platform that lacks <sys/select.h>. */
+/* Get the 'struct timeval' and 'fd_set' types and the FD_* macros
+ on most platforms. */
+# include <sys/time.h>
+/* On HP-UX 11, <sys/time.h> provides an FD_ZERO implementation
+ that relies on memset(), but without including <string.h>. */
+# if defined __hpux
+# include <string.h>
+# endif
+/* On native Windows platforms:
+ Get the 'fd_set' type.
+ Get the close() declaration before we override it. */
+# if @HAVE_WINSOCK2_H@
+# if !defined _GL_INCLUDING_WINSOCK2_H
+# define _GL_INCLUDING_WINSOCK2_H
+# include <winsock2.h>
+# undef _GL_INCLUDING_WINSOCK2_H
+# endif
+# include <io.h>
+# endif
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+/* Fix some definitions from <winsock2.h>. */
+
+#if @HAVE_WINSOCK2_H@
+
+# if !GNULIB_defined_rpl_fd_isset
+
+/* Re-define FD_ISSET to avoid a WSA call while we are not using
+ network sockets. */
+static int
+rpl_fd_isset (SOCKET fd, fd_set * set)
+{
+ u_int i;
+ if (set == NULL)
+ return 0;
+
+ for (i = 0; i < set->fd_count; i++)
+ if (set->fd_array[i] == fd)
+ return 1;
+
+ return 0;
+}
+
+# define GNULIB_defined_rpl_fd_isset 1
+# endif
+
+# undef FD_ISSET
+# define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
+
+#endif
+
+/* Hide some function declarations from <winsock2.h>. */
+
+#if @HAVE_WINSOCK2_H@
+# if !defined _@GUARD_PREFIX@_UNISTD_H
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef close
+# define close close_used_without_including_unistd_h
+# elif !defined __clang__
+ _GL_WARN_ON_USE (close,
+ "close() used without including <unistd.h>");
+# endif
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef gethostname
+# define gethostname gethostname_used_without_including_unistd_h
+# elif !defined __clang__
+ _GL_WARN_ON_USE (gethostname,
+ "gethostname() used without including <unistd.h>");
+# endif
+# endif
+# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef socket
+# define socket socket_used_without_including_sys_socket_h
+# undef connect
+# define connect connect_used_without_including_sys_socket_h
+# undef accept
+# define accept accept_used_without_including_sys_socket_h
+# undef bind
+# define bind bind_used_without_including_sys_socket_h
+# undef getpeername
+# define getpeername getpeername_used_without_including_sys_socket_h
+# undef getsockname
+# define getsockname getsockname_used_without_including_sys_socket_h
+# undef getsockopt
+# define getsockopt getsockopt_used_without_including_sys_socket_h
+# undef listen
+# define listen listen_used_without_including_sys_socket_h
+# undef recv
+# define recv recv_used_without_including_sys_socket_h
+# undef send
+# define send send_used_without_including_sys_socket_h
+# undef recvfrom
+# define recvfrom recvfrom_used_without_including_sys_socket_h
+# undef sendto
+# define sendto sendto_used_without_including_sys_socket_h
+# undef setsockopt
+# define setsockopt setsockopt_used_without_including_sys_socket_h
+# undef shutdown
+# define shutdown shutdown_used_without_including_sys_socket_h
+# elif !defined __clang__
+ _GL_WARN_ON_USE (socket,
+ "socket() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (connect,
+ "connect() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (accept,
+ "accept() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (bind,
+ "bind() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (getpeername,
+ "getpeername() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (getsockname,
+ "getsockname() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (getsockopt,
+ "getsockopt() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (listen,
+ "listen() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (recv,
+ "recv() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (send,
+ "send() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (recvfrom,
+ "recvfrom() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (sendto,
+ "sendto() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (setsockopt,
+ "setsockopt() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (shutdown,
+ "shutdown() used without including <sys/socket.h>");
+# endif
+# endif
+#endif
+
+
+#if @GNULIB_PSELECT@
+# if @REPLACE_PSELECT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pselect
+# define pselect rpl_pselect
+# endif
+_GL_FUNCDECL_RPL (pselect, int,
+ (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
+ struct timespec const *restrict, const sigset_t *restrict));
+_GL_CXXALIAS_RPL (pselect, int,
+ (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
+ struct timespec const *restrict, const sigset_t *restrict));
+# else
+# if !@HAVE_PSELECT@
+_GL_FUNCDECL_SYS (pselect, int,
+ (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
+ struct timespec const *restrict, const sigset_t *restrict));
+# endif
+/* Need to cast, because on AIX 7, the second, third, fourth argument may be
+ void *restrict, void *restrict, void *restrict. */
+_GL_CXXALIAS_SYS_CAST (pselect, int,
+ (int,
+ fd_set *restrict, fd_set *restrict, fd_set *restrict,
+ struct timespec const *restrict,
+ const sigset_t *restrict));
+# endif
+_GL_CXXALIASWARN (pselect);
+#elif defined GNULIB_POSIXCHECK
+# undef pselect
+# if HAVE_RAW_DECL_PSELECT
+_GL_WARN_ON_USE (pselect, "pselect is not portable - "
+ "use gnulib module pselect for portability");
+# endif
+#endif
+
+#if @GNULIB_SELECT@
+# if @REPLACE_SELECT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef select
+# define select rpl_select
+# endif
+_GL_FUNCDECL_RPL (select, int,
+ (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
+ struct timeval *restrict));
+_GL_CXXALIAS_RPL (select, int,
+ (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
+ timeval *restrict));
+# else
+_GL_CXXALIAS_SYS (select, int,
+ (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
+ timeval *restrict));
+# endif
+_GL_CXXALIASWARN (select);
+#elif @HAVE_WINSOCK2_H@
+# undef select
+# define select select_used_without_requesting_gnulib_module_select
+#elif defined GNULIB_POSIXCHECK
+# undef select
+# if HAVE_RAW_DECL_SELECT
+_GL_WARN_ON_USE (select, "select is not always POSIX compliant - "
+ "use gnulib module select for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_SYS_SELECT_H */
+#endif /* _@GUARD_PREFIX@_SYS_SELECT_H */
+#endif /* OSF/1 */
diff --git a/gl/lib/sys_socket.c b/gl/lib/sys_socket.c
new file mode 100644
index 0000000..0bfd60f
--- /dev/null
+++ b/gl/lib/sys_socket.c
@@ -0,0 +1,22 @@
+/* Inline functions for <sys/socket.h>.
+
+ Copyright (C) 2012-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+#define _GL_SYS_SOCKET_INLINE _GL_EXTERN_INLINE
+#include "sys/socket.h"
+typedef int dummy;
diff --git a/gl/lib/sys_socket.in.h b/gl/lib/sys_socket.in.h
new file mode 100644
index 0000000..acdf7ee
--- /dev/null
+++ b/gl/lib/sys_socket.in.h
@@ -0,0 +1,734 @@
+/* Provide a sys/socket header file for systems lacking it (read: MinGW)
+ and for systems where it is incomplete.
+ Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Written by Simon Josefsson.
+
+ 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 2.1 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/>. */
+
+/* This file is supposed to be used on platforms that lack <sys/socket.h>,
+ on platforms where <sys/socket.h> cannot be included standalone, and on
+ platforms where <sys/socket.h> does not provide all necessary definitions.
+ It is intended to provide definitions and prototypes needed by an
+ application. */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined _GL_ALREADY_INCLUDING_SYS_SOCKET_H
+/* Special invocation convention:
+ - On Cygwin 1.5.x we have a sequence of nested includes
+ <sys/socket.h> -> <cygwin/socket.h> -> <asm/socket.h> -> <cygwin/if.h>,
+ and the latter includes <sys/socket.h>. In this situation, the functions
+ are not yet declared, therefore we cannot provide the C++ aliases. */
+
+#@INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_SYS_SOCKET_H
+
+#if @HAVE_SYS_SOCKET_H@
+
+# define _GL_ALREADY_INCLUDING_SYS_SOCKET_H
+
+/* On many platforms, <sys/socket.h> assumes prior inclusion of
+ <sys/types.h>. */
+# include <sys/types.h>
+
+/* On FreeBSD 6.4, <sys/socket.h> defines some macros that assume that NULL
+ is defined. */
+# include <stddef.h>
+
+/* The include_next requires a split double-inclusion guard. */
+# @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@
+
+# undef _GL_ALREADY_INCLUDING_SYS_SOCKET_H
+
+#endif
+
+#ifndef _@GUARD_PREFIX@_SYS_SOCKET_H
+#define _@GUARD_PREFIX@_SYS_SOCKET_H
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GL_SYS_SOCKET_INLINE
+# define _GL_SYS_SOCKET_INLINE _GL_INLINE
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+#if !@HAVE_SA_FAMILY_T@
+# if !GNULIB_defined_sa_family_t
+/* On OS/2 kLIBC, sa_family_t is unsigned char unless TCPV40HDRS is defined. */
+# if !defined __KLIBC__ || defined TCPV40HDRS
+typedef unsigned short sa_family_t;
+# else
+typedef unsigned char sa_family_t;
+# endif
+# define GNULIB_defined_sa_family_t 1
+# endif
+#endif
+
+#if @HAVE_STRUCT_SOCKADDR_STORAGE@
+/* Make the 'struct sockaddr_storage' field 'ss_family' visible on AIX 7.1. */
+# if !@HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@
+# ifndef ss_family
+# define ss_family __ss_family
+# endif
+# endif
+#else
+# include <stdalign.h>
+/* Code taken from glibc sysdeps/unix/sysv/linux/bits/socket.h on
+ 2009-05-08, licensed under LGPLv2.1+, plus portability fixes. */
+# define __ss_aligntype unsigned long int
+# define _SS_SIZE 256
+# define _SS_PADSIZE \
+ (_SS_SIZE - ((sizeof (sa_family_t) >= alignof (__ss_aligntype) \
+ ? sizeof (sa_family_t) \
+ : alignof (__ss_aligntype)) \
+ + sizeof (__ss_aligntype)))
+
+# if !GNULIB_defined_struct_sockaddr_storage
+struct sockaddr_storage
+{
+ sa_family_t ss_family; /* Address family, etc. */
+ __ss_aligntype __ss_align; /* Force desired alignment. */
+ char __ss_padding[_SS_PADSIZE];
+};
+# define GNULIB_defined_struct_sockaddr_storage 1
+# endif
+
+#endif
+
+/* Get struct iovec. */
+/* But avoid namespace pollution on glibc systems. */
+#if ! defined __GLIBC__
+# include <sys/uio.h>
+#endif
+
+#if @HAVE_SYS_SOCKET_H@
+
+/* A platform that has <sys/socket.h>. */
+
+/* For shutdown(). */
+# if !defined SHUT_RD
+# define SHUT_RD 0
+# endif
+# if !defined SHUT_WR
+# define SHUT_WR 1
+# endif
+# if !defined SHUT_RDWR
+# define SHUT_RDWR 2
+# endif
+
+# ifdef __VMS /* OpenVMS */
+# ifndef CMSG_SPACE
+# define CMSG_SPACE(length) _CMSG_SPACE(length)
+# endif
+# ifndef CMSG_LEN
+# define CMSG_LEN(length) _CMSG_LEN(length)
+# endif
+# endif
+
+#else
+
+# ifdef __CYGWIN__
+# error "Cygwin does have a sys/socket.h, doesn't it?!?"
+# endif
+
+/* A platform that lacks <sys/socket.h>.
+
+ Currently only MinGW is supported. See the gnulib manual regarding
+ Windows sockets. MinGW has the header files winsock2.h and
+ ws2tcpip.h that declare the sys/socket.h definitions we need. Note
+ that you can influence which definitions you get by setting the
+ WINVER symbol before including these two files. For example,
+ getaddrinfo is only available if _WIN32_WINNT >= 0x0501 (that
+ symbol is set indirectly through WINVER). You can set this by
+ adding AC_DEFINE(WINVER, 0x0501) to configure.ac. Note that your
+ code may not run on older Windows releases then. My Windows 2000
+ box was not able to run the code, for example. The situation is
+ slightly confusing because
+ <https://docs.microsoft.com/en-us/windows/desktop/api/ws2tcpip/nf-ws2tcpip-getaddrinfo>
+ suggests that getaddrinfo should be available on all Windows
+ releases. */
+
+# if @HAVE_WINSOCK2_H@
+# include <winsock2.h>
+# endif
+# if @HAVE_WS2TCPIP_H@
+# include <ws2tcpip.h>
+# endif
+
+/* For shutdown(). */
+# if !defined SHUT_RD && defined SD_RECEIVE
+# define SHUT_RD SD_RECEIVE
+# endif
+# if !defined SHUT_WR && defined SD_SEND
+# define SHUT_WR SD_SEND
+# endif
+# if !defined SHUT_RDWR && defined SD_BOTH
+# define SHUT_RDWR SD_BOTH
+# endif
+
+# if @HAVE_WINSOCK2_H@
+/* Include headers needed by the emulation code. */
+# include <sys/types.h>
+# include <io.h>
+/* If these headers don't define socklen_t, <config.h> does. */
+# endif
+
+/* Rudimentary 'struct msghdr'; this works as long as you don't try to
+ access msg_control or msg_controllen. */
+struct msghdr {
+ void *msg_name;
+ socklen_t msg_namelen;
+ struct iovec *msg_iov;
+ int msg_iovlen;
+ int msg_flags;
+};
+
+#endif
+
+/* Ensure SO_REUSEPORT is defined. */
+/* For the subtle differences between SO_REUSEPORT and SO_REUSEADDR, see
+ https://stackoverflow.com/questions/14388706/socket-options-so-reuseaddr-and-so-reuseport-how-do-they-differ-do-they-mean-t
+ and https://lwn.net/Articles/542629/
+ */
+#ifndef SO_REUSEPORT
+# define SO_REUSEPORT SO_REUSEADDR
+#endif
+
+/* Fix some definitions from <winsock2.h>. */
+
+#if @HAVE_WINSOCK2_H@
+
+# if !GNULIB_defined_rpl_fd_isset
+
+/* Re-define FD_ISSET to avoid a WSA call while we are not using
+ network sockets. */
+_GL_SYS_SOCKET_INLINE int
+rpl_fd_isset (SOCKET fd, fd_set * set)
+{
+ u_int i;
+ if (set == NULL)
+ return 0;
+
+ for (i = 0; i < set->fd_count; i++)
+ if (set->fd_array[i] == fd)
+ return 1;
+
+ return 0;
+}
+
+# define GNULIB_defined_rpl_fd_isset 1
+# endif
+
+# undef FD_ISSET
+# define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
+
+#endif
+
+/* Hide some function declarations from <winsock2.h>. */
+
+#if @HAVE_WINSOCK2_H@
+# if !defined _@GUARD_PREFIX@_UNISTD_H
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef close
+# define close close_used_without_including_unistd_h
+# elif !defined __clang__
+ _GL_WARN_ON_USE (close,
+ "close() used without including <unistd.h>");
+# endif
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef gethostname
+# define gethostname gethostname_used_without_including_unistd_h
+# else
+ _GL_WARN_ON_USE (gethostname,
+ "gethostname() used without including <unistd.h>");
+# endif
+# endif
+# if !defined _@GUARD_PREFIX@_SYS_SELECT_H
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef select
+# define select select_used_without_including_sys_select_h
+# else
+ _GL_WARN_ON_USE (select,
+ "select() used without including <sys/select.h>");
+# endif
+# endif
+#endif
+
+/* Wrap everything else to use libc file descriptors for sockets. */
+
+#if @GNULIB_SOCKET@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef socket
+# define socket rpl_socket
+# endif
+_GL_FUNCDECL_RPL (socket, int, (int domain, int type, int protocol));
+_GL_CXXALIAS_RPL (socket, int, (int domain, int type, int protocol));
+# else
+_GL_CXXALIAS_SYS (socket, int, (int domain, int type, int protocol));
+# endif
+_GL_CXXALIASWARN (socket);
+#elif @HAVE_WINSOCK2_H@
+# undef socket
+# define socket socket_used_without_requesting_gnulib_module_socket
+#elif defined GNULIB_POSIXCHECK
+# undef socket
+# if HAVE_RAW_DECL_SOCKET
+_GL_WARN_ON_USE (socket, "socket is not always POSIX compliant - "
+ "use gnulib module socket for portability");
+# endif
+#endif
+
+#if @GNULIB_CONNECT@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef connect
+# define connect rpl_connect
+# endif
+_GL_FUNCDECL_RPL (connect, int,
+ (int fd, const struct sockaddr *addr, socklen_t addrlen)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (connect, int,
+ (int fd, const struct sockaddr *addr, socklen_t addrlen));
+# else
+/* Need to cast, because on NonStop Kernel, the third parameter is
+ size_t addrlen. */
+_GL_CXXALIAS_SYS_CAST (connect, int,
+ (int fd,
+ const struct sockaddr *addr, socklen_t addrlen));
+# endif
+_GL_CXXALIASWARN (connect);
+#elif @HAVE_WINSOCK2_H@
+# undef connect
+# define connect socket_used_without_requesting_gnulib_module_connect
+#elif defined GNULIB_POSIXCHECK
+# undef connect
+# if HAVE_RAW_DECL_CONNECT
+_GL_WARN_ON_USE (connect, "connect is not always POSIX compliant - "
+ "use gnulib module connect for portability");
+# endif
+#endif
+
+#if @GNULIB_ACCEPT@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef accept
+# define accept rpl_accept
+# endif
+_GL_FUNCDECL_RPL (accept, int,
+ (int fd,
+ struct sockaddr *restrict addr,
+ socklen_t *restrict addrlen));
+_GL_CXXALIAS_RPL (accept, int,
+ (int fd,
+ struct sockaddr *restrict addr,
+ socklen_t *restrict addrlen));
+# else
+/* Need to cast, because on Solaris 10 systems, the third parameter is
+ void *addrlen. */
+_GL_CXXALIAS_SYS_CAST (accept, int,
+ (int fd,
+ struct sockaddr *restrict addr,
+ socklen_t *restrict addrlen));
+# endif
+_GL_CXXALIASWARN (accept);
+#elif @HAVE_WINSOCK2_H@
+# undef accept
+# define accept accept_used_without_requesting_gnulib_module_accept
+#elif defined GNULIB_POSIXCHECK
+# undef accept
+# if HAVE_RAW_DECL_ACCEPT
+_GL_WARN_ON_USE (accept, "accept is not always POSIX compliant - "
+ "use gnulib module accept for portability");
+# endif
+#endif
+
+#if @GNULIB_BIND@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef bind
+# define bind rpl_bind
+# endif
+_GL_FUNCDECL_RPL (bind, int,
+ (int fd, const struct sockaddr *addr, socklen_t addrlen)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (bind, int,
+ (int fd, const struct sockaddr *addr, socklen_t addrlen));
+# else
+/* Need to cast, because on NonStop Kernel, the third parameter is
+ size_t addrlen. */
+_GL_CXXALIAS_SYS_CAST (bind, int,
+ (int fd,
+ const struct sockaddr *addr, socklen_t addrlen));
+# endif
+_GL_CXXALIASWARN (bind);
+#elif @HAVE_WINSOCK2_H@
+# undef bind
+# define bind bind_used_without_requesting_gnulib_module_bind
+#elif defined GNULIB_POSIXCHECK
+# undef bind
+# if HAVE_RAW_DECL_BIND
+_GL_WARN_ON_USE (bind, "bind is not always POSIX compliant - "
+ "use gnulib module bind for portability");
+# endif
+#endif
+
+#if @GNULIB_GETPEERNAME@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getpeername
+# define getpeername rpl_getpeername
+# endif
+_GL_FUNCDECL_RPL (getpeername, int,
+ (int fd, struct sockaddr *restrict addr,
+ socklen_t *restrict addrlen)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (getpeername, int,
+ (int fd, struct sockaddr *restrict addr,
+ socklen_t *restrict addrlen));
+# else
+/* Need to cast, because on Solaris 10 systems, the third parameter is
+ void *addrlen. */
+_GL_CXXALIAS_SYS_CAST (getpeername, int,
+ (int fd, struct sockaddr *restrict addr,
+ socklen_t *restrict addrlen));
+# endif
+_GL_CXXALIASWARN (getpeername);
+#elif @HAVE_WINSOCK2_H@
+# undef getpeername
+# define getpeername getpeername_used_without_requesting_gnulib_module_getpeername
+#elif defined GNULIB_POSIXCHECK
+# undef getpeername
+# if HAVE_RAW_DECL_GETPEERNAME
+_GL_WARN_ON_USE (getpeername, "getpeername is not always POSIX compliant - "
+ "use gnulib module getpeername for portability");
+# endif
+#endif
+
+#if @GNULIB_GETSOCKNAME@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getsockname
+# define getsockname rpl_getsockname
+# endif
+_GL_FUNCDECL_RPL (getsockname, int,
+ (int fd, struct sockaddr *restrict addr,
+ socklen_t *restrict addrlen)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (getsockname, int,
+ (int fd, struct sockaddr *restrict addr,
+ socklen_t *restrict addrlen));
+# else
+/* Need to cast, because on Solaris 10 systems, the third parameter is
+ void *addrlen. */
+_GL_CXXALIAS_SYS_CAST (getsockname, int,
+ (int fd, struct sockaddr *restrict addr,
+ socklen_t *restrict addrlen));
+# endif
+_GL_CXXALIASWARN (getsockname);
+#elif @HAVE_WINSOCK2_H@
+# undef getsockname
+# define getsockname getsockname_used_without_requesting_gnulib_module_getsockname
+#elif defined GNULIB_POSIXCHECK
+# undef getsockname
+# if HAVE_RAW_DECL_GETSOCKNAME
+_GL_WARN_ON_USE (getsockname, "getsockname is not always POSIX compliant - "
+ "use gnulib module getsockname for portability");
+# endif
+#endif
+
+#if @GNULIB_GETSOCKOPT@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getsockopt
+# define getsockopt rpl_getsockopt
+# endif
+_GL_FUNCDECL_RPL (getsockopt, int,
+ (int fd, int level, int optname,
+ void *restrict optval, socklen_t *restrict optlen)
+ _GL_ARG_NONNULL ((4, 5)));
+_GL_CXXALIAS_RPL (getsockopt, int,
+ (int fd, int level, int optname,
+ void *restrict optval, socklen_t *restrict optlen));
+# else
+/* Need to cast, because on Solaris 10 systems, the fifth parameter is
+ void *optlen. */
+_GL_CXXALIAS_SYS_CAST (getsockopt, int,
+ (int fd, int level, int optname,
+ void *restrict optval, socklen_t *restrict optlen));
+# endif
+_GL_CXXALIASWARN (getsockopt);
+#elif @HAVE_WINSOCK2_H@
+# undef getsockopt
+# define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt
+#elif defined GNULIB_POSIXCHECK
+# undef getsockopt
+# if HAVE_RAW_DECL_GETSOCKOPT
+_GL_WARN_ON_USE (getsockopt, "getsockopt is not always POSIX compliant - "
+ "use gnulib module getsockopt for portability");
+# endif
+#endif
+
+#if @GNULIB_LISTEN@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef listen
+# define listen rpl_listen
+# endif
+_GL_FUNCDECL_RPL (listen, int, (int fd, int backlog));
+_GL_CXXALIAS_RPL (listen, int, (int fd, int backlog));
+# else
+_GL_CXXALIAS_SYS (listen, int, (int fd, int backlog));
+# endif
+_GL_CXXALIASWARN (listen);
+#elif @HAVE_WINSOCK2_H@
+# undef listen
+# define listen listen_used_without_requesting_gnulib_module_listen
+#elif defined GNULIB_POSIXCHECK
+# undef listen
+# if HAVE_RAW_DECL_LISTEN
+_GL_WARN_ON_USE (listen, "listen is not always POSIX compliant - "
+ "use gnulib module listen for portability");
+# endif
+#endif
+
+#if @GNULIB_RECV@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef recv
+# define recv rpl_recv
+# endif
+_GL_FUNCDECL_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags));
+# else
+/* Need to cast, because on HP-UX 11.31 the return type may be
+ int,
+ depending on compiler options. */
+_GL_CXXALIAS_SYS_CAST (recv, ssize_t, (int fd, void *buf, size_t len, int flags));
+# endif
+_GL_CXXALIASWARN (recv);
+#elif @HAVE_WINSOCK2_H@
+# undef recv
+# define recv recv_used_without_requesting_gnulib_module_recv
+#elif defined GNULIB_POSIXCHECK
+# undef recv
+# if HAVE_RAW_DECL_RECV
+_GL_WARN_ON_USE (recv, "recv is not always POSIX compliant - "
+ "use gnulib module recv for portability");
+# endif
+#endif
+
+#if @GNULIB_SEND@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef send
+# define send rpl_send
+# endif
+_GL_FUNCDECL_RPL (send, ssize_t,
+ (int fd, const void *buf, size_t len, int flags)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (send, ssize_t,
+ (int fd, const void *buf, size_t len, int flags));
+# else
+/* Need to cast, because on HP-UX 11.31 the return type may be
+ int,
+ depending on compiler options. */
+_GL_CXXALIAS_SYS_CAST (send, ssize_t,
+ (int fd, const void *buf, size_t len, int flags));
+# endif
+_GL_CXXALIASWARN (send);
+#elif @HAVE_WINSOCK2_H@
+# undef send
+# define send send_used_without_requesting_gnulib_module_send
+#elif defined GNULIB_POSIXCHECK
+# undef send
+# if HAVE_RAW_DECL_SEND
+_GL_WARN_ON_USE (send, "send is not always POSIX compliant - "
+ "use gnulib module send for portability");
+# endif
+#endif
+
+#if @GNULIB_RECVFROM@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef recvfrom
+# define recvfrom rpl_recvfrom
+# endif
+_GL_FUNCDECL_RPL (recvfrom, ssize_t,
+ (int fd, void *restrict buf, size_t len, int flags,
+ struct sockaddr *restrict from,
+ socklen_t *restrict fromlen)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (recvfrom, ssize_t,
+ (int fd, void *restrict buf, size_t len, int flags,
+ struct sockaddr *restrict from,
+ socklen_t *restrict fromlen));
+# else
+/* Need to cast, because on Solaris 10 systems, the sixth parameter is
+ void *fromlen. */
+_GL_CXXALIAS_SYS_CAST (recvfrom, ssize_t,
+ (int fd, void *restrict buf, size_t len, int flags,
+ struct sockaddr *restrict from,
+ socklen_t *restrict fromlen));
+# endif
+_GL_CXXALIASWARN (recvfrom);
+#elif @HAVE_WINSOCK2_H@
+# undef recvfrom
+# define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom
+#elif defined GNULIB_POSIXCHECK
+# undef recvfrom
+# if HAVE_RAW_DECL_RECVFROM
+_GL_WARN_ON_USE (recvfrom, "recvfrom is not always POSIX compliant - "
+ "use gnulib module recvfrom for portability");
+# endif
+#endif
+
+#if @GNULIB_SENDTO@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef sendto
+# define sendto rpl_sendto
+# endif
+_GL_FUNCDECL_RPL (sendto, ssize_t,
+ (int fd, const void *buf, size_t len, int flags,
+ const struct sockaddr *to, socklen_t tolen)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (sendto, ssize_t,
+ (int fd, const void *buf, size_t len, int flags,
+ const struct sockaddr *to, socklen_t tolen));
+# else
+/* Need to cast, because on NonStop Kernel, the sixth parameter is
+ size_t tolen. */
+_GL_CXXALIAS_SYS_CAST (sendto, ssize_t,
+ (int fd, const void *buf, size_t len, int flags,
+ const struct sockaddr *to, socklen_t tolen));
+# endif
+_GL_CXXALIASWARN (sendto);
+#elif @HAVE_WINSOCK2_H@
+# undef sendto
+# define sendto sendto_used_without_requesting_gnulib_module_sendto
+#elif defined GNULIB_POSIXCHECK
+# undef sendto
+# if HAVE_RAW_DECL_SENDTO
+_GL_WARN_ON_USE (sendto, "sendto is not always POSIX compliant - "
+ "use gnulib module sendto for portability");
+# endif
+#endif
+
+#if @GNULIB_SETSOCKOPT@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef setsockopt
+# define setsockopt rpl_setsockopt
+# endif
+_GL_FUNCDECL_RPL (setsockopt, int, (int fd, int level, int optname,
+ const void * optval, socklen_t optlen)
+ _GL_ARG_NONNULL ((4)));
+_GL_CXXALIAS_RPL (setsockopt, int, (int fd, int level, int optname,
+ const void * optval, socklen_t optlen));
+# else
+/* Need to cast, because on NonStop Kernel, the fifth parameter is
+ size_t optlen. */
+_GL_CXXALIAS_SYS_CAST (setsockopt, int,
+ (int fd, int level, int optname,
+ const void * optval, socklen_t optlen));
+# endif
+_GL_CXXALIASWARN (setsockopt);
+#elif @HAVE_WINSOCK2_H@
+# undef setsockopt
+# define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt
+#elif defined GNULIB_POSIXCHECK
+# undef setsockopt
+# if HAVE_RAW_DECL_SETSOCKOPT
+_GL_WARN_ON_USE (setsockopt, "setsockopt is not always POSIX compliant - "
+ "use gnulib module setsockopt for portability");
+# endif
+#endif
+
+#if @GNULIB_SHUTDOWN@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef shutdown
+# define shutdown rpl_shutdown
+# endif
+_GL_FUNCDECL_RPL (shutdown, int, (int fd, int how));
+_GL_CXXALIAS_RPL (shutdown, int, (int fd, int how));
+# else
+_GL_CXXALIAS_SYS (shutdown, int, (int fd, int how));
+# endif
+_GL_CXXALIASWARN (shutdown);
+#elif @HAVE_WINSOCK2_H@
+# undef shutdown
+# define shutdown shutdown_used_without_requesting_gnulib_module_shutdown
+#elif defined GNULIB_POSIXCHECK
+# undef shutdown
+# if HAVE_RAW_DECL_SHUTDOWN
+_GL_WARN_ON_USE (shutdown, "shutdown is not always POSIX compliant - "
+ "use gnulib module shutdown for portability");
+# endif
+#endif
+
+#if @GNULIB_ACCEPT4@
+/* Accept a connection on a socket, with specific opening flags.
+ The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
+ and O_TEXT, O_BINARY (defined in "binary-io.h").
+ See also the Linux man page at
+ <https://www.kernel.org/doc/man-pages/online/pages/man2/accept4.2.html>. */
+# if @HAVE_ACCEPT4@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define accept4 rpl_accept4
+# endif
+_GL_FUNCDECL_RPL (accept4, int,
+ (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
+ int flags));
+_GL_CXXALIAS_RPL (accept4, int,
+ (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
+ int flags));
+# else
+_GL_FUNCDECL_SYS (accept4, int,
+ (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
+ int flags));
+_GL_CXXALIAS_SYS (accept4, int,
+ (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
+ int flags));
+# endif
+_GL_CXXALIASWARN (accept4);
+#elif defined GNULIB_POSIXCHECK
+# undef accept4
+# if HAVE_RAW_DECL_ACCEPT4
+_GL_WARN_ON_USE (accept4, "accept4 is unportable - "
+ "use gnulib module accept4 for portability");
+# endif
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif /* _@GUARD_PREFIX@_SYS_SOCKET_H */
+#endif /* _@GUARD_PREFIX@_SYS_SOCKET_H */
+#endif
diff --git a/gl/lib/sys_stat.in.h b/gl/lib/sys_stat.in.h
new file mode 100644
index 0000000..714c3cb
--- /dev/null
+++ b/gl/lib/sys_stat.in.h
@@ -0,0 +1,954 @@
+/* Provide a more complete sys/stat.h header file.
+ Copyright (C) 2005-2022 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 2.1 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 Eric Blake, Paul Eggert, and Jim Meyering. */
+
+/* This file is supposed to be used on platforms where <sys/stat.h> is
+ incomplete. It is intended to provide definitions and prototypes
+ needed by an application. Start with what the system provides. */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined __need_system_sys_stat_h
+/* Special invocation convention. */
+
+#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_SYS_STAT_H
+
+/* Get nlink_t.
+ May also define off_t to a 64-bit type on native Windows. */
+#include <sys/types.h>
+
+/* Get struct timespec. */
+#include <time.h>
+
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
+
+#ifndef _@GUARD_PREFIX@_SYS_STAT_H
+#define _@GUARD_PREFIX@_SYS_STAT_H
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* Before doing "#define mknod rpl_mknod" below, we need to include all
+ headers that may declare mknod(). OS/2 kLIBC declares mknod() in
+ <unistd.h>, not in <sys/stat.h>. */
+#ifdef __KLIBC__
+# include <unistd.h>
+#endif
+
+/* Before doing "#define mkdir rpl_mkdir" below, we need to include all
+ headers that may declare mkdir(). Native Windows platforms declare mkdir
+ in <io.h> and/or <direct.h>, not in <sys/stat.h>. */
+#if defined _WIN32 && ! defined __CYGWIN__
+# include <io.h> /* mingw32, mingw64 */
+# include <direct.h> /* mingw64, MSVC 9 */
+#endif
+
+/* Native Windows platforms declare umask() in <io.h>. */
+#if 0 && (defined _WIN32 && ! defined __CYGWIN__)
+# include <io.h>
+#endif
+
+/* Large File Support on native Windows. */
+#if @WINDOWS_64_BIT_ST_SIZE@
+# define stat _stati64
+#endif
+
+/* Optionally, override 'struct stat' on native Windows. */
+#if @GNULIB_OVERRIDES_STRUCT_STAT@
+
+# undef stat
+# if @GNULIB_STAT@
+# define stat rpl_stat
+# else
+ /* Provoke a clear link error if stat() is used as a function and
+ module 'stat' is not in use. */
+# define stat stat_used_without_requesting_gnulib_module_stat
+# endif
+
+# if !GNULIB_defined_struct_stat
+struct stat
+{
+ dev_t st_dev;
+ ino_t st_ino;
+ mode_t st_mode;
+ nlink_t st_nlink;
+# if 0
+ uid_t st_uid;
+# else /* uid_t is not defined by default on native Windows. */
+ short st_uid;
+# endif
+# if 0
+ gid_t st_gid;
+# else /* gid_t is not defined by default on native Windows. */
+ short st_gid;
+# endif
+ dev_t st_rdev;
+ off_t st_size;
+# if 0
+ blksize_t st_blksize;
+ blkcnt_t st_blocks;
+# endif
+
+# if @WINDOWS_STAT_TIMESPEC@
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
+# else
+ time_t st_atime;
+ time_t st_mtime;
+ time_t st_ctime;
+# endif
+};
+# if @WINDOWS_STAT_TIMESPEC@
+# define st_atime st_atim.tv_sec
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+ /* Indicator, for gnulib internal purposes. */
+# define _GL_WINDOWS_STAT_TIMESPEC 1
+# endif
+# define GNULIB_defined_struct_stat 1
+# endif
+
+/* Other possible values of st_mode. */
+# if 0
+# define _S_IFBLK 0x6000
+# endif
+# if 0
+# define _S_IFLNK 0xA000
+# endif
+# if 0
+# define _S_IFSOCK 0xC000
+# endif
+
+#endif
+
+#ifndef S_IFIFO
+# ifdef _S_IFIFO
+# define S_IFIFO _S_IFIFO
+# endif
+#endif
+
+#ifndef S_IFMT
+# define S_IFMT 0170000
+#endif
+
+#if STAT_MACROS_BROKEN
+# undef S_ISBLK
+# undef S_ISCHR
+# undef S_ISDIR
+# undef S_ISFIFO
+# undef S_ISLNK
+# undef S_ISNAM
+# undef S_ISMPB
+# undef S_ISMPC
+# undef S_ISNWK
+# undef S_ISREG
+# undef S_ISSOCK
+#endif
+
+#ifndef S_ISBLK
+# ifdef S_IFBLK
+# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
+# else
+# define S_ISBLK(m) 0
+# endif
+#endif
+
+#ifndef S_ISCHR
+# ifdef S_IFCHR
+# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
+# else
+# define S_ISCHR(m) 0
+# endif
+#endif
+
+#ifndef S_ISDIR
+# ifdef S_IFDIR
+# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+# else
+# define S_ISDIR(m) 0
+# endif
+#endif
+
+#ifndef S_ISDOOR /* Solaris 2.5 and up */
+# define S_ISDOOR(m) 0
+#endif
+
+#ifndef S_ISFIFO
+# ifdef S_IFIFO
+# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
+# else
+# define S_ISFIFO(m) 0
+# endif
+#endif
+
+#ifndef S_ISLNK
+# ifdef S_IFLNK
+# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
+# else
+# define S_ISLNK(m) 0
+# endif
+#endif
+
+#ifndef S_ISMPB /* V7 */
+# ifdef S_IFMPB
+# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
+# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
+# else
+# define S_ISMPB(m) 0
+# define S_ISMPC(m) 0
+# endif
+#endif
+
+#ifndef S_ISMPX /* AIX */
+# define S_ISMPX(m) 0
+#endif
+
+#ifndef S_ISNAM /* Xenix */
+# ifdef S_IFNAM
+# define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM)
+# else
+# define S_ISNAM(m) 0
+# endif
+#endif
+
+#ifndef S_ISNWK /* HP/UX */
+# ifdef S_IFNWK
+# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
+# else
+# define S_ISNWK(m) 0
+# endif
+#endif
+
+#ifndef S_ISPORT /* Solaris 10 and up */
+# define S_ISPORT(m) 0
+#endif
+
+#ifndef S_ISREG
+# ifdef S_IFREG
+# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+# else
+# define S_ISREG(m) 0
+# endif
+#endif
+
+#ifndef S_ISSOCK
+# ifdef S_IFSOCK
+# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
+# else
+# define S_ISSOCK(m) 0
+# endif
+#endif
+
+
+#ifndef S_TYPEISMQ
+# define S_TYPEISMQ(p) 0
+#endif
+
+#ifndef S_TYPEISTMO
+# define S_TYPEISTMO(p) 0
+#endif
+
+
+#ifndef S_TYPEISSEM
+# ifdef S_INSEM
+# define S_TYPEISSEM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSEM)
+# else
+# define S_TYPEISSEM(p) 0
+# endif
+#endif
+
+#ifndef S_TYPEISSHM
+# ifdef S_INSHD
+# define S_TYPEISSHM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSHD)
+# else
+# define S_TYPEISSHM(p) 0
+# endif
+#endif
+
+/* high performance ("contiguous data") */
+#ifndef S_ISCTG
+# define S_ISCTG(p) 0
+#endif
+
+/* Cray DMF (data migration facility): off line, with data */
+#ifndef S_ISOFD
+# define S_ISOFD(p) 0
+#endif
+
+/* Cray DMF (data migration facility): off line, with no data */
+#ifndef S_ISOFL
+# define S_ISOFL(p) 0
+#endif
+
+/* 4.4BSD whiteout */
+#ifndef S_ISWHT
+# define S_ISWHT(m) 0
+#endif
+
+/* If any of the following are undefined,
+ define them to their de facto standard values. */
+#if !S_ISUID
+# define S_ISUID 04000
+#endif
+#if !S_ISGID
+# define S_ISGID 02000
+#endif
+
+/* S_ISVTX is a common extension to POSIX. */
+#ifndef S_ISVTX
+# define S_ISVTX 01000
+#endif
+
+#if !S_IRUSR && S_IREAD
+# define S_IRUSR S_IREAD
+#endif
+#if !S_IRUSR
+# define S_IRUSR 00400
+#endif
+#if !S_IRGRP
+# define S_IRGRP (S_IRUSR >> 3)
+#endif
+#if !S_IROTH
+# define S_IROTH (S_IRUSR >> 6)
+#endif
+
+#if !S_IWUSR && S_IWRITE
+# define S_IWUSR S_IWRITE
+#endif
+#if !S_IWUSR
+# define S_IWUSR 00200
+#endif
+#if !S_IWGRP
+# define S_IWGRP (S_IWUSR >> 3)
+#endif
+#if !S_IWOTH
+# define S_IWOTH (S_IWUSR >> 6)
+#endif
+
+#if !S_IXUSR && S_IEXEC
+# define S_IXUSR S_IEXEC
+#endif
+#if !S_IXUSR
+# define S_IXUSR 00100
+#endif
+#if !S_IXGRP
+# define S_IXGRP (S_IXUSR >> 3)
+#endif
+#if !S_IXOTH
+# define S_IXOTH (S_IXUSR >> 6)
+#endif
+
+#if !S_IRWXU
+# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
+#endif
+#if !S_IRWXG
+# define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
+#endif
+#if !S_IRWXO
+# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
+#endif
+
+/* Although S_IXUGO and S_IRWXUGO are not specified by POSIX and are
+ not implemented in GNU/Linux, some Gnulib-using apps use the macros. */
+#if !S_IXUGO
+# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
+#endif
+#ifndef S_IRWXUGO
+# define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
+#endif
+
+/* Macros for futimens and utimensat. */
+#ifndef UTIME_NOW
+# define UTIME_NOW (-1)
+# define UTIME_OMIT (-2)
+#endif
+
+
+#if @GNULIB_CHMOD@
+# if @REPLACE_CHMOD@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef chmod
+# define chmod rpl_chmod
+# endif
+_GL_FUNCDECL_RPL (chmod, int, (const char *filename, mode_t mode)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (chmod, int, (const char *filename, mode_t mode));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef chmod
+# define chmod _chmod
+# endif
+/* Need to cast, because in mingw the last argument is 'int mode'. */
+_GL_CXXALIAS_MDA_CAST (chmod, int, (const char *filename, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (chmod, int, (const char *filename, mode_t mode));
+# endif
+_GL_CXXALIASWARN (chmod);
+#elif defined GNULIB_POSIXCHECK
+# undef chmod
+# if HAVE_RAW_DECL_CHMOD
+_GL_WARN_ON_USE (chmod, "chmod has portability problems - "
+ "use gnulib module chmod for portability");
+# endif
+#elif @GNULIB_MDA_CHMOD@
+/* On native Windows, map 'chmod' to '_chmod', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::chmod always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef chmod
+# define chmod _chmod
+# endif
+/* Need to cast, because in mingw the last argument is 'int mode'. */
+_GL_CXXALIAS_MDA_CAST (chmod, int, (const char *filename, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (chmod, int, (const char *filename, mode_t mode));
+# endif
+_GL_CXXALIASWARN (chmod);
+#endif
+
+
+#if @GNULIB_FCHMODAT@
+# if @REPLACE_FCHMODAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fchmodat
+# define fchmodat rpl_fchmodat
+# endif
+_GL_FUNCDECL_RPL (fchmodat, int,
+ (int fd, char const *file, mode_t mode, int flag)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (fchmodat, int,
+ (int fd, char const *file, mode_t mode, int flag));
+# else
+# if !@HAVE_FCHMODAT@
+_GL_FUNCDECL_SYS (fchmodat, int,
+ (int fd, char const *file, mode_t mode, int flag)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (fchmodat, int,
+ (int fd, char const *file, mode_t mode, int flag));
+# endif
+_GL_CXXALIASWARN (fchmodat);
+#elif defined GNULIB_POSIXCHECK
+# undef fchmodat
+# if HAVE_RAW_DECL_FCHMODAT
+_GL_WARN_ON_USE (fchmodat, "fchmodat is not portable - "
+ "use gnulib module openat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FSTAT@
+# if @REPLACE_FSTAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fstat
+# define fstat rpl_fstat
+# endif
+_GL_FUNCDECL_RPL (fstat, int, (int fd, struct stat *buf) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf));
+# else
+_GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fstat);
+# endif
+#elif @GNULIB_OVERRIDES_STRUCT_STAT@
+# undef fstat
+# define fstat fstat_used_without_requesting_gnulib_module_fstat
+#elif @WINDOWS_64_BIT_ST_SIZE@
+/* Above, we define stat to _stati64. */
+# define fstat _fstati64
+#elif defined GNULIB_POSIXCHECK
+# undef fstat
+# if HAVE_RAW_DECL_FSTAT
+_GL_WARN_ON_USE (fstat, "fstat has portability problems - "
+ "use gnulib module fstat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FSTATAT@
+# if @REPLACE_FSTATAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fstatat
+# define fstatat rpl_fstatat
+# endif
+_GL_FUNCDECL_RPL (fstatat, int,
+ (int fd, char const *restrict name, struct stat *restrict st,
+ int flags)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (fstatat, int,
+ (int fd, char const *restrict name, struct stat *restrict st,
+ int flags));
+# else
+# if !@HAVE_FSTATAT@
+_GL_FUNCDECL_SYS (fstatat, int,
+ (int fd, char const *restrict name, struct stat *restrict st,
+ int flags)
+ _GL_ARG_NONNULL ((2, 3)));
+# endif
+_GL_CXXALIAS_SYS (fstatat, int,
+ (int fd, char const *restrict name, struct stat *restrict st,
+ int flags));
+# endif
+_GL_CXXALIASWARN (fstatat);
+#elif @GNULIB_OVERRIDES_STRUCT_STAT@
+# undef fstatat
+# define fstatat fstatat_used_without_requesting_gnulib_module_fstatat
+#elif defined GNULIB_POSIXCHECK
+# undef fstatat
+# if HAVE_RAW_DECL_FSTATAT
+_GL_WARN_ON_USE (fstatat, "fstatat is not portable - "
+ "use gnulib module openat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FUTIMENS@
+/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our futimens
+ implementation relies on futimesat, which on Solaris 10 makes an invocation
+ to futimens that is meant to invoke the libc's futimens(), not gnulib's
+ futimens(). */
+# if @REPLACE_FUTIMENS@ || (!@HAVE_FUTIMENS@ && defined __sun)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef futimens
+# define futimens rpl_futimens
+# endif
+_GL_FUNCDECL_RPL (futimens, int, (int fd, struct timespec const times[2]));
+_GL_CXXALIAS_RPL (futimens, int, (int fd, struct timespec const times[2]));
+# else
+# if !@HAVE_FUTIMENS@
+_GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2]));
+# endif
+_GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2]));
+# endif
+# if @HAVE_FUTIMENS@
+_GL_CXXALIASWARN (futimens);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef futimens
+# if HAVE_RAW_DECL_FUTIMENS
+_GL_WARN_ON_USE (futimens, "futimens is not portable - "
+ "use gnulib module futimens for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETUMASK@
+# if !@HAVE_GETUMASK@
+_GL_FUNCDECL_SYS (getumask, mode_t, (void));
+# endif
+_GL_CXXALIAS_SYS (getumask, mode_t, (void));
+# if @HAVE_GETUMASK@
+_GL_CXXALIASWARN (getumask);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef getumask
+# if HAVE_RAW_DECL_GETUMASK
+_GL_WARN_ON_USE (getumask, "getumask is not portable - "
+ "use gnulib module getumask for portability");
+# endif
+#endif
+
+
+#if @GNULIB_LCHMOD@
+/* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME
+ denotes a symbolic link. */
+# if !@HAVE_LCHMOD@ || defined __hpux
+_GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode));
+_GL_CXXALIASWARN (lchmod);
+#elif defined GNULIB_POSIXCHECK
+# undef lchmod
+# if HAVE_RAW_DECL_LCHMOD
+_GL_WARN_ON_USE (lchmod, "lchmod is unportable - "
+ "use gnulib module lchmod for portability");
+# endif
+#endif
+
+
+#if @GNULIB_LSTAT@
+# if ! @HAVE_LSTAT@
+/* mingw does not support symlinks, therefore it does not have lstat. But
+ without links, stat does just fine. */
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define lstat stat
+# endif
+_GL_CXXALIAS_RPL_1 (lstat, stat, int,
+ (const char *restrict name, struct stat *restrict buf));
+# elif @REPLACE_LSTAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef lstat
+# define lstat rpl_lstat
+# endif
+_GL_FUNCDECL_RPL (lstat, int,
+ (const char *restrict name, struct stat *restrict buf)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (lstat, int,
+ (const char *restrict name, struct stat *restrict buf));
+# else
+_GL_CXXALIAS_SYS (lstat, int,
+ (const char *restrict name, struct stat *restrict buf));
+# endif
+# if @HAVE_LSTAT@
+_GL_CXXALIASWARN (lstat);
+# endif
+#elif @GNULIB_OVERRIDES_STRUCT_STAT@
+# undef lstat
+# define lstat lstat_used_without_requesting_gnulib_module_lstat
+#elif defined GNULIB_POSIXCHECK
+# undef lstat
+# if HAVE_RAW_DECL_LSTAT
+_GL_WARN_ON_USE (lstat, "lstat is unportable - "
+ "use gnulib module lstat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_MKDIR@
+# if @REPLACE_MKDIR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mkdir
+# define mkdir rpl_mkdir
+# endif
+_GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
+# elif defined _WIN32 && !defined __CYGWIN__
+/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
+ Additionally, it declares _mkdir (and depending on compile flags, an
+ alias mkdir), only in the nonstandard includes <direct.h> and <io.h>,
+ which are included above. */
+# if !GNULIB_defined_rpl_mkdir
+static int
+rpl_mkdir (char const *name, mode_t mode)
+{
+ return _mkdir (name);
+}
+# define GNULIB_defined_rpl_mkdir 1
+# endif
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mkdir
+# define mkdir rpl_mkdir
+# endif
+_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode));
+# endif
+_GL_CXXALIASWARN (mkdir);
+#elif defined GNULIB_POSIXCHECK
+# undef mkdir
+# if HAVE_RAW_DECL_MKDIR
+_GL_WARN_ON_USE (mkdir, "mkdir does not always support two parameters - "
+ "use gnulib module mkdir for portability");
+# endif
+#elif @GNULIB_MDA_MKDIR@
+/* On native Windows, map 'mkdir' to '_mkdir', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::mkdir always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !GNULIB_defined_rpl_mkdir
+static int
+rpl_mkdir (char const *name, mode_t mode)
+{
+ return _mkdir (name);
+}
+# define GNULIB_defined_rpl_mkdir 1
+# endif
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mkdir
+# define mkdir rpl_mkdir
+# endif
+_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode));
+# endif
+_GL_CXXALIASWARN (mkdir);
+#endif
+
+
+#if @GNULIB_MKDIRAT@
+# if !@HAVE_MKDIRAT@
+_GL_FUNCDECL_SYS (mkdirat, int, (int fd, char const *file, mode_t mode)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (mkdirat, int, (int fd, char const *file, mode_t mode));
+_GL_CXXALIASWARN (mkdirat);
+#elif defined GNULIB_POSIXCHECK
+# undef mkdirat
+# if HAVE_RAW_DECL_MKDIRAT
+_GL_WARN_ON_USE (mkdirat, "mkdirat is not portable - "
+ "use gnulib module openat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_MKFIFO@
+# if @REPLACE_MKFIFO@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mkfifo
+# define mkfifo rpl_mkfifo
+# endif
+_GL_FUNCDECL_RPL (mkfifo, int, (char const *file, mode_t mode)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mkfifo, int, (char const *file, mode_t mode));
+# else
+# if !@HAVE_MKFIFO@
+_GL_FUNCDECL_SYS (mkfifo, int, (char const *file, mode_t mode)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (mkfifo, int, (char const *file, mode_t mode));
+# endif
+_GL_CXXALIASWARN (mkfifo);
+#elif defined GNULIB_POSIXCHECK
+# undef mkfifo
+# if HAVE_RAW_DECL_MKFIFO
+_GL_WARN_ON_USE (mkfifo, "mkfifo is not portable - "
+ "use gnulib module mkfifo for portability");
+# endif
+#endif
+
+
+#if @GNULIB_MKFIFOAT@
+# if @REPLACE_MKFIFOAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mkfifoat
+# define mkfifoat rpl_mkfifoat
+# endif
+_GL_FUNCDECL_RPL (mkfifoat, int, (int fd, char const *file, mode_t mode)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (mkfifoat, int, (int fd, char const *file, mode_t mode));
+# else
+# if !@HAVE_MKFIFOAT@
+_GL_FUNCDECL_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode));
+# endif
+_GL_CXXALIASWARN (mkfifoat);
+#elif defined GNULIB_POSIXCHECK
+# undef mkfifoat
+# if HAVE_RAW_DECL_MKFIFOAT
+_GL_WARN_ON_USE (mkfifoat, "mkfifoat is not portable - "
+ "use gnulib module mkfifoat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_MKNOD@
+# if @REPLACE_MKNOD@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mknod
+# define mknod rpl_mknod
+# endif
+_GL_FUNCDECL_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev));
+# else
+# if !@HAVE_MKNOD@
+_GL_FUNCDECL_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev)
+ _GL_ARG_NONNULL ((1)));
+# endif
+/* Need to cast, because on OSF/1 5.1, the third parameter is '...'. */
+_GL_CXXALIAS_SYS_CAST (mknod, int, (char const *file, mode_t mode, dev_t dev));
+# endif
+_GL_CXXALIASWARN (mknod);
+#elif defined GNULIB_POSIXCHECK
+# undef mknod
+# if HAVE_RAW_DECL_MKNOD
+_GL_WARN_ON_USE (mknod, "mknod is not portable - "
+ "use gnulib module mknod for portability");
+# endif
+#endif
+
+
+#if @GNULIB_MKNODAT@
+# if @REPLACE_MKNODAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mknodat
+# define mknodat rpl_mknodat
+# endif
+_GL_FUNCDECL_RPL (mknodat, int,
+ (int fd, char const *file, mode_t mode, dev_t dev)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (mknodat, int,
+ (int fd, char const *file, mode_t mode, dev_t dev));
+# else
+# if !@HAVE_MKNODAT@
+_GL_FUNCDECL_SYS (mknodat, int,
+ (int fd, char const *file, mode_t mode, dev_t dev)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (mknodat, int,
+ (int fd, char const *file, mode_t mode, dev_t dev));
+# endif
+_GL_CXXALIASWARN (mknodat);
+#elif defined GNULIB_POSIXCHECK
+# undef mknodat
+# if HAVE_RAW_DECL_MKNODAT
+_GL_WARN_ON_USE (mknodat, "mknodat is not portable - "
+ "use gnulib module mkfifoat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_STAT@
+# if @REPLACE_STAT@
+# if !@GNULIB_OVERRIDES_STRUCT_STAT@
+ /* We can't use the object-like #define stat rpl_stat, because of
+ struct stat. This means that rpl_stat will not be used if the user
+ does (stat)(a,b). Oh well. */
+# if defined _AIX && defined stat && defined _LARGE_FILES
+ /* With _LARGE_FILES defined, AIX (only) defines stat to stat64,
+ so we have to replace stat64() instead of stat(). */
+# undef stat64
+# define stat64(name, st) rpl_stat (name, st)
+# elif @WINDOWS_64_BIT_ST_SIZE@
+ /* Above, we define stat to _stati64. */
+# if defined __MINGW32__ && defined _stati64
+# ifndef _USE_32BIT_TIME_T
+ /* The system headers define _stati64 to _stat64. */
+# undef _stat64
+# define _stat64(name, st) rpl_stat (name, st)
+# endif
+# elif defined _MSC_VER && defined _stati64
+# ifdef _USE_32BIT_TIME_T
+ /* The system headers define _stati64 to _stat32i64. */
+# undef _stat32i64
+# define _stat32i64(name, st) rpl_stat (name, st)
+# else
+ /* The system headers define _stati64 to _stat64. */
+# undef _stat64
+# define _stat64(name, st) rpl_stat (name, st)
+# endif
+# else
+# undef _stati64
+# define _stati64(name, st) rpl_stat (name, st)
+# endif
+# elif defined __MINGW32__ && defined stat
+# ifdef _USE_32BIT_TIME_T
+ /* The system headers define stat to _stat32i64. */
+# undef _stat32i64
+# define _stat32i64(name, st) rpl_stat (name, st)
+# else
+ /* The system headers define stat to _stat64. */
+# undef _stat64
+# define _stat64(name, st) rpl_stat (name, st)
+# endif
+# elif defined _MSC_VER && defined stat
+# ifdef _USE_32BIT_TIME_T
+ /* The system headers define stat to _stat32. */
+# undef _stat32
+# define _stat32(name, st) rpl_stat (name, st)
+# else
+ /* The system headers define stat to _stat64i32. */
+# undef _stat64i32
+# define _stat64i32(name, st) rpl_stat (name, st)
+# endif
+# else /* !(_AIX || __MINGW32__ || _MSC_VER) */
+# undef stat
+# define stat(name, st) rpl_stat (name, st)
+# endif /* !_LARGE_FILES */
+# endif /* !@GNULIB_OVERRIDES_STRUCT_STAT@ */
+_GL_EXTERN_C int stat (const char *restrict name, struct stat *restrict buf)
+ _GL_ARG_NONNULL ((1, 2));
+# endif
+#elif @GNULIB_OVERRIDES_STRUCT_STAT@
+/* see above:
+ #define stat stat_used_without_requesting_gnulib_module_stat
+ */
+#elif defined GNULIB_POSIXCHECK
+# undef stat
+# if HAVE_RAW_DECL_STAT
+_GL_WARN_ON_USE (stat, "stat is unportable - "
+ "use gnulib module stat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_MDA_UMASK@
+/* On native Windows, map 'umask' to '_umask', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::umask always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef umask
+# define umask _umask
+# endif
+/* Need to cast, because in mingw the last argument is 'int mode'. */
+_GL_CXXALIAS_MDA_CAST (umask, mode_t, (mode_t mask));
+# else
+_GL_CXXALIAS_SYS (umask, mode_t, (mode_t mask));
+# endif
+_GL_CXXALIASWARN (umask);
+#endif
+
+
+#if @GNULIB_UTIMENSAT@
+/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our utimensat
+ implementation relies on futimesat, which on Solaris 10 makes an invocation
+ to utimensat that is meant to invoke the libc's utimensat(), not gnulib's
+ utimensat(). */
+# if @REPLACE_UTIMENSAT@ || (!@HAVE_UTIMENSAT@ && defined __sun)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef utimensat
+# define utimensat rpl_utimensat
+# endif
+_GL_FUNCDECL_RPL (utimensat, int, (int fd, char const *name,
+ struct timespec const times[2], int flag)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (utimensat, int, (int fd, char const *name,
+ struct timespec const times[2], int flag));
+# else
+# if !@HAVE_UTIMENSAT@
+_GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name,
+ struct timespec const times[2], int flag)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name,
+ struct timespec const times[2], int flag));
+# endif
+# if @HAVE_UTIMENSAT@
+_GL_CXXALIASWARN (utimensat);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef utimensat
+# if HAVE_RAW_DECL_UTIMENSAT
+_GL_WARN_ON_USE (utimensat, "utimensat is not portable - "
+ "use gnulib module utimensat for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_SYS_STAT_H */
+#endif /* _@GUARD_PREFIX@_SYS_STAT_H */
+#endif
diff --git a/gl/lib/sys_time.in.h b/gl/lib/sys_time.in.h
new file mode 100644
index 0000000..87db1a8
--- /dev/null
+++ b/gl/lib/sys_time.in.h
@@ -0,0 +1,224 @@
+/* Provide a more complete sys/time.h.
+
+ Copyright (C) 2007-2022 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 2.1 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 Paul Eggert. */
+
+#ifndef _@GUARD_PREFIX@_SYS_TIME_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* On Cygwin and on many BSDish systems, <sys/time.h> includes itself
+ recursively via <sys/select.h>.
+ Simply delegate to the system's header in this case; it is a no-op.
+ Without this extra ifdef, the C++ gettimeofday declaration below
+ would be a forward declaration in gnulib's nested <sys/time.h>. */
+#if defined _CYGWIN_SYS_TIME_H || defined _SYS_TIME_H || defined _SYS_TIME_H_
+# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
+#else
+
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_SYS_TIME_H@
+# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_SYS_TIME_H
+#define _@GUARD_PREFIX@_SYS_TIME_H
+
+#if ! @HAVE_SYS_TIME_H@
+# include <time.h>
+#endif
+
+/* On native Windows with MSVC, get the 'struct timeval' type.
+ Also, on native Windows with a 64-bit time_t, where we are overriding the
+ 'struct timeval' type, get all declarations of system functions whose
+ signature contains 'struct timeval'. */
+#if (defined _MSC_VER || @REPLACE_STRUCT_TIMEVAL@) && @HAVE_WINSOCK2_H@ && !defined _GL_INCLUDING_WINSOCK2_H
+# define _GL_INCLUDING_WINSOCK2_H
+# include <winsock2.h>
+# undef _GL_INCLUDING_WINSOCK2_H
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !@HAVE_STRUCT_TIMEVAL@ || @REPLACE_STRUCT_TIMEVAL@
+
+# if @REPLACE_STRUCT_TIMEVAL@
+# define timeval rpl_timeval
+# endif
+
+# if !GNULIB_defined_struct_timeval
+struct timeval
+{
+ time_t tv_sec;
+ long int tv_usec;
+};
+# define GNULIB_defined_struct_timeval 1
+# endif
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#if @GNULIB_GETTIMEOFDAY@
+# if @REPLACE_GETTIMEOFDAY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef gettimeofday
+# define gettimeofday rpl_gettimeofday
+# endif
+_GL_FUNCDECL_RPL (gettimeofday, int,
+ (struct timeval *restrict, void *restrict)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (gettimeofday, int,
+ (struct timeval *restrict, void *restrict));
+# else
+# if !@HAVE_GETTIMEOFDAY@
+_GL_FUNCDECL_SYS (gettimeofday, int,
+ (struct timeval *restrict, void *restrict)
+ _GL_ARG_NONNULL ((1)));
+# endif
+/* Need to cast, because on glibc systems, by default, the second argument is
+ struct timezone *. */
+_GL_CXXALIAS_SYS_CAST (gettimeofday, int,
+ (struct timeval *restrict, void *restrict));
+# endif
+_GL_CXXALIASWARN (gettimeofday);
+# if defined __cplusplus && defined GNULIB_NAMESPACE
+namespace GNULIB_NAMESPACE {
+ typedef ::timeval
+# undef timeval
+ timeval;
+# if @REPLACE_STRUCT_TIMEVAL@
+# define timeval rpl_timeval
+ typedef ::timeval timeval;
+# endif
+}
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef gettimeofday
+# if HAVE_RAW_DECL_GETTIMEOFDAY
+_GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - "
+ "use gnulib module gettimeofday for portability");
+# endif
+#endif
+
+/* Hide some function declarations from <winsock2.h>. */
+
+#if defined _MSC_VER && @HAVE_WINSOCK2_H@
+# if !defined _@GUARD_PREFIX@_UNISTD_H
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef close
+# define close close_used_without_including_unistd_h
+# elif !defined __clang__
+ _GL_WARN_ON_USE (close,
+ "close() used without including <unistd.h>");
+# endif
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef gethostname
+# define gethostname gethostname_used_without_including_unistd_h
+# else
+ _GL_WARN_ON_USE (gethostname,
+ "gethostname() used without including <unistd.h>");
+# endif
+# endif
+# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef socket
+# define socket socket_used_without_including_sys_socket_h
+# undef connect
+# define connect connect_used_without_including_sys_socket_h
+# undef accept
+# define accept accept_used_without_including_sys_socket_h
+# undef bind
+# define bind bind_used_without_including_sys_socket_h
+# undef getpeername
+# define getpeername getpeername_used_without_including_sys_socket_h
+# undef getsockname
+# define getsockname getsockname_used_without_including_sys_socket_h
+# undef getsockopt
+# define getsockopt getsockopt_used_without_including_sys_socket_h
+# undef listen
+# define listen listen_used_without_including_sys_socket_h
+# undef recv
+# define recv recv_used_without_including_sys_socket_h
+# undef send
+# define send send_used_without_including_sys_socket_h
+# undef recvfrom
+# define recvfrom recvfrom_used_without_including_sys_socket_h
+# undef sendto
+# define sendto sendto_used_without_including_sys_socket_h
+# undef setsockopt
+# define setsockopt setsockopt_used_without_including_sys_socket_h
+# undef shutdown
+# define shutdown shutdown_used_without_including_sys_socket_h
+# else
+ _GL_WARN_ON_USE (socket,
+ "socket() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (connect,
+ "connect() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (accept,
+ "accept() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (bind,
+ "bind() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (getpeername,
+ "getpeername() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (getsockname,
+ "getsockname() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (getsockopt,
+ "getsockopt() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (listen,
+ "listen() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (recv,
+ "recv() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (send,
+ "send() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (recvfrom,
+ "recvfrom() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (sendto,
+ "sendto() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (setsockopt,
+ "setsockopt() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (shutdown,
+ "shutdown() used without including <sys/socket.h>");
+# endif
+# endif
+# if !defined _@GUARD_PREFIX@_SYS_SELECT_H
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef select
+# define select select_used_without_including_sys_select_h
+# else
+ _GL_WARN_ON_USE (select,
+ "select() used without including <sys/select.h>");
+# endif
+# endif
+#endif
+
+#endif /* _@GUARD_PREFIX@_SYS_TIME_H */
+#endif /* _CYGWIN_SYS_TIME_H */
+#endif /* _@GUARD_PREFIX@_SYS_TIME_H */
diff --git a/gl/lib/sys_types.in.h b/gl/lib/sys_types.in.h
new file mode 100644
index 0000000..698e88d
--- /dev/null
+++ b/gl/lib/sys_types.in.h
@@ -0,0 +1,106 @@
+/* Provide a more complete sys/types.h.
+
+ Copyright (C) 2011-2022 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 2.1 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 __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined _WIN32 && !defined __CYGWIN__ \
+ && (defined __need_off_t || defined __need___off64_t \
+ || defined __need_ssize_t || defined __need_time_t)
+
+/* Special invocation convention inside mingw header files. */
+
+#@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_SYS_TYPES_H
+
+/* The include_next requires a split double-inclusion guard. */
+# define _GL_INCLUDING_SYS_TYPES_H
+#@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@
+# undef _GL_INCLUDING_SYS_TYPES_H
+
+#ifndef _@GUARD_PREFIX@_SYS_TYPES_H
+#define _@GUARD_PREFIX@_SYS_TYPES_H
+
+/* Override off_t if Large File Support is requested on native Windows. */
+#if @WINDOWS_64_BIT_OFF_T@
+/* Same as int64_t in <stdint.h>. */
+# if defined _MSC_VER
+# define off_t __int64
+# else
+# define off_t long long int
+# endif
+/* Indicator, for gnulib internal purposes. */
+# define _GL_WINDOWS_64_BIT_OFF_T 1
+#endif
+
+/* Override dev_t and ino_t if distinguishable inodes support is requested
+ on native Windows. */
+#if @WINDOWS_STAT_INODES@
+
+# if @WINDOWS_STAT_INODES@ == 2
+/* Experimental, not useful in Windows 10. */
+
+/* Define dev_t to a 64-bit type. */
+# if !defined GNULIB_defined_dev_t
+typedef unsigned long long int rpl_dev_t;
+# undef dev_t
+# define dev_t rpl_dev_t
+# define GNULIB_defined_dev_t 1
+# endif
+
+/* Define ino_t to a 128-bit type. */
+# if !defined GNULIB_defined_ino_t
+/* MSVC does not have a 128-bit integer type.
+ GCC has a 128-bit integer type __int128, but only on 64-bit targets. */
+typedef struct { unsigned long long int _gl_ino[2]; } rpl_ino_t;
+# undef ino_t
+# define ino_t rpl_ino_t
+# define GNULIB_defined_ino_t 1
+# endif
+
+# else /* @WINDOWS_STAT_INODES@ == 1 */
+
+/* Define ino_t to a 64-bit type. */
+# if !defined GNULIB_defined_ino_t
+typedef unsigned long long int rpl_ino_t;
+# undef ino_t
+# define ino_t rpl_ino_t
+# define GNULIB_defined_ino_t 1
+# endif
+
+# endif
+
+/* Indicator, for gnulib internal purposes. */
+# define _GL_WINDOWS_STAT_INODES @WINDOWS_STAT_INODES@
+
+#endif
+
+/* MSVC 9 defines size_t in <stddef.h>, not in <sys/types.h>. */
+/* But avoid namespace pollution on glibc systems. */
+#if (defined _WIN32 && ! defined __CYGWIN__) && ! defined __GLIBC__
+# include <stddef.h>
+#endif
+
+#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
+#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
+#endif /* __need_XXX */
diff --git a/gl/lib/sys_uio.in.h b/gl/lib/sys_uio.in.h
new file mode 100644
index 0000000..788d461
--- /dev/null
+++ b/gl/lib/sys_uio.in.h
@@ -0,0 +1,63 @@
+/* Substitute for <sys/uio.h>.
+ Copyright (C) 2011-2022 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 2.1 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 __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+# endif
+@PRAGMA_COLUMNS@
+
+#ifndef _@GUARD_PREFIX@_SYS_UIO_H
+
+#if @HAVE_SYS_UIO_H@
+
+/* On OpenBSD 4.4, <sys/uio.h> assumes prior inclusion of <sys/types.h>. */
+# include <sys/types.h>
+
+/* The include_next requires a split double-inclusion guard. */
+# @INCLUDE_NEXT@ @NEXT_SYS_UIO_H@
+
+#endif
+
+#ifndef _@GUARD_PREFIX@_SYS_UIO_H
+#define _@GUARD_PREFIX@_SYS_UIO_H
+
+#if !@HAVE_SYS_UIO_H@
+/* A platform that lacks <sys/uio.h>. */
+/* Get 'size_t' and 'ssize_t'. */
+# include <sys/types.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if !GNULIB_defined_struct_iovec
+/* All known platforms that lack <sys/uio.h> also lack any declaration
+ of struct iovec in any other header. */
+struct iovec {
+ void *iov_base;
+ size_t iov_len;
+};
+# define GNULIB_defined_struct_iovec 1
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+#endif /* _@GUARD_PREFIX@_SYS_UIO_H */
+#endif /* _@GUARD_PREFIX@_SYS_UIO_H */
diff --git a/gl/lib/sysexits.in.h b/gl/lib/sysexits.in.h
new file mode 100644
index 0000000..9a65060
--- /dev/null
+++ b/gl/lib/sysexits.in.h
@@ -0,0 +1,72 @@
+/* exit() exit codes for some BSD system programs.
+ Copyright (C) 2003, 2006-2022 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 2.1 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 Simon Josefsson based on sysexits(3) man page */
+
+#ifndef _@GUARD_PREFIX@_SYSEXITS_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if @HAVE_SYSEXITS_H@
+
+/* IRIX 6.5 has an <unistd.h> that defines a macro EX_OK with a nonzero
+ value. Override it. See
+ <https://lists.gnu.org/r/bug-gnulib/2007-03/msg00361.html> */
+# ifdef __sgi
+# include <unistd.h>
+# undef EX_OK
+# endif
+
+/* The include_next requires a split double-inclusion guard. */
+# @INCLUDE_NEXT@ @NEXT_SYSEXITS_H@
+
+/* HP-UX 11 <sysexits.h> ends at EX_NOPERM. */
+# ifndef EX_CONFIG
+# define EX_CONFIG 78
+# endif
+
+#endif
+
+#ifndef _@GUARD_PREFIX@_SYSEXITS_H
+#define _@GUARD_PREFIX@_SYSEXITS_H
+
+#if !(@HAVE_SYSEXITS_H@ && defined EX_USAGE)
+
+# define EX_OK 0 /* same value as EXIT_SUCCESS */
+
+# define EX_USAGE 64
+# define EX_DATAERR 65
+# define EX_NOINPUT 66
+# define EX_NOUSER 67
+# define EX_NOHOST 68
+# define EX_UNAVAILABLE 69
+# define EX_SOFTWARE 70
+# define EX_OSERR 71
+# define EX_OSFILE 72
+# define EX_CANTCREAT 73
+# define EX_IOERR 74
+# define EX_TEMPFAIL 75
+# define EX_PROTOCOL 76
+# define EX_NOPERM 77
+# define EX_CONFIG 78
+
+#endif
+
+#endif /* _@GUARD_PREFIX@_SYSEXITS_H */
+#endif /* _@GUARD_PREFIX@_SYSEXITS_H */
diff --git a/gl/lib/tempname.c b/gl/lib/tempname.c
new file mode 100644
index 0000000..5fc5efe
--- /dev/null
+++ b/gl/lib/tempname.c
@@ -0,0 +1,345 @@
+/* Copyright (C) 1991-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library 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 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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 the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#if !_LIBC
+# include <libc-config.h>
+# include "tempname.h"
+#endif
+
+#include <sys/types.h>
+#include <assert.h>
+#include <stdbool.h>
+
+#include <errno.h>
+
+#include <stdio.h>
+#ifndef P_tmpdir
+# define P_tmpdir "/tmp"
+#endif
+#ifndef TMP_MAX
+# define TMP_MAX 238328
+#endif
+#ifndef __GT_FILE
+# define __GT_FILE 0
+# define __GT_DIR 1
+# define __GT_NOCREATE 2
+#endif
+#if !_LIBC && (GT_FILE != __GT_FILE || GT_DIR != __GT_DIR \
+ || GT_NOCREATE != __GT_NOCREATE)
+# error report this to bug-gnulib@gnu.org
+#endif
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <fcntl.h>
+#include <stdalign.h>
+#include <stdint.h>
+#include <sys/random.h>
+#include <sys/stat.h>
+#include <time.h>
+
+#if _LIBC
+# define struct_stat64 struct stat64
+# define __secure_getenv __libc_secure_getenv
+#else
+# define struct_stat64 struct stat
+# define __gen_tempname gen_tempname
+# define __mkdir mkdir
+# define __open open
+# define __lstat64(file, buf) lstat (file, buf)
+# define __stat64(file, buf) stat (file, buf)
+# define __getrandom getrandom
+# define __clock_gettime64 clock_gettime
+# define __timespec64 timespec
+#endif
+
+/* Use getrandom if it works, falling back on a 64-bit linear
+ congruential generator that starts with Var's value
+ mixed in with a clock's low-order bits if available. */
+typedef uint_fast64_t random_value;
+#define RANDOM_VALUE_MAX UINT_FAST64_MAX
+#define BASE_62_DIGITS 10 /* 62**10 < UINT_FAST64_MAX */
+#define BASE_62_POWER (62LL * 62 * 62 * 62 * 62 * 62 * 62 * 62 * 62 * 62)
+
+static random_value
+random_bits (random_value var, bool use_getrandom)
+{
+ random_value r;
+ /* Without GRND_NONBLOCK it can be blocked for minutes on some systems. */
+ if (use_getrandom && __getrandom (&r, sizeof r, GRND_NONBLOCK) == sizeof r)
+ return r;
+#if _LIBC || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
+ /* Add entropy if getrandom did not work. */
+ struct __timespec64 tv;
+ __clock_gettime64 (CLOCK_MONOTONIC, &tv);
+ var ^= tv.tv_nsec;
+#endif
+ return 2862933555777941757 * var + 3037000493;
+}
+
+#if _LIBC
+/* Return nonzero if DIR is an existent directory. */
+static int
+direxists (const char *dir)
+{
+ struct_stat64 buf;
+ return __stat64 (dir, &buf) == 0 && S_ISDIR (buf.st_mode);
+}
+
+/* Path search algorithm, for tmpnam, tmpfile, etc. If DIR is
+ non-null and exists, uses it; otherwise uses the first of $TMPDIR,
+ P_tmpdir, /tmp that exists. Copies into TMPL a template suitable
+ for use with mk[s]temp. Will fail (-1) if DIR is non-null and
+ doesn't exist, none of the searched dirs exists, or there's not
+ enough space in TMPL. */
+int
+__path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
+ int try_tmpdir)
+{
+ const char *d;
+ size_t dlen, plen;
+
+ if (!pfx || !pfx[0])
+ {
+ pfx = "file";
+ plen = 4;
+ }
+ else
+ {
+ plen = strlen (pfx);
+ if (plen > 5)
+ plen = 5;
+ }
+
+ if (try_tmpdir)
+ {
+ d = __secure_getenv ("TMPDIR");
+ if (d != NULL && direxists (d))
+ dir = d;
+ else if (dir != NULL && direxists (dir))
+ /* nothing */ ;
+ else
+ dir = NULL;
+ }
+ if (dir == NULL)
+ {
+ if (direxists (P_tmpdir))
+ dir = P_tmpdir;
+ else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
+ dir = "/tmp";
+ else
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+ }
+
+ dlen = strlen (dir);
+ while (dlen > 1 && dir[dlen - 1] == '/')
+ dlen--; /* remove trailing slashes */
+
+ /* check we have room for "${dir}/${pfx}XXXXXX\0" */
+ if (tmpl_len < dlen + 1 + plen + 6 + 1)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ sprintf (tmpl, "%.*s/%.*sXXXXXX", (int) dlen, dir, (int) plen, pfx);
+ return 0;
+}
+#endif /* _LIBC */
+
+#if _LIBC
+static int try_tempname_len (char *, int, void *, int (*) (char *, void *),
+ size_t);
+#endif
+
+static int
+try_file (char *tmpl, void *flags)
+{
+ int *openflags = flags;
+ return __open (tmpl,
+ (*openflags & ~O_ACCMODE)
+ | O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+}
+
+static int
+try_dir (char *tmpl, _GL_UNUSED void *flags)
+{
+ return __mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR);
+}
+
+static int
+try_nocreate (char *tmpl, _GL_UNUSED void *flags)
+{
+ struct_stat64 st;
+
+ if (__lstat64 (tmpl, &st) == 0 || errno == EOVERFLOW)
+ __set_errno (EEXIST);
+ return errno == ENOENT ? 0 : -1;
+}
+
+/* These are the characters used in temporary file names. */
+static const char letters[] =
+"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+
+/* Generate a temporary file name based on TMPL. TMPL must match the
+ rules for mk[s]temp (i.e., end in at least X_SUFFIX_LEN "X"s,
+ possibly with a suffix).
+ The name constructed does not exist at the time of the call to
+ this function. TMPL is overwritten with the result.
+
+ KIND may be one of:
+ __GT_NOCREATE: simply verify that the name does not exist
+ at the time of the call.
+ __GT_FILE: create the file using open(O_CREAT|O_EXCL)
+ and return a read-write fd. The file is mode 0600.
+ __GT_DIR: create a directory, which will be mode 0700.
+
+ We use a clever algorithm to get hard-to-predict names. */
+#ifdef _LIBC
+static
+#endif
+int
+gen_tempname_len (char *tmpl, int suffixlen, int flags, int kind,
+ size_t x_suffix_len)
+{
+ static int (*const tryfunc[]) (char *, void *) =
+ {
+ [__GT_FILE] = try_file,
+ [__GT_DIR] = try_dir,
+ [__GT_NOCREATE] = try_nocreate
+ };
+ return try_tempname_len (tmpl, suffixlen, &flags, tryfunc[kind],
+ x_suffix_len);
+}
+
+#ifdef _LIBC
+static
+#endif
+int
+try_tempname_len (char *tmpl, int suffixlen, void *args,
+ int (*tryfunc) (char *, void *), size_t x_suffix_len)
+{
+ size_t len;
+ char *XXXXXX;
+ unsigned int count;
+ int fd = -1;
+ int save_errno = errno;
+
+ /* A lower bound on the number of temporary files to attempt to
+ generate. The maximum total number of temporary file names that
+ can exist for a given template is 62**6. It should never be
+ necessary to try all of these combinations. Instead if a reasonable
+ number of names is tried (we define reasonable as 62**3) fail to
+ give the system administrator the chance to remove the problems.
+ This value requires that X_SUFFIX_LEN be at least 3. */
+#define ATTEMPTS_MIN (62 * 62 * 62)
+
+ /* The number of times to attempt to generate a temporary file. To
+ conform to POSIX, this must be no smaller than TMP_MAX. */
+#if ATTEMPTS_MIN < TMP_MAX
+ unsigned int attempts = TMP_MAX;
+#else
+ unsigned int attempts = ATTEMPTS_MIN;
+#endif
+
+ /* A random variable. The initial value is used only the for fallback path
+ on 'random_bits' on 'getrandom' failure. Its initial value tries to use
+ some entropy from the ASLR and ignore possible bits from the stack
+ alignment. */
+ random_value v = ((uintptr_t) &v) / alignof (max_align_t);
+
+ /* How many random base-62 digits can currently be extracted from V. */
+ int vdigits = 0;
+
+ /* Whether to consume entropy when acquiring random bits. On the
+ first try it's worth the entropy cost with __GT_NOCREATE, which
+ is inherently insecure and can use the entropy to make it a bit
+ less secure. On the (rare) second and later attempts it might
+ help against DoS attacks. */
+ bool use_getrandom = tryfunc == try_nocreate;
+
+ /* Least unfair value for V. If V is less than this, V can generate
+ BASE_62_DIGITS digits fairly. Otherwise it might be biased. */
+ random_value const unfair_min
+ = RANDOM_VALUE_MAX - RANDOM_VALUE_MAX % BASE_62_POWER;
+
+ len = strlen (tmpl);
+ if (len < x_suffix_len + suffixlen
+ || strspn (&tmpl[len - x_suffix_len - suffixlen], "X") < x_suffix_len)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ /* This is where the Xs start. */
+ XXXXXX = &tmpl[len - x_suffix_len - suffixlen];
+
+ for (count = 0; count < attempts; ++count)
+ {
+ for (size_t i = 0; i < x_suffix_len; i++)
+ {
+ if (vdigits == 0)
+ {
+ do
+ {
+ v = random_bits (v, use_getrandom);
+ use_getrandom = true;
+ }
+ while (unfair_min <= v);
+
+ vdigits = BASE_62_DIGITS;
+ }
+
+ XXXXXX[i] = letters[v % 62];
+ v /= 62;
+ vdigits--;
+ }
+
+ fd = tryfunc (tmpl, args);
+ if (fd >= 0)
+ {
+ __set_errno (save_errno);
+ return fd;
+ }
+ else if (errno != EEXIST)
+ return -1;
+ }
+
+ /* We got out of the loop because we ran out of combinations to try. */
+ __set_errno (EEXIST);
+ return -1;
+}
+
+int
+__gen_tempname (char *tmpl, int suffixlen, int flags, int kind)
+{
+ return gen_tempname_len (tmpl, suffixlen, flags, kind, 6);
+}
+
+#if !_LIBC
+int
+try_tempname (char *tmpl, int suffixlen, void *args,
+ int (*tryfunc) (char *, void *))
+{
+ return try_tempname_len (tmpl, suffixlen, args, tryfunc, 6);
+}
+#endif
diff --git a/gl/lib/tempname.h b/gl/lib/tempname.h
new file mode 100644
index 0000000..c172820
--- /dev/null
+++ b/gl/lib/tempname.h
@@ -0,0 +1,72 @@
+/* Create a temporary file or directory.
+
+ Copyright (C) 2006, 2009-2022 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 2.1 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/>. */
+
+/* header written by Eric Blake */
+
+#ifndef GL_TEMPNAME_H
+# define GL_TEMPNAME_H
+
+# include <stdio.h>
+
+# ifdef __GT_FILE
+# define GT_FILE __GT_FILE
+# define GT_DIR __GT_DIR
+# define GT_NOCREATE __GT_NOCREATE
+# else
+# define GT_FILE 0
+# define GT_DIR 1
+# define GT_NOCREATE 2
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Generate a temporary file name based on TMPL. TMPL must match the
+ rules for mk[s]temp (i.e. end in "XXXXXX", possibly with a suffix).
+ The name constructed does not exist at the time of the call to
+ gen_tempname. TMPL is overwritten with the result.
+
+ KIND may be one of:
+ GT_NOCREATE: simply verify that the name does not exist
+ at the time of the call.
+ GT_FILE: create a large file using open(O_CREAT|O_EXCL)
+ and return a read-write fd. The file is mode 0600.
+ GT_DIR: create a directory, which will be mode 0700.
+
+ We use a clever algorithm to get hard-to-predict names. */
+extern int gen_tempname (char *tmpl, int suffixlen, int flags, int kind);
+/* Similar, except X_SUFFIX_LEN gives the number of Xs. */
+extern int gen_tempname_len (char *tmpl, int suffixlen, int flags, int kind,
+ size_t x_suffix_len);
+
+/* Similar to gen_tempname, but TRYFUNC is called for each temporary
+ name to try. If TRYFUNC returns a non-negative number, TRY_GEN_TEMPNAME
+ returns with this value. Otherwise, if errno is set to EEXIST, another
+ name is tried, or else TRY_GEN_TEMPNAME returns -1. */
+extern int try_tempname (char *tmpl, int suffixlen, void *args,
+ int (*tryfunc) (char *, void *));
+/* Similar, except X_SUFFIX_LEN gives the number of Xs. */
+extern int try_tempname_len (char *tmpl, int suffixlen, void *args,
+ int (*tryfunc) (char *, void *),
+ size_t x_suffix_len);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GL_TEMPNAME_H */
diff --git a/gl/lib/termios.in.h b/gl/lib/termios.in.h
new file mode 100644
index 0000000..32b7c5b
--- /dev/null
+++ b/gl/lib/termios.in.h
@@ -0,0 +1,73 @@
+/* Substitute for and wrapper around <termios.h>.
+ Copyright (C) 2010-2022 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 2.1 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/>. */
+
+#ifndef _@GUARD_PREFIX@_TERMIOS_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* On HP-UX 11.00, some of the function declarations in <sys/termio.h>,
+ included by <termios.h>, are not protected by extern "C". Enforce
+ "C" linkage for these functions nevertheless. */
+#if defined __hpux && defined __cplusplus
+# include <sys/types.h>
+# include <sys/ioctl.h>
+extern "C" {
+# include <sys/termio.h>
+}
+#endif
+
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_TERMIOS_H@
+# @INCLUDE_NEXT@ @NEXT_TERMIOS_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_TERMIOS_H
+#define _@GUARD_PREFIX@_TERMIOS_H
+
+/* Get pid_t. */
+#include <sys/types.h>
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+/* Declare overridden functions. */
+
+#if @GNULIB_TCGETSID@
+/* Return the session ID of the controlling terminal of the current process.
+ The argument is a descriptor if this controlling terminal.
+ Return -1, with errno set, upon failure. errno = ENOSYS means that the
+ function is unsupported. */
+# if !@HAVE_DECL_TCGETSID@
+_GL_FUNCDECL_SYS (tcgetsid, pid_t, (int fd));
+# endif
+_GL_CXXALIAS_SYS (tcgetsid, pid_t, (int fd));
+_GL_CXXALIASWARN (tcgetsid);
+#elif defined GNULIB_POSIXCHECK
+# undef tcgetsid
+# if HAVE_RAW_DECL_TCGETSID
+_GL_WARN_ON_USE (tcgetsid, "tcgetsid is not portable - "
+ "use gnulib module tcgetsid for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_TERMIOS_H */
+#endif /* _@GUARD_PREFIX@_TERMIOS_H */
diff --git a/gl/lib/time.in.h b/gl/lib/time.in.h
new file mode 100644
index 0000000..6d4c771
--- /dev/null
+++ b/gl/lib/time.in.h
@@ -0,0 +1,452 @@
+/* A more-standard <time.h>.
+
+ Copyright (C) 2007-2022 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 2.1 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 __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* Don't get in the way of glibc when it includes time.h merely to
+ declare a few standard symbols, rather than to declare all the
+ symbols. (However, skip this for MinGW as it treats __need_time_t
+ incompatibly.) Also, Solaris 8 <time.h> eventually includes itself
+ recursively; if that is happening, just include the system <time.h>
+ without adding our own declarations. */
+#if (((defined __need_time_t || defined __need_clock_t \
+ || defined __need_timespec) \
+ && !defined __MINGW32__) \
+ || defined _@GUARD_PREFIX@_TIME_H)
+
+# @INCLUDE_NEXT@ @NEXT_TIME_H@
+
+#else
+
+# define _@GUARD_PREFIX@_TIME_H
+
+/* mingw's <time.h> provides the functions asctime_r, ctime_r, gmtime_r,
+ localtime_r only if <unistd.h> or <pthread.h> has been included before. */
+# if defined __MINGW32__
+# include <unistd.h>
+# endif
+
+# @INCLUDE_NEXT@ @NEXT_TIME_H@
+
+/* NetBSD 5.0 mis-defines NULL. */
+# include <stddef.h>
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* Some systems don't define struct timespec (e.g., AIX 4.1).
+ Or they define it with the wrong member names or define it in <sys/time.h>
+ (e.g., FreeBSD circa 1997). Stock Mingw prior to 3.0 does not define it,
+ but the pthreads-win32 library defines it in <pthread.h>. */
+# if ! @TIME_H_DEFINES_STRUCT_TIMESPEC@
+# if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
+# include <sys/time.h>
+# elif @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+# include <pthread.h>
+# elif @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
+# include <unistd.h>
+# else
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if !GNULIB_defined_struct_timespec
+# undef timespec
+# define timespec rpl_timespec
+struct timespec
+{
+ time_t tv_sec;
+ long int tv_nsec;
+};
+# define GNULIB_defined_struct_timespec 1
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+
+# endif
+# endif
+
+# if !GNULIB_defined_struct_time_t_must_be_integral
+/* https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html
+ requires time_t to be an integer type, even though C99 permits floating
+ point. We don't know of any implementation that uses floating
+ point, and it is much easier to write code that doesn't have to
+ worry about that corner case, so we force the issue. */
+struct __time_t_must_be_integral {
+ unsigned int __floating_time_t_unsupported : (time_t) 1;
+};
+# define GNULIB_defined_struct_time_t_must_be_integral 1
+# endif
+
+/* Define TIME_UTC, a positive integer constant used for timespec_get(). */
+# if ! @TIME_H_DEFINES_TIME_UTC@
+# if !GNULIB_defined_TIME_UTC
+# define TIME_UTC 1
+# define GNULIB_defined_TIME_UTC 1
+# endif
+# endif
+
+/* Set *TS to the current time, and return BASE.
+ Upon failure, return 0. */
+# if @GNULIB_TIMESPEC_GET@
+# if ! @HAVE_TIMESPEC_GET@
+_GL_FUNCDECL_SYS (timespec_get, int, (struct timespec *ts, int base)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (timespec_get, int, (struct timespec *ts, int base));
+_GL_CXXALIASWARN (timespec_get);
+# endif
+
+/* Set *TS to the current time resolution, and return BASE.
+ Upon failure, return 0. */
+# if @GNULIB_TIMESPEC_GETRES@
+# if ! @HAVE_TIMESPEC_GETRES@
+_GL_FUNCDECL_SYS (timespec_getres, int, (struct timespec *ts, int base)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (timespec_getres, int, (struct timespec *ts, int base));
+_GL_CXXALIASWARN (timespec_getres);
+# endif
+
+/* Sleep for at least RQTP seconds unless interrupted, If interrupted,
+ return -1 and store the remaining time into RMTP. See
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/nanosleep.html>. */
+# if @GNULIB_NANOSLEEP@
+# if @REPLACE_NANOSLEEP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define nanosleep rpl_nanosleep
+# endif
+_GL_FUNCDECL_RPL (nanosleep, int,
+ (struct timespec const *__rqtp, struct timespec *__rmtp)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (nanosleep, int,
+ (struct timespec const *__rqtp, struct timespec *__rmtp));
+# else
+# if ! @HAVE_NANOSLEEP@
+_GL_FUNCDECL_SYS (nanosleep, int,
+ (struct timespec const *__rqtp, struct timespec *__rmtp)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (nanosleep, int,
+ (struct timespec const *__rqtp, struct timespec *__rmtp));
+# endif
+_GL_CXXALIASWARN (nanosleep);
+# endif
+
+/* Initialize time conversion information. */
+# if @GNULIB_TZSET@
+# if @REPLACE_TZSET@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef tzset
+# define tzset rpl_tzset
+# endif
+_GL_FUNCDECL_RPL (tzset, void, (void));
+_GL_CXXALIAS_RPL (tzset, void, (void));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef tzset
+# define tzset _tzset
+# endif
+_GL_CXXALIAS_MDA (tzset, void, (void));
+# else
+_GL_CXXALIAS_SYS (tzset, void, (void));
+# endif
+_GL_CXXALIASWARN (tzset);
+# elif @GNULIB_MDA_TZSET@
+/* On native Windows, map 'tzset' to '_tzset', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::tzset always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef tzset
+# define tzset _tzset
+# endif
+_GL_CXXALIAS_MDA (tzset, void, (void));
+# else
+_GL_CXXALIAS_SYS (tzset, void, (void));
+# endif
+_GL_CXXALIASWARN (tzset);
+# endif
+
+/* Return the 'time_t' representation of TP and normalize TP. */
+# if @GNULIB_MKTIME@
+# if @REPLACE_MKTIME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define mktime rpl_mktime
+# endif
+_GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp));
+# else
+_GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (mktime);
+# endif
+# endif
+
+/* Convert TIMER to RESULT, assuming local time and UTC respectively. See
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/localtime_r.html> and
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/gmtime_r.html>. */
+# if @GNULIB_TIME_R@
+# if @REPLACE_LOCALTIME_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef localtime_r
+# define localtime_r rpl_localtime_r
+# endif
+_GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
+ struct tm *restrict __result)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
+ struct tm *restrict __result));
+# else
+# if ! @HAVE_DECL_LOCALTIME_R@
+_GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
+ struct tm *restrict __result)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
+ struct tm *restrict __result));
+# endif
+# if @HAVE_DECL_LOCALTIME_R@
+_GL_CXXALIASWARN (localtime_r);
+# endif
+# if @REPLACE_LOCALTIME_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef gmtime_r
+# define gmtime_r rpl_gmtime_r
+# endif
+_GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
+ struct tm *restrict __result)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
+ struct tm *restrict __result));
+# else
+# if ! @HAVE_DECL_LOCALTIME_R@
+_GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
+ struct tm *restrict __result)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
+ struct tm *restrict __result));
+# endif
+# if @HAVE_DECL_LOCALTIME_R@
+_GL_CXXALIASWARN (gmtime_r);
+# endif
+# endif
+
+/* Convert TIMER to RESULT, assuming local time and UTC respectively. See
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/localtime.html> and
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/gmtime.html>. */
+# if @GNULIB_LOCALTIME@ || @REPLACE_LOCALTIME@
+# if @REPLACE_LOCALTIME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef localtime
+# define localtime rpl_localtime
+# endif
+_GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer));
+# else
+_GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (localtime);
+# endif
+# endif
+
+# if 0 || @REPLACE_GMTIME@
+# if @REPLACE_GMTIME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef gmtime
+# define gmtime rpl_gmtime
+# endif
+_GL_FUNCDECL_RPL (gmtime, struct tm *, (time_t const *__timer)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (gmtime, struct tm *, (time_t const *__timer));
+# else
+_GL_CXXALIAS_SYS (gmtime, struct tm *, (time_t const *__timer));
+# endif
+_GL_CXXALIASWARN (gmtime);
+# endif
+
+/* Parse BUF as a timestamp, assuming FORMAT specifies its layout, and store
+ the resulting broken-down time into TM. See
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/strptime.html>. */
+# if @GNULIB_STRPTIME@
+# if ! @HAVE_STRPTIME@
+_GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf,
+ char const *restrict __format,
+ struct tm *restrict __tm)
+ _GL_ARG_NONNULL ((1, 2, 3)));
+# endif
+_GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf,
+ char const *restrict __format,
+ struct tm *restrict __tm));
+_GL_CXXALIASWARN (strptime);
+# endif
+
+/* Convert *TP to a date and time string. See
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/ctime.html>. */
+# if @GNULIB_CTIME@
+# if @REPLACE_CTIME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define ctime rpl_ctime
+# endif
+_GL_FUNCDECL_RPL (ctime, char *, (time_t const *__tp)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (ctime, char *, (time_t const *__tp));
+# else
+_GL_CXXALIAS_SYS (ctime, char *, (time_t const *__tp));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (ctime);
+# endif
+# endif
+
+/* Convert *TP to a date and time string. See
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html>. */
+# if @GNULIB_STRFTIME@
+# if @REPLACE_STRFTIME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strftime rpl_strftime
+# endif
+_GL_FUNCDECL_RPL (strftime, size_t,
+ (char *restrict __buf, size_t __bufsize,
+ const char *restrict __fmt, const struct tm *restrict __tp)
+ _GL_ARG_NONNULL ((1, 3, 4)));
+_GL_CXXALIAS_RPL (strftime, size_t,
+ (char *restrict __buf, size_t __bufsize,
+ const char *restrict __fmt, const struct tm *restrict __tp));
+# else
+_GL_CXXALIAS_SYS (strftime, size_t,
+ (char *restrict __buf, size_t __bufsize,
+ const char *restrict __fmt, const struct tm *restrict __tp));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (strftime);
+# endif
+# endif
+
+# if defined _GNU_SOURCE && @GNULIB_TIME_RZ@ && ! @HAVE_TIMEZONE_T@
+/* Functions that use a first-class time zone data type, instead of
+ relying on an implicit global time zone.
+ Inspired by NetBSD. */
+
+/* Represents a time zone.
+ (timezone_t) NULL stands for UTC. */
+typedef struct tm_zone *timezone_t;
+
+/* tzalloc (name)
+ Returns a time zone object for the given time zone NAME. This object
+ represents the time zone that other functions would use it the TZ
+ environment variable was set to NAME.
+ If NAME is NULL, the result represents the time zone that other functions
+ would use it the TZ environment variable was unset.
+ May return NULL if NAME is invalid (this is platform dependent) or
+ upon memory allocation failure. */
+_GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name));
+_GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name));
+
+/* tzfree (tz)
+ Frees a time zone object.
+ The argument must have been returned by tzalloc(). */
+_GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz));
+_GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz));
+
+/* localtime_rz (tz, &t, &result)
+ Converts an absolute time T to a broken-down time RESULT, assuming the
+ time zone TZ.
+ This function is like 'localtime_r', but relies on the argument TZ instead
+ of an implicit global time zone. */
+_GL_FUNCDECL_SYS (localtime_rz, struct tm *,
+ (timezone_t __tz, time_t const *restrict __timer,
+ struct tm *restrict __result) _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_SYS (localtime_rz, struct tm *,
+ (timezone_t __tz, time_t const *restrict __timer,
+ struct tm *restrict __result));
+
+/* mktime_z (tz, &tm)
+ Normalizes the broken-down time TM and converts it to an absolute time,
+ assuming the time zone TZ. Returns the absolute time.
+ This function is like 'mktime', but relies on the argument TZ instead
+ of an implicit global time zone. */
+_GL_FUNCDECL_SYS (mktime_z, time_t,
+ (timezone_t __tz, struct tm *restrict __tm)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_SYS (mktime_z, time_t,
+ (timezone_t __tz, struct tm *restrict __tm));
+
+/* Time zone abbreviation strings (returned by 'localtime_rz' or 'mktime_z'
+ in the 'tm_zone' member of 'struct tm') are valid as long as
+ - the 'struct tm' argument is not destroyed or overwritten,
+ and
+ - the 'timezone_t' argument is not freed through tzfree(). */
+
+# endif
+
+/* Convert TM to a time_t value, assuming UTC. */
+# if @GNULIB_TIMEGM@
+# if @REPLACE_TIMEGM@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef timegm
+# define timegm rpl_timegm
+# endif
+_GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm));
+# else
+# if ! @HAVE_TIMEGM@
+_GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm));
+# endif
+_GL_CXXALIASWARN (timegm);
+# endif
+
+/* Encourage applications to avoid unsafe functions that can overrun
+ buffers when given outlandish struct tm values. Portable
+ applications should use strftime (or even sprintf) instead. */
+# if defined GNULIB_POSIXCHECK
+# undef asctime
+_GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - "
+ "better use strftime (or even sprintf) instead");
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef asctime_r
+_GL_WARN_ON_USE (asctime_r, "asctime_r can overrun buffers in some cases - "
+ "better use strftime (or even sprintf) instead");
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef ctime
+_GL_WARN_ON_USE (ctime, "ctime can overrun buffers in some cases - "
+ "better use strftime (or even sprintf) instead");
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef ctime_r
+_GL_WARN_ON_USE (ctime_r, "ctime_r can overrun buffers in some cases - "
+ "better use strftime (or even sprintf) instead");
+# endif
+
+#endif
diff --git a/gl/lib/timespec.c b/gl/lib/timespec.c
new file mode 100644
index 0000000..9d136cb
--- /dev/null
+++ b/gl/lib/timespec.c
@@ -0,0 +1,21 @@
+/* Inline functions for <timespec.h>.
+
+ Copyright (C) 2012-2022 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/>. */
+
+#include <config.h>
+
+#define _GL_TIMESPEC_INLINE _GL_EXTERN_INLINE
+#include "timespec.h"
diff --git a/gl/lib/timespec.h b/gl/lib/timespec.h
new file mode 100644
index 0000000..9e35828
--- /dev/null
+++ b/gl/lib/timespec.h
@@ -0,0 +1,102 @@
+/* timespec -- System time interface
+
+ Copyright (C) 2000, 2002, 2004-2005, 2007, 2009-2022 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 TIMESPEC_H
+#define TIMESPEC_H
+
+#include <time.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GL_TIMESPEC_INLINE
+# define _GL_TIMESPEC_INLINE _GL_INLINE
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "arg-nonnull.h"
+
+/* Inverse resolution of timespec timestamps (in units per second),
+ and log base 10 of the inverse resolution. */
+
+enum { TIMESPEC_HZ = 1000000000 };
+enum { LOG10_TIMESPEC_HZ = 9 };
+
+/* Obsolescent names for backward compatibility.
+ They are misnomers, because TIMESPEC_RESOLUTION is not a resolution. */
+
+enum { TIMESPEC_RESOLUTION = TIMESPEC_HZ };
+enum { LOG10_TIMESPEC_RESOLUTION = LOG10_TIMESPEC_HZ };
+
+/* Return a timespec with seconds S and nanoseconds NS. */
+
+_GL_TIMESPEC_INLINE struct timespec
+make_timespec (time_t s, long int ns)
+{
+ struct timespec r;
+ r.tv_sec = s;
+ r.tv_nsec = ns;
+ return r;
+}
+
+/* Return negative, zero, positive if A < B, A == B, A > B, respectively. */
+
+_GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE
+timespec_cmp (struct timespec a, struct timespec b)
+{
+ return 2 * _GL_CMP (a.tv_sec, b.tv_sec) + _GL_CMP (a.tv_nsec, b.tv_nsec);
+}
+
+/* Return -1, 0, 1, depending on the sign of A. A.tv_nsec must be
+ nonnegative. */
+_GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE
+timespec_sign (struct timespec a)
+{
+ return _GL_CMP (a.tv_sec, 0) + (!a.tv_sec & !!a.tv_nsec);
+}
+
+struct timespec timespec_add (struct timespec, struct timespec)
+ _GL_ATTRIBUTE_CONST;
+struct timespec timespec_sub (struct timespec, struct timespec)
+ _GL_ATTRIBUTE_CONST;
+struct timespec dtotimespec (double)
+ _GL_ATTRIBUTE_CONST;
+
+/* Return an approximation to A, of type 'double'. */
+_GL_TIMESPEC_INLINE double
+timespectod (struct timespec a)
+{
+ return a.tv_sec + a.tv_nsec / 1e9;
+}
+
+long int gettime_res (void);
+struct timespec current_timespec (void);
+void gettime (struct timespec *) _GL_ARG_NONNULL ((1));
+int settime (struct timespec const *) _GL_ARG_NONNULL ((1));
+
+#ifdef __cplusplus
+}
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif
diff --git a/gl/lib/unistd--.h b/gl/lib/unistd--.h
new file mode 100644
index 0000000..d395f7e
--- /dev/null
+++ b/gl/lib/unistd--.h
@@ -0,0 +1,32 @@
+/* Like unistd.h, but redefine some names to avoid glitches.
+
+ Copyright (C) 2005, 2009-2022 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 <unistd.h>
+#include "unistd-safer.h"
+
+#undef dup
+#define dup dup_safer
+
+#undef pipe
+#define pipe pipe_safer
+
+#if GNULIB_PIPE2_SAFER
+# undef pipe2
+# define pipe2 pipe2_safer
+#endif
diff --git a/gl/lib/unistd-safer.h b/gl/lib/unistd-safer.h
new file mode 100644
index 0000000..db82c85
--- /dev/null
+++ b/gl/lib/unistd-safer.h
@@ -0,0 +1,31 @@
+/* Invoke unistd-like functions, but avoid some glitches.
+
+ Copyright (C) 2001, 2003, 2005, 2009-2022 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 and Eric Blake. */
+
+int dup_safer (int);
+int fd_safer (int);
+int pipe_safer (int[2]);
+
+#if GNULIB_FD_SAFER_FLAG
+int dup_safer_flag (int, int);
+int fd_safer_flag (int, int);
+#endif
+
+#if GNULIB_PIPE2_SAFER
+int pipe2_safer (int[2], int);
+#endif
diff --git a/gl/lib/unistd.c b/gl/lib/unistd.c
new file mode 100644
index 0000000..95978e6
--- /dev/null
+++ b/gl/lib/unistd.c
@@ -0,0 +1,22 @@
+/* Inline functions for <unistd.h>.
+
+ Copyright (C) 2012-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+#define _GL_UNISTD_INLINE _GL_EXTERN_INLINE
+#include "unistd.h"
+typedef int dummy;
diff --git a/gl/lib/unistd.in.h b/gl/lib/unistd.in.h
new file mode 100644
index 0000000..57df09e
--- /dev/null
+++ b/gl/lib/unistd.in.h
@@ -0,0 +1,2327 @@
+/* Substitute for and wrapper around <unistd.h>.
+ Copyright (C) 2003-2022 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 2.1 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/>. */
+
+#ifndef _@GUARD_PREFIX@_UNISTD_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if @HAVE_UNISTD_H@ && defined _GL_INCLUDING_UNISTD_H
+/* Special invocation convention:
+ - On Mac OS X 10.3.9 we have a sequence of nested includes
+ <unistd.h> -> <signal.h> -> <pthread.h> -> <unistd.h>
+ In this situation, the functions are not yet declared, therefore we cannot
+ provide the C++ aliases. */
+
+#@INCLUDE_NEXT@ @NEXT_UNISTD_H@
+
+#else
+/* Normal invocation convention. */
+
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_UNISTD_H@
+# define _GL_INCLUDING_UNISTD_H
+# @INCLUDE_NEXT@ @NEXT_UNISTD_H@
+# undef _GL_INCLUDING_UNISTD_H
+#endif
+
+/* Get all possible declarations of gethostname(). */
+#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
+ && !defined _GL_INCLUDING_WINSOCK2_H
+# define _GL_INCLUDING_WINSOCK2_H
+# include <winsock2.h>
+# undef _GL_INCLUDING_WINSOCK2_H
+#endif
+
+#if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
+#define _@GUARD_PREFIX@_UNISTD_H
+
+/* NetBSD 5.0 mis-defines NULL. Also get size_t. */
+/* But avoid namespace pollution on glibc systems. */
+#ifndef __GLIBC__
+# include <stddef.h>
+#endif
+
+/* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>. */
+/* MSVC declares 'unlink' in <stdio.h>, not in <unistd.h>. We must include
+ it before we #define unlink rpl_unlink. */
+/* Cygwin 1.7.1 declares symlinkat in <stdio.h>, not in <unistd.h>. */
+/* But avoid namespace pollution on glibc systems. */
+#if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \
+ || ((@GNULIB_UNLINK@ || defined GNULIB_POSIXCHECK) \
+ && (defined _WIN32 && ! defined __CYGWIN__)) \
+ || ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \
+ && defined __CYGWIN__)) \
+ && ! defined __GLIBC__
+# include <stdio.h>
+#endif
+
+/* Cygwin 1.7.1 and Android 4.3 declare unlinkat in <fcntl.h>, not in
+ <unistd.h>. */
+/* But avoid namespace pollution on glibc systems. */
+#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) \
+ && (defined __CYGWIN__ || defined __ANDROID__) \
+ && ! defined __GLIBC__
+# include <fcntl.h>
+#endif
+
+/* mingw fails to declare _exit in <unistd.h>. */
+/* mingw, MSVC, BeOS, Haiku declare environ in <stdlib.h>, not in
+ <unistd.h>. */
+/* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>. */
+/* OSF Tru64 Unix cannot see gnulib rpl_strtod when system <stdlib.h> is
+ included here. */
+/* But avoid namespace pollution on glibc systems. */
+#if !defined __GLIBC__ && !defined __osf__
+# define __need_system_stdlib_h
+# include <stdlib.h>
+# undef __need_system_stdlib_h
+#endif
+
+/* Native Windows platforms declare _chdir, _getcwd, _rmdir in
+ <io.h> and/or <direct.h>, not in <unistd.h>.
+ They also declare _access(), _chmod(), _close(), _dup(), _dup2(), _isatty(),
+ _lseek(), _read(), _unlink(), _write() in <io.h>. */
+#if defined _WIN32 && !defined __CYGWIN__
+# include <io.h>
+# include <direct.h>
+#endif
+
+/* Native Windows platforms declare _execl*, _execv* in <process.h>. */
+#if defined _WIN32 && !defined __CYGWIN__
+# include <process.h>
+#endif
+
+/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.
+ NonStop Kernel declares gethostname in <netdb.h>, not in <unistd.h>. */
+/* But avoid namespace pollution on glibc systems. */
+#if ((@GNULIB_GETDOMAINNAME@ && (defined _AIX || defined __osf__)) \
+ || (@GNULIB_GETHOSTNAME@ && defined __TANDEM)) \
+ && !defined __GLIBC__
+# include <netdb.h>
+#endif
+
+/* Mac OS X 10.13, Solaris 11.4, and Android 9.0 declare getentropy in
+ <sys/random.h>, not in <unistd.h>. */
+/* But avoid namespace pollution on glibc systems. */
+#if (@GNULIB_GETENTROPY@ || defined GNULIB_POSIXCHECK) \
+ && ((defined __APPLE__ && defined __MACH__) || defined __sun \
+ || defined __ANDROID__) \
+ && @UNISTD_H_HAVE_SYS_RANDOM_H@ \
+ && !defined __GLIBC__
+# include <sys/random.h>
+#endif
+
+/* Android 4.3 declares fchownat in <sys/stat.h>, not in <unistd.h>. */
+/* But avoid namespace pollution on glibc systems. */
+#if (@GNULIB_FCHOWNAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \
+ && !defined __GLIBC__
+# include <sys/stat.h>
+#endif
+
+/* MSVC defines off_t in <sys/types.h>.
+ May also define off_t to a 64-bit type on native Windows. */
+/* Get off_t, ssize_t, mode_t. */
+#include <sys/types.h>
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+/* Get getopt(), optarg, optind, opterr, optopt. */
+#if @GNULIB_GETOPT_POSIX@ && @GNULIB_UNISTD_H_GETOPT@ && !defined _GL_SYSTEM_GETOPT
+# include <getopt-cdefs.h>
+# include <getopt-pfx-core.h>
+#endif
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GL_UNISTD_INLINE
+# define _GL_UNISTD_INLINE _GL_INLINE
+#endif
+
+/* Hide some function declarations from <winsock2.h>. */
+
+#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@
+# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef socket
+# define socket socket_used_without_including_sys_socket_h
+# undef connect
+# define connect connect_used_without_including_sys_socket_h
+# undef accept
+# define accept accept_used_without_including_sys_socket_h
+# undef bind
+# define bind bind_used_without_including_sys_socket_h
+# undef getpeername
+# define getpeername getpeername_used_without_including_sys_socket_h
+# undef getsockname
+# define getsockname getsockname_used_without_including_sys_socket_h
+# undef getsockopt
+# define getsockopt getsockopt_used_without_including_sys_socket_h
+# undef listen
+# define listen listen_used_without_including_sys_socket_h
+# undef recv
+# define recv recv_used_without_including_sys_socket_h
+# undef send
+# define send send_used_without_including_sys_socket_h
+# undef recvfrom
+# define recvfrom recvfrom_used_without_including_sys_socket_h
+# undef sendto
+# define sendto sendto_used_without_including_sys_socket_h
+# undef setsockopt
+# define setsockopt setsockopt_used_without_including_sys_socket_h
+# undef shutdown
+# define shutdown shutdown_used_without_including_sys_socket_h
+# else
+ _GL_WARN_ON_USE (socket,
+ "socket() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (connect,
+ "connect() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (accept,
+ "accept() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (bind,
+ "bind() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (getpeername,
+ "getpeername() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (getsockname,
+ "getsockname() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (getsockopt,
+ "getsockopt() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (listen,
+ "listen() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (recv,
+ "recv() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (send,
+ "send() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (recvfrom,
+ "recvfrom() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (sendto,
+ "sendto() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (setsockopt,
+ "setsockopt() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (shutdown,
+ "shutdown() used without including <sys/socket.h>");
+# endif
+# endif
+# if !defined _@GUARD_PREFIX@_SYS_SELECT_H
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef select
+# define select select_used_without_including_sys_select_h
+# else
+ _GL_WARN_ON_USE (select,
+ "select() used without including <sys/select.h>");
+# endif
+# endif
+#endif
+
+
+/* OS/2 EMX lacks these macros. */
+#ifndef STDIN_FILENO
+# define STDIN_FILENO 0
+#endif
+#ifndef STDOUT_FILENO
+# define STDOUT_FILENO 1
+#endif
+#ifndef STDERR_FILENO
+# define STDERR_FILENO 2
+#endif
+
+/* Ensure *_OK macros exist. */
+#ifndef F_OK
+# define F_OK 0
+# define X_OK 1
+# define W_OK 2
+# define R_OK 4
+#endif
+
+
+/* Declare overridden functions. */
+
+
+#if @GNULIB_ACCESS@
+# if @REPLACE_ACCESS@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef access
+# define access rpl_access
+# endif
+_GL_FUNCDECL_RPL (access, int, (const char *file, int mode)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (access, int, (const char *file, int mode));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef access
+# define access _access
+# endif
+_GL_CXXALIAS_MDA (access, int, (const char *file, int mode));
+# else
+_GL_CXXALIAS_SYS (access, int, (const char *file, int mode));
+# endif
+_GL_CXXALIASWARN (access);
+#elif defined GNULIB_POSIXCHECK
+# undef access
+# if HAVE_RAW_DECL_ACCESS
+/* The access() function is a security risk. */
+_GL_WARN_ON_USE (access, "access does not always support X_OK - "
+ "use gnulib module access for portability; "
+ "also, this function is a security risk - "
+ "use the gnulib module faccessat instead");
+# endif
+#elif @GNULIB_MDA_ACCESS@
+/* On native Windows, map 'access' to '_access', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::access always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef access
+# define access _access
+# endif
+_GL_CXXALIAS_MDA (access, int, (const char *file, int mode));
+# else
+_GL_CXXALIAS_SYS (access, int, (const char *file, int mode));
+# endif
+_GL_CXXALIASWARN (access);
+#endif
+
+
+#if @GNULIB_CHDIR@
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef chdir
+# define chdir _chdir
+# endif
+_GL_CXXALIAS_MDA (chdir, int, (const char *file));
+# else
+_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIASWARN (chdir);
+#elif defined GNULIB_POSIXCHECK
+# undef chdir
+# if HAVE_RAW_DECL_CHDIR
+_GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - "
+ "use gnulib module chdir for portability");
+# endif
+#elif @GNULIB_MDA_CHDIR@
+/* On native Windows, map 'chdir' to '_chdir', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::chdir always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef chdir
+# define chdir _chdir
+# endif
+_GL_CXXALIAS_MDA (chdir, int, (const char *file));
+# else
+_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIASWARN (chdir);
+#endif
+
+
+#if @GNULIB_CHOWN@
+/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
+ to GID (if GID is not -1). Follow symbolic links.
+ Return 0 if successful, otherwise -1 and errno set.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html. */
+# if @REPLACE_CHOWN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef chown
+# define chown rpl_chown
+# endif
+_GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (chown, int, (const char *file, uid_t uid, gid_t gid));
+# else
+# if !@HAVE_CHOWN@
+_GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid));
+# endif
+_GL_CXXALIASWARN (chown);
+#elif defined GNULIB_POSIXCHECK
+# undef chown
+# if HAVE_RAW_DECL_CHOWN
+_GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and "
+ "doesn't treat a uid or gid of -1 on some systems - "
+ "use gnulib module chown for portability");
+# endif
+#endif
+
+
+#if @GNULIB_CLOSE@
+# if @REPLACE_CLOSE@
+/* Automatically included by modules that need a replacement for close. */
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef close
+# define close rpl_close
+# endif
+_GL_FUNCDECL_RPL (close, int, (int fd));
+_GL_CXXALIAS_RPL (close, int, (int fd));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef close
+# define close _close
+# endif
+_GL_CXXALIAS_MDA (close, int, (int fd));
+# else
+_GL_CXXALIAS_SYS (close, int, (int fd));
+# endif
+_GL_CXXALIASWARN (close);
+#elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+# undef close
+# define close close_used_without_requesting_gnulib_module_close
+#elif defined GNULIB_POSIXCHECK
+# undef close
+/* Assume close is always declared. */
+_GL_WARN_ON_USE (close, "close does not portably work on sockets - "
+ "use gnulib module close for portability");
+#elif @GNULIB_MDA_CLOSE@
+/* On native Windows, map 'close' to '_close', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::close always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef close
+# define close _close
+# endif
+_GL_CXXALIAS_MDA (close, int, (int fd));
+# else
+_GL_CXXALIAS_SYS (close, int, (int fd));
+# endif
+_GL_CXXALIASWARN (close);
+#endif
+
+
+#if @GNULIB_COPY_FILE_RANGE@
+# if @REPLACE_COPY_FILE_RANGE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef copy_file_range
+# define copy_file_range rpl_copy_file_range
+# endif
+_GL_FUNCDECL_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos,
+ int ofd, off_t *opos,
+ size_t len, unsigned flags));
+_GL_CXXALIAS_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos,
+ int ofd, off_t *opos,
+ size_t len, unsigned flags));
+# else
+# if !@HAVE_COPY_FILE_RANGE@
+_GL_FUNCDECL_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos,
+ int ofd, off_t *opos,
+ size_t len, unsigned flags));
+# endif
+_GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos,
+ int ofd, off_t *opos,
+ size_t len, unsigned flags));
+# endif
+_GL_CXXALIASWARN (copy_file_range);
+#elif defined GNULIB_POSIXCHECK
+# undef copy_file_range
+# if HAVE_RAW_DECL_COPY_FILE_RANGE
+_GL_WARN_ON_USE (copy_file_range,
+ "copy_file_range is unportable - "
+ "use gnulib module copy_file_range for portability");
+# endif
+#endif
+
+
+#if @GNULIB_DUP@
+# if @REPLACE_DUP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define dup rpl_dup
+# endif
+_GL_FUNCDECL_RPL (dup, int, (int oldfd));
+_GL_CXXALIAS_RPL (dup, int, (int oldfd));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef dup
+# define dup _dup
+# endif
+_GL_CXXALIAS_MDA (dup, int, (int oldfd));
+# else
+_GL_CXXALIAS_SYS (dup, int, (int oldfd));
+# endif
+_GL_CXXALIASWARN (dup);
+#elif defined GNULIB_POSIXCHECK
+# undef dup
+# if HAVE_RAW_DECL_DUP
+_GL_WARN_ON_USE (dup, "dup is unportable - "
+ "use gnulib module dup for portability");
+# endif
+#elif @GNULIB_MDA_DUP@
+/* On native Windows, map 'dup' to '_dup', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::dup always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef dup
+# define dup _dup
+# endif
+_GL_CXXALIAS_MDA (dup, int, (int oldfd));
+# else
+_GL_CXXALIAS_SYS (dup, int, (int oldfd));
+# endif
+_GL_CXXALIASWARN (dup);
+#endif
+
+
+#if @GNULIB_DUP2@
+/* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if
+ NEWFD = OLDFD, otherwise close NEWFD first if it is open.
+ Return newfd if successful, otherwise -1 and errno set.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html>. */
+# if @REPLACE_DUP2@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define dup2 rpl_dup2
+# endif
+_GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd));
+_GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef dup2
+# define dup2 _dup2
+# endif
+_GL_CXXALIAS_MDA (dup2, int, (int oldfd, int newfd));
+# else
+_GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd));
+# endif
+_GL_CXXALIASWARN (dup2);
+#elif defined GNULIB_POSIXCHECK
+# undef dup2
+# if HAVE_RAW_DECL_DUP2
+_GL_WARN_ON_USE (dup2, "dup2 is unportable - "
+ "use gnulib module dup2 for portability");
+# endif
+#elif @GNULIB_MDA_DUP2@
+/* On native Windows, map 'dup2' to '_dup2', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::dup2 always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef dup2
+# define dup2 _dup2
+# endif
+_GL_CXXALIAS_MDA (dup2, int, (int oldfd, int newfd));
+# else
+_GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd));
+# endif
+_GL_CXXALIASWARN (dup2);
+#endif
+
+
+#if @GNULIB_DUP3@
+/* Copy the file descriptor OLDFD into file descriptor NEWFD, with the
+ specified flags.
+ The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
+ and O_TEXT, O_BINARY (defined in "binary-io.h").
+ Close NEWFD first if it is open.
+ Return newfd if successful, otherwise -1 and errno set.
+ See the Linux man page at
+ <https://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>. */
+# if @HAVE_DUP3@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define dup3 rpl_dup3
+# endif
+_GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags));
+_GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags));
+# else
+_GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags));
+_GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags));
+# endif
+_GL_CXXALIASWARN (dup3);
+#elif defined GNULIB_POSIXCHECK
+# undef dup3
+# if HAVE_RAW_DECL_DUP3
+_GL_WARN_ON_USE (dup3, "dup3 is unportable - "
+ "use gnulib module dup3 for portability");
+# endif
+#endif
+
+
+#if @GNULIB_ENVIRON@
+# if defined __CYGWIN__ && !defined __i386__
+/* The 'environ' variable is defined in a DLL. Therefore its declaration needs
+ the '__declspec(dllimport)' attribute, but the system's <unistd.h> lacks it.
+ This leads to a link error on 64-bit Cygwin when the option
+ -Wl,--disable-auto-import is in use. */
+_GL_EXTERN_C __declspec(dllimport) char **environ;
+# endif
+# if !@HAVE_DECL_ENVIRON@
+/* Set of environment variables and values. An array of strings of the form
+ "VARIABLE=VALUE", terminated with a NULL. */
+# if defined __APPLE__ && defined __MACH__
+# include <TargetConditionals.h>
+# if !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR
+# define _GL_USE_CRT_EXTERNS
+# endif
+# endif
+# ifdef _GL_USE_CRT_EXTERNS
+# include <crt_externs.h>
+# define environ (*_NSGetEnviron ())
+# else
+# ifdef __cplusplus
+extern "C" {
+# endif
+extern char **environ;
+# ifdef __cplusplus
+}
+# endif
+# endif
+# endif
+#elif defined GNULIB_POSIXCHECK
+# if HAVE_RAW_DECL_ENVIRON
+_GL_UNISTD_INLINE char ***
+_GL_WARN_ON_USE_ATTRIBUTE ("environ is unportable - "
+ "use gnulib module environ for portability")
+rpl_environ (void)
+{
+ return &environ;
+}
+# undef environ
+# define environ (*rpl_environ ())
+# endif
+#endif
+
+
+#if @GNULIB_EUIDACCESS@
+/* Like access(), except that it uses the effective user id and group id of
+ the current process. */
+# if !@HAVE_EUIDACCESS@
+_GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (euidaccess, int, (const char *filename, int mode));
+_GL_CXXALIASWARN (euidaccess);
+# if defined GNULIB_POSIXCHECK
+/* Like access(), this function is a security risk. */
+_GL_WARN_ON_USE (euidaccess, "the euidaccess function is a security risk - "
+ "use the gnulib module faccessat instead");
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef euidaccess
+# if HAVE_RAW_DECL_EUIDACCESS
+_GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - "
+ "use gnulib module euidaccess for portability");
+# endif
+#endif
+
+
+#if @GNULIB_EXECL@
+# if @REPLACE_EXECL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execl
+# define execl rpl_execl
+# endif
+_GL_FUNCDECL_RPL (execl, int, (const char *program, const char *arg, ...)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (execl, int, (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execl, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execl);
+#elif defined GNULIB_POSIXCHECK
+# undef execl
+# if HAVE_RAW_DECL_EXECL
+_GL_WARN_ON_USE (execl, "execl behaves very differently on mingw - "
+ "use gnulib module execl for portability");
+# endif
+#elif @GNULIB_MDA_EXECL@
+/* On native Windows, map 'execl' to '_execl', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::execl always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execl
+# define execl _execl
+# endif
+_GL_CXXALIAS_MDA (execl, intptr_t, (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execl, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execl);
+#endif
+
+#if @GNULIB_EXECLE@
+# if @REPLACE_EXECLE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execle
+# define execle rpl_execle
+# endif
+_GL_FUNCDECL_RPL (execle, int, (const char *program, const char *arg, ...)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (execle, int, (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execle, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execle);
+#elif defined GNULIB_POSIXCHECK
+# undef execle
+# if HAVE_RAW_DECL_EXECLE
+_GL_WARN_ON_USE (execle, "execle behaves very differently on mingw - "
+ "use gnulib module execle for portability");
+# endif
+#elif @GNULIB_MDA_EXECLE@
+/* On native Windows, map 'execle' to '_execle', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::execle always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execle
+# define execle _execle
+# endif
+_GL_CXXALIAS_MDA (execle, intptr_t,
+ (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execle, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execle);
+#endif
+
+#if @GNULIB_EXECLP@
+# if @REPLACE_EXECLP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execlp
+# define execlp rpl_execlp
+# endif
+_GL_FUNCDECL_RPL (execlp, int, (const char *program, const char *arg, ...)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (execlp, int, (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execlp, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execlp);
+#elif defined GNULIB_POSIXCHECK
+# undef execlp
+# if HAVE_RAW_DECL_EXECLP
+_GL_WARN_ON_USE (execlp, "execlp behaves very differently on mingw - "
+ "use gnulib module execlp for portability");
+# endif
+#elif @GNULIB_MDA_EXECLP@
+/* On native Windows, map 'execlp' to '_execlp', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::execlp always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execlp
+# define execlp _execlp
+# endif
+_GL_CXXALIAS_MDA (execlp, intptr_t,
+ (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execlp, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execlp);
+#endif
+
+
+#if @GNULIB_EXECV@
+# if @REPLACE_EXECV@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execv
+# define execv rpl_execv
+# endif
+_GL_FUNCDECL_RPL (execv, int, (const char *program, char * const *argv)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (execv, int, (const char *program, char * const *argv));
+# else
+_GL_CXXALIAS_SYS (execv, int, (const char *program, char * const *argv));
+# endif
+_GL_CXXALIASWARN (execv);
+#elif defined GNULIB_POSIXCHECK
+# undef execv
+# if HAVE_RAW_DECL_EXECV
+_GL_WARN_ON_USE (execv, "execv behaves very differently on mingw - "
+ "use gnulib module execv for portability");
+# endif
+#elif @GNULIB_MDA_EXECV@
+/* On native Windows, map 'execv' to '_execv', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::execv always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execv
+# define execv _execv
+# endif
+_GL_CXXALIAS_MDA_CAST (execv, intptr_t,
+ (const char *program, char * const *argv));
+# else
+_GL_CXXALIAS_SYS (execv, int, (const char *program, char * const *argv));
+# endif
+_GL_CXXALIASWARN (execv);
+#endif
+
+#if @GNULIB_EXECVE@
+# if @REPLACE_EXECVE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execve
+# define execve rpl_execve
+# endif
+_GL_FUNCDECL_RPL (execve, int,
+ (const char *program, char * const *argv, char * const *env)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (execve, int,
+ (const char *program, char * const *argv, char * const *env));
+# else
+_GL_CXXALIAS_SYS (execve, int,
+ (const char *program, char * const *argv, char * const *env));
+# endif
+_GL_CXXALIASWARN (execve);
+#elif defined GNULIB_POSIXCHECK
+# undef execve
+# if HAVE_RAW_DECL_EXECVE
+_GL_WARN_ON_USE (execve, "execve behaves very differently on mingw - "
+ "use gnulib module execve for portability");
+# endif
+#elif @GNULIB_MDA_EXECVE@
+/* On native Windows, map 'execve' to '_execve', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::execve always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execve
+# define execve _execve
+# endif
+_GL_CXXALIAS_MDA_CAST (execve, intptr_t,
+ (const char *program, char * const *argv,
+ char * const *env));
+# else
+_GL_CXXALIAS_SYS (execve, int,
+ (const char *program, char * const *argv, char * const *env));
+# endif
+_GL_CXXALIASWARN (execve);
+#endif
+
+#if @GNULIB_EXECVP@
+# if @REPLACE_EXECVP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execvp
+# define execvp rpl_execvp
+# endif
+_GL_FUNCDECL_RPL (execvp, int, (const char *program, char * const *argv)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (execvp, int, (const char *program, char * const *argv));
+# else
+_GL_CXXALIAS_SYS (execvp, int, (const char *program, char * const *argv));
+# endif
+_GL_CXXALIASWARN (execvp);
+#elif defined GNULIB_POSIXCHECK
+# undef execvp
+# if HAVE_RAW_DECL_EXECVP
+_GL_WARN_ON_USE (execvp, "execvp behaves very differently on mingw - "
+ "use gnulib module execvp for portability");
+# endif
+#elif @GNULIB_MDA_EXECVP@
+/* On native Windows, map 'execvp' to '_execvp', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::execvp always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execvp
+# define execvp _execvp
+# endif
+_GL_CXXALIAS_MDA_CAST (execvp, intptr_t,
+ (const char *program, char * const *argv));
+# else
+_GL_CXXALIAS_SYS (execvp, int, (const char *program, char * const *argv));
+# endif
+_GL_CXXALIASWARN (execvp);
+#endif
+
+#if @GNULIB_EXECVPE@
+# if @REPLACE_EXECVPE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execvpe
+# define execvpe rpl_execvpe
+# endif
+_GL_FUNCDECL_RPL (execvpe, int,
+ (const char *program, char * const *argv, char * const *env)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (execvpe, int,
+ (const char *program, char * const *argv, char * const *env));
+# else
+# if !@HAVE_DECL_EXECVPE@
+_GL_FUNCDECL_SYS (execvpe, int,
+ (const char *program, char * const *argv, char * const *env)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (execvpe, int,
+ (const char *program, char * const *argv, char * const *env));
+# endif
+_GL_CXXALIASWARN (execvpe);
+#elif defined GNULIB_POSIXCHECK
+# undef execvpe
+# if HAVE_RAW_DECL_EXECVPE
+_GL_WARN_ON_USE (execvpe, "execvpe behaves very differently on mingw - "
+ "use gnulib module execvpe for portability");
+# endif
+#elif @GNULIB_MDA_EXECVPE@
+/* On native Windows, map 'execvpe' to '_execvpe', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::execvpe on all platforms that have
+ it. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execvpe
+# define execvpe _execvpe
+# endif
+_GL_CXXALIAS_MDA_CAST (execvpe, intptr_t,
+ (const char *program, char * const *argv,
+ char * const *env));
+# elif @HAVE_EXECVPE@
+# if !@HAVE_DECL_EXECVPE@
+_GL_FUNCDECL_SYS (execvpe, int,
+ (const char *program, char * const *argv, char * const *env)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (execvpe, int,
+ (const char *program, char * const *argv, char * const *env));
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_EXECVPE@
+_GL_CXXALIASWARN (execvpe);
+# endif
+#endif
+
+
+#if @GNULIB_FACCESSAT@
+# if @REPLACE_FACCESSAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef faccessat
+# define faccessat rpl_faccessat
+# endif
+_GL_FUNCDECL_RPL (faccessat, int,
+ (int fd, char const *name, int mode, int flag)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (faccessat, int,
+ (int fd, char const *name, int mode, int flag));
+# else
+# if !@HAVE_FACCESSAT@
+_GL_FUNCDECL_SYS (faccessat, int,
+ (int fd, char const *file, int mode, int flag)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (faccessat, int,
+ (int fd, char const *file, int mode, int flag));
+# endif
+_GL_CXXALIASWARN (faccessat);
+#elif defined GNULIB_POSIXCHECK
+# undef faccessat
+# if HAVE_RAW_DECL_FACCESSAT
+_GL_WARN_ON_USE (faccessat, "faccessat is not portable - "
+ "use gnulib module faccessat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FCHDIR@
+/* Change the process' current working directory to the directory on which
+ the given file descriptor is open.
+ Return 0 if successful, otherwise -1 and errno set.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>. */
+# if ! @HAVE_FCHDIR@
+_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
+
+/* Gnulib internal hooks needed to maintain the fchdir metadata. */
+_GL_EXTERN_C int _gl_register_fd (int fd, const char *filename)
+ _GL_ARG_NONNULL ((2));
+_GL_EXTERN_C void _gl_unregister_fd (int fd);
+_GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd);
+_GL_EXTERN_C const char *_gl_directory_name (int fd);
+
+# else
+# if !@HAVE_DECL_FCHDIR@
+_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
+# endif
+# endif
+_GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/));
+_GL_CXXALIASWARN (fchdir);
+#elif defined GNULIB_POSIXCHECK
+# undef fchdir
+# if HAVE_RAW_DECL_FCHDIR
+_GL_WARN_ON_USE (fchdir, "fchdir is unportable - "
+ "use gnulib module fchdir for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FCHOWNAT@
+# if @REPLACE_FCHOWNAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fchownat
+# define fchownat rpl_fchownat
+# endif
+_GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file,
+ uid_t owner, gid_t group, int flag)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file,
+ uid_t owner, gid_t group, int flag));
+# else
+# if !@HAVE_FCHOWNAT@
+_GL_FUNCDECL_SYS (fchownat, int, (int fd, char const *file,
+ uid_t owner, gid_t group, int flag)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file,
+ uid_t owner, gid_t group, int flag));
+# endif
+_GL_CXXALIASWARN (fchownat);
+#elif defined GNULIB_POSIXCHECK
+# undef fchownat
+# if HAVE_RAW_DECL_FCHOWNAT
+_GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
+ "use gnulib module fchownat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FDATASYNC@
+/* Synchronize changes to a file.
+ Return 0 if successful, otherwise -1 and errno set.
+ See POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>. */
+# if !@HAVE_FDATASYNC@ || !@HAVE_DECL_FDATASYNC@
+_GL_FUNCDECL_SYS (fdatasync, int, (int fd));
+# endif
+_GL_CXXALIAS_SYS (fdatasync, int, (int fd));
+_GL_CXXALIASWARN (fdatasync);
+#elif defined GNULIB_POSIXCHECK
+# undef fdatasync
+# if HAVE_RAW_DECL_FDATASYNC
+_GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - "
+ "use gnulib module fdatasync for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FSYNC@
+/* Synchronize changes, including metadata, to a file.
+ Return 0 if successful, otherwise -1 and errno set.
+ See POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>. */
+# if !@HAVE_FSYNC@
+_GL_FUNCDECL_SYS (fsync, int, (int fd));
+# endif
+_GL_CXXALIAS_SYS (fsync, int, (int fd));
+_GL_CXXALIASWARN (fsync);
+#elif defined GNULIB_POSIXCHECK
+# undef fsync
+# if HAVE_RAW_DECL_FSYNC
+_GL_WARN_ON_USE (fsync, "fsync is unportable - "
+ "use gnulib module fsync for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FTRUNCATE@
+/* Change the size of the file to which FD is opened to become equal to LENGTH.
+ Return 0 if successful, otherwise -1 and errno set.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html>. */
+# if @REPLACE_FTRUNCATE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ftruncate
+# define ftruncate rpl_ftruncate
+# endif
+_GL_FUNCDECL_RPL (ftruncate, int, (int fd, off_t length));
+_GL_CXXALIAS_RPL (ftruncate, int, (int fd, off_t length));
+# else
+# if !@HAVE_FTRUNCATE@
+_GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length));
+# endif
+_GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length));
+# endif
+_GL_CXXALIASWARN (ftruncate);
+#elif defined GNULIB_POSIXCHECK
+# undef ftruncate
+# if HAVE_RAW_DECL_FTRUNCATE
+_GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
+ "use gnulib module ftruncate for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETCWD@
+/* Get the name of the current working directory, and put it in SIZE bytes
+ of BUF.
+ Return BUF if successful, or NULL if the directory couldn't be determined
+ or SIZE was too small.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html>.
+ Additionally, the gnulib module 'getcwd' guarantees the following GNU
+ extension: If BUF is NULL, an array is allocated with 'malloc'; the array
+ is SIZE bytes long, unless SIZE == 0, in which case it is as big as
+ necessary. */
+# if @REPLACE_GETCWD@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define getcwd rpl_getcwd
+# endif
+_GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size));
+_GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getcwd
+# define getcwd _getcwd
+# endif
+_GL_CXXALIAS_MDA (getcwd, char *, (char *buf, size_t size));
+# else
+/* Need to cast, because on mingw, the second parameter is
+ int size. */
+_GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size));
+# endif
+_GL_CXXALIASWARN (getcwd);
+#elif defined GNULIB_POSIXCHECK
+# undef getcwd
+# if HAVE_RAW_DECL_GETCWD
+_GL_WARN_ON_USE (getcwd, "getcwd is unportable - "
+ "use gnulib module getcwd for portability");
+# endif
+#elif @GNULIB_MDA_GETCWD@
+/* On native Windows, map 'getcwd' to '_getcwd', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::getcwd always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getcwd
+# define getcwd _getcwd
+# endif
+/* Need to cast, because on mingw, the second parameter is either
+ 'int size' or 'size_t size'. */
+_GL_CXXALIAS_MDA_CAST (getcwd, char *, (char *buf, size_t size));
+# else
+_GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size));
+# endif
+_GL_CXXALIASWARN (getcwd);
+#endif
+
+
+#if @GNULIB_GETDOMAINNAME@
+/* Return the NIS domain name of the machine.
+ WARNING! The NIS domain name is unrelated to the fully qualified host name
+ of the machine. It is also unrelated to email addresses.
+ WARNING! The NIS domain name is usually the empty string or "(none)" when
+ not using NIS.
+
+ Put up to LEN bytes of the NIS domain name into NAME.
+ Null terminate it if the name is shorter than LEN.
+ If the NIS domain name is longer than LEN, set errno = EINVAL and return -1.
+ Return 0 if successful, otherwise set errno and return -1. */
+# if @REPLACE_GETDOMAINNAME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getdomainname
+# define getdomainname rpl_getdomainname
+# endif
+_GL_FUNCDECL_RPL (getdomainname, int, (char *name, size_t len)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (getdomainname, int, (char *name, size_t len));
+# else
+# if !@HAVE_DECL_GETDOMAINNAME@
+_GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (getdomainname, int, (char *name, size_t len));
+# endif
+_GL_CXXALIASWARN (getdomainname);
+#elif defined GNULIB_POSIXCHECK
+# undef getdomainname
+# if HAVE_RAW_DECL_GETDOMAINNAME
+_GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - "
+ "use gnulib module getdomainname for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETDTABLESIZE@
+/* Return the maximum number of file descriptors in the current process.
+ In POSIX, this is same as sysconf (_SC_OPEN_MAX). */
+# if @REPLACE_GETDTABLESIZE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getdtablesize
+# define getdtablesize rpl_getdtablesize
+# endif
+_GL_FUNCDECL_RPL (getdtablesize, int, (void));
+_GL_CXXALIAS_RPL (getdtablesize, int, (void));
+# else
+# if !@HAVE_GETDTABLESIZE@
+_GL_FUNCDECL_SYS (getdtablesize, int, (void));
+# endif
+/* Need to cast, because on AIX, the parameter list is
+ (...). */
+_GL_CXXALIAS_SYS_CAST (getdtablesize, int, (void));
+# endif
+_GL_CXXALIASWARN (getdtablesize);
+#elif defined GNULIB_POSIXCHECK
+# undef getdtablesize
+# if HAVE_RAW_DECL_GETDTABLESIZE
+_GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - "
+ "use gnulib module getdtablesize for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETENTROPY@
+/* Fill a buffer with random bytes. */
+# if !@HAVE_GETENTROPY@
+_GL_FUNCDECL_SYS (getentropy, int, (void *buffer, size_t length));
+# endif
+_GL_CXXALIAS_SYS (getentropy, int, (void *buffer, size_t length));
+_GL_CXXALIASWARN (getentropy);
+#elif defined GNULIB_POSIXCHECK
+# undef getentropy
+# if HAVE_RAW_DECL_GETENTROPY
+_GL_WARN_ON_USE (getentropy, "getentropy is unportable - "
+ "use gnulib module getentropy for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETGROUPS@
+/* Return the supplemental groups that the current process belongs to.
+ It is unspecified whether the effective group id is in the list.
+ If N is 0, return the group count; otherwise, N describes how many
+ entries are available in GROUPS. Return -1 and set errno if N is
+ not 0 and not large enough. Fails with ENOSYS on some systems. */
+# if @REPLACE_GETGROUPS@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getgroups
+# define getgroups rpl_getgroups
+# endif
+_GL_FUNCDECL_RPL (getgroups, int, (int n, gid_t *groups));
+_GL_CXXALIAS_RPL (getgroups, int, (int n, gid_t *groups));
+# else
+# if !@HAVE_GETGROUPS@
+_GL_FUNCDECL_SYS (getgroups, int, (int n, gid_t *groups));
+# endif
+_GL_CXXALIAS_SYS (getgroups, int, (int n, gid_t *groups));
+# endif
+_GL_CXXALIASWARN (getgroups);
+#elif defined GNULIB_POSIXCHECK
+# undef getgroups
+# if HAVE_RAW_DECL_GETGROUPS
+_GL_WARN_ON_USE (getgroups, "getgroups is unportable - "
+ "use gnulib module getgroups for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETHOSTNAME@
+/* Return the standard host name of the machine.
+ WARNING! The host name may or may not be fully qualified.
+
+ Put up to LEN bytes of the host name into NAME.
+ Null terminate it if the name is shorter than LEN.
+ If the host name is longer than LEN, set errno = EINVAL and return -1.
+ Return 0 if successful, otherwise set errno and return -1. */
+# if @UNISTD_H_HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef gethostname
+# define gethostname rpl_gethostname
+# endif
+_GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len));
+# else
+# if !@HAVE_GETHOSTNAME@
+_GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len)
+ _GL_ARG_NONNULL ((1)));
+# endif
+/* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second
+ parameter is
+ int len. */
+_GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len));
+# endif
+_GL_CXXALIASWARN (gethostname);
+#elif @UNISTD_H_HAVE_WINSOCK2_H@
+# undef gethostname
+# define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
+#elif defined GNULIB_POSIXCHECK
+# undef gethostname
+# if HAVE_RAW_DECL_GETHOSTNAME
+_GL_WARN_ON_USE (gethostname, "gethostname is unportable - "
+ "use gnulib module gethostname for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETLOGIN@
+/* Returns the user's login name, or NULL if it cannot be found. Upon error,
+ returns NULL with errno set.
+
+ See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getlogin.html>.
+
+ Most programs don't need to use this function, because the information is
+ available through environment variables:
+ ${LOGNAME-$USER} on Unix platforms,
+ $USERNAME on native Windows platforms.
+ */
+# if !@HAVE_DECL_GETLOGIN@
+_GL_FUNCDECL_SYS (getlogin, char *, (void));
+# endif
+_GL_CXXALIAS_SYS (getlogin, char *, (void));
+_GL_CXXALIASWARN (getlogin);
+#elif defined GNULIB_POSIXCHECK
+# undef getlogin
+# if HAVE_RAW_DECL_GETLOGIN
+_GL_WARN_ON_USE (getlogin, "getlogin is unportable - "
+ "use gnulib module getlogin for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETLOGIN_R@
+/* Copies the user's login name to NAME.
+ The array pointed to by NAME has room for SIZE bytes.
+
+ Returns 0 if successful. Upon error, an error number is returned, or -1 in
+ the case that the login name cannot be found but no specific error is
+ provided (this case is hopefully rare but is left open by the POSIX spec).
+
+ See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getlogin.html>.
+
+ Most programs don't need to use this function, because the information is
+ available through environment variables:
+ ${LOGNAME-$USER} on Unix platforms,
+ $USERNAME on native Windows platforms.
+ */
+# if @REPLACE_GETLOGIN_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define getlogin_r rpl_getlogin_r
+# endif
+_GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (getlogin_r, int, (char *name, size_t size));
+# else
+# if !@HAVE_DECL_GETLOGIN_R@
+_GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size)
+ _GL_ARG_NONNULL ((1)));
+# endif
+/* Need to cast, because on Solaris 10 systems, the second argument is
+ int size. */
+_GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size));
+# endif
+_GL_CXXALIASWARN (getlogin_r);
+#elif defined GNULIB_POSIXCHECK
+# undef getlogin_r
+# if HAVE_RAW_DECL_GETLOGIN_R
+_GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - "
+ "use gnulib module getlogin_r for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETPAGESIZE@
+# if @REPLACE_GETPAGESIZE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define getpagesize rpl_getpagesize
+# endif
+_GL_FUNCDECL_RPL (getpagesize, int, (void));
+_GL_CXXALIAS_RPL (getpagesize, int, (void));
+# else
+/* On HP-UX, getpagesize exists, but it is not declared in <unistd.h> even if
+ the compiler options -D_HPUX_SOURCE -D_XOPEN_SOURCE=600 are used. */
+# if defined __hpux
+_GL_FUNCDECL_SYS (getpagesize, int, (void));
+# endif
+# if !@HAVE_GETPAGESIZE@
+# if !defined getpagesize
+/* This is for POSIX systems. */
+# if !defined _gl_getpagesize && defined _SC_PAGESIZE
+# if ! (defined __VMS && __VMS_VER < 70000000)
+# define _gl_getpagesize() sysconf (_SC_PAGESIZE)
+# endif
+# endif
+/* This is for older VMS. */
+# if !defined _gl_getpagesize && defined __VMS
+# ifdef __ALPHA
+# define _gl_getpagesize() 8192
+# else
+# define _gl_getpagesize() 512
+# endif
+# endif
+/* This is for BeOS. */
+# if !defined _gl_getpagesize && @HAVE_OS_H@
+# include <OS.h>
+# if defined B_PAGE_SIZE
+# define _gl_getpagesize() B_PAGE_SIZE
+# endif
+# endif
+/* This is for AmigaOS4.0. */
+# if !defined _gl_getpagesize && defined __amigaos4__
+# define _gl_getpagesize() 2048
+# endif
+/* This is for older Unix systems. */
+# if !defined _gl_getpagesize && @HAVE_SYS_PARAM_H@
+# include <sys/param.h>
+# ifdef EXEC_PAGESIZE
+# define _gl_getpagesize() EXEC_PAGESIZE
+# else
+# ifdef NBPG
+# ifndef CLSIZE
+# define CLSIZE 1
+# endif
+# define _gl_getpagesize() (NBPG * CLSIZE)
+# else
+# ifdef NBPC
+# define _gl_getpagesize() NBPC
+# endif
+# endif
+# endif
+# endif
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define getpagesize() _gl_getpagesize ()
+# else
+# if !GNULIB_defined_getpagesize_function
+_GL_UNISTD_INLINE int
+getpagesize ()
+{
+ return _gl_getpagesize ();
+}
+# define GNULIB_defined_getpagesize_function 1
+# endif
+# endif
+# endif
+# endif
+/* Need to cast, because on Cygwin 1.5.x systems, the return type is size_t. */
+_GL_CXXALIAS_SYS_CAST (getpagesize, int, (void));
+# endif
+# if @HAVE_DECL_GETPAGESIZE@
+_GL_CXXALIASWARN (getpagesize);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef getpagesize
+# if HAVE_RAW_DECL_GETPAGESIZE
+_GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - "
+ "use gnulib module getpagesize for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETPASS@
+/* Function getpass() from module 'getpass':
+ Read a password from /dev/tty or stdin.
+ Function getpass() from module 'getpass-gnu':
+ Read a password of arbitrary length from /dev/tty or stdin. */
+# if (@GNULIB_GETPASS@ && @REPLACE_GETPASS@) \
+ || (@GNULIB_GETPASS_GNU@ && @REPLACE_GETPASS_FOR_GETPASS_GNU@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getpass
+# define getpass rpl_getpass
+# endif
+_GL_FUNCDECL_RPL (getpass, char *, (const char *prompt)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (getpass, char *, (const char *prompt));
+# else
+# if !@HAVE_GETPASS@
+_GL_FUNCDECL_SYS (getpass, char *, (const char *prompt)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (getpass, char *, (const char *prompt));
+# endif
+_GL_CXXALIASWARN (getpass);
+#elif defined GNULIB_POSIXCHECK
+# undef getpass
+# if HAVE_RAW_DECL_GETPASS
+_GL_WARN_ON_USE (getpass, "getpass is unportable - "
+ "use gnulib module getpass or getpass-gnu for portability");
+# endif
+#endif
+
+
+#if @GNULIB_MDA_GETPID@
+/* On native Windows, map 'getpid' to '_getpid', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::getpid always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getpid
+# define getpid _getpid
+# endif
+_GL_CXXALIAS_MDA (getpid, int, (void));
+# else
+_GL_CXXALIAS_SYS (getpid, pid_t, (void));
+# endif
+_GL_CXXALIASWARN (getpid);
+#endif
+
+
+#if @GNULIB_GETUSERSHELL@
+/* Return the next valid login shell on the system, or NULL when the end of
+ the list has been reached. */
+# if !@HAVE_DECL_GETUSERSHELL@
+_GL_FUNCDECL_SYS (getusershell, char *, (void));
+# endif
+_GL_CXXALIAS_SYS (getusershell, char *, (void));
+_GL_CXXALIASWARN (getusershell);
+#elif defined GNULIB_POSIXCHECK
+# undef getusershell
+# if HAVE_RAW_DECL_GETUSERSHELL
+_GL_WARN_ON_USE (getusershell, "getusershell is unportable - "
+ "use gnulib module getusershell for portability");
+# endif
+#endif
+
+#if @GNULIB_GETUSERSHELL@
+/* Rewind to pointer that is advanced at each getusershell() call. */
+# if !@HAVE_DECL_GETUSERSHELL@
+_GL_FUNCDECL_SYS (setusershell, void, (void));
+# endif
+_GL_CXXALIAS_SYS (setusershell, void, (void));
+_GL_CXXALIASWARN (setusershell);
+#elif defined GNULIB_POSIXCHECK
+# undef setusershell
+# if HAVE_RAW_DECL_SETUSERSHELL
+_GL_WARN_ON_USE (setusershell, "setusershell is unportable - "
+ "use gnulib module getusershell for portability");
+# endif
+#endif
+
+#if @GNULIB_GETUSERSHELL@
+/* Free the pointer that is advanced at each getusershell() call and
+ associated resources. */
+# if !@HAVE_DECL_GETUSERSHELL@
+_GL_FUNCDECL_SYS (endusershell, void, (void));
+# endif
+_GL_CXXALIAS_SYS (endusershell, void, (void));
+_GL_CXXALIASWARN (endusershell);
+#elif defined GNULIB_POSIXCHECK
+# undef endusershell
+# if HAVE_RAW_DECL_ENDUSERSHELL
+_GL_WARN_ON_USE (endusershell, "endusershell is unportable - "
+ "use gnulib module getusershell for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GROUP_MEMBER@
+/* Determine whether group id is in calling user's group list. */
+# if !@HAVE_GROUP_MEMBER@
+_GL_FUNCDECL_SYS (group_member, int, (gid_t gid));
+# endif
+_GL_CXXALIAS_SYS (group_member, int, (gid_t gid));
+_GL_CXXALIASWARN (group_member);
+#elif defined GNULIB_POSIXCHECK
+# undef group_member
+# if HAVE_RAW_DECL_GROUP_MEMBER
+_GL_WARN_ON_USE (group_member, "group_member is unportable - "
+ "use gnulib module group-member for portability");
+# endif
+#endif
+
+
+#if @GNULIB_ISATTY@
+# if @REPLACE_ISATTY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef isatty
+# define isatty rpl_isatty
+# endif
+# define GNULIB_defined_isatty 1
+_GL_FUNCDECL_RPL (isatty, int, (int fd));
+_GL_CXXALIAS_RPL (isatty, int, (int fd));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef isatty
+# define isatty _isatty
+# endif
+_GL_CXXALIAS_MDA (isatty, int, (int fd));
+# else
+_GL_CXXALIAS_SYS (isatty, int, (int fd));
+# endif
+_GL_CXXALIASWARN (isatty);
+#elif defined GNULIB_POSIXCHECK
+# undef isatty
+# if HAVE_RAW_DECL_ISATTY
+_GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - "
+ "use gnulib module isatty for portability");
+# endif
+#elif @GNULIB_MDA_ISATTY@
+/* On native Windows, map 'isatty' to '_isatty', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::isatty always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef isatty
+# define isatty _isatty
+# endif
+_GL_CXXALIAS_MDA (isatty, int, (int fd));
+# else
+_GL_CXXALIAS_SYS (isatty, int, (int fd));
+# endif
+_GL_CXXALIASWARN (isatty);
+#endif
+
+
+#if @GNULIB_LCHOWN@
+/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
+ to GID (if GID is not -1). Do not follow symbolic links.
+ Return 0 if successful, otherwise -1 and errno set.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html>. */
+# if @REPLACE_LCHOWN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef lchown
+# define lchown rpl_lchown
+# endif
+_GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (lchown, int, (char const *file, uid_t owner, gid_t group));
+# else
+# if !@HAVE_LCHOWN@
+_GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (lchown, int, (char const *file, uid_t owner, gid_t group));
+# endif
+_GL_CXXALIASWARN (lchown);
+#elif defined GNULIB_POSIXCHECK
+# undef lchown
+# if HAVE_RAW_DECL_LCHOWN
+_GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - "
+ "use gnulib module lchown for portability");
+# endif
+#endif
+
+
+#if @GNULIB_LINK@
+/* Create a new hard link for an existing file.
+ Return 0 if successful, otherwise -1 and errno set.
+ See POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html>. */
+# if @REPLACE_LINK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define link rpl_link
+# endif
+_GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (link, int, (const char *path1, const char *path2));
+# else
+# if !@HAVE_LINK@
+_GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (link, int, (const char *path1, const char *path2));
+# endif
+_GL_CXXALIASWARN (link);
+#elif defined GNULIB_POSIXCHECK
+# undef link
+# if HAVE_RAW_DECL_LINK
+_GL_WARN_ON_USE (link, "link is unportable - "
+ "use gnulib module link for portability");
+# endif
+#endif
+
+
+#if @GNULIB_LINKAT@
+/* Create a new hard link for an existing file, relative to two
+ directories. FLAG controls whether symlinks are followed.
+ Return 0 if successful, otherwise -1 and errno set. */
+# if @REPLACE_LINKAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef linkat
+# define linkat rpl_linkat
+# endif
+_GL_FUNCDECL_RPL (linkat, int,
+ (int fd1, const char *path1, int fd2, const char *path2,
+ int flag)
+ _GL_ARG_NONNULL ((2, 4)));
+_GL_CXXALIAS_RPL (linkat, int,
+ (int fd1, const char *path1, int fd2, const char *path2,
+ int flag));
+# else
+# if !@HAVE_LINKAT@
+_GL_FUNCDECL_SYS (linkat, int,
+ (int fd1, const char *path1, int fd2, const char *path2,
+ int flag)
+ _GL_ARG_NONNULL ((2, 4)));
+# endif
+_GL_CXXALIAS_SYS (linkat, int,
+ (int fd1, const char *path1, int fd2, const char *path2,
+ int flag));
+# endif
+_GL_CXXALIASWARN (linkat);
+#elif defined GNULIB_POSIXCHECK
+# undef linkat
+# if HAVE_RAW_DECL_LINKAT
+_GL_WARN_ON_USE (linkat, "linkat is unportable - "
+ "use gnulib module linkat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_LSEEK@
+/* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END.
+ Return the new offset if successful, otherwise -1 and errno set.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html>. */
+# if @REPLACE_LSEEK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define lseek rpl_lseek
+# endif
+_GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence));
+_GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef lseek
+# define lseek _lseek
+# endif
+_GL_CXXALIAS_MDA (lseek, off_t, (int fd, off_t offset, int whence));
+# else
+_GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence));
+# endif
+_GL_CXXALIASWARN (lseek);
+#elif defined GNULIB_POSIXCHECK
+# undef lseek
+# if HAVE_RAW_DECL_LSEEK
+_GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some "
+ "systems - use gnulib module lseek for portability");
+# endif
+#elif @GNULIB_MDA_LSEEK@
+/* On native Windows, map 'lseek' to '_lseek', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::lseek always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef lseek
+# define lseek _lseek
+# endif
+_GL_CXXALIAS_MDA (lseek, long, (int fd, long offset, int whence));
+# else
+_GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence));
+# endif
+_GL_CXXALIASWARN (lseek);
+#endif
+
+
+#if @GNULIB_PIPE@
+/* Create a pipe, defaulting to O_BINARY mode.
+ Store the read-end as fd[0] and the write-end as fd[1].
+ Return 0 upon success, or -1 with errno set upon failure. */
+# if !@HAVE_PIPE@
+_GL_FUNCDECL_SYS (pipe, int, (int fd[2]) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pipe, int, (int fd[2]));
+_GL_CXXALIASWARN (pipe);
+#elif defined GNULIB_POSIXCHECK
+# undef pipe
+# if HAVE_RAW_DECL_PIPE
+_GL_WARN_ON_USE (pipe, "pipe is unportable - "
+ "use gnulib module pipe-posix for portability");
+# endif
+#endif
+
+
+#if @GNULIB_PIPE2@
+/* Create a pipe, applying the given flags when opening the read-end of the
+ pipe and the write-end of the pipe.
+ The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
+ and O_TEXT, O_BINARY (defined in "binary-io.h").
+ Store the read-end as fd[0] and the write-end as fd[1].
+ Return 0 upon success, or -1 with errno set upon failure.
+ See also the Linux man page at
+ <https://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>. */
+# if @HAVE_PIPE2@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define pipe2 rpl_pipe2
+# endif
+_GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags));
+# else
+_GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags));
+# endif
+_GL_CXXALIASWARN (pipe2);
+#elif defined GNULIB_POSIXCHECK
+# undef pipe2
+# if HAVE_RAW_DECL_PIPE2
+_GL_WARN_ON_USE (pipe2, "pipe2 is unportable - "
+ "use gnulib module pipe2 for portability");
+# endif
+#endif
+
+
+#if @GNULIB_PREAD@
+/* Read at most BUFSIZE bytes from FD into BUF, starting at OFFSET.
+ Return the number of bytes placed into BUF if successful, otherwise
+ set errno and return -1. 0 indicates EOF.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html>. */
+# if @REPLACE_PREAD@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pread
+# define pread rpl_pread
+# endif
+_GL_FUNCDECL_RPL (pread, ssize_t,
+ (int fd, void *buf, size_t bufsize, off_t offset)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (pread, ssize_t,
+ (int fd, void *buf, size_t bufsize, off_t offset));
+# else
+# if !@HAVE_PREAD@
+_GL_FUNCDECL_SYS (pread, ssize_t,
+ (int fd, void *buf, size_t bufsize, off_t offset)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (pread, ssize_t,
+ (int fd, void *buf, size_t bufsize, off_t offset));
+# endif
+_GL_CXXALIASWARN (pread);
+#elif defined GNULIB_POSIXCHECK
+# undef pread
+# if HAVE_RAW_DECL_PREAD
+_GL_WARN_ON_USE (pread, "pread is unportable - "
+ "use gnulib module pread for portability");
+# endif
+#endif
+
+
+#if @GNULIB_PWRITE@
+/* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET.
+ Return the number of bytes written if successful, otherwise
+ set errno and return -1. 0 indicates nothing written. See the
+ POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html>. */
+# if @REPLACE_PWRITE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pwrite
+# define pwrite rpl_pwrite
+# endif
+_GL_FUNCDECL_RPL (pwrite, ssize_t,
+ (int fd, const void *buf, size_t bufsize, off_t offset)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (pwrite, ssize_t,
+ (int fd, const void *buf, size_t bufsize, off_t offset));
+# else
+# if !@HAVE_PWRITE@
+_GL_FUNCDECL_SYS (pwrite, ssize_t,
+ (int fd, const void *buf, size_t bufsize, off_t offset)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (pwrite, ssize_t,
+ (int fd, const void *buf, size_t bufsize, off_t offset));
+# endif
+_GL_CXXALIASWARN (pwrite);
+#elif defined GNULIB_POSIXCHECK
+# undef pwrite
+# if HAVE_RAW_DECL_PWRITE
+_GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
+ "use gnulib module pwrite for portability");
+# endif
+#endif
+
+
+#if @GNULIB_READ@
+/* Read up to COUNT bytes from file descriptor FD into the buffer starting
+ at BUF. See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html>. */
+# if @REPLACE_READ@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef read
+# define read rpl_read
+# endif
+_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef read
+# define read _read
+# endif
+_GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, size_t count));
+# else
+_GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count));
+# endif
+_GL_CXXALIASWARN (read);
+#elif @GNULIB_MDA_READ@
+/* On native Windows, map 'read' to '_read', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::read always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef read
+# define read _read
+# endif
+# ifdef __MINGW32__
+_GL_CXXALIAS_MDA (read, int, (int fd, void *buf, unsigned int count));
+# else
+_GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, unsigned int count));
+# endif
+# else
+_GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count));
+# endif
+_GL_CXXALIASWARN (read);
+#endif
+
+
+#if @GNULIB_READLINK@
+/* Read the contents of the symbolic link FILE and place the first BUFSIZE
+ bytes of it into BUF. Return the number of bytes placed into BUF if
+ successful, otherwise -1 and errno set.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html>. */
+# if @REPLACE_READLINK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define readlink rpl_readlink
+# endif
+_GL_FUNCDECL_RPL (readlink, ssize_t,
+ (const char *restrict file,
+ char *restrict buf, size_t bufsize)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (readlink, ssize_t,
+ (const char *restrict file,
+ char *restrict buf, size_t bufsize));
+# else
+# if !@HAVE_READLINK@
+_GL_FUNCDECL_SYS (readlink, ssize_t,
+ (const char *restrict file,
+ char *restrict buf, size_t bufsize)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (readlink, ssize_t,
+ (const char *restrict file,
+ char *restrict buf, size_t bufsize));
+# endif
+_GL_CXXALIASWARN (readlink);
+#elif defined GNULIB_POSIXCHECK
+# undef readlink
+# if HAVE_RAW_DECL_READLINK
+_GL_WARN_ON_USE (readlink, "readlink is unportable - "
+ "use gnulib module readlink for portability");
+# endif
+#endif
+
+
+#if @GNULIB_READLINKAT@
+# if @REPLACE_READLINKAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define readlinkat rpl_readlinkat
+# endif
+_GL_FUNCDECL_RPL (readlinkat, ssize_t,
+ (int fd, char const *restrict file,
+ char *restrict buf, size_t len)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (readlinkat, ssize_t,
+ (int fd, char const *restrict file,
+ char *restrict buf, size_t len));
+# else
+# if !@HAVE_READLINKAT@
+_GL_FUNCDECL_SYS (readlinkat, ssize_t,
+ (int fd, char const *restrict file,
+ char *restrict buf, size_t len)
+ _GL_ARG_NONNULL ((2, 3)));
+# endif
+_GL_CXXALIAS_SYS (readlinkat, ssize_t,
+ (int fd, char const *restrict file,
+ char *restrict buf, size_t len));
+# endif
+_GL_CXXALIASWARN (readlinkat);
+#elif defined GNULIB_POSIXCHECK
+# undef readlinkat
+# if HAVE_RAW_DECL_READLINKAT
+_GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - "
+ "use gnulib module readlinkat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_RMDIR@
+/* Remove the directory DIR. */
+# if @REPLACE_RMDIR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define rmdir rpl_rmdir
+# endif
+_GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (rmdir, int, (char const *name));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef rmdir
+# define rmdir _rmdir
+# endif
+_GL_CXXALIAS_MDA (rmdir, int, (char const *name));
+# else
+_GL_CXXALIAS_SYS (rmdir, int, (char const *name));
+# endif
+_GL_CXXALIASWARN (rmdir);
+#elif defined GNULIB_POSIXCHECK
+# undef rmdir
+# if HAVE_RAW_DECL_RMDIR
+_GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
+ "use gnulib module rmdir for portability");
+# endif
+#elif @GNULIB_MDA_RMDIR@
+/* On native Windows, map 'rmdir' to '_rmdir', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::rmdir always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef rmdir
+# define rmdir _rmdir
+# endif
+_GL_CXXALIAS_MDA (rmdir, int, (char const *name));
+# else
+_GL_CXXALIAS_SYS (rmdir, int, (char const *name));
+# endif
+_GL_CXXALIASWARN (rmdir);
+#endif
+
+
+#if @GNULIB_SETHOSTNAME@
+/* Set the host name of the machine.
+ The host name may or may not be fully qualified.
+
+ Put LEN bytes of NAME into the host name.
+ Return 0 if successful, otherwise, set errno and return -1.
+
+ Platforms with no ability to set the hostname return -1 and set
+ errno = ENOSYS. */
+# if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@
+_GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len)
+ _GL_ARG_NONNULL ((1)));
+# endif
+/* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5
+ and FreeBSD 6.4 the second parameter is int. On Solaris 11
+ 2011-10, the first parameter is not const. */
+_GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len));
+_GL_CXXALIASWARN (sethostname);
+#elif defined GNULIB_POSIXCHECK
+# undef sethostname
+# if HAVE_RAW_DECL_SETHOSTNAME
+_GL_WARN_ON_USE (sethostname, "sethostname is unportable - "
+ "use gnulib module sethostname for portability");
+# endif
+#endif
+
+
+#if @GNULIB_SLEEP@
+/* Pause the execution of the current thread for N seconds.
+ Returns the number of seconds left to sleep.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/sleep.html>. */
+# if @REPLACE_SLEEP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef sleep
+# define sleep rpl_sleep
+# endif
+_GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n));
+_GL_CXXALIAS_RPL (sleep, unsigned int, (unsigned int n));
+# else
+# if !@HAVE_SLEEP@
+_GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n));
+# endif
+_GL_CXXALIAS_SYS (sleep, unsigned int, (unsigned int n));
+# endif
+_GL_CXXALIASWARN (sleep);
+#elif defined GNULIB_POSIXCHECK
+# undef sleep
+# if HAVE_RAW_DECL_SLEEP
+_GL_WARN_ON_USE (sleep, "sleep is unportable - "
+ "use gnulib module sleep for portability");
+# endif
+#endif
+
+
+#if @GNULIB_MDA_SWAB@
+/* On native Windows, map 'swab' to '_swab', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::swab always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef swab
+# define swab _swab
+# endif
+/* Need to cast, because in old mingw the arguments are
+ (const char *from, char *to, size_t n). */
+_GL_CXXALIAS_MDA_CAST (swab, void, (char *from, char *to, int n));
+# else
+# if defined __hpux /* HP-UX */
+_GL_CXXALIAS_SYS (swab, void, (const char *from, char *to, int n));
+# elif defined __sun && !defined _XPG4 /* Solaris */
+_GL_CXXALIAS_SYS (swab, void, (const char *from, char *to, ssize_t n));
+# else
+_GL_CXXALIAS_SYS (swab, void, (const void *from, void *to, ssize_t n));
+# endif
+# endif
+_GL_CXXALIASWARN (swab);
+#endif
+
+
+#if @GNULIB_SYMLINK@
+# if @REPLACE_SYMLINK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef symlink
+# define symlink rpl_symlink
+# endif
+_GL_FUNCDECL_RPL (symlink, int, (char const *contents, char const *file)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (symlink, int, (char const *contents, char const *file));
+# else
+# if !@HAVE_SYMLINK@
+_GL_FUNCDECL_SYS (symlink, int, (char const *contents, char const *file)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (symlink, int, (char const *contents, char const *file));
+# endif
+_GL_CXXALIASWARN (symlink);
+#elif defined GNULIB_POSIXCHECK
+# undef symlink
+# if HAVE_RAW_DECL_SYMLINK
+_GL_WARN_ON_USE (symlink, "symlink is not portable - "
+ "use gnulib module symlink for portability");
+# endif
+#endif
+
+
+#if @GNULIB_SYMLINKAT@
+# if @REPLACE_SYMLINKAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef symlinkat
+# define symlinkat rpl_symlinkat
+# endif
+_GL_FUNCDECL_RPL (symlinkat, int,
+ (char const *contents, int fd, char const *file)
+ _GL_ARG_NONNULL ((1, 3)));
+_GL_CXXALIAS_RPL (symlinkat, int,
+ (char const *contents, int fd, char const *file));
+# else
+# if !@HAVE_SYMLINKAT@
+_GL_FUNCDECL_SYS (symlinkat, int,
+ (char const *contents, int fd, char const *file)
+ _GL_ARG_NONNULL ((1, 3)));
+# endif
+_GL_CXXALIAS_SYS (symlinkat, int,
+ (char const *contents, int fd, char const *file));
+# endif
+_GL_CXXALIASWARN (symlinkat);
+#elif defined GNULIB_POSIXCHECK
+# undef symlinkat
+# if HAVE_RAW_DECL_SYMLINKAT
+_GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - "
+ "use gnulib module symlinkat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_TRUNCATE@
+/* Change the size of the file designated by FILENAME to become equal to LENGTH.
+ Return 0 if successful, otherwise -1 and errno set.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html>. */
+# if @REPLACE_TRUNCATE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef truncate
+# define truncate rpl_truncate
+# endif
+_GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (truncate, int, (const char *filename, off_t length));
+# else
+# if !@HAVE_DECL_TRUNCATE@
+_GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length));
+# endif
+_GL_CXXALIASWARN (truncate);
+#elif defined GNULIB_POSIXCHECK
+# undef truncate
+# if HAVE_RAW_DECL_TRUNCATE
+_GL_WARN_ON_USE (truncate, "truncate is unportable - "
+ "use gnulib module truncate for portability");
+# endif
+#endif
+
+
+#if @GNULIB_TTYNAME_R@
+/* Store at most BUFLEN characters of the pathname of the terminal FD is
+ open on in BUF. Return 0 on success, otherwise an error number. */
+# if @REPLACE_TTYNAME_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ttyname_r
+# define ttyname_r rpl_ttyname_r
+# endif
+_GL_FUNCDECL_RPL (ttyname_r, int,
+ (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (ttyname_r, int,
+ (int fd, char *buf, size_t buflen));
+# else
+# if !@HAVE_DECL_TTYNAME_R@
+_GL_FUNCDECL_SYS (ttyname_r, int,
+ (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (ttyname_r, int,
+ (int fd, char *buf, size_t buflen));
+# endif
+_GL_CXXALIASWARN (ttyname_r);
+#elif defined GNULIB_POSIXCHECK
+# undef ttyname_r
+# if HAVE_RAW_DECL_TTYNAME_R
+_GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - "
+ "use gnulib module ttyname_r for portability");
+# endif
+#endif
+
+
+#if @GNULIB_UNLINK@
+# if @REPLACE_UNLINK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef unlink
+# define unlink rpl_unlink
+# endif
+_GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (unlink, int, (char const *file));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef unlink
+# define unlink _unlink
+# endif
+_GL_CXXALIAS_MDA (unlink, int, (char const *file));
+# else
+_GL_CXXALIAS_SYS (unlink, int, (char const *file));
+# endif
+_GL_CXXALIASWARN (unlink);
+#elif defined GNULIB_POSIXCHECK
+# undef unlink
+# if HAVE_RAW_DECL_UNLINK
+_GL_WARN_ON_USE (unlink, "unlink is not portable - "
+ "use gnulib module unlink for portability");
+# endif
+#elif @GNULIB_MDA_UNLINK@
+/* On native Windows, map 'unlink' to '_unlink', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::unlink always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef unlink
+# define unlink _unlink
+# endif
+_GL_CXXALIAS_MDA (unlink, int, (char const *file));
+# else
+_GL_CXXALIAS_SYS (unlink, int, (char const *file));
+# endif
+_GL_CXXALIASWARN (unlink);
+#endif
+
+
+#if @GNULIB_UNLINKAT@
+# if @REPLACE_UNLINKAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef unlinkat
+# define unlinkat rpl_unlinkat
+# endif
+_GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (unlinkat, int, (int fd, char const *file, int flag));
+# else
+# if !@HAVE_UNLINKAT@
+_GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (unlinkat, int, (int fd, char const *file, int flag));
+# endif
+_GL_CXXALIASWARN (unlinkat);
+#elif defined GNULIB_POSIXCHECK
+# undef unlinkat
+# if HAVE_RAW_DECL_UNLINKAT
+_GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - "
+ "use gnulib module unlinkat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_USLEEP@
+/* Pause the execution of the current thread for N microseconds.
+ Returns 0 on completion, or -1 on range error.
+ See the POSIX:2001 specification
+ <https://pubs.opengroup.org/onlinepubs/009695399/functions/usleep.html>. */
+# if @REPLACE_USLEEP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef usleep
+# define usleep rpl_usleep
+# endif
+_GL_FUNCDECL_RPL (usleep, int, (useconds_t n));
+_GL_CXXALIAS_RPL (usleep, int, (useconds_t n));
+# else
+# if !@HAVE_USLEEP@
+_GL_FUNCDECL_SYS (usleep, int, (useconds_t n));
+# endif
+/* Need to cast, because on Haiku, the first parameter is
+ unsigned int n. */
+_GL_CXXALIAS_SYS_CAST (usleep, int, (useconds_t n));
+# endif
+_GL_CXXALIASWARN (usleep);
+#elif defined GNULIB_POSIXCHECK
+# undef usleep
+# if HAVE_RAW_DECL_USLEEP
+_GL_WARN_ON_USE (usleep, "usleep is unportable - "
+ "use gnulib module usleep for portability");
+# endif
+#endif
+
+
+#if @GNULIB_WRITE@
+/* Write up to COUNT bytes starting at BUF to file descriptor FD.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html>. */
+# if @REPLACE_WRITE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef write
+# define write rpl_write
+# endif
+_GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef write
+# define write _write
+# endif
+_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, size_t count));
+# else
+_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count));
+# endif
+_GL_CXXALIASWARN (write);
+#elif @GNULIB_MDA_WRITE@
+/* On native Windows, map 'write' to '_write', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::write always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef write
+# define write _write
+# endif
+# ifdef __MINGW32__
+_GL_CXXALIAS_MDA (write, int, (int fd, const void *buf, unsigned int count));
+# else
+_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, unsigned int count));
+# endif
+# else
+_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count));
+# endif
+_GL_CXXALIASWARN (write);
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif /* _@GUARD_PREFIX@_UNISTD_H */
+#endif /* _GL_INCLUDING_UNISTD_H */
+#endif /* _@GUARD_PREFIX@_UNISTD_H */
diff --git a/gl/lib/unlink.c b/gl/lib/unlink.c
new file mode 100644
index 0000000..b549dd4
--- /dev/null
+++ b/gl/lib/unlink.c
@@ -0,0 +1,98 @@
+/* Work around unlink bugs.
+
+ Copyright (C) 2009-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+
+#include "filename.h"
+
+#undef unlink
+#if defined _WIN32 && !defined __CYGWIN__
+# define unlink _unlink
+#endif
+
+/* Remove file NAME.
+ Return 0 if successful, -1 if not. */
+
+int
+rpl_unlink (char const *name)
+{
+ /* Work around Solaris 9 bug where unlink("file/") succeeds. */
+ size_t len = strlen (name);
+ int result = 0;
+ if (len && ISSLASH (name[len - 1]))
+ {
+ /* We can't unlink(2) something if it doesn't exist. If it does
+ exist, then it resolved to a directory, due to the trailing
+ slash, and POSIX requires that the unlink attempt to remove
+ that directory (which would leave the symlink dangling).
+ Unfortunately, Solaris 9 is one of the platforms where the
+ root user can unlink directories, and we don't want to
+ cripple this behavior on real directories, even if it is
+ seldom needed (at any rate, it's nicer to let coreutils'
+ unlink(1) give the correct errno for non-root users). But we
+ don't know whether name was an actual directory, or a symlink
+ to a directory; and due to the bug of ignoring trailing
+ slash, Solaris 9 would end up successfully unlinking the
+ symlink instead of the directory. Technically, we could use
+ realpath to find the canonical directory name to attempt
+ deletion on. But that is a lot of work for a corner case; so
+ we instead just use an lstat on the shortened name, and
+ reject symlinks with trailing slashes. The root user of
+ unlink(1) will just have to live with the rule that they
+ can't delete a directory via a symlink. */
+ struct stat st;
+ result = lstat (name, &st);
+ if (result == 0 || errno == EOVERFLOW)
+ {
+ /* Trailing NUL will overwrite the trailing slash. */
+ char *short_name = malloc (len);
+ if (!short_name)
+ return -1;
+ memcpy (short_name, name, len);
+ while (len && ISSLASH (short_name[len - 1]))
+ short_name[--len] = '\0';
+ if (len && (lstat (short_name, &st) || S_ISLNK (st.st_mode)))
+ {
+ free (short_name);
+ errno = EPERM;
+ return -1;
+ }
+ free (short_name);
+ result = 0;
+ }
+ }
+ if (!result)
+ {
+#if UNLINK_PARENT_BUG
+ if (len >= 2 && name[len - 1] == '.' && name[len - 2] == '.'
+ && (len == 2 || ISSLASH (name[len - 3])))
+ {
+ errno = EISDIR; /* could also use EPERM */
+ return -1;
+ }
+#endif
+ result = unlink (name);
+ }
+ return result;
+}
diff --git a/gl/lib/unlinkat.c b/gl/lib/unlinkat.c
new file mode 100644
index 0000000..c9ff3ab
--- /dev/null
+++ b/gl/lib/unlinkat.c
@@ -0,0 +1,124 @@
+/* Work around unlinkat bugs on Solaris 9 and Hurd.
+
+ Copyright (C) 2009-2022 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 Eric Blake. */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <sys/stat.h>
+
+#include <stdlib.h>
+
+#include "filename.h"
+#include "openat.h"
+
+#if HAVE_UNLINKAT
+
+# undef unlinkat
+
+/* unlinkat without AT_REMOVEDIR does not honor trailing / on Solaris 9.
+ Hurd has the same issue.
+
+ unlinkat without AT_REMOVEDIR erroneously ignores ".." on Darwin 14.
+
+ Solve these in a similar manner to unlink. */
+
+int
+rpl_unlinkat (int fd, char const *name, int flag)
+{
+ size_t len;
+ int result = 0;
+ /* rmdir behavior has no problems with trailing slash. */
+ if (flag & AT_REMOVEDIR)
+ return unlinkat (fd, name, flag);
+
+ len = strlen (name);
+ if (len && ISSLASH (name[len - 1]))
+ {
+ /* See the lengthy comment in unlink.c why we disobey the POSIX
+ rule of letting unlink("link-to-dir/") attempt to unlink a
+ directory. */
+ struct stat st;
+ result = fstatat (fd, name, &st, AT_SYMLINK_NOFOLLOW);
+ if (result == 0 || errno == EOVERFLOW)
+ {
+ /* Trailing NUL will overwrite the trailing slash. */
+ char *short_name = malloc (len);
+ if (!short_name)
+ {
+ errno = EPERM;
+ return -1;
+ }
+ memcpy (short_name, name, len);
+ while (len && ISSLASH (short_name[len - 1]))
+ short_name[--len] = '\0';
+ if (len && (fstatat (fd, short_name, &st, AT_SYMLINK_NOFOLLOW)
+ || S_ISLNK (st.st_mode)))
+ {
+ free (short_name);
+ errno = EPERM;
+ return -1;
+ }
+ free (short_name);
+ result = 0;
+ }
+ }
+ if (!result)
+ {
+# if UNLINK_PARENT_BUG
+ if (len >= 2 && name[len - 1] == '.' && name[len - 2] == '.'
+ && (len == 2 || ISSLASH (name[len - 3])))
+ {
+ errno = EISDIR; /* could also use EPERM */
+ return -1;
+ }
+# endif
+ result = unlinkat (fd, name, flag);
+ }
+ return result;
+}
+
+#else /* !HAVE_UNLINKAT */
+
+/* Replacement for Solaris' function by the same name.
+ <https://www.google.com/search?q=unlinkat+site:docs.oracle.com>
+ First, try to simulate it via (unlink|rmdir) ("/proc/self/fd/FD/FILE").
+ Failing that, simulate it via save_cwd/fchdir/(unlink|rmdir)/restore_cwd.
+ If either the save_cwd or the restore_cwd fails (relatively unlikely),
+ then give a diagnostic and exit nonzero.
+ Otherwise, this function works just like Solaris' unlinkat. */
+
+# define AT_FUNC_NAME unlinkat
+# define AT_FUNC_F1 rmdir
+# define AT_FUNC_F2 unlink
+# define AT_FUNC_USE_F1_COND AT_REMOVEDIR
+# define AT_FUNC_POST_FILE_PARAM_DECLS , int flag
+# define AT_FUNC_POST_FILE_ARGS /* empty */
+# include "at-func.c"
+# undef AT_FUNC_NAME
+# undef AT_FUNC_F1
+# undef AT_FUNC_F2
+# undef AT_FUNC_USE_F1_COND
+# undef AT_FUNC_POST_FILE_PARAM_DECLS
+# undef AT_FUNC_POST_FILE_ARGS
+
+#endif /* !HAVE_UNLINKAT */
diff --git a/gl/lib/utime.c b/gl/lib/utime.c
new file mode 100644
index 0000000..799be0f
--- /dev/null
+++ b/gl/lib/utime.c
@@ -0,0 +1,288 @@
+/* Work around platform bugs in utime.
+ Copyright (C) 2017-2022 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. */
+
+#include <config.h>
+
+/* Specification. */
+#include <utime.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+
+# include <errno.h>
+# include <stdbool.h>
+# include <windows.h>
+# include "filename.h"
+# include "malloca.h"
+
+/* Don't assume that UNICODE is not defined. */
+# undef CreateFile
+# define CreateFile CreateFileA
+# undef GetFileAttributes
+# define GetFileAttributes GetFileAttributesA
+
+int
+_gl_utimens_windows (const char *name, struct timespec ts[2])
+{
+ /* POSIX <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>
+ specifies: "More than two leading <slash> characters shall be treated as
+ a single <slash> character." */
+ if (ISSLASH (name[0]) && ISSLASH (name[1]) && ISSLASH (name[2]))
+ {
+ name += 2;
+ while (ISSLASH (name[1]))
+ name++;
+ }
+
+ size_t len = strlen (name);
+ size_t drive_prefix_len = (HAS_DEVICE (name) ? 2 : 0);
+
+ /* Remove trailing slashes (except the very first one, at position
+ drive_prefix_len), but remember their presence. */
+ size_t rlen;
+ bool check_dir = false;
+
+ rlen = len;
+ while (rlen > drive_prefix_len && ISSLASH (name[rlen-1]))
+ {
+ check_dir = true;
+ if (rlen == drive_prefix_len + 1)
+ break;
+ rlen--;
+ }
+
+ const char *rname;
+ char *malloca_rname;
+ if (rlen == len)
+ {
+ rname = name;
+ malloca_rname = NULL;
+ }
+ else
+ {
+ malloca_rname = malloca (rlen + 1);
+ if (malloca_rname == NULL)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+ memcpy (malloca_rname, name, rlen);
+ malloca_rname[rlen] = '\0';
+ rname = malloca_rname;
+ }
+
+ DWORD error;
+
+ /* Open a handle to the file.
+ CreateFile
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-createfilea>
+ <https://docs.microsoft.com/en-us/windows/desktop/FileIO/creating-and-opening-files> */
+ HANDLE handle =
+ CreateFile (rname,
+ FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ NULL,
+ OPEN_EXISTING,
+ /* FILE_FLAG_POSIX_SEMANTICS (treat file names that differ only
+ in case as different) makes sense only when applied to *all*
+ filesystem operations. */
+ FILE_FLAG_BACKUP_SEMANTICS /* | FILE_FLAG_POSIX_SEMANTICS */,
+ NULL);
+ if (handle == INVALID_HANDLE_VALUE)
+ {
+ error = GetLastError ();
+ goto failed;
+ }
+
+ if (check_dir)
+ {
+ /* GetFileAttributes
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileattributesa> */
+ DWORD attributes = GetFileAttributes (rname);
+ if (attributes == INVALID_FILE_ATTRIBUTES)
+ {
+ error = GetLastError ();
+ CloseHandle (handle);
+ goto failed;
+ }
+ if ((attributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
+ {
+ CloseHandle (handle);
+ if (malloca_rname != NULL)
+ freea (malloca_rname);
+ errno = ENOTDIR;
+ return -1;
+ }
+ }
+
+ {
+ /* Use SetFileTime(). See
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-setfiletime>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-filetime> */
+ FILETIME last_access_time;
+ FILETIME last_write_time;
+ if (ts == NULL)
+ {
+ /* GetSystemTimeAsFileTime is the same as
+ GetSystemTime followed by SystemTimeToFileTime.
+ <https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimeasfiletime>.
+ It would be overkill to use
+ GetSystemTimePreciseAsFileTime
+ <https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimepreciseasfiletime>. */
+ FILETIME current_time;
+ GetSystemTimeAsFileTime (&current_time);
+ last_access_time = current_time;
+ last_write_time = current_time;
+ }
+ else
+ {
+ {
+ ULONGLONG time_since_16010101 =
+ (ULONGLONG) ts[0].tv_sec * 10000000 + ts[0].tv_nsec / 100 + 116444736000000000LL;
+ last_access_time.dwLowDateTime = (DWORD) time_since_16010101;
+ last_access_time.dwHighDateTime = time_since_16010101 >> 32;
+ }
+ {
+ ULONGLONG time_since_16010101 =
+ (ULONGLONG) ts[1].tv_sec * 10000000 + ts[1].tv_nsec / 100 + 116444736000000000LL;
+ last_write_time.dwLowDateTime = (DWORD) time_since_16010101;
+ last_write_time.dwHighDateTime = time_since_16010101 >> 32;
+ }
+ }
+ if (SetFileTime (handle, NULL, &last_access_time, &last_write_time))
+ {
+ CloseHandle (handle);
+ if (malloca_rname != NULL)
+ freea (malloca_rname);
+ return 0;
+ }
+ else
+ {
+ #if 0
+ DWORD sft_error = GetLastError ();
+ fprintf (stderr, "utimens SetFileTime error 0x%x\n", (unsigned int) sft_error);
+ #endif
+ CloseHandle (handle);
+ if (malloca_rname != NULL)
+ freea (malloca_rname);
+ errno = EINVAL;
+ return -1;
+ }
+ }
+
+ failed:
+ {
+ #if 0
+ fprintf (stderr, "utimens CreateFile/GetFileAttributes error 0x%x\n", (unsigned int) error);
+ #endif
+ if (malloca_rname != NULL)
+ freea (malloca_rname);
+
+ switch (error)
+ {
+ /* Some of these errors probably cannot happen with the specific flags
+ that we pass to CreateFile. But who knows... */
+ case ERROR_FILE_NOT_FOUND: /* The last component of rname does not exist. */
+ case ERROR_PATH_NOT_FOUND: /* Some directory component in rname does not exist. */
+ case ERROR_BAD_PATHNAME: /* rname is such as '\\server'. */
+ case ERROR_BAD_NETPATH: /* rname is such as '\\nonexistentserver\share'. */
+ case ERROR_BAD_NET_NAME: /* rname is such as '\\server\nonexistentshare'. */
+ case ERROR_INVALID_NAME: /* rname contains wildcards, misplaced colon, etc. */
+ case ERROR_DIRECTORY:
+ errno = ENOENT;
+ break;
+
+ case ERROR_ACCESS_DENIED: /* rname is such as 'C:\System Volume Information\foo'. */
+ case ERROR_SHARING_VIOLATION: /* rname is such as 'C:\pagefile.sys'. */
+ errno = (ts != NULL ? EPERM : EACCES);
+ break;
+
+ case ERROR_OUTOFMEMORY:
+ errno = ENOMEM;
+ break;
+
+ case ERROR_WRITE_PROTECT:
+ errno = EROFS;
+ break;
+
+ case ERROR_WRITE_FAULT:
+ case ERROR_READ_FAULT:
+ case ERROR_GEN_FAILURE:
+ errno = EIO;
+ break;
+
+ case ERROR_BUFFER_OVERFLOW:
+ case ERROR_FILENAME_EXCED_RANGE:
+ errno = ENAMETOOLONG;
+ break;
+
+ case ERROR_DELETE_PENDING: /* XXX map to EACCES or EPERM? */
+ errno = EPERM;
+ break;
+
+ default:
+ errno = EINVAL;
+ break;
+ }
+
+ return -1;
+ }
+}
+
+int
+utime (const char *name, const struct utimbuf *ts)
+{
+ if (ts == NULL)
+ return _gl_utimens_windows (name, NULL);
+ else
+ {
+ struct timespec ts_with_nanoseconds[2];
+ ts_with_nanoseconds[0].tv_sec = ts->actime;
+ ts_with_nanoseconds[0].tv_nsec = 0;
+ ts_with_nanoseconds[1].tv_sec = ts->modtime;
+ ts_with_nanoseconds[1].tv_nsec = 0;
+ return _gl_utimens_windows (name, ts_with_nanoseconds);
+ }
+}
+
+#else
+
+# include <errno.h>
+# include <sys/stat.h>
+# include "filename.h"
+
+int
+utime (const char *name, const struct utimbuf *ts)
+#undef utime
+{
+# if REPLACE_FUNC_UTIME_FILE
+ /* macOS 10.13 mistakenly succeeds when given a symbolic link to a
+ non-directory with a trailing slash. */
+ size_t len = strlen (name);
+ if (len > 0 && ISSLASH (name[len - 1]))
+ {
+ struct stat buf;
+
+ if (stat (name, &buf) == -1 && errno != EOVERFLOW)
+ return -1;
+ }
+# endif /* REPLACE_FUNC_UTIME_FILE */
+
+ return utime (name, ts);
+}
+
+#endif
diff --git a/gl/lib/utime.in.h b/gl/lib/utime.in.h
new file mode 100644
index 0000000..6cf17b6
--- /dev/null
+++ b/gl/lib/utime.in.h
@@ -0,0 +1,112 @@
+/* Substitute for and wrapper around <utime.h>.
+ Copyright (C) 2017-2022 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 2.1 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/>. */
+
+#ifndef _@GUARD_PREFIX@_UTIME_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_UTIME_H@
+# @INCLUDE_NEXT@ @NEXT_UTIME_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_UTIME_H
+#define _@GUARD_PREFIX@_UTIME_H
+
+#if !@HAVE_UTIME_H@
+# include <sys/utime.h>
+#endif
+
+#if @GNULIB_UTIME@
+/* Get struct timespec. */
+# include <time.h>
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+#if defined _WIN32 && ! defined __CYGWIN__
+
+/* Define 'struct utimbuf' as an alias of 'struct _utimbuf'
+ (or possibly, if present, 'struct __utimbuf64'). */
+# define utimbuf _utimbuf
+
+#endif
+
+
+#if @GNULIB_UTIME@
+# if @REPLACE_UTIME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define utime rpl_utime
+# endif
+_GL_FUNCDECL_RPL (utime, int, (const char *filename, const struct utimbuf *ts)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (utime, int, (const char *filename, const struct utimbuf *ts));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef utime
+# define utime _utime
+# endif
+_GL_CXXALIAS_MDA (utime, int, (const char *filename, const struct utimbuf *ts));
+# else
+# if !@HAVE_UTIME@
+_GL_FUNCDECL_SYS (utime, int, (const char *filename, const struct utimbuf *ts)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (utime, int, (const char *filename, const struct utimbuf *ts));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (utime);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef utime
+# if HAVE_RAW_DECL_UTIME
+_GL_WARN_ON_USE (utime,
+ "utime is unportable - "
+ "use gnulib module canonicalize-lgpl for portability");
+# endif
+#elif @GNULIB_MDA_UTIME@
+/* On native Windows, map 'utime' to '_utime', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::utime always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef utime
+# define utime _utime
+# endif
+_GL_CXXALIAS_MDA (utime, int, (const char *filename, const struct utimbuf *ts));
+# else
+_GL_CXXALIAS_SYS (utime, int, (const char *filename, const struct utimbuf *ts));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (utime);
+# endif
+#endif
+
+#if @GNULIB_UTIME@
+extern int _gl_utimens_windows (const char *filename, struct timespec ts[2]);
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_UTIME_H */
+#endif /* _@GUARD_PREFIX@_UTIME_H */
diff --git a/gl/lib/utimens.c b/gl/lib/utimens.c
new file mode 100644
index 0000000..2fa1251
--- /dev/null
+++ b/gl/lib/utimens.c
@@ -0,0 +1,647 @@
+/* Set file access and modification times.
+
+ Copyright (C) 2003-2022 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 Paul Eggert. */
+
+/* derived from a function in touch.c */
+
+#include <config.h>
+
+#define _GL_UTIMENS_INLINE _GL_EXTERN_INLINE
+#include "utimens.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <utime.h>
+
+#include "stat-time.h"
+#include "timespec.h"
+
+/* On native Windows, use SetFileTime; but avoid this when compiling
+ GNU Emacs, which arranges for this in some other way and which
+ defines WIN32_LEAN_AND_MEAN itself. */
+
+#if defined _WIN32 && ! defined __CYGWIN__ && ! defined EMACS_CONFIGURATION
+# define USE_SETFILETIME
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+#endif
+
+/* Avoid recursion with rpl_futimens or rpl_utimensat. */
+#undef futimens
+#if !HAVE_NEARLY_WORKING_UTIMENSAT
+# undef utimensat
+#endif
+
+/* Solaris 9 mistakenly succeeds when given a non-directory with a
+ trailing slash. Force the use of rpl_stat for a fix. */
+#ifndef REPLACE_FUNC_STAT_FILE
+# define REPLACE_FUNC_STAT_FILE 0
+#endif
+
+#if HAVE_UTIMENSAT || HAVE_FUTIMENS
+/* Cache variables for whether the utimensat syscall works; used to
+ avoid calling the syscall if we know it will just fail with ENOSYS,
+ and to avoid unnecessary work in massaging timestamps if the
+ syscall will work. Multiple variables are needed, to distinguish
+ between the following scenarios on Linux:
+ utimensat doesn't exist, or is in glibc but kernel 2.6.18 fails with ENOSYS
+ kernel 2.6.22 and earlier rejects AT_SYMLINK_NOFOLLOW
+ kernel 2.6.25 and earlier reject UTIME_NOW/UTIME_OMIT with non-zero tv_sec
+ kernel 2.6.32 used with xfs or ntfs-3g fail to honor UTIME_OMIT
+ utimensat completely works
+ For each cache variable: 0 = unknown, 1 = yes, -1 = no. */
+static int utimensat_works_really;
+static int lutimensat_works_really;
+#endif /* HAVE_UTIMENSAT || HAVE_FUTIMENS */
+
+/* Validate the requested timestamps. Return 0 if the resulting
+ timespec can be used for utimensat (after possibly modifying it to
+ work around bugs in utimensat). Return a positive value if the
+ timespec needs further adjustment based on stat results: 1 if any
+ adjustment is needed for utimes, and 2 if any adjustment is needed
+ for Linux utimensat. Return -1, with errno set to EINVAL, if
+ timespec is out of range. */
+static int
+validate_timespec (struct timespec timespec[2])
+{
+ int result = 0;
+ int utime_omit_count = 0;
+ if ((timespec[0].tv_nsec != UTIME_NOW
+ && timespec[0].tv_nsec != UTIME_OMIT
+ && ! (0 <= timespec[0].tv_nsec
+ && timespec[0].tv_nsec < TIMESPEC_HZ))
+ || (timespec[1].tv_nsec != UTIME_NOW
+ && timespec[1].tv_nsec != UTIME_OMIT
+ && ! (0 <= timespec[1].tv_nsec
+ && timespec[1].tv_nsec < TIMESPEC_HZ)))
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ /* Work around Linux kernel 2.6.25 bug, where utimensat fails with
+ EINVAL if tv_sec is not 0 when using the flag values of tv_nsec.
+ Flag a Linux kernel 2.6.32 bug, where an mtime of UTIME_OMIT
+ fails to bump ctime. */
+ if (timespec[0].tv_nsec == UTIME_NOW
+ || timespec[0].tv_nsec == UTIME_OMIT)
+ {
+ timespec[0].tv_sec = 0;
+ result = 1;
+ if (timespec[0].tv_nsec == UTIME_OMIT)
+ utime_omit_count++;
+ }
+ if (timespec[1].tv_nsec == UTIME_NOW
+ || timespec[1].tv_nsec == UTIME_OMIT)
+ {
+ timespec[1].tv_sec = 0;
+ result = 1;
+ if (timespec[1].tv_nsec == UTIME_OMIT)
+ utime_omit_count++;
+ }
+ return result + (utime_omit_count == 1);
+}
+
+/* Normalize any UTIME_NOW or UTIME_OMIT values in (*TS)[0] and (*TS)[1],
+ using STATBUF to obtain the current timestamps of the file. If
+ both times are UTIME_NOW, set *TS to NULL (as this can avoid some
+ permissions issues). If both times are UTIME_OMIT, return true
+ (nothing further beyond the prior collection of STATBUF is
+ necessary); otherwise return false. */
+static bool
+update_timespec (struct stat const *statbuf, struct timespec **ts)
+{
+ struct timespec *timespec = *ts;
+ if (timespec[0].tv_nsec == UTIME_OMIT
+ && timespec[1].tv_nsec == UTIME_OMIT)
+ return true;
+ if (timespec[0].tv_nsec == UTIME_NOW
+ && timespec[1].tv_nsec == UTIME_NOW)
+ {
+ *ts = NULL;
+ return false;
+ }
+
+ if (timespec[0].tv_nsec == UTIME_OMIT)
+ timespec[0] = get_stat_atime (statbuf);
+ else if (timespec[0].tv_nsec == UTIME_NOW)
+ gettime (&timespec[0]);
+
+ if (timespec[1].tv_nsec == UTIME_OMIT)
+ timespec[1] = get_stat_mtime (statbuf);
+ else if (timespec[1].tv_nsec == UTIME_NOW)
+ gettime (&timespec[1]);
+
+ return false;
+}
+
+/* Set the access and modification timestamps of FD (a.k.a. FILE) to be
+ TIMESPEC[0] and TIMESPEC[1], respectively.
+ FD must be either negative -- in which case it is ignored --
+ or a file descriptor that is open on FILE.
+ If FD is nonnegative, then FILE can be NULL, which means
+ use just futimes (or equivalent) instead of utimes (or equivalent),
+ and fail if on an old system without futimes (or equivalent).
+ If TIMESPEC is null, set the timestamps to the current time.
+ Return 0 on success, -1 (setting errno) on failure. */
+
+int
+fdutimens (int fd, char const *file, struct timespec const timespec[2])
+{
+ struct timespec adjusted_timespec[2];
+ struct timespec *ts = timespec ? adjusted_timespec : NULL;
+ int adjustment_needed = 0;
+ struct stat st;
+
+ if (ts)
+ {
+ adjusted_timespec[0] = timespec[0];
+ adjusted_timespec[1] = timespec[1];
+ adjustment_needed = validate_timespec (ts);
+ }
+ if (adjustment_needed < 0)
+ return -1;
+
+ /* Require that at least one of FD or FILE are potentially valid, to avoid
+ a Linux bug where futimens (AT_FDCWD, NULL) changes "." rather
+ than failing. */
+ if (fd < 0 && !file)
+ {
+ errno = EBADF;
+ return -1;
+ }
+
+ /* Some Linux-based NFS clients are buggy, and mishandle timestamps
+ of files in NFS file systems in some cases. We have no
+ configure-time test for this, but please see
+ <https://bugs.gentoo.org/show_bug.cgi?id=132673> for references to
+ some of the problems with Linux 2.6.16. If this affects you,
+ compile with -DHAVE_BUGGY_NFS_TIME_STAMPS; this is reported to
+ help in some cases, albeit at a cost in performance. But you
+ really should upgrade your kernel to a fixed version, since the
+ problem affects many applications. */
+
+#if HAVE_BUGGY_NFS_TIME_STAMPS
+ if (fd < 0)
+ sync ();
+ else
+ fsync (fd);
+#endif
+
+ /* POSIX 2008 added two interfaces to set file timestamps with
+ nanosecond resolution; newer Linux implements both functions via
+ a single syscall. We provide a fallback for ENOSYS (for example,
+ compiling against Linux 2.6.25 kernel headers and glibc 2.7, but
+ running on Linux 2.6.18 kernel). */
+#if HAVE_UTIMENSAT || HAVE_FUTIMENS
+ if (0 <= utimensat_works_really)
+ {
+ int result;
+# if __linux__ || __sun
+ /* As recently as Linux kernel 2.6.32 (Dec 2009), several file
+ systems (xfs, ntfs-3g) have bugs with a single UTIME_OMIT,
+ but work if both times are either explicitly specified or
+ UTIME_NOW. Work around it with a preparatory [f]stat prior
+ to calling futimens/utimensat; fortunately, there is not much
+ timing impact due to the extra syscall even on file systems
+ where UTIME_OMIT would have worked.
+
+ The same bug occurs in Solaris 11.1 (Apr 2013).
+
+ FIXME: Simplify this for Linux in 2016 and for Solaris in
+ 2024, when file system bugs are no longer common. */
+ if (adjustment_needed == 2)
+ {
+ if (fd < 0 ? stat (file, &st) : fstat (fd, &st))
+ return -1;
+ if (ts[0].tv_nsec == UTIME_OMIT)
+ ts[0] = get_stat_atime (&st);
+ else if (ts[1].tv_nsec == UTIME_OMIT)
+ ts[1] = get_stat_mtime (&st);
+ /* Note that st is good, in case utimensat gives ENOSYS. */
+ adjustment_needed++;
+ }
+# endif
+# if HAVE_UTIMENSAT
+ if (fd < 0)
+ {
+# if defined __APPLE__ && defined __MACH__
+ size_t len = strlen (file);
+ if (len > 0 && file[len - 1] == '/')
+ {
+ struct stat statbuf;
+ if (stat (file, &statbuf) < 0)
+ return -1;
+ if (!S_ISDIR (statbuf.st_mode))
+ {
+ errno = ENOTDIR;
+ return -1;
+ }
+ }
+# endif
+ result = utimensat (AT_FDCWD, file, ts, 0);
+# ifdef __linux__
+ /* Work around a kernel bug:
+ https://bugzilla.redhat.com/show_bug.cgi?id=442352
+ https://bugzilla.redhat.com/show_bug.cgi?id=449910
+ It appears that utimensat can mistakenly return 280 rather
+ than -1 upon ENOSYS failure.
+ FIXME: remove in 2010 or whenever the offending kernels
+ are no longer in common use. */
+ if (0 < result)
+ errno = ENOSYS;
+# endif /* __linux__ */
+ if (result == 0 || errno != ENOSYS)
+ {
+ utimensat_works_really = 1;
+ return result;
+ }
+ }
+# endif /* HAVE_UTIMENSAT */
+# if HAVE_FUTIMENS
+ if (0 <= fd)
+ {
+ result = futimens (fd, ts);
+# ifdef __linux__
+ /* Work around the same bug as above. */
+ if (0 < result)
+ errno = ENOSYS;
+# endif /* __linux__ */
+ if (result == 0 || errno != ENOSYS)
+ {
+ utimensat_works_really = 1;
+ return result;
+ }
+ }
+# endif /* HAVE_FUTIMENS */
+ }
+ utimensat_works_really = -1;
+ lutimensat_works_really = -1;
+#endif /* HAVE_UTIMENSAT || HAVE_FUTIMENS */
+
+#ifdef USE_SETFILETIME
+ /* On native Windows, use SetFileTime(). See
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-setfiletime>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-filetime> */
+ if (0 <= fd)
+ {
+ HANDLE handle;
+ FILETIME current_time;
+ FILETIME last_access_time;
+ FILETIME last_write_time;
+
+ handle = (HANDLE) _get_osfhandle (fd);
+ if (handle == INVALID_HANDLE_VALUE)
+ {
+ errno = EBADF;
+ return -1;
+ }
+
+ if (ts == NULL || ts[0].tv_nsec == UTIME_NOW || ts[1].tv_nsec == UTIME_NOW)
+ {
+ /* GetSystemTimeAsFileTime
+ <https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimeasfiletime>.
+ It would be overkill to use
+ GetSystemTimePreciseAsFileTime
+ <https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimepreciseasfiletime>. */
+ GetSystemTimeAsFileTime (&current_time);
+ }
+
+ if (ts == NULL || ts[0].tv_nsec == UTIME_NOW)
+ {
+ last_access_time = current_time;
+ }
+ else if (ts[0].tv_nsec == UTIME_OMIT)
+ {
+ last_access_time.dwLowDateTime = 0;
+ last_access_time.dwHighDateTime = 0;
+ }
+ else
+ {
+ ULONGLONG time_since_16010101 =
+ (ULONGLONG) ts[0].tv_sec * 10000000 + ts[0].tv_nsec / 100 + 116444736000000000LL;
+ last_access_time.dwLowDateTime = (DWORD) time_since_16010101;
+ last_access_time.dwHighDateTime = time_since_16010101 >> 32;
+ }
+
+ if (ts == NULL || ts[1].tv_nsec == UTIME_NOW)
+ {
+ last_write_time = current_time;
+ }
+ else if (ts[1].tv_nsec == UTIME_OMIT)
+ {
+ last_write_time.dwLowDateTime = 0;
+ last_write_time.dwHighDateTime = 0;
+ }
+ else
+ {
+ ULONGLONG time_since_16010101 =
+ (ULONGLONG) ts[1].tv_sec * 10000000 + ts[1].tv_nsec / 100 + 116444736000000000LL;
+ last_write_time.dwLowDateTime = (DWORD) time_since_16010101;
+ last_write_time.dwHighDateTime = time_since_16010101 >> 32;
+ }
+
+ if (SetFileTime (handle, NULL, &last_access_time, &last_write_time))
+ return 0;
+ else
+ {
+ DWORD sft_error = GetLastError ();
+ #if 0
+ fprintf (stderr, "fdutimens SetFileTime error 0x%x\n", (unsigned int) sft_error);
+ #endif
+ switch (sft_error)
+ {
+ case ERROR_ACCESS_DENIED: /* fd was opened without O_RDWR */
+ errno = EACCES; /* not specified by POSIX */
+ break;
+ default:
+ errno = EINVAL;
+ break;
+ }
+ return -1;
+ }
+ }
+#endif
+
+ /* The platform lacks an interface to set file timestamps with
+ nanosecond resolution, so do the best we can, discarding any
+ fractional part of the timestamp. */
+
+ if (adjustment_needed || (REPLACE_FUNC_STAT_FILE && fd < 0))
+ {
+ if (adjustment_needed != 3
+ && (fd < 0 ? stat (file, &st) : fstat (fd, &st)))
+ return -1;
+ if (ts && update_timespec (&st, &ts))
+ return 0;
+ }
+
+ {
+#if HAVE_FUTIMESAT || HAVE_WORKING_UTIMES
+ struct timeval timeval[2];
+ struct timeval *t;
+ if (ts)
+ {
+ timeval[0].tv_sec = ts[0].tv_sec;
+ timeval[0].tv_usec = ts[0].tv_nsec / 1000;
+ timeval[1].tv_sec = ts[1].tv_sec;
+ timeval[1].tv_usec = ts[1].tv_nsec / 1000;
+ t = timeval;
+ }
+ else
+ t = NULL;
+
+ if (fd < 0)
+ {
+# if HAVE_FUTIMESAT
+ return futimesat (AT_FDCWD, file, t);
+# endif
+ }
+ else
+ {
+ /* If futimesat or futimes fails here, don't try to speed things
+ up by returning right away. glibc can incorrectly fail with
+ errno == ENOENT if /proc isn't mounted. Also, Mandrake 10.0
+ in high security mode doesn't allow ordinary users to read
+ /proc/self, so glibc incorrectly fails with errno == EACCES.
+ If errno == EIO, EPERM, or EROFS, it's probably safe to fail
+ right away, but these cases are rare enough that they're not
+ worth optimizing, and who knows what other messed-up systems
+ are out there? So play it safe and fall back on the code
+ below. */
+
+# if (HAVE_FUTIMESAT && !FUTIMESAT_NULL_BUG) || HAVE_FUTIMES
+# if HAVE_FUTIMESAT && !FUTIMESAT_NULL_BUG
+# undef futimes
+# define futimes(fd, t) futimesat (fd, NULL, t)
+# endif
+ if (futimes (fd, t) == 0)
+ {
+# if __linux__ && __GLIBC__
+ /* Work around a longstanding glibc bug, still present as
+ of 2010-12-27. On older Linux kernels that lack both
+ utimensat and utimes, glibc's futimes rounds instead of
+ truncating when falling back on utime. The same bug
+ occurs in futimesat with a null 2nd arg. */
+ if (t)
+ {
+ bool abig = 500000 <= t[0].tv_usec;
+ bool mbig = 500000 <= t[1].tv_usec;
+ if ((abig | mbig) && fstat (fd, &st) == 0)
+ {
+ /* If these two subtractions overflow, they'll
+ track the overflows inside the buggy glibc. */
+ time_t adiff = st.st_atime - t[0].tv_sec;
+ time_t mdiff = st.st_mtime - t[1].tv_sec;
+
+ struct timeval *tt = NULL;
+ struct timeval truncated_timeval[2];
+ truncated_timeval[0] = t[0];
+ truncated_timeval[1] = t[1];
+ if (abig && adiff == 1 && get_stat_atime_ns (&st) == 0)
+ {
+ tt = truncated_timeval;
+ tt[0].tv_usec = 0;
+ }
+ if (mbig && mdiff == 1 && get_stat_mtime_ns (&st) == 0)
+ {
+ tt = truncated_timeval;
+ tt[1].tv_usec = 0;
+ }
+ if (tt)
+ futimes (fd, tt);
+ }
+ }
+# endif
+
+ return 0;
+ }
+# endif
+ }
+#endif /* HAVE_FUTIMESAT || HAVE_WORKING_UTIMES */
+
+ if (!file)
+ {
+#if ! ((HAVE_FUTIMESAT && !FUTIMESAT_NULL_BUG) \
+ || (HAVE_WORKING_UTIMES && HAVE_FUTIMES))
+ errno = ENOSYS;
+#endif
+ return -1;
+ }
+
+#ifdef USE_SETFILETIME
+ return _gl_utimens_windows (file, ts);
+#elif HAVE_WORKING_UTIMES
+ return utimes (file, t);
+#else
+ {
+ struct utimbuf utimbuf;
+ struct utimbuf *ut;
+ if (ts)
+ {
+ utimbuf.actime = ts[0].tv_sec;
+ utimbuf.modtime = ts[1].tv_sec;
+ ut = &utimbuf;
+ }
+ else
+ ut = NULL;
+
+ return utime (file, ut);
+ }
+#endif /* !HAVE_WORKING_UTIMES */
+ }
+}
+
+/* Set the access and modification timestamps of FILE to be
+ TIMESPEC[0] and TIMESPEC[1], respectively. */
+int
+utimens (char const *file, struct timespec const timespec[2])
+{
+ return fdutimens (-1, file, timespec);
+}
+
+/* Set the access and modification timestamps of FILE to be
+ TIMESPEC[0] and TIMESPEC[1], respectively, without dereferencing
+ symlinks. Fail with ENOSYS if the platform does not support
+ changing symlink timestamps, but FILE was a symlink. */
+int
+lutimens (char const *file, struct timespec const timespec[2])
+{
+ struct timespec adjusted_timespec[2];
+ struct timespec *ts = timespec ? adjusted_timespec : NULL;
+ int adjustment_needed = 0;
+ struct stat st;
+
+ if (ts)
+ {
+ adjusted_timespec[0] = timespec[0];
+ adjusted_timespec[1] = timespec[1];
+ adjustment_needed = validate_timespec (ts);
+ }
+ if (adjustment_needed < 0)
+ return -1;
+
+ /* The Linux kernel did not support symlink timestamps until
+ utimensat, in version 2.6.22, so we don't need to mimic
+ fdutimens' worry about buggy NFS clients. But we do have to
+ worry about bogus return values. */
+
+#if HAVE_UTIMENSAT
+ if (0 <= lutimensat_works_really)
+ {
+ int result;
+# if __linux__ || __sun
+ /* As recently as Linux kernel 2.6.32 (Dec 2009), several file
+ systems (xfs, ntfs-3g) have bugs with a single UTIME_OMIT,
+ but work if both times are either explicitly specified or
+ UTIME_NOW. Work around it with a preparatory lstat prior to
+ calling utimensat; fortunately, there is not much timing
+ impact due to the extra syscall even on file systems where
+ UTIME_OMIT would have worked.
+
+ The same bug occurs in Solaris 11.1 (Apr 2013).
+
+ FIXME: Simplify this for Linux in 2016 and for Solaris in
+ 2024, when file system bugs are no longer common. */
+ if (adjustment_needed == 2)
+ {
+ if (lstat (file, &st))
+ return -1;
+ if (ts[0].tv_nsec == UTIME_OMIT)
+ ts[0] = get_stat_atime (&st);
+ else if (ts[1].tv_nsec == UTIME_OMIT)
+ ts[1] = get_stat_mtime (&st);
+ /* Note that st is good, in case utimensat gives ENOSYS. */
+ adjustment_needed++;
+ }
+# endif
+ result = utimensat (AT_FDCWD, file, ts, AT_SYMLINK_NOFOLLOW);
+# ifdef __linux__
+ /* Work around a kernel bug:
+ https://bugzilla.redhat.com/show_bug.cgi?id=442352
+ https://bugzilla.redhat.com/show_bug.cgi?id=449910
+ It appears that utimensat can mistakenly return 280 rather
+ than -1 upon ENOSYS failure.
+ FIXME: remove in 2010 or whenever the offending kernels
+ are no longer in common use. */
+ if (0 < result)
+ errno = ENOSYS;
+# endif
+ if (result == 0 || errno != ENOSYS)
+ {
+ utimensat_works_really = 1;
+ lutimensat_works_really = 1;
+ return result;
+ }
+ }
+ lutimensat_works_really = -1;
+#endif /* HAVE_UTIMENSAT */
+
+ /* The platform lacks an interface to set file timestamps with
+ nanosecond resolution, so do the best we can, discarding any
+ fractional part of the timestamp. */
+
+ if (adjustment_needed || REPLACE_FUNC_STAT_FILE)
+ {
+ if (adjustment_needed != 3 && lstat (file, &st))
+ return -1;
+ if (ts && update_timespec (&st, &ts))
+ return 0;
+ }
+
+ /* On Linux, lutimes is a thin wrapper around utimensat, so there is
+ no point trying lutimes if utimensat failed with ENOSYS. */
+#if HAVE_LUTIMES && !HAVE_UTIMENSAT
+ {
+ struct timeval timeval[2];
+ struct timeval *t;
+ int result;
+ if (ts)
+ {
+ timeval[0].tv_sec = ts[0].tv_sec;
+ timeval[0].tv_usec = ts[0].tv_nsec / 1000;
+ timeval[1].tv_sec = ts[1].tv_sec;
+ timeval[1].tv_usec = ts[1].tv_nsec / 1000;
+ t = timeval;
+ }
+ else
+ t = NULL;
+
+ result = lutimes (file, t);
+ if (result == 0 || errno != ENOSYS)
+ return result;
+ }
+#endif /* HAVE_LUTIMES && !HAVE_UTIMENSAT */
+
+ /* Out of luck for symlinks, but we still handle regular files. */
+ if (!(adjustment_needed || REPLACE_FUNC_STAT_FILE) && lstat (file, &st))
+ return -1;
+ if (!S_ISLNK (st.st_mode))
+ return fdutimens (-1, file, ts);
+ errno = ENOSYS;
+ return -1;
+}
diff --git a/gl/lib/utimens.h b/gl/lib/utimens.h
new file mode 100644
index 0000000..2ccc06e
--- /dev/null
+++ b/gl/lib/utimens.h
@@ -0,0 +1,49 @@
+/* Set file access and modification times.
+
+ Copyright 2012-2022 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 Paul Eggert. */
+
+#include <time.h>
+int fdutimens (int, char const *, struct timespec const [2]);
+int utimens (char const *, struct timespec const [2]);
+int lutimens (char const *, struct timespec const [2]);
+
+#if GNULIB_FDUTIMENSAT
+# include <fcntl.h>
+# include <sys/stat.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GL_UTIMENS_INLINE
+# define _GL_UTIMENS_INLINE _GL_INLINE
+#endif
+
+int fdutimensat (int fd, int dir, char const *name, struct timespec const [2],
+ int atflag);
+
+/* Using this function makes application code slightly more readable. */
+_GL_UTIMENS_INLINE int
+lutimensat (int dir, char const *file, struct timespec const times[2])
+{
+ return utimensat (dir, file, times, AT_SYMLINK_NOFOLLOW);
+}
+
+_GL_INLINE_HEADER_END
+
+#endif
diff --git a/gl/lib/vasnprintf.c b/gl/lib/vasnprintf.c
new file mode 100644
index 0000000..285c674
--- /dev/null
+++ b/gl/lib/vasnprintf.c
@@ -0,0 +1,5741 @@
+/* vsprintf with automatic memory allocation.
+ Copyright (C) 1999, 2002-2022 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 2.1 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/>. */
+
+/* This file can be parametrized with the following macros:
+ VASNPRINTF The name of the function being defined.
+ FCHAR_T The element type of the format string.
+ DCHAR_T The element type of the destination (result) string.
+ FCHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters
+ in the format string are ASCII. MUST be set if
+ FCHAR_T and DCHAR_T are not the same type.
+ DIRECTIVE Structure denoting a format directive.
+ Depends on FCHAR_T.
+ DIRECTIVES Structure denoting the set of format directives of a
+ format string. Depends on FCHAR_T.
+ PRINTF_PARSE Function that parses a format string.
+ Depends on FCHAR_T.
+ DCHAR_CPY memcpy like function for DCHAR_T[] arrays.
+ DCHAR_SET memset like function for DCHAR_T[] arrays.
+ DCHAR_MBSNLEN mbsnlen like function for DCHAR_T[] arrays.
+ SNPRINTF The system's snprintf (or similar) function.
+ This may be either snprintf or swprintf.
+ TCHAR_T The element type of the argument and result string
+ of the said SNPRINTF function. This may be either
+ char or wchar_t. The code exploits that
+ sizeof (TCHAR_T) | sizeof (DCHAR_T) and
+ alignof (TCHAR_T) <= alignof (DCHAR_T).
+ DCHAR_IS_TCHAR Set to 1 if DCHAR_T and TCHAR_T are the same type.
+ DCHAR_CONV_FROM_ENCODING A function to convert from char[] to DCHAR[].
+ DCHAR_IS_UINT8_T Set to 1 if DCHAR_T is uint8_t.
+ DCHAR_IS_UINT16_T Set to 1 if DCHAR_T is uint16_t.
+ DCHAR_IS_UINT32_T Set to 1 if DCHAR_T is uint32_t.
+ ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
+ ENABLE_WCHAR_FALLBACK Set to 1 to avoid EILSEQ during conversion of wide
+ characters (wchar_t) and wide character strings
+ (wchar_t[]) to multibyte sequences. The fallback is the
+ hexadecimal escape syntax (\unnnn or \Unnnnnnnn) or,
+ if wchar_t is not Unicode encoded, \wnnnn or \Wnnnnnnnn.
+ */
+
+/* Tell glibc's <stdio.h> to provide a prototype for snprintf().
+ This must come before <config.h> because <config.h> may include
+ <features.h>, and once <features.h> has been included, it's too late. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#ifndef VASNPRINTF
+# include <config.h>
+#endif
+
+/* As of GCC 11.2.1, gcc -Wanalyzer-too-complex reports that main's
+ use of CHECK macros expands to code that is too complicated for gcc
+ -fanalyzer. Suppress the resulting bogus warnings. */
+#if 10 <= __GNUC__
+# pragma GCC diagnostic ignored "-Wanalyzer-null-argument"
+#endif
+
+#include <alloca.h>
+
+/* Specification. */
+#ifndef VASNPRINTF
+# if WIDE_CHAR_VERSION
+# include "vasnwprintf.h"
+# else
+# include "vasnprintf.h"
+# endif
+#endif
+
+#include <locale.h> /* localeconv() */
+#include <stdio.h> /* snprintf(), sprintf() */
+#include <stdlib.h> /* abort(), malloc(), realloc(), free() */
+#include <string.h> /* memcpy(), strlen() */
+#include <errno.h> /* errno */
+#include <limits.h> /* CHAR_BIT */
+#include <float.h> /* DBL_MAX_EXP, LDBL_MAX_EXP */
+#if HAVE_NL_LANGINFO
+# include <langinfo.h>
+#endif
+#ifndef VASNPRINTF
+# if WIDE_CHAR_VERSION
+# include "wprintf-parse.h"
+# else
+# include "printf-parse.h"
+# endif
+#endif
+
+/* Checked size_t computations. */
+#include "xsize.h"
+
+#include "attribute.h"
+#include "verify.h"
+
+#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
+# include <math.h>
+# include "float+.h"
+#endif
+
+#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
+# include <math.h>
+# include "isnand-nolibm.h"
+#endif
+
+#if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) && !defined IN_LIBINTL
+# include <math.h>
+# include "isnanl-nolibm.h"
+# include "fpucw.h"
+#endif
+
+#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
+# include <math.h>
+# include "isnand-nolibm.h"
+# include "printf-frexp.h"
+#endif
+
+#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
+# include <math.h>
+# include "isnanl-nolibm.h"
+# include "printf-frexpl.h"
+# include "fpucw.h"
+#endif
+
+/* Default parameters. */
+#ifndef VASNPRINTF
+# if WIDE_CHAR_VERSION
+# define VASNPRINTF vasnwprintf
+# define FCHAR_T wchar_t
+# define DCHAR_T wchar_t
+# define TCHAR_T wchar_t
+# define DCHAR_IS_TCHAR 1
+# define DIRECTIVE wchar_t_directive
+# define DIRECTIVES wchar_t_directives
+# define PRINTF_PARSE wprintf_parse
+# define DCHAR_CPY wmemcpy
+# define DCHAR_SET wmemset
+# else
+# define VASNPRINTF vasnprintf
+# define FCHAR_T char
+# define DCHAR_T char
+# define TCHAR_T char
+# define DCHAR_IS_TCHAR 1
+# define DIRECTIVE char_directive
+# define DIRECTIVES char_directives
+# define PRINTF_PARSE printf_parse
+# define DCHAR_CPY memcpy
+# define DCHAR_SET memset
+# endif
+#endif
+#if WIDE_CHAR_VERSION
+ /* TCHAR_T is wchar_t. */
+# define USE_SNPRINTF 1
+# if HAVE_DECL__SNWPRINTF
+ /* On Windows, the function swprintf() has a different signature than
+ on Unix; we use the function _snwprintf() or - on mingw - snwprintf()
+ instead. The mingw function snwprintf() has fewer bugs than the
+ MSVCRT function _snwprintf(), so prefer that. */
+# if defined __MINGW32__
+# define SNPRINTF snwprintf
+# else
+# define SNPRINTF _snwprintf
+# define USE_MSVC__SNPRINTF 1
+# endif
+# else
+ /* Unix. */
+# define SNPRINTF swprintf
+# endif
+#else
+ /* TCHAR_T is char. */
+ /* Use snprintf if it exists under the name 'snprintf' or '_snprintf'.
+ But don't use it on BeOS, since BeOS snprintf produces no output if the
+ size argument is >= 0x3000000.
+ Also don't use it on Linux libc5, since there snprintf with size = 1
+ writes any output without bounds, like sprintf. */
+# if (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) && !defined __BEOS__ && !(__GNU_LIBRARY__ == 1)
+# define USE_SNPRINTF 1
+# else
+# define USE_SNPRINTF 0
+# endif
+# if HAVE_DECL__SNPRINTF
+ /* Windows. The mingw function snprintf() has fewer bugs than the MSVCRT
+ function _snprintf(), so prefer that. */
+# if defined __MINGW32__
+# define SNPRINTF snprintf
+ /* Here we need to call the native snprintf, not rpl_snprintf. */
+# undef snprintf
+# else
+ /* MSVC versions < 14 did not have snprintf, only _snprintf. */
+# define SNPRINTF _snprintf
+# define USE_MSVC__SNPRINTF 1
+# endif
+# else
+ /* Unix. */
+# define SNPRINTF snprintf
+ /* Here we need to call the native snprintf, not rpl_snprintf. */
+# undef snprintf
+# endif
+#endif
+/* Here we need to call the native sprintf, not rpl_sprintf. */
+#undef sprintf
+
+/* GCC >= 4.0 with -Wall emits unjustified "... may be used uninitialized"
+ warnings in this file. Use -Dlint to suppress them. */
+#if defined GCC_LINT || defined lint
+# define IF_LINT(Code) Code
+#else
+# define IF_LINT(Code) /* empty */
+#endif
+
+/* Avoid some warnings from "gcc -Wshadow".
+ This file doesn't use the exp() and remainder() functions. */
+#undef exp
+#define exp expo
+#undef remainder
+#define remainder rem
+
+#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && !WIDE_CHAR_VERSION
+# if (HAVE_STRNLEN && !defined _AIX)
+# define local_strnlen strnlen
+# else
+# ifndef local_strnlen_defined
+# define local_strnlen_defined 1
+static size_t
+local_strnlen (const char *string, size_t maxlen)
+{
+ const char *end = memchr (string, '\0', maxlen);
+ return end ? (size_t) (end - string) : maxlen;
+}
+# endif
+# endif
+#endif
+
+#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)) && HAVE_WCHAR_T
+# if HAVE_WCSLEN
+# define local_wcslen wcslen
+# else
+ /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid
+ a dependency towards this library, here is a local substitute.
+ Define this substitute only once, even if this file is included
+ twice in the same compilation unit. */
+# ifndef local_wcslen_defined
+# define local_wcslen_defined 1
+static size_t
+local_wcslen (const wchar_t *s)
+{
+ const wchar_t *ptr;
+
+ for (ptr = s; *ptr != (wchar_t) 0; ptr++)
+ ;
+ return ptr - s;
+}
+# endif
+# endif
+#endif
+
+#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && HAVE_WCHAR_T && WIDE_CHAR_VERSION
+# if HAVE_WCSNLEN
+# define local_wcsnlen wcsnlen
+# else
+# ifndef local_wcsnlen_defined
+# define local_wcsnlen_defined 1
+static size_t
+local_wcsnlen (const wchar_t *s, size_t maxlen)
+{
+ const wchar_t *ptr;
+
+ for (ptr = s; maxlen > 0 && *ptr != (wchar_t) 0; ptr++, maxlen--)
+ ;
+ return ptr - s;
+}
+# endif
+# endif
+#endif
+
+#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL) || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T) || (ENABLE_WCHAR_FALLBACK && HAVE_WINT_T)) && !WIDE_CHAR_VERSION
+# if ENABLE_WCHAR_FALLBACK
+static size_t
+wctomb_fallback (char *s, wchar_t wc)
+{
+ static char hex[16] = "0123456789ABCDEF";
+
+ s[0] = '\\';
+ if (sizeof (wchar_t) > 2 && wc > 0xffff)
+ {
+# if __STDC_ISO_10646__ || (__GLIBC__ >= 2) || (defined _WIN32 || defined __CYGWIN__)
+ s[1] = 'U';
+# else
+ s[1] = 'W';
+# endif
+ s[2] = hex[(wc & 0xf0000000U) >> 28];
+ s[3] = hex[(wc & 0xf000000U) >> 24];
+ s[4] = hex[(wc & 0xf00000U) >> 20];
+ s[5] = hex[(wc & 0xf0000U) >> 16];
+ s[6] = hex[(wc & 0xf000U) >> 12];
+ s[7] = hex[(wc & 0xf00U) >> 8];
+ s[8] = hex[(wc & 0xf0U) >> 4];
+ s[9] = hex[wc & 0xfU];
+ return 10;
+ }
+ else
+ {
+# if __STDC_ISO_10646__ || (__GLIBC__ >= 2) || (defined _WIN32 || defined __CYGWIN__)
+ s[1] = 'u';
+# else
+ s[1] = 'w';
+# endif
+ s[2] = hex[(wc & 0xf000U) >> 12];
+ s[3] = hex[(wc & 0xf00U) >> 8];
+ s[4] = hex[(wc & 0xf0U) >> 4];
+ s[5] = hex[wc & 0xfU];
+ return 6;
+ }
+}
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+static size_t
+local_wcrtomb (char *s, wchar_t wc, mbstate_t *ps)
+{
+ size_t count = wcrtomb (s, wc, ps);
+ if (count == (size_t)(-1))
+ count = wctomb_fallback (s, wc);
+ return count;
+}
+# else
+static int
+local_wctomb (char *s, wchar_t wc)
+{
+ int count = wctomb (s, wc);
+ if (count < 0)
+ count = wctomb_fallback (s, wc);
+ return count;
+}
+# define local_wcrtomb(S, WC, PS) local_wctomb ((S), (WC))
+# endif
+# else
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+# define local_wcrtomb(S, WC, PS) wcrtomb ((S), (WC), (PS))
+# else
+# define local_wcrtomb(S, WC, PS) wctomb ((S), (WC))
+# endif
+# endif
+#endif
+
+#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
+/* Determine the decimal-point character according to the current locale. */
+# ifndef decimal_point_char_defined
+# define decimal_point_char_defined 1
+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
+#endif
+
+#if NEED_PRINTF_INFINITE_DOUBLE && !NEED_PRINTF_DOUBLE && !defined IN_LIBINTL
+
+/* Equivalent to !isfinite(x) || x == 0, but does not require libm. */
+static int
+is_infinite_or_zero (double x)
+{
+ return isnand (x) || x + x == x;
+}
+
+#endif
+
+#if NEED_PRINTF_INFINITE_LONG_DOUBLE && !NEED_PRINTF_LONG_DOUBLE && !defined IN_LIBINTL
+
+/* Equivalent to !isfinite(x) || x == 0, but does not require libm. */
+static int
+is_infinite_or_zerol (long double x)
+{
+ return isnanl (x) || x + x == x;
+}
+
+#endif
+
+#if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
+
+/* Converting 'long double' to decimal without rare rounding bugs requires
+ real bignums. We use the naming conventions of GNU gmp, but vastly simpler
+ (and slower) algorithms. */
+
+typedef unsigned int mp_limb_t;
+# define GMP_LIMB_BITS 32
+verify (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS);
+
+typedef unsigned long long mp_twolimb_t;
+# define GMP_TWOLIMB_BITS 64
+verify (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS);
+
+/* Representation of a bignum >= 0. */
+typedef struct
+{
+ size_t nlimbs;
+ mp_limb_t *limbs; /* Bits in little-endian order, allocated with malloc(). */
+} mpn_t;
+
+/* Compute the product of two bignums >= 0.
+ Return the allocated memory in case of success, NULL in case of memory
+ allocation failure. */
+static void *
+multiply (mpn_t src1, mpn_t src2, mpn_t *dest)
+{
+ const mp_limb_t *p1;
+ const mp_limb_t *p2;
+ size_t len1;
+ size_t len2;
+
+ if (src1.nlimbs <= src2.nlimbs)
+ {
+ len1 = src1.nlimbs;
+ p1 = src1.limbs;
+ len2 = src2.nlimbs;
+ p2 = src2.limbs;
+ }
+ else
+ {
+ len1 = src2.nlimbs;
+ p1 = src2.limbs;
+ len2 = src1.nlimbs;
+ p2 = src1.limbs;
+ }
+ /* Now 0 <= len1 <= len2. */
+ if (len1 == 0)
+ {
+ /* src1 or src2 is zero. */
+ dest->nlimbs = 0;
+ dest->limbs = (mp_limb_t *) malloc (1);
+ }
+ else
+ {
+ /* Here 1 <= len1 <= len2. */
+ size_t dlen;
+ mp_limb_t *dp;
+ size_t k, i, j;
+
+ dlen = len1 + len2;
+ dp = (mp_limb_t *) malloc (dlen * sizeof (mp_limb_t));
+ if (dp == NULL)
+ return NULL;
+ for (k = len2; k > 0; )
+ dp[--k] = 0;
+ for (i = 0; i < len1; i++)
+ {
+ mp_limb_t digit1 = p1[i];
+ mp_twolimb_t carry = 0;
+ for (j = 0; j < len2; j++)
+ {
+ mp_limb_t digit2 = p2[j];
+ carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2;
+ carry += dp[i + j];
+ dp[i + j] = (mp_limb_t) carry;
+ carry = carry >> GMP_LIMB_BITS;
+ }
+ dp[i + len2] = (mp_limb_t) carry;
+ }
+ /* Normalise. */
+ while (dlen > 0 && dp[dlen - 1] == 0)
+ dlen--;
+ dest->nlimbs = dlen;
+ dest->limbs = dp;
+ }
+ return dest->limbs;
+}
+
+/* Compute the quotient of a bignum a >= 0 and a bignum b > 0.
+ a is written as a = q * b + r with 0 <= r < b. q is the quotient, r
+ the remainder.
+ Finally, round-to-even is performed: If r > b/2 or if r = b/2 and q is odd,
+ q is incremented.
+ Return the allocated memory in case of success, NULL in case of memory
+ allocation failure. */
+static void *
+divide (mpn_t a, mpn_t b, mpn_t *q)
+{
+ /* Algorithm:
+ First normalise a and b: a=[a[m-1],...,a[0]], b=[b[n-1],...,b[0]]
+ with m>=0 and n>0 (in base beta = 2^GMP_LIMB_BITS).
+ If m<n, then q:=0 and r:=a.
+ If m>=n=1, perform a single-precision division:
+ r:=0, j:=m,
+ while j>0 do
+ {Here (q[m-1]*beta^(m-1)+...+q[j]*beta^j) * b[0] + r*beta^j =
+ = a[m-1]*beta^(m-1)+...+a[j]*beta^j und 0<=r<b[0]<beta}
+ j:=j-1, r:=r*beta+a[j], q[j]:=floor(r/b[0]), r:=r-b[0]*q[j].
+ Normalise [q[m-1],...,q[0]], yields q.
+ If m>=n>1, perform a multiple-precision division:
+ We have a/b < beta^(m-n+1).
+ s:=intDsize-1-(highest bit in b[n-1]), 0<=s<intDsize.
+ Shift a and b left by s bits, copying them. r:=a.
+ r=[r[m],...,r[0]], b=[b[n-1],...,b[0]] with b[n-1]>=beta/2.
+ For j=m-n,...,0: {Here 0 <= r < b*beta^(j+1).}
+ Compute q* :
+ q* := floor((r[j+n]*beta+r[j+n-1])/b[n-1]).
+ In case of overflow (q* >= beta) set q* := beta-1.
+ Compute c2 := ((r[j+n]*beta+r[j+n-1]) - q* * b[n-1])*beta + r[j+n-2]
+ and c3 := b[n-2] * q*.
+ {We have 0 <= c2 < 2*beta^2, even 0 <= c2 < beta^2 if no overflow
+ occurred. Furthermore 0 <= c3 < beta^2.
+ If there was overflow and
+ r[j+n]*beta+r[j+n-1] - q* * b[n-1] >= beta, i.e. c2 >= beta^2,
+ the next test can be skipped.}
+ While c3 > c2, {Here 0 <= c2 < c3 < beta^2}
+ Put q* := q* - 1, c2 := c2 + b[n-1]*beta, c3 := c3 - b[n-2].
+ If q* > 0:
+ Put r := r - b * q* * beta^j. In detail:
+ [r[n+j],...,r[j]] := [r[n+j],...,r[j]] - q* * [b[n-1],...,b[0]].
+ hence: u:=0, for i:=0 to n-1 do
+ u := u + q* * b[i],
+ r[j+i]:=r[j+i]-(u mod beta) (+ beta, if carry),
+ u:=u div beta (+ 1, if carry in subtraction)
+ r[n+j]:=r[n+j]-u.
+ {Since always u = (q* * [b[i-1],...,b[0]] div beta^i) + 1
+ < q* + 1 <= beta,
+ the carry u does not overflow.}
+ If a negative carry occurs, put q* := q* - 1
+ and [r[n+j],...,r[j]] := [r[n+j],...,r[j]] + [0,b[n-1],...,b[0]].
+ Set q[j] := q*.
+ Normalise [q[m-n],..,q[0]]; this yields the quotient q.
+ Shift [r[n-1],...,r[0]] right by s bits and normalise; this yields the
+ rest r.
+ The room for q[j] can be allocated at the memory location of r[n+j].
+ Finally, round-to-even:
+ Shift r left by 1 bit.
+ If r > b or if r = b and q[0] is odd, q := q+1.
+ */
+ const mp_limb_t *a_ptr = a.limbs;
+ size_t a_len = a.nlimbs;
+ const mp_limb_t *b_ptr = b.limbs;
+ size_t b_len = b.nlimbs;
+ mp_limb_t *roomptr;
+ mp_limb_t *tmp_roomptr = NULL;
+ mp_limb_t *q_ptr;
+ size_t q_len;
+ mp_limb_t *r_ptr;
+ size_t r_len;
+
+ /* Allocate room for a_len+2 digits.
+ (Need a_len+1 digits for the real division and 1 more digit for the
+ final rounding of q.) */
+ roomptr = (mp_limb_t *) malloc ((a_len + 2) * sizeof (mp_limb_t));
+ if (roomptr == NULL)
+ return NULL;
+
+ /* Normalise a. */
+ while (a_len > 0 && a_ptr[a_len - 1] == 0)
+ a_len--;
+
+ /* Normalise b. */
+ for (;;)
+ {
+ if (b_len == 0)
+ /* Division by zero. */
+ abort ();
+ if (b_ptr[b_len - 1] == 0)
+ b_len--;
+ else
+ break;
+ }
+
+ /* Here m = a_len >= 0 and n = b_len > 0. */
+
+ if (a_len < b_len)
+ {
+ /* m<n: trivial case. q=0, r := copy of a. */
+ r_ptr = roomptr;
+ r_len = a_len;
+ memcpy (r_ptr, a_ptr, a_len * sizeof (mp_limb_t));
+ q_ptr = roomptr + a_len;
+ q_len = 0;
+ }
+ else if (b_len == 1)
+ {
+ /* n=1: single precision division.
+ beta^(m-1) <= a < beta^m ==> beta^(m-2) <= a/b < beta^m */
+ r_ptr = roomptr;
+ q_ptr = roomptr + 1;
+ {
+ mp_limb_t den = b_ptr[0];
+ mp_limb_t remainder = 0;
+ const mp_limb_t *sourceptr = a_ptr + a_len;
+ mp_limb_t *destptr = q_ptr + a_len;
+ size_t count;
+ for (count = a_len; count > 0; count--)
+ {
+ mp_twolimb_t num =
+ ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--sourceptr;
+ *--destptr = num / den;
+ remainder = num % den;
+ }
+ /* Normalise and store r. */
+ if (remainder > 0)
+ {
+ r_ptr[0] = remainder;
+ r_len = 1;
+ }
+ else
+ r_len = 0;
+ /* Normalise q. */
+ q_len = a_len;
+ if (q_ptr[q_len - 1] == 0)
+ q_len--;
+ }
+ }
+ else
+ {
+ /* n>1: multiple precision division.
+ beta^(m-1) <= a < beta^m, beta^(n-1) <= b < beta^n ==>
+ beta^(m-n-1) <= a/b < beta^(m-n+1). */
+ /* Determine s. */
+ size_t s;
+ {
+ mp_limb_t msd = b_ptr[b_len - 1]; /* = b[n-1], > 0 */
+ /* Determine s = GMP_LIMB_BITS - integer_length (msd).
+ Code copied from gnulib's integer_length.c. */
+# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) \
+ || (__clang_major__ >= 4)
+ s = __builtin_clz (msd);
+# else
+# if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT
+ if (GMP_LIMB_BITS <= DBL_MANT_BIT)
+ {
+ /* Use 'double' operations.
+ Assumes an IEEE 754 'double' implementation. */
+# define DBL_EXP_MASK ((DBL_MAX_EXP - DBL_MIN_EXP) | 7)
+# define DBL_EXP_BIAS (DBL_EXP_MASK / 2 - 1)
+# define NWORDS \
+ ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+ union { double value; unsigned int word[NWORDS]; } m;
+
+ /* Use a single integer to floating-point conversion. */
+ m.value = msd;
+
+ s = GMP_LIMB_BITS
+ - (((m.word[DBL_EXPBIT0_WORD] >> DBL_EXPBIT0_BIT) & DBL_EXP_MASK)
+ - DBL_EXP_BIAS);
+ }
+ else
+# undef NWORDS
+# endif
+ {
+ s = 31;
+ if (msd >= 0x10000)
+ {
+ msd = msd >> 16;
+ s -= 16;
+ }
+ if (msd >= 0x100)
+ {
+ msd = msd >> 8;
+ s -= 8;
+ }
+ if (msd >= 0x10)
+ {
+ msd = msd >> 4;
+ s -= 4;
+ }
+ if (msd >= 0x4)
+ {
+ msd = msd >> 2;
+ s -= 2;
+ }
+ if (msd >= 0x2)
+ {
+ msd = msd >> 1;
+ s -= 1;
+ }
+ }
+# endif
+ }
+ /* 0 <= s < GMP_LIMB_BITS.
+ Copy b, shifting it left by s bits. */
+ if (s > 0)
+ {
+ tmp_roomptr = (mp_limb_t *) malloc (b_len * sizeof (mp_limb_t));
+ if (tmp_roomptr == NULL)
+ {
+ free (roomptr);
+ return NULL;
+ }
+ {
+ const mp_limb_t *sourceptr = b_ptr;
+ mp_limb_t *destptr = tmp_roomptr;
+ mp_twolimb_t accu = 0;
+ size_t count;
+ for (count = b_len; count > 0; count--)
+ {
+ accu += (mp_twolimb_t) *sourceptr++ << s;
+ *destptr++ = (mp_limb_t) accu;
+ accu = accu >> GMP_LIMB_BITS;
+ }
+ /* accu must be zero, since that was how s was determined. */
+ if (accu != 0)
+ abort ();
+ }
+ b_ptr = tmp_roomptr;
+ }
+ /* Copy a, shifting it left by s bits, yields r.
+ Memory layout:
+ At the beginning: r = roomptr[0..a_len],
+ at the end: r = roomptr[0..b_len-1], q = roomptr[b_len..a_len] */
+ r_ptr = roomptr;
+ if (s == 0)
+ {
+ memcpy (r_ptr, a_ptr, a_len * sizeof (mp_limb_t));
+ r_ptr[a_len] = 0;
+ }
+ else
+ {
+ const mp_limb_t *sourceptr = a_ptr;
+ mp_limb_t *destptr = r_ptr;
+ mp_twolimb_t accu = 0;
+ size_t count;
+ for (count = a_len; count > 0; count--)
+ {
+ accu += (mp_twolimb_t) *sourceptr++ << s;
+ *destptr++ = (mp_limb_t) accu;
+ accu = accu >> GMP_LIMB_BITS;
+ }
+ *destptr++ = (mp_limb_t) accu;
+ }
+ q_ptr = roomptr + b_len;
+ q_len = a_len - b_len + 1; /* q will have m-n+1 limbs */
+ {
+ size_t j = a_len - b_len; /* m-n */
+ mp_limb_t b_msd = b_ptr[b_len - 1]; /* b[n-1] */
+ mp_limb_t b_2msd = b_ptr[b_len - 2]; /* b[n-2] */
+ mp_twolimb_t b_msdd = /* b[n-1]*beta+b[n-2] */
+ ((mp_twolimb_t) b_msd << GMP_LIMB_BITS) | b_2msd;
+ /* Division loop, traversed m-n+1 times.
+ j counts down, b is unchanged, beta/2 <= b[n-1] < beta. */
+ for (;;)
+ {
+ mp_limb_t q_star;
+ mp_limb_t c1;
+ if (r_ptr[j + b_len] < b_msd) /* r[j+n] < b[n-1] ? */
+ {
+ /* Divide r[j+n]*beta+r[j+n-1] by b[n-1], no overflow. */
+ mp_twolimb_t num =
+ ((mp_twolimb_t) r_ptr[j + b_len] << GMP_LIMB_BITS)
+ | r_ptr[j + b_len - 1];
+ q_star = num / b_msd;
+ c1 = num % b_msd;
+ }
+ else
+ {
+ /* Overflow, hence r[j+n]*beta+r[j+n-1] >= beta*b[n-1]. */
+ q_star = (mp_limb_t)~(mp_limb_t)0; /* q* = beta-1 */
+ /* Test whether r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] >= beta
+ <==> r[j+n]*beta+r[j+n-1] + b[n-1] >= beta*b[n-1]+beta
+ <==> b[n-1] < floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta)
+ {<= beta !}.
+ If yes, jump directly to the subtraction loop.
+ (Otherwise, r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] < beta
+ <==> floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta) = b[n-1] ) */
+ if (r_ptr[j + b_len] > b_msd
+ || (c1 = r_ptr[j + b_len - 1] + b_msd) < b_msd)
+ /* r[j+n] >= b[n-1]+1 or
+ r[j+n] = b[n-1] and the addition r[j+n-1]+b[n-1] gives a
+ carry. */
+ goto subtract;
+ }
+ /* q_star = q*,
+ c1 = (r[j+n]*beta+r[j+n-1]) - q* * b[n-1] (>=0, <beta). */
+ {
+ mp_twolimb_t c2 = /* c1*beta+r[j+n-2] */
+ ((mp_twolimb_t) c1 << GMP_LIMB_BITS) | r_ptr[j + b_len - 2];
+ mp_twolimb_t c3 = /* b[n-2] * q* */
+ (mp_twolimb_t) b_2msd * (mp_twolimb_t) q_star;
+ /* While c2 < c3, increase c2 and decrease c3.
+ Consider c3-c2. While it is > 0, decrease it by
+ b[n-1]*beta+b[n-2]. Because of b[n-1]*beta+b[n-2] >= beta^2/2
+ this can happen only twice. */
+ if (c3 > c2)
+ {
+ q_star = q_star - 1; /* q* := q* - 1 */
+ if (c3 - c2 > b_msdd)
+ q_star = q_star - 1; /* q* := q* - 1 */
+ }
+ }
+ if (q_star > 0)
+ subtract:
+ {
+ /* Subtract r := r - b * q* * beta^j. */
+ mp_limb_t cr;
+ {
+ const mp_limb_t *sourceptr = b_ptr;
+ mp_limb_t *destptr = r_ptr + j;
+ mp_twolimb_t carry = 0;
+ size_t count;
+ for (count = b_len; count > 0; count--)
+ {
+ /* Here 0 <= carry <= q*. */
+ carry =
+ carry
+ + (mp_twolimb_t) q_star * (mp_twolimb_t) *sourceptr++
+ + (mp_limb_t) ~(*destptr);
+ /* Here 0 <= carry <= beta*q* + beta-1. */
+ *destptr++ = ~(mp_limb_t) carry;
+ carry = carry >> GMP_LIMB_BITS; /* <= q* */
+ }
+ cr = (mp_limb_t) carry;
+ }
+ /* Subtract cr from r_ptr[j + b_len], then forget about
+ r_ptr[j + b_len]. */
+ if (cr > r_ptr[j + b_len])
+ {
+ /* Subtraction gave a carry. */
+ q_star = q_star - 1; /* q* := q* - 1 */
+ /* Add b back. */
+ {
+ const mp_limb_t *sourceptr = b_ptr;
+ mp_limb_t *destptr = r_ptr + j;
+ mp_limb_t carry = 0;
+ size_t count;
+ for (count = b_len; count > 0; count--)
+ {
+ mp_limb_t source1 = *sourceptr++;
+ mp_limb_t source2 = *destptr;
+ *destptr++ = source1 + source2 + carry;
+ carry =
+ (carry
+ ? source1 >= (mp_limb_t) ~source2
+ : source1 > (mp_limb_t) ~source2);
+ }
+ }
+ /* Forget about the carry and about r[j+n]. */
+ }
+ }
+ /* q* is determined. Store it as q[j]. */
+ q_ptr[j] = q_star;
+ if (j == 0)
+ break;
+ j--;
+ }
+ }
+ r_len = b_len;
+ /* Normalise q. */
+ if (q_ptr[q_len - 1] == 0)
+ q_len--;
+# if 0 /* Not needed here, since we need r only to compare it with b/2, and
+ b is shifted left by s bits. */
+ /* Shift r right by s bits. */
+ if (s > 0)
+ {
+ mp_limb_t ptr = r_ptr + r_len;
+ mp_twolimb_t accu = 0;
+ size_t count;
+ for (count = r_len; count > 0; count--)
+ {
+ accu = (mp_twolimb_t) (mp_limb_t) accu << GMP_LIMB_BITS;
+ accu += (mp_twolimb_t) *--ptr << (GMP_LIMB_BITS - s);
+ *ptr = (mp_limb_t) (accu >> GMP_LIMB_BITS);
+ }
+ }
+# endif
+ /* Normalise r. */
+ while (r_len > 0 && r_ptr[r_len - 1] == 0)
+ r_len--;
+ }
+ /* Compare r << 1 with b. */
+ if (r_len > b_len)
+ goto increment_q;
+ {
+ size_t i;
+ for (i = b_len;;)
+ {
+ mp_limb_t r_i =
+ (i <= r_len && i > 0 ? r_ptr[i - 1] >> (GMP_LIMB_BITS - 1) : 0)
+ | (i < r_len ? r_ptr[i] << 1 : 0);
+ mp_limb_t b_i = (i < b_len ? b_ptr[i] : 0);
+ if (r_i > b_i)
+ goto increment_q;
+ if (r_i < b_i)
+ goto keep_q;
+ if (i == 0)
+ break;
+ i--;
+ }
+ }
+ if (q_len > 0 && ((q_ptr[0] & 1) != 0))
+ /* q is odd. */
+ increment_q:
+ {
+ size_t i;
+ for (i = 0; i < q_len; i++)
+ if (++(q_ptr[i]) != 0)
+ goto keep_q;
+ q_ptr[q_len++] = 1;
+ }
+ keep_q:
+ free (tmp_roomptr);
+ q->limbs = q_ptr;
+ q->nlimbs = q_len;
+ return roomptr;
+}
+
+/* Convert a bignum a >= 0, multiplied with 10^extra_zeroes, to decimal
+ representation.
+ Destroys the contents of a.
+ Return the allocated memory - containing the decimal digits in low-to-high
+ order, terminated with a NUL character - in case of success, NULL in case
+ of memory allocation failure. */
+static char *
+convert_to_decimal (mpn_t a, size_t extra_zeroes)
+{
+ mp_limb_t *a_ptr = a.limbs;
+ size_t a_len = a.nlimbs;
+ /* 0.03345 is slightly larger than log(2)/(9*log(10)). */
+ size_t c_len = 9 * ((size_t)(a_len * (GMP_LIMB_BITS * 0.03345f)) + 1);
+ /* We need extra_zeroes bytes for zeroes, followed by c_len bytes for the
+ digits of a, followed by 1 byte for the terminating NUL. */
+ char *c_ptr = (char *) malloc (xsum (xsum (extra_zeroes, c_len), 1));
+ if (c_ptr != NULL)
+ {
+ char *d_ptr = c_ptr;
+ for (; extra_zeroes > 0; extra_zeroes--)
+ *d_ptr++ = '0';
+ while (a_len > 0)
+ {
+ /* Divide a by 10^9, in-place. */
+ mp_limb_t remainder = 0;
+ mp_limb_t *ptr = a_ptr + a_len;
+ size_t count;
+ for (count = a_len; count > 0; count--)
+ {
+ mp_twolimb_t num =
+ ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--ptr;
+ *ptr = num / 1000000000;
+ remainder = num % 1000000000;
+ }
+ /* Store the remainder as 9 decimal digits. */
+ for (count = 9; count > 0; count--)
+ {
+ *d_ptr++ = '0' + (remainder % 10);
+ remainder = remainder / 10;
+ }
+ /* Normalize a. */
+ if (a_ptr[a_len - 1] == 0)
+ a_len--;
+ }
+ /* Remove leading zeroes. */
+ while (d_ptr > c_ptr && d_ptr[-1] == '0')
+ d_ptr--;
+ /* But keep at least one zero. */
+ if (d_ptr == c_ptr)
+ *d_ptr++ = '0';
+ /* Terminate the string. */
+ *d_ptr = '\0';
+ }
+ return c_ptr;
+}
+
+# if NEED_PRINTF_LONG_DOUBLE
+
+/* Assuming x is finite and >= 0:
+ write x as x = 2^e * m, where m is a bignum.
+ Return the allocated memory in case of success, NULL in case of memory
+ allocation failure. */
+static void *
+decode_long_double (long double x, int *ep, mpn_t *mp)
+{
+ mpn_t m;
+ int exp;
+ long double y;
+ size_t i;
+
+ /* Allocate memory for result. */
+ m.nlimbs = (LDBL_MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS;
+ m.limbs = (mp_limb_t *) malloc (m.nlimbs * sizeof (mp_limb_t));
+ if (m.limbs == NULL)
+ return NULL;
+ /* Split into exponential part and mantissa. */
+ y = frexpl (x, &exp);
+ if (!(y >= 0.0L && y < 1.0L))
+ abort ();
+ /* x = 2^exp * y = 2^(exp - LDBL_MANT_BIT) * (y * 2^LDBL_MANT_BIT), and the
+ latter is an integer. */
+ /* Convert the mantissa (y * 2^LDBL_MANT_BIT) to a sequence of limbs.
+ I'm not sure whether it's safe to cast a 'long double' value between
+ 2^31 and 2^32 to 'unsigned int', therefore play safe and cast only
+ 'long double' values between 0 and 2^16 (to 'unsigned int' or 'int',
+ doesn't matter). */
+# if (LDBL_MANT_BIT % GMP_LIMB_BITS) != 0
+# if (LDBL_MANT_BIT % GMP_LIMB_BITS) > GMP_LIMB_BITS / 2
+ {
+ mp_limb_t hi, lo;
+ y *= (mp_limb_t) 1 << (LDBL_MANT_BIT % (GMP_LIMB_BITS / 2));
+ hi = (int) y;
+ y -= hi;
+ if (!(y >= 0.0L && y < 1.0L))
+ abort ();
+ y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
+ lo = (int) y;
+ y -= lo;
+ if (!(y >= 0.0L && y < 1.0L))
+ abort ();
+ m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo;
+ }
+# else
+ {
+ mp_limb_t d;
+ y *= (mp_limb_t) 1 << (LDBL_MANT_BIT % GMP_LIMB_BITS);
+ d = (int) y;
+ y -= d;
+ if (!(y >= 0.0L && y < 1.0L))
+ abort ();
+ m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = d;
+ }
+# endif
+# endif
+ for (i = LDBL_MANT_BIT / GMP_LIMB_BITS; i > 0; )
+ {
+ mp_limb_t hi, lo;
+ y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
+ hi = (int) y;
+ y -= hi;
+ if (!(y >= 0.0L && y < 1.0L))
+ abort ();
+ y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
+ lo = (int) y;
+ y -= lo;
+ if (!(y >= 0.0L && y < 1.0L))
+ abort ();
+ m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo;
+ }
+# if 0 /* On FreeBSD 6.1/x86, 'long double' numbers sometimes have excess
+ precision. */
+ if (!(y == 0.0L))
+ abort ();
+# endif
+ /* Normalise. */
+ while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0)
+ m.nlimbs--;
+ *mp = m;
+ *ep = exp - LDBL_MANT_BIT;
+ return m.limbs;
+}
+
+# endif
+
+# if NEED_PRINTF_DOUBLE
+
+/* Assuming x is finite and >= 0:
+ write x as x = 2^e * m, where m is a bignum.
+ Return the allocated memory in case of success, NULL in case of memory
+ allocation failure. */
+static void *
+decode_double (double x, int *ep, mpn_t *mp)
+{
+ mpn_t m;
+ int exp;
+ double y;
+ size_t i;
+
+ /* Allocate memory for result. */
+ m.nlimbs = (DBL_MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS;
+ m.limbs = (mp_limb_t *) malloc (m.nlimbs * sizeof (mp_limb_t));
+ if (m.limbs == NULL)
+ return NULL;
+ /* Split into exponential part and mantissa. */
+ y = frexp (x, &exp);
+ if (!(y >= 0.0 && y < 1.0))
+ abort ();
+ /* x = 2^exp * y = 2^(exp - DBL_MANT_BIT) * (y * 2^DBL_MANT_BIT), and the
+ latter is an integer. */
+ /* Convert the mantissa (y * 2^DBL_MANT_BIT) to a sequence of limbs.
+ I'm not sure whether it's safe to cast a 'double' value between
+ 2^31 and 2^32 to 'unsigned int', therefore play safe and cast only
+ 'double' values between 0 and 2^16 (to 'unsigned int' or 'int',
+ doesn't matter). */
+# if (DBL_MANT_BIT % GMP_LIMB_BITS) != 0
+# if (DBL_MANT_BIT % GMP_LIMB_BITS) > GMP_LIMB_BITS / 2
+ {
+ mp_limb_t hi, lo;
+ y *= (mp_limb_t) 1 << (DBL_MANT_BIT % (GMP_LIMB_BITS / 2));
+ hi = (int) y;
+ y -= hi;
+ if (!(y >= 0.0 && y < 1.0))
+ abort ();
+ y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
+ lo = (int) y;
+ y -= lo;
+ if (!(y >= 0.0 && y < 1.0))
+ abort ();
+ m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo;
+ }
+# else
+ {
+ mp_limb_t d;
+ y *= (mp_limb_t) 1 << (DBL_MANT_BIT % GMP_LIMB_BITS);
+ d = (int) y;
+ y -= d;
+ if (!(y >= 0.0 && y < 1.0))
+ abort ();
+ m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = d;
+ }
+# endif
+# endif
+ for (i = DBL_MANT_BIT / GMP_LIMB_BITS; i > 0; )
+ {
+ mp_limb_t hi, lo;
+ y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
+ hi = (int) y;
+ y -= hi;
+ if (!(y >= 0.0 && y < 1.0))
+ abort ();
+ y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
+ lo = (int) y;
+ y -= lo;
+ if (!(y >= 0.0 && y < 1.0))
+ abort ();
+ m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo;
+ }
+ if (!(y == 0.0))
+ abort ();
+ /* Normalise. */
+ while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0)
+ m.nlimbs--;
+ *mp = m;
+ *ep = exp - DBL_MANT_BIT;
+ return m.limbs;
+}
+
+# endif
+
+/* Assuming x = 2^e * m is finite and >= 0, and n is an integer:
+ Returns the decimal representation of round (x * 10^n).
+ Return the allocated memory - containing the decimal digits in low-to-high
+ order, terminated with a NUL character - in case of success, NULL in case
+ of memory allocation failure. */
+static char *
+scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n)
+{
+ int s;
+ size_t extra_zeroes;
+ unsigned int abs_n;
+ unsigned int abs_s;
+ mp_limb_t *pow5_ptr;
+ size_t pow5_len;
+ unsigned int s_limbs;
+ unsigned int s_bits;
+ mpn_t pow5;
+ mpn_t z;
+ void *z_memory;
+ char *digits;
+
+ if (memory == NULL)
+ return NULL;
+ /* x = 2^e * m, hence
+ y = round (2^e * 10^n * m) = round (2^(e+n) * 5^n * m)
+ = round (2^s * 5^n * m). */
+ s = e + n;
+ extra_zeroes = 0;
+ /* Factor out a common power of 10 if possible. */
+ if (s > 0 && n > 0)
+ {
+ extra_zeroes = (s < n ? s : n);
+ s -= extra_zeroes;
+ n -= extra_zeroes;
+ }
+ /* Here y = round (2^s * 5^n * m) * 10^extra_zeroes.
+ Before converting to decimal, we need to compute
+ z = round (2^s * 5^n * m). */
+ /* Compute 5^|n|, possibly shifted by |s| bits if n and s have the same
+ sign. 2.322 is slightly larger than log(5)/log(2). */
+ abs_n = (n >= 0 ? n : -n);
+ abs_s = (s >= 0 ? s : -s);
+ pow5_ptr = (mp_limb_t *) malloc (((int)(abs_n * (2.322f / GMP_LIMB_BITS)) + 1
+ + abs_s / GMP_LIMB_BITS + 1)
+ * sizeof (mp_limb_t));
+ if (pow5_ptr == NULL)
+ {
+ free (memory);
+ return NULL;
+ }
+ /* Initialize with 1. */
+ pow5_ptr[0] = 1;
+ pow5_len = 1;
+ /* Multiply with 5^|n|. */
+ if (abs_n > 0)
+ {
+ static mp_limb_t const small_pow5[13 + 1] =
+ {
+ 1, 5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 9765625,
+ 48828125, 244140625, 1220703125
+ };
+ unsigned int n13;
+ for (n13 = 0; n13 <= abs_n; n13 += 13)
+ {
+ mp_limb_t digit1 = small_pow5[n13 + 13 <= abs_n ? 13 : abs_n - n13];
+ size_t j;
+ mp_twolimb_t carry = 0;
+ for (j = 0; j < pow5_len; j++)
+ {
+ mp_limb_t digit2 = pow5_ptr[j];
+ carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2;
+ pow5_ptr[j] = (mp_limb_t) carry;
+ carry = carry >> GMP_LIMB_BITS;
+ }
+ if (carry > 0)
+ pow5_ptr[pow5_len++] = (mp_limb_t) carry;
+ }
+ }
+ s_limbs = abs_s / GMP_LIMB_BITS;
+ s_bits = abs_s % GMP_LIMB_BITS;
+ if (n >= 0 ? s >= 0 : s <= 0)
+ {
+ /* Multiply with 2^|s|. */
+ if (s_bits > 0)
+ {
+ mp_limb_t *ptr = pow5_ptr;
+ mp_twolimb_t accu = 0;
+ size_t count;
+ for (count = pow5_len; count > 0; count--)
+ {
+ accu += (mp_twolimb_t) *ptr << s_bits;
+ *ptr++ = (mp_limb_t) accu;
+ accu = accu >> GMP_LIMB_BITS;
+ }
+ if (accu > 0)
+ {
+ *ptr = (mp_limb_t) accu;
+ pow5_len++;
+ }
+ }
+ if (s_limbs > 0)
+ {
+ size_t count;
+ for (count = pow5_len; count > 0;)
+ {
+ count--;
+ pow5_ptr[s_limbs + count] = pow5_ptr[count];
+ }
+ for (count = s_limbs; count > 0;)
+ {
+ count--;
+ pow5_ptr[count] = 0;
+ }
+ pow5_len += s_limbs;
+ }
+ pow5.limbs = pow5_ptr;
+ pow5.nlimbs = pow5_len;
+ if (n >= 0)
+ {
+ /* Multiply m with pow5. No division needed. */
+ z_memory = multiply (m, pow5, &z);
+ }
+ else
+ {
+ /* Divide m by pow5 and round. */
+ z_memory = divide (m, pow5, &z);
+ }
+ }
+ else
+ {
+ pow5.limbs = pow5_ptr;
+ pow5.nlimbs = pow5_len;
+ if (n >= 0)
+ {
+ /* n >= 0, s < 0.
+ Multiply m with pow5, then divide by 2^|s|. */
+ mpn_t numerator;
+ mpn_t denominator;
+ void *tmp_memory;
+ tmp_memory = multiply (m, pow5, &numerator);
+ if (tmp_memory == NULL)
+ {
+ free (pow5_ptr);
+ free (memory);
+ return NULL;
+ }
+ /* Construct 2^|s|. */
+ {
+ mp_limb_t *ptr = pow5_ptr + pow5_len;
+ size_t i;
+ for (i = 0; i < s_limbs; i++)
+ ptr[i] = 0;
+ ptr[s_limbs] = (mp_limb_t) 1 << s_bits;
+ denominator.limbs = ptr;
+ denominator.nlimbs = s_limbs + 1;
+ }
+ z_memory = divide (numerator, denominator, &z);
+ free (tmp_memory);
+ }
+ else
+ {
+ /* n < 0, s > 0.
+ Multiply m with 2^s, then divide by pow5. */
+ mpn_t numerator;
+ mp_limb_t *num_ptr;
+ num_ptr = (mp_limb_t *) malloc ((m.nlimbs + s_limbs + 1)
+ * sizeof (mp_limb_t));
+ if (num_ptr == NULL)
+ {
+ free (pow5_ptr);
+ free (memory);
+ return NULL;
+ }
+ {
+ mp_limb_t *destptr = num_ptr;
+ {
+ size_t i;
+ for (i = 0; i < s_limbs; i++)
+ *destptr++ = 0;
+ }
+ if (s_bits > 0)
+ {
+ const mp_limb_t *sourceptr = m.limbs;
+ mp_twolimb_t accu = 0;
+ size_t count;
+ for (count = m.nlimbs; count > 0; count--)
+ {
+ accu += (mp_twolimb_t) *sourceptr++ << s_bits;
+ *destptr++ = (mp_limb_t) accu;
+ accu = accu >> GMP_LIMB_BITS;
+ }
+ if (accu > 0)
+ *destptr++ = (mp_limb_t) accu;
+ }
+ else
+ {
+ const mp_limb_t *sourceptr = m.limbs;
+ size_t count;
+ for (count = m.nlimbs; count > 0; count--)
+ *destptr++ = *sourceptr++;
+ }
+ numerator.limbs = num_ptr;
+ numerator.nlimbs = destptr - num_ptr;
+ }
+ z_memory = divide (numerator, pow5, &z);
+ free (num_ptr);
+ }
+ }
+ free (pow5_ptr);
+ free (memory);
+
+ /* Here y = round (x * 10^n) = z * 10^extra_zeroes. */
+
+ if (z_memory == NULL)
+ return NULL;
+ digits = convert_to_decimal (z, extra_zeroes);
+ free (z_memory);
+ return digits;
+}
+
+# if NEED_PRINTF_LONG_DOUBLE
+
+/* Assuming x is finite and >= 0, and n is an integer:
+ Returns the decimal representation of round (x * 10^n).
+ Return the allocated memory - containing the decimal digits in low-to-high
+ order, terminated with a NUL character - in case of success, NULL in case
+ of memory allocation failure. */
+static char *
+scale10_round_decimal_long_double (long double x, int n)
+{
+ int e IF_LINT(= 0);
+ mpn_t m;
+ void *memory = decode_long_double (x, &e, &m);
+ return scale10_round_decimal_decoded (e, m, memory, n);
+}
+
+# endif
+
+# if NEED_PRINTF_DOUBLE
+
+/* Assuming x is finite and >= 0, and n is an integer:
+ Returns the decimal representation of round (x * 10^n).
+ Return the allocated memory - containing the decimal digits in low-to-high
+ order, terminated with a NUL character - in case of success, NULL in case
+ of memory allocation failure. */
+static char *
+scale10_round_decimal_double (double x, int n)
+{
+ int e IF_LINT(= 0);
+ mpn_t m;
+ void *memory = decode_double (x, &e, &m);
+ return scale10_round_decimal_decoded (e, m, memory, n);
+}
+
+# endif
+
+# if NEED_PRINTF_LONG_DOUBLE
+
+/* Assuming x is finite and > 0:
+ Return an approximation for n with 10^n <= x < 10^(n+1).
+ The approximation is usually the right n, but may be off by 1 sometimes. */
+static int
+floorlog10l (long double x)
+{
+ int exp;
+ long double y;
+ double z;
+ double l;
+
+ /* Split into exponential part and mantissa. */
+ y = frexpl (x, &exp);
+ if (!(y >= 0.0L && y < 1.0L))
+ abort ();
+ if (y == 0.0L)
+ return INT_MIN;
+ if (y < 0.5L)
+ {
+ while (y < (1.0L / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2))))
+ {
+ y *= 1.0L * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2));
+ exp -= GMP_LIMB_BITS;
+ }
+ if (y < (1.0L / (1 << 16)))
+ {
+ y *= 1.0L * (1 << 16);
+ exp -= 16;
+ }
+ if (y < (1.0L / (1 << 8)))
+ {
+ y *= 1.0L * (1 << 8);
+ exp -= 8;
+ }
+ if (y < (1.0L / (1 << 4)))
+ {
+ y *= 1.0L * (1 << 4);
+ exp -= 4;
+ }
+ if (y < (1.0L / (1 << 2)))
+ {
+ y *= 1.0L * (1 << 2);
+ exp -= 2;
+ }
+ if (y < (1.0L / (1 << 1)))
+ {
+ y *= 1.0L * (1 << 1);
+ exp -= 1;
+ }
+ }
+ if (!(y >= 0.5L && y < 1.0L))
+ abort ();
+ /* Compute an approximation for l = log2(x) = exp + log2(y). */
+ l = exp;
+ z = y;
+ if (z < 0.70710678118654752444)
+ {
+ z *= 1.4142135623730950488;
+ l -= 0.5;
+ }
+ if (z < 0.8408964152537145431)
+ {
+ z *= 1.1892071150027210667;
+ l -= 0.25;
+ }
+ if (z < 0.91700404320467123175)
+ {
+ z *= 1.0905077326652576592;
+ l -= 0.125;
+ }
+ if (z < 0.9576032806985736469)
+ {
+ z *= 1.0442737824274138403;
+ l -= 0.0625;
+ }
+ /* Now 0.95 <= z <= 1.01. */
+ z = 1 - z;
+ /* log2(1-z) = 1/log(2) * (- z - z^2/2 - z^3/3 - z^4/4 - ...)
+ Four terms are enough to get an approximation with error < 10^-7. */
+ l -= 1.4426950408889634074 * z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25)));
+ /* Finally multiply with log(2)/log(10), yields an approximation for
+ log10(x). */
+ l *= 0.30102999566398119523;
+ /* Round down to the next integer. */
+ return (int) l + (l < 0 ? -1 : 0);
+}
+
+# endif
+
+# if NEED_PRINTF_DOUBLE
+
+/* Assuming x is finite and > 0:
+ Return an approximation for n with 10^n <= x < 10^(n+1).
+ The approximation is usually the right n, but may be off by 1 sometimes. */
+static int
+floorlog10 (double x)
+{
+ int exp;
+ double y;
+ double z;
+ double l;
+
+ /* Split into exponential part and mantissa. */
+ y = frexp (x, &exp);
+ if (!(y >= 0.0 && y < 1.0))
+ abort ();
+ if (y == 0.0)
+ return INT_MIN;
+ if (y < 0.5)
+ {
+ while (y < (1.0 / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2))))
+ {
+ y *= 1.0 * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2));
+ exp -= GMP_LIMB_BITS;
+ }
+ if (y < (1.0 / (1 << 16)))
+ {
+ y *= 1.0 * (1 << 16);
+ exp -= 16;
+ }
+ if (y < (1.0 / (1 << 8)))
+ {
+ y *= 1.0 * (1 << 8);
+ exp -= 8;
+ }
+ if (y < (1.0 / (1 << 4)))
+ {
+ y *= 1.0 * (1 << 4);
+ exp -= 4;
+ }
+ if (y < (1.0 / (1 << 2)))
+ {
+ y *= 1.0 * (1 << 2);
+ exp -= 2;
+ }
+ if (y < (1.0 / (1 << 1)))
+ {
+ y *= 1.0 * (1 << 1);
+ exp -= 1;
+ }
+ }
+ if (!(y >= 0.5 && y < 1.0))
+ abort ();
+ /* Compute an approximation for l = log2(x) = exp + log2(y). */
+ l = exp;
+ z = y;
+ if (z < 0.70710678118654752444)
+ {
+ z *= 1.4142135623730950488;
+ l -= 0.5;
+ }
+ if (z < 0.8408964152537145431)
+ {
+ z *= 1.1892071150027210667;
+ l -= 0.25;
+ }
+ if (z < 0.91700404320467123175)
+ {
+ z *= 1.0905077326652576592;
+ l -= 0.125;
+ }
+ if (z < 0.9576032806985736469)
+ {
+ z *= 1.0442737824274138403;
+ l -= 0.0625;
+ }
+ /* Now 0.95 <= z <= 1.01. */
+ z = 1 - z;
+ /* log2(1-z) = 1/log(2) * (- z - z^2/2 - z^3/3 - z^4/4 - ...)
+ Four terms are enough to get an approximation with error < 10^-7. */
+ l -= 1.4426950408889634074 * z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25)));
+ /* Finally multiply with log(2)/log(10), yields an approximation for
+ log10(x). */
+ l *= 0.30102999566398119523;
+ /* Round down to the next integer. */
+ return (int) l + (l < 0 ? -1 : 0);
+}
+
+# endif
+
+/* Tests whether a string of digits consists of exactly PRECISION zeroes and
+ a single '1' digit. */
+static int
+is_borderline (const char *digits, size_t precision)
+{
+ for (; precision > 0; precision--, digits++)
+ if (*digits != '0')
+ return 0;
+ if (*digits != '1')
+ return 0;
+ digits++;
+ return *digits == '\0';
+}
+
+#endif
+
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF
+
+/* Use a different function name, to make it possible that the 'wchar_t'
+ parametrization and the 'char' parametrization get compiled in the same
+ translation unit. */
+# if WIDE_CHAR_VERSION
+# define MAX_ROOM_NEEDED wmax_room_needed
+# else
+# define MAX_ROOM_NEEDED max_room_needed
+# endif
+
+/* Returns the number of TCHAR_T units needed as temporary space for the result
+ of sprintf or SNPRINTF of a single conversion directive. */
+static size_t
+MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion,
+ arg_type type, int flags, size_t width, int has_precision,
+ size_t precision, int pad_ourselves)
+{
+ size_t tmp_length;
+
+ switch (conversion)
+ {
+ case 'd': case 'i': case 'u':
+ if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ else if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ else
+ tmp_length =
+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ if (tmp_length < precision)
+ tmp_length = precision;
+ /* Multiply by 2, as an estimate for FLAG_GROUP. */
+ tmp_length = xsum (tmp_length, tmp_length);
+ /* Add 1, to account for a leading sign. */
+ tmp_length = xsum (tmp_length, 1);
+ break;
+
+ case 'o':
+ if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1; /* turn floor into ceil */
+ else if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1; /* turn floor into ceil */
+ else
+ tmp_length =
+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1; /* turn floor into ceil */
+ if (tmp_length < precision)
+ tmp_length = precision;
+ /* Add 1, to account for a leading sign. */
+ tmp_length = xsum (tmp_length, 1);
+ break;
+
+ case 'x': case 'X':
+ if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ else if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ else
+ tmp_length =
+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ if (tmp_length < precision)
+ tmp_length = precision;
+ /* Add 2, to account for a leading sign or alternate form. */
+ tmp_length = xsum (tmp_length, 2);
+ break;
+
+ case 'f': case 'F':
+ if (type == TYPE_LONGDOUBLE)
+ tmp_length =
+ (unsigned int) (LDBL_MAX_EXP
+ * 0.30103 /* binary -> decimal */
+ * 2 /* estimate for FLAG_GROUP */
+ )
+ + 1 /* turn floor into ceil */
+ + 10; /* sign, decimal point etc. */
+ else
+ tmp_length =
+ (unsigned int) (DBL_MAX_EXP
+ * 0.30103 /* binary -> decimal */
+ * 2 /* estimate for FLAG_GROUP */
+ )
+ + 1 /* turn floor into ceil */
+ + 10; /* sign, decimal point etc. */
+ tmp_length = xsum (tmp_length, precision);
+ break;
+
+ case 'e': case 'E': case 'g': case 'G':
+ tmp_length =
+ 12; /* sign, decimal point, exponent etc. */
+ tmp_length = xsum (tmp_length, precision);
+ break;
+
+ case 'a': case 'A':
+ if (type == TYPE_LONGDOUBLE)
+ tmp_length =
+ (unsigned int) (LDBL_DIG
+ * 0.831 /* decimal -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ else
+ tmp_length =
+ (unsigned int) (DBL_DIG
+ * 0.831 /* decimal -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ if (tmp_length < precision)
+ tmp_length = precision;
+ /* Account for sign, decimal point etc. */
+ tmp_length = xsum (tmp_length, 12);
+ break;
+
+ case 'c':
+# if HAVE_WINT_T && !WIDE_CHAR_VERSION
+ if (type == TYPE_WIDE_CHAR)
+ {
+ tmp_length = MB_CUR_MAX;
+# if ENABLE_WCHAR_FALLBACK
+ if (tmp_length < (sizeof (wchar_t) > 2 ? 10 : 6))
+ tmp_length = (sizeof (wchar_t) > 2 ? 10 : 6);
+# endif
+ }
+ else
+# endif
+ tmp_length = 1;
+ break;
+
+ case 's':
+# if HAVE_WCHAR_T
+ if (type == TYPE_WIDE_STRING)
+ {
+# if WIDE_CHAR_VERSION
+ /* ISO C says about %ls in fwprintf:
+ "If the precision is not specified or is greater than the size
+ of the array, the array shall contain a null wide character."
+ So if there is a precision, we must not use wcslen. */
+ const wchar_t *arg = ap->arg[arg_index].a.a_wide_string;
+
+ if (has_precision)
+ tmp_length = local_wcsnlen (arg, precision);
+ else
+ tmp_length = local_wcslen (arg);
+# else
+ /* ISO C says about %ls in fprintf:
+ "If a precision is specified, no more than that many bytes are
+ written (including shift sequences, if any), and the array
+ shall contain a null wide character if, to equal the multibyte
+ character sequence length given by the precision, the function
+ would need to access a wide character one past the end of the
+ array."
+ So if there is a precision, we must not use wcslen. */
+ /* This case has already been handled separately in VASNPRINTF. */
+ abort ();
+# endif
+ }
+ else
+# endif
+ {
+# if WIDE_CHAR_VERSION
+ /* ISO C says about %s in fwprintf:
+ "If the precision is not specified or is greater than the size
+ of the converted array, the converted array shall contain a
+ null wide character."
+ So if there is a precision, we must not use strlen. */
+ /* This case has already been handled separately in VASNPRINTF. */
+ abort ();
+# else
+ /* ISO C says about %s in fprintf:
+ "If the precision is not specified or greater than the size of
+ the array, the array shall contain a null character."
+ So if there is a precision, we must not use strlen. */
+ const char *arg = ap->arg[arg_index].a.a_string;
+
+ if (has_precision)
+ tmp_length = local_strnlen (arg, precision);
+ else
+ tmp_length = strlen (arg);
+# endif
+ }
+ break;
+
+ case 'p':
+ tmp_length =
+ (unsigned int) (sizeof (void *) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1 /* turn floor into ceil */
+ + 2; /* account for leading 0x */
+ break;
+
+ default:
+ abort ();
+ }
+
+ if (!pad_ourselves)
+ {
+# if ENABLE_UNISTDIO
+ /* Padding considers the number of characters, therefore the number of
+ elements after padding may be
+ > max (tmp_length, width)
+ but is certainly
+ <= tmp_length + width. */
+ tmp_length = xsum (tmp_length, width);
+# else
+ /* Padding considers the number of elements, says POSIX. */
+ if (tmp_length < width)
+ tmp_length = width;
+# endif
+ }
+
+ tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
+
+ return tmp_length;
+}
+
+#endif
+
+DCHAR_T *
+VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
+ const FCHAR_T *format, va_list args)
+{
+ DIRECTIVES d;
+ arguments a;
+
+ if (PRINTF_PARSE (format, &d, &a) < 0)
+ /* errno is already set. */
+ return NULL;
+
+ /* Frees the memory allocated by this function. Preserves errno. */
+#define CLEANUP() \
+ if (d.dir != d.direct_alloc_dir) \
+ free (d.dir); \
+ if (a.arg != a.direct_alloc_arg) \
+ free (a.arg);
+
+ if (PRINTF_FETCHARGS (args, &a) < 0)
+ goto fail_1_with_EINVAL;
+
+ {
+ size_t buf_neededlength;
+ TCHAR_T *buf;
+ TCHAR_T *buf_malloced;
+ const FCHAR_T *cp;
+ size_t i;
+ DIRECTIVE *dp;
+ /* Output string accumulator. */
+ DCHAR_T *result;
+ size_t allocated;
+ size_t length;
+
+ /* Allocate a small buffer that will hold a directive passed to
+ sprintf or snprintf. */
+ buf_neededlength =
+ xsum4 (7, d.max_width_length, d.max_precision_length, 6);
+#if HAVE_ALLOCA
+ if (buf_neededlength < 4000 / sizeof (TCHAR_T))
+ {
+ buf = (TCHAR_T *) alloca (buf_neededlength * sizeof (TCHAR_T));
+ buf_malloced = NULL;
+ }
+ else
+#endif
+ {
+ size_t buf_memsize = xtimes (buf_neededlength, sizeof (TCHAR_T));
+ if (size_overflow_p (buf_memsize))
+ goto out_of_memory_1;
+ buf = (TCHAR_T *) malloc (buf_memsize);
+ if (buf == NULL)
+ goto out_of_memory_1;
+ buf_malloced = buf;
+ }
+
+ result = resultbuf;
+ allocated = (resultbuf != NULL ? *lengthp : 0);
+ length = 0;
+ /* Invariants:
+ result is either == resultbuf or malloc-allocated.
+ If result == NULL, resultbuf is == NULL as well.
+ If length > 0, then result != NULL. */
+
+ /* Ensures that allocated >= needed. Aborts through a jump to
+ out_of_memory if needed is SIZE_MAX or otherwise too big. */
+#define ENSURE_ALLOCATION_ELSE(needed, oom_statement) \
+ if ((needed) > allocated) \
+ { \
+ size_t memory_size; \
+ DCHAR_T *memory; \
+ \
+ allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \
+ if ((needed) > allocated) \
+ allocated = (needed); \
+ memory_size = xtimes (allocated, sizeof (DCHAR_T)); \
+ if (size_overflow_p (memory_size)) \
+ oom_statement \
+ if (result == resultbuf) \
+ memory = (DCHAR_T *) malloc (memory_size); \
+ else \
+ memory = (DCHAR_T *) realloc (result, memory_size); \
+ if (memory == NULL) \
+ oom_statement \
+ if (result == resultbuf && length > 0) \
+ DCHAR_CPY (memory, result, length); \
+ result = memory; \
+ }
+#define ENSURE_ALLOCATION(needed) \
+ ENSURE_ALLOCATION_ELSE((needed), goto out_of_memory; )
+
+ for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++)
+ {
+ if (cp != dp->dir_start)
+ {
+ size_t n = dp->dir_start - cp;
+ size_t augmented_length = xsum (length, n);
+
+ ENSURE_ALLOCATION (augmented_length);
+ /* This copies a piece of FCHAR_T[] into a DCHAR_T[]. Here we
+ need that the format string contains only ASCII characters
+ if FCHAR_T and DCHAR_T are not the same type. */
+ if (sizeof (FCHAR_T) == sizeof (DCHAR_T))
+ {
+ DCHAR_CPY (result + length, (const DCHAR_T *) cp, n);
+ length = augmented_length;
+ }
+ else
+ {
+ do
+ result[length++] = *cp++;
+ while (--n > 0);
+ }
+ }
+ if (i == d.count)
+ break;
+
+ /* Execute a single directive. */
+ if (dp->conversion == '%')
+ {
+ size_t augmented_length;
+
+ if (!(dp->arg_index == ARG_NONE))
+ abort ();
+ augmented_length = xsum (length, 1);
+ ENSURE_ALLOCATION (augmented_length);
+ result[length] = '%';
+ length = augmented_length;
+ }
+ else
+ {
+ if (!(dp->arg_index != ARG_NONE))
+ abort ();
+
+ if (dp->conversion == 'n')
+ {
+ switch (a.arg[dp->arg_index].type)
+ {
+ case TYPE_COUNT_SCHAR_POINTER:
+ *a.arg[dp->arg_index].a.a_count_schar_pointer = length;
+ break;
+ case TYPE_COUNT_SHORT_POINTER:
+ *a.arg[dp->arg_index].a.a_count_short_pointer = length;
+ break;
+ case TYPE_COUNT_INT_POINTER:
+ *a.arg[dp->arg_index].a.a_count_int_pointer = length;
+ break;
+ case TYPE_COUNT_LONGINT_POINTER:
+ *a.arg[dp->arg_index].a.a_count_longint_pointer = length;
+ break;
+ case TYPE_COUNT_LONGLONGINT_POINTER:
+ *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
+ break;
+ default:
+ abort ();
+ }
+ }
+#if ENABLE_UNISTDIO
+ /* The unistdio extensions. */
+ else if (dp->conversion == 'U')
+ {
+ arg_type type = a.arg[dp->arg_index].type;
+ int flags = dp->flags;
+ int has_width;
+ size_t width;
+ int has_precision;
+ size_t precision;
+
+ has_width = 0;
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ width = arg;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-' flag
+ followed by a positive field width." */
+ flags |= FLAG_LEFT;
+ width = -width;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ do
+ width = xsum (xtimes (width, 10), *digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+ has_width = 1;
+ }
+
+ has_precision = 0;
+ precision = 0;
+ if (dp->precision_start != dp->precision_end)
+ {
+ if (dp->precision_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->precision_arg_index].a.a_int;
+ /* "A negative precision is taken as if the precision
+ were omitted." */
+ if (arg >= 0)
+ {
+ precision = arg;
+ has_precision = 1;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->precision_start + 1;
+
+ precision = 0;
+ while (digitp != dp->precision_end)
+ precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+ has_precision = 1;
+ }
+ }
+
+ switch (type)
+ {
+ case TYPE_U8_STRING:
+ {
+ const uint8_t *arg = a.arg[dp->arg_index].a.a_u8_string;
+ const uint8_t *arg_end;
+ size_t characters;
+
+ if (has_precision)
+ {
+ /* Use only PRECISION characters, from the left. */
+ arg_end = arg;
+ characters = 0;
+ for (; precision > 0; precision--)
+ {
+ int count = u8_strmblen (arg_end);
+ if (count == 0)
+ break;
+ if (count < 0)
+ goto fail_with_EILSEQ;
+ arg_end += count;
+ characters++;
+ }
+ }
+ else if (has_width)
+ {
+ /* Use the entire string, and count the number of
+ characters. */
+ arg_end = arg;
+ characters = 0;
+ for (;;)
+ {
+ int count = u8_strmblen (arg_end);
+ if (count == 0)
+ break;
+ if (count < 0)
+ goto fail_with_EILSEQ;
+ arg_end += count;
+ characters++;
+ }
+ }
+ else
+ {
+ /* Use the entire string. */
+ arg_end = arg + u8_strlen (arg);
+ /* The number of characters doesn't matter. */
+ characters = 0;
+ }
+
+ if (characters < width && !(dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+
+# if DCHAR_IS_UINT8_T
+ {
+ size_t n = arg_end - arg;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_CPY (result + length, arg, n);
+ length += n;
+ }
+# else
+ { /* Convert. */
+ DCHAR_T *converted = result + length;
+ size_t converted_len = allocated - length;
+# if DCHAR_IS_TCHAR
+ /* Convert from UTF-8 to locale encoding. */
+ converted =
+ u8_conv_to_encoding (locale_charset (),
+ iconveh_question_mark,
+ arg, arg_end - arg, NULL,
+ converted, &converted_len);
+# else
+ /* Convert from UTF-8 to UTF-16/UTF-32. */
+ converted =
+ U8_TO_DCHAR (arg, arg_end - arg,
+ converted, &converted_len);
+# endif
+ if (converted == NULL)
+ goto fail_with_errno;
+ if (converted != result + length)
+ {
+ ENSURE_ALLOCATION_ELSE (xsum (length, converted_len),
+ { free (converted); goto out_of_memory; });
+ DCHAR_CPY (result + length, converted, converted_len);
+ free (converted);
+ }
+ length += converted_len;
+ }
+# endif
+
+ if (characters < width && (dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+ break;
+
+ case TYPE_U16_STRING:
+ {
+ const uint16_t *arg = a.arg[dp->arg_index].a.a_u16_string;
+ const uint16_t *arg_end;
+ size_t characters;
+
+ if (has_precision)
+ {
+ /* Use only PRECISION characters, from the left. */
+ arg_end = arg;
+ characters = 0;
+ for (; precision > 0; precision--)
+ {
+ int count = u16_strmblen (arg_end);
+ if (count == 0)
+ break;
+ if (count < 0)
+ goto fail_with_EILSEQ;
+ arg_end += count;
+ characters++;
+ }
+ }
+ else if (has_width)
+ {
+ /* Use the entire string, and count the number of
+ characters. */
+ arg_end = arg;
+ characters = 0;
+ for (;;)
+ {
+ int count = u16_strmblen (arg_end);
+ if (count == 0)
+ break;
+ if (count < 0)
+ goto fail_with_EILSEQ;
+ arg_end += count;
+ characters++;
+ }
+ }
+ else
+ {
+ /* Use the entire string. */
+ arg_end = arg + u16_strlen (arg);
+ /* The number of characters doesn't matter. */
+ characters = 0;
+ }
+
+ if (characters < width && !(dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+
+# if DCHAR_IS_UINT16_T
+ {
+ size_t n = arg_end - arg;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_CPY (result + length, arg, n);
+ length += n;
+ }
+# else
+ { /* Convert. */
+ DCHAR_T *converted = result + length;
+ size_t converted_len = allocated - length;
+# if DCHAR_IS_TCHAR
+ /* Convert from UTF-16 to locale encoding. */
+ converted =
+ u16_conv_to_encoding (locale_charset (),
+ iconveh_question_mark,
+ arg, arg_end - arg, NULL,
+ converted, &converted_len);
+# else
+ /* Convert from UTF-16 to UTF-8/UTF-32. */
+ converted =
+ U16_TO_DCHAR (arg, arg_end - arg,
+ converted, &converted_len);
+# endif
+ if (converted == NULL)
+ goto fail_with_errno;
+ if (converted != result + length)
+ {
+ ENSURE_ALLOCATION_ELSE (xsum (length, converted_len),
+ { free (converted); goto out_of_memory; });
+ DCHAR_CPY (result + length, converted, converted_len);
+ free (converted);
+ }
+ length += converted_len;
+ }
+# endif
+
+ if (characters < width && (dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+ break;
+
+ case TYPE_U32_STRING:
+ {
+ const uint32_t *arg = a.arg[dp->arg_index].a.a_u32_string;
+ const uint32_t *arg_end;
+ size_t characters;
+
+ if (has_precision)
+ {
+ /* Use only PRECISION characters, from the left. */
+ arg_end = arg;
+ characters = 0;
+ for (; precision > 0; precision--)
+ {
+ int count = u32_strmblen (arg_end);
+ if (count == 0)
+ break;
+ if (count < 0)
+ goto fail_with_EILSEQ;
+ arg_end += count;
+ characters++;
+ }
+ }
+ else if (has_width)
+ {
+ /* Use the entire string, and count the number of
+ characters. */
+ arg_end = arg;
+ characters = 0;
+ for (;;)
+ {
+ int count = u32_strmblen (arg_end);
+ if (count == 0)
+ break;
+ if (count < 0)
+ goto fail_with_EILSEQ;
+ arg_end += count;
+ characters++;
+ }
+ }
+ else
+ {
+ /* Use the entire string. */
+ arg_end = arg + u32_strlen (arg);
+ /* The number of characters doesn't matter. */
+ characters = 0;
+ }
+
+ if (characters < width && !(dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+
+# if DCHAR_IS_UINT32_T
+ {
+ size_t n = arg_end - arg;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_CPY (result + length, arg, n);
+ length += n;
+ }
+# else
+ { /* Convert. */
+ DCHAR_T *converted = result + length;
+ size_t converted_len = allocated - length;
+# if DCHAR_IS_TCHAR
+ /* Convert from UTF-32 to locale encoding. */
+ converted =
+ u32_conv_to_encoding (locale_charset (),
+ iconveh_question_mark,
+ arg, arg_end - arg, NULL,
+ converted, &converted_len);
+# else
+ /* Convert from UTF-32 to UTF-8/UTF-16. */
+ converted =
+ U32_TO_DCHAR (arg, arg_end - arg,
+ converted, &converted_len);
+# endif
+ if (converted == NULL)
+ goto fail_with_errno;
+ if (converted != result + length)
+ {
+ ENSURE_ALLOCATION_ELSE (xsum (length, converted_len),
+ { free (converted); goto out_of_memory; });
+ DCHAR_CPY (result + length, converted, converted_len);
+ free (converted);
+ }
+ length += converted_len;
+ }
+# endif
+
+ if (characters < width && (dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+ break;
+
+ default:
+ abort ();
+ }
+ }
+#endif
+#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL) || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T
+ else if (dp->conversion == 's'
+# if WIDE_CHAR_VERSION
+ && a.arg[dp->arg_index].type != TYPE_WIDE_STRING
+# else
+ && a.arg[dp->arg_index].type == TYPE_WIDE_STRING
+# endif
+ )
+ {
+ /* The normal handling of the 's' directive below requires
+ allocating a temporary buffer. The determination of its
+ length (tmp_length), in the case when a precision is
+ specified, below requires a conversion between a char[]
+ string and a wchar_t[] wide string. It could be done, but
+ we have no guarantee that the implementation of sprintf will
+ use the exactly same algorithm. Without this guarantee, it
+ is possible to have buffer overrun bugs. In order to avoid
+ such bugs, we implement the entire processing of the 's'
+ directive ourselves. */
+ int flags = dp->flags;
+ int has_width;
+ size_t width;
+ int has_precision;
+ size_t precision;
+
+ has_width = 0;
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ width = arg;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-' flag
+ followed by a positive field width." */
+ flags |= FLAG_LEFT;
+ width = -width;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ do
+ width = xsum (xtimes (width, 10), *digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+ has_width = 1;
+ }
+
+ has_precision = 0;
+ precision = 6;
+ if (dp->precision_start != dp->precision_end)
+ {
+ if (dp->precision_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->precision_arg_index].a.a_int;
+ /* "A negative precision is taken as if the precision
+ were omitted." */
+ if (arg >= 0)
+ {
+ precision = arg;
+ has_precision = 1;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->precision_start + 1;
+
+ precision = 0;
+ while (digitp != dp->precision_end)
+ precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+ has_precision = 1;
+ }
+ }
+
+# if WIDE_CHAR_VERSION
+ /* %s in vasnwprintf. See the specification of fwprintf. */
+ {
+ const char *arg = a.arg[dp->arg_index].a.a_string;
+ const char *arg_end;
+ size_t characters;
+
+ if (has_precision)
+ {
+ /* Use only as many bytes as needed to produce PRECISION
+ wide characters, from the left. */
+# if HAVE_MBRTOWC
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ arg_end = arg;
+ characters = 0;
+ for (; precision > 0; precision--)
+ {
+ int count;
+# if HAVE_MBRTOWC
+ count = mbrlen (arg_end, MB_CUR_MAX, &state);
+# else
+ count = mblen (arg_end, MB_CUR_MAX);
+# endif
+ if (count == 0)
+ /* Found the terminating NUL. */
+ break;
+ if (count < 0)
+ /* Invalid or incomplete multibyte character. */
+ goto fail_with_EILSEQ;
+ arg_end += count;
+ characters++;
+ }
+ }
+ else if (has_width)
+ {
+ /* Use the entire string, and count the number of wide
+ characters. */
+# if HAVE_MBRTOWC
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ arg_end = arg;
+ characters = 0;
+ for (;;)
+ {
+ int count;
+# if HAVE_MBRTOWC
+ count = mbrlen (arg_end, MB_CUR_MAX, &state);
+# else
+ count = mblen (arg_end, MB_CUR_MAX);
+# endif
+ if (count == 0)
+ /* Found the terminating NUL. */
+ break;
+ if (count < 0)
+ /* Invalid or incomplete multibyte character. */
+ goto fail_with_EILSEQ;
+ arg_end += count;
+ characters++;
+ }
+ }
+ else
+ {
+ /* Use the entire string. */
+ arg_end = arg + strlen (arg);
+ /* The number of characters doesn't matter. */
+ characters = 0;
+ }
+
+ if (characters < width && !(dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+
+ if (has_precision || has_width)
+ {
+ /* We know the number of wide characters in advance. */
+ size_t remaining;
+# if HAVE_MBRTOWC
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ ENSURE_ALLOCATION (xsum (length, characters));
+ for (remaining = characters; remaining > 0; remaining--)
+ {
+ wchar_t wc;
+ int count;
+# if HAVE_MBRTOWC
+ count = mbrtowc (&wc, arg, arg_end - arg, &state);
+# else
+ count = mbtowc (&wc, arg, arg_end - arg);
+# endif
+ if (count <= 0)
+ /* mbrtowc not consistent with mbrlen, or mbtowc
+ not consistent with mblen. */
+ abort ();
+ result[length++] = wc;
+ arg += count;
+ }
+ if (!(arg == arg_end))
+ abort ();
+ }
+ else
+ {
+# if HAVE_MBRTOWC
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ while (arg < arg_end)
+ {
+ wchar_t wc;
+ int count;
+# if HAVE_MBRTOWC
+ count = mbrtowc (&wc, arg, arg_end - arg, &state);
+# else
+ count = mbtowc (&wc, arg, arg_end - arg);
+# endif
+ if (count <= 0)
+ /* mbrtowc not consistent with mbrlen, or mbtowc
+ not consistent with mblen. */
+ abort ();
+ ENSURE_ALLOCATION (xsum (length, 1));
+ result[length++] = wc;
+ arg += count;
+ }
+ }
+
+ if (characters < width && (dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+# else
+ /* %ls in vasnprintf. See the specification of fprintf. */
+ {
+ const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
+ const wchar_t *arg_end;
+ size_t characters;
+# if !DCHAR_IS_TCHAR
+ /* This code assumes that TCHAR_T is 'char'. */
+ verify (sizeof (TCHAR_T) == 1);
+ TCHAR_T *tmpsrc;
+ DCHAR_T *tmpdst;
+ size_t tmpdst_len;
+# endif
+ size_t w;
+
+ if (has_precision)
+ {
+ /* Use only as many wide characters as needed to produce
+ at most PRECISION bytes, from the left. */
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ arg_end = arg;
+ characters = 0;
+ while (precision > 0)
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+
+ if (*arg_end == 0)
+ /* Found the terminating null wide character. */
+ break;
+ count = local_wcrtomb (cbuf, *arg_end, &state);
+ if (count < 0)
+ /* Cannot convert. */
+ goto fail_with_EILSEQ;
+ if (precision < (unsigned int) count)
+ break;
+ arg_end++;
+ characters += count;
+ precision -= count;
+ }
+ }
+# if DCHAR_IS_TCHAR
+ else if (has_width)
+# else
+ else
+# endif
+ {
+ /* Use the entire string, and count the number of
+ bytes. */
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ arg_end = arg;
+ characters = 0;
+ for (;;)
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+
+ if (*arg_end == 0)
+ /* Found the terminating null wide character. */
+ break;
+ count = local_wcrtomb (cbuf, *arg_end, &state);
+ if (count < 0)
+ /* Cannot convert. */
+ goto fail_with_EILSEQ;
+ arg_end++;
+ characters += count;
+ }
+ }
+# if DCHAR_IS_TCHAR
+ else
+ {
+ /* Use the entire string. */
+ arg_end = arg + local_wcslen (arg);
+ /* The number of bytes doesn't matter. */
+ characters = 0;
+ }
+# endif
+
+# if !DCHAR_IS_TCHAR
+ /* Convert the string into a piece of temporary memory. */
+ tmpsrc = (TCHAR_T *) malloc (characters * sizeof (TCHAR_T));
+ if (tmpsrc == NULL)
+ goto out_of_memory;
+ {
+ TCHAR_T *tmpptr = tmpsrc;
+ size_t remaining;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ for (remaining = characters; remaining > 0; )
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+
+ if (*arg == 0)
+ abort ();
+ count = local_wcrtomb (cbuf, *arg, &state);
+ if (count <= 0)
+ /* Inconsistency. */
+ abort ();
+ memcpy (tmpptr, cbuf, count);
+ tmpptr += count;
+ arg++;
+ remaining -= count;
+ }
+ if (!(arg == arg_end))
+ abort ();
+ }
+
+ /* Convert from TCHAR_T[] to DCHAR_T[]. */
+ tmpdst =
+ DCHAR_CONV_FROM_ENCODING (locale_charset (),
+ iconveh_question_mark,
+ tmpsrc, characters,
+ NULL,
+ NULL, &tmpdst_len);
+ if (tmpdst == NULL)
+ {
+ free (tmpsrc);
+ goto fail_with_errno;
+ }
+ free (tmpsrc);
+# endif
+
+ if (has_width)
+ {
+# if ENABLE_UNISTDIO
+ /* Outside POSIX, it's preferable to compare the width
+ against the number of _characters_ of the converted
+ value. */
+ w = DCHAR_MBSNLEN (result + length, characters);
+# else
+ /* The width is compared against the number of _bytes_
+ of the converted value, says POSIX. */
+ w = characters;
+# endif
+ }
+ else
+ /* w doesn't matter. */
+ w = 0;
+
+ if (w < width && !(dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - w;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+
+# if DCHAR_IS_TCHAR
+ if (has_precision || has_width)
+ {
+ /* We know the number of bytes in advance. */
+ size_t remaining;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ ENSURE_ALLOCATION (xsum (length, characters));
+ for (remaining = characters; remaining > 0; )
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+
+ if (*arg == 0)
+ abort ();
+ count = local_wcrtomb (cbuf, *arg, &state);
+ if (count <= 0)
+ /* Inconsistency. */
+ abort ();
+ memcpy (result + length, cbuf, count);
+ length += count;
+ arg++;
+ remaining -= count;
+ }
+ if (!(arg == arg_end))
+ abort ();
+ }
+ else
+ {
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ while (arg < arg_end)
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+
+ if (*arg == 0)
+ abort ();
+ count = local_wcrtomb (cbuf, *arg, &state);
+ if (count <= 0)
+ /* Cannot convert. */
+ goto fail_with_EILSEQ;
+ ENSURE_ALLOCATION (xsum (length, count));
+ memcpy (result + length, cbuf, count);
+ length += count;
+ arg++;
+ }
+ }
+# else
+ ENSURE_ALLOCATION_ELSE (xsum (length, tmpdst_len),
+ { free (tmpdst); goto out_of_memory; });
+ DCHAR_CPY (result + length, tmpdst, tmpdst_len);
+ free (tmpdst);
+ length += tmpdst_len;
+# endif
+
+ if (w < width && (dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - w;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+# endif
+ }
+#endif
+#if ENABLE_WCHAR_FALLBACK && HAVE_WINT_T && !WIDE_CHAR_VERSION
+ else if (dp->conversion == 'c'
+ && a.arg[dp->arg_index].type == TYPE_WIDE_CHAR)
+ {
+ /* Implement the 'lc' directive ourselves, in order to provide
+ the fallback that avoids EILSEQ. */
+ int flags = dp->flags;
+ int has_width;
+ size_t width;
+
+ has_width = 0;
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ width = arg;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-' flag
+ followed by a positive field width." */
+ flags |= FLAG_LEFT;
+ width = -width;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ do
+ width = xsum (xtimes (width, 10), *digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+ has_width = 1;
+ }
+
+ /* %lc in vasnprintf. See the specification of fprintf. */
+ {
+ wchar_t arg = (wchar_t) a.arg[dp->arg_index].a.a_wide_char;
+ size_t characters;
+# if !DCHAR_IS_TCHAR
+ /* This code assumes that TCHAR_T is 'char'. */
+ verify (sizeof (TCHAR_T) == 1);
+ TCHAR_T tmpsrc[64]; /* Assume MB_CUR_MAX <= 64. */
+ DCHAR_T *tmpdst;
+ size_t tmpdst_len;
+# endif
+ size_t w;
+
+# if DCHAR_IS_TCHAR
+ if (has_width)
+# endif
+ {
+ /* Count the number of bytes. */
+ characters = 0;
+ if (arg != 0)
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+
+ count = local_wcrtomb (cbuf, arg, &state);
+ if (count < 0)
+ /* Inconsistency. */
+ abort ();
+ characters = count;
+ }
+ }
+# if DCHAR_IS_TCHAR
+ else
+ {
+ /* The number of bytes doesn't matter. */
+ characters = 0;
+ }
+# endif
+
+# if !DCHAR_IS_TCHAR
+ /* Convert the string into a piece of temporary memory. */
+ if (characters > 0) /* implies arg != 0 */
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+
+ count = local_wcrtomb (cbuf, arg, &state);
+ if (count <= 0)
+ /* Inconsistency. */
+ abort ();
+ memcpy (tmpsrc, cbuf, count);
+ }
+
+ /* Convert from TCHAR_T[] to DCHAR_T[]. */
+ tmpdst =
+ DCHAR_CONV_FROM_ENCODING (locale_charset (),
+ iconveh_question_mark,
+ tmpsrc, characters,
+ NULL,
+ NULL, &tmpdst_len);
+ if (tmpdst == NULL)
+ goto fail_with_errno;
+# endif
+
+ if (has_width)
+ {
+# if ENABLE_UNISTDIO
+ /* Outside POSIX, it's preferable to compare the width
+ against the number of _characters_ of the converted
+ value. */
+ w = DCHAR_MBSNLEN (result + length, characters);
+# else
+ /* The width is compared against the number of _bytes_
+ of the converted value, says POSIX. */
+ w = characters;
+# endif
+ }
+ else
+ /* w doesn't matter. */
+ w = 0;
+
+ if (w < width && !(dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - w;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+
+# if DCHAR_IS_TCHAR
+ if (has_width)
+ {
+ /* We know the number of bytes in advance. */
+ ENSURE_ALLOCATION (xsum (length, characters));
+ if (characters > 0) /* implies arg != 0 */
+ {
+ int count;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+
+ count = local_wcrtomb (result + length, arg, &state);
+ if (count <= 0)
+ /* Inconsistency. */
+ abort ();
+ length += count;
+ }
+ }
+ else
+ {
+ if (arg != 0)
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+
+ count = local_wcrtomb (cbuf, arg, &state);
+ if (count <= 0)
+ /* Inconsistency. */
+ abort ();
+ ENSURE_ALLOCATION (xsum (length, count));
+ memcpy (result + length, cbuf, count);
+ length += count;
+ }
+ }
+# else
+ ENSURE_ALLOCATION_ELSE (xsum (length, tmpdst_len),
+ { free (tmpdst); goto out_of_memory; });
+ DCHAR_CPY (result + length, tmpdst, tmpdst_len);
+ free (tmpdst);
+ length += tmpdst_len;
+# endif
+
+ if (w < width && (dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - w;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+ }
+#endif
+#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
+ else if ((dp->conversion == 'a' || dp->conversion == 'A')
+# if !(NEED_PRINTF_DIRECTIVE_A || (NEED_PRINTF_LONG_DOUBLE && NEED_PRINTF_DOUBLE))
+ && (0
+# if NEED_PRINTF_DOUBLE
+ || a.arg[dp->arg_index].type == TYPE_DOUBLE
+# endif
+# if NEED_PRINTF_LONG_DOUBLE
+ || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
+# endif
+ )
+# endif
+ )
+ {
+ arg_type type = a.arg[dp->arg_index].type;
+ int flags = dp->flags;
+ size_t width;
+ int has_precision;
+ size_t precision;
+ size_t tmp_length;
+ size_t count;
+ DCHAR_T tmpbuf[700];
+ DCHAR_T *tmp;
+ DCHAR_T *pad_ptr;
+ DCHAR_T *p;
+
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ width = arg;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-' flag
+ followed by a positive field width." */
+ flags |= FLAG_LEFT;
+ width = -width;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ do
+ width = xsum (xtimes (width, 10), *digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+ }
+
+ has_precision = 0;
+ precision = 0;
+ if (dp->precision_start != dp->precision_end)
+ {
+ if (dp->precision_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->precision_arg_index].a.a_int;
+ /* "A negative precision is taken as if the precision
+ were omitted." */
+ if (arg >= 0)
+ {
+ precision = arg;
+ has_precision = 1;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->precision_start + 1;
+
+ precision = 0;
+ while (digitp != dp->precision_end)
+ precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+ has_precision = 1;
+ }
+ }
+
+ /* Allocate a temporary buffer of sufficient size. */
+ if (type == TYPE_LONGDOUBLE)
+ tmp_length =
+ (unsigned int) ((LDBL_DIG + 1)
+ * 0.831 /* decimal -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ else
+ tmp_length =
+ (unsigned int) ((DBL_DIG + 1)
+ * 0.831 /* decimal -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ if (tmp_length < precision)
+ tmp_length = precision;
+ /* Account for sign, decimal point etc. */
+ tmp_length = xsum (tmp_length, 12);
+
+ if (tmp_length < width)
+ tmp_length = width;
+
+ tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
+
+ if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T))
+ tmp = tmpbuf;
+ else
+ {
+ size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T));
+
+ if (size_overflow_p (tmp_memsize))
+ /* Overflow, would lead to out of memory. */
+ goto out_of_memory;
+ tmp = (DCHAR_T *) malloc (tmp_memsize);
+ if (tmp == NULL)
+ /* Out of memory. */
+ goto out_of_memory;
+ }
+
+ pad_ptr = NULL;
+ p = tmp;
+ if (type == TYPE_LONGDOUBLE)
+ {
+# if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE
+ long double arg = a.arg[dp->arg_index].a.a_longdouble;
+
+ if (isnanl (arg))
+ {
+ if (dp->conversion == 'A')
+ {
+ *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
+ }
+ else
+ {
+ *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
+ }
+ }
+ else
+ {
+ int sign = 0;
+ DECL_LONG_DOUBLE_ROUNDING
+
+ BEGIN_LONG_DOUBLE_ROUNDING ();
+
+ if (signbit (arg)) /* arg < 0.0L or negative zero */
+ {
+ sign = -1;
+ arg = -arg;
+ }
+
+ if (sign < 0)
+ *p++ = '-';
+ else if (flags & FLAG_SHOWSIGN)
+ *p++ = '+';
+ else if (flags & FLAG_SPACE)
+ *p++ = ' ';
+
+ if (arg > 0.0L && arg + arg == arg)
+ {
+ if (dp->conversion == 'A')
+ {
+ *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
+ }
+ else
+ {
+ *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
+ }
+ }
+ else
+ {
+ int exponent;
+ long double mantissa;
+
+ if (arg > 0.0L)
+ mantissa = printf_frexpl (arg, &exponent);
+ else
+ {
+ exponent = 0;
+ mantissa = 0.0L;
+ }
+
+ if (has_precision
+ && precision < (unsigned int) ((LDBL_DIG + 1) * 0.831) + 1)
+ {
+ /* Round the mantissa. */
+ long double tail = mantissa;
+ size_t q;
+
+ for (q = precision; ; q--)
+ {
+ int digit = (int) tail;
+ tail -= digit;
+ if (q == 0)
+ {
+ if (digit & 1 ? tail >= 0.5L : tail > 0.5L)
+ tail = 1 - tail;
+ else
+ tail = - tail;
+ break;
+ }
+ tail *= 16.0L;
+ }
+ if (tail != 0.0L)
+ for (q = precision; q > 0; q--)
+ tail *= 0.0625L;
+ mantissa += tail;
+ }
+
+ *p++ = '0';
+ *p++ = dp->conversion - 'A' + 'X';
+ pad_ptr = p;
+ {
+ int digit;
+
+ digit = (int) mantissa;
+ mantissa -= digit;
+ *p++ = '0' + digit;
+ if ((flags & FLAG_ALT)
+ || mantissa > 0.0L || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ /* This loop terminates because we assume
+ that FLT_RADIX is a power of 2. */
+ while (mantissa > 0.0L)
+ {
+ mantissa *= 16.0L;
+ digit = (int) mantissa;
+ mantissa -= digit;
+ *p++ = digit
+ + (digit < 10
+ ? '0'
+ : dp->conversion - 10);
+ if (precision > 0)
+ precision--;
+ }
+ while (precision > 0)
+ {
+ *p++ = '0';
+ precision--;
+ }
+ }
+ }
+ *p++ = dp->conversion - 'A' + 'P';
+# if WIDE_CHAR_VERSION
+ {
+ static const wchar_t decimal_format[] =
+ { '%', '+', 'd', '\0' };
+ SNPRINTF (p, 6 + 1, decimal_format, exponent);
+ }
+ while (*p != '\0')
+ p++;
+# else
+ if (sizeof (DCHAR_T) == 1)
+ {
+ sprintf ((char *) p, "%+d", exponent);
+ while (*p != '\0')
+ p++;
+ }
+ else
+ {
+ char expbuf[6 + 1];
+ const char *ep;
+ sprintf (expbuf, "%+d", exponent);
+ for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+ p++;
+ }
+# endif
+ }
+
+ END_LONG_DOUBLE_ROUNDING ();
+ }
+# else
+ abort ();
+# endif
+ }
+ else
+ {
+# if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE
+ double arg = a.arg[dp->arg_index].a.a_double;
+
+ if (isnand (arg))
+ {
+ if (dp->conversion == 'A')
+ {
+ *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
+ }
+ else
+ {
+ *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
+ }
+ }
+ else
+ {
+ int sign = 0;
+
+ if (signbit (arg)) /* arg < 0.0 or negative zero */
+ {
+ sign = -1;
+ arg = -arg;
+ }
+
+ if (sign < 0)
+ *p++ = '-';
+ else if (flags & FLAG_SHOWSIGN)
+ *p++ = '+';
+ else if (flags & FLAG_SPACE)
+ *p++ = ' ';
+
+ if (arg > 0.0 && arg + arg == arg)
+ {
+ if (dp->conversion == 'A')
+ {
+ *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
+ }
+ else
+ {
+ *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
+ }
+ }
+ else
+ {
+ int exponent;
+ double mantissa;
+
+ if (arg > 0.0)
+ mantissa = printf_frexp (arg, &exponent);
+ else
+ {
+ exponent = 0;
+ mantissa = 0.0;
+ }
+
+ if (has_precision
+ && precision < (unsigned int) ((DBL_DIG + 1) * 0.831) + 1)
+ {
+ /* Round the mantissa. */
+ double tail = mantissa;
+ size_t q;
+
+ for (q = precision; ; q--)
+ {
+ int digit = (int) tail;
+ tail -= digit;
+ if (q == 0)
+ {
+ if (digit & 1 ? tail >= 0.5 : tail > 0.5)
+ tail = 1 - tail;
+ else
+ tail = - tail;
+ break;
+ }
+ tail *= 16.0;
+ }
+ if (tail != 0.0)
+ for (q = precision; q > 0; q--)
+ tail *= 0.0625;
+ mantissa += tail;
+ }
+
+ *p++ = '0';
+ *p++ = dp->conversion - 'A' + 'X';
+ pad_ptr = p;
+ {
+ int digit;
+
+ digit = (int) mantissa;
+ mantissa -= digit;
+ *p++ = '0' + digit;
+ if ((flags & FLAG_ALT)
+ || mantissa > 0.0 || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ /* This loop terminates because we assume
+ that FLT_RADIX is a power of 2. */
+ while (mantissa > 0.0)
+ {
+ mantissa *= 16.0;
+ digit = (int) mantissa;
+ mantissa -= digit;
+ *p++ = digit
+ + (digit < 10
+ ? '0'
+ : dp->conversion - 10);
+ if (precision > 0)
+ precision--;
+ }
+ while (precision > 0)
+ {
+ *p++ = '0';
+ precision--;
+ }
+ }
+ }
+ *p++ = dp->conversion - 'A' + 'P';
+# if WIDE_CHAR_VERSION
+ {
+ static const wchar_t decimal_format[] =
+ { '%', '+', 'd', '\0' };
+ SNPRINTF (p, 6 + 1, decimal_format, exponent);
+ }
+ while (*p != '\0')
+ p++;
+# else
+ if (sizeof (DCHAR_T) == 1)
+ {
+ sprintf ((char *) p, "%+d", exponent);
+ while (*p != '\0')
+ p++;
+ }
+ else
+ {
+ char expbuf[6 + 1];
+ const char *ep;
+ sprintf (expbuf, "%+d", exponent);
+ for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+ p++;
+ }
+# endif
+ }
+ }
+# else
+ abort ();
+# endif
+ }
+
+ /* The generated string now extends from tmp to p, with the
+ zero padding insertion point being at pad_ptr. */
+ count = p - tmp;
+
+ if (count < width)
+ {
+ size_t pad = width - count;
+ DCHAR_T *end = p + pad;
+
+ if (flags & FLAG_LEFT)
+ {
+ /* Pad with spaces on the right. */
+ for (; pad > 0; pad--)
+ *p++ = ' ';
+ }
+ else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
+ {
+ /* Pad with zeroes. */
+ DCHAR_T *q = end;
+
+ while (p > pad_ptr)
+ *--q = *--p;
+ for (; pad > 0; pad--)
+ *p++ = '0';
+ }
+ else
+ {
+ /* Pad with spaces on the left. */
+ DCHAR_T *q = end;
+
+ while (p > tmp)
+ *--q = *--p;
+ for (; pad > 0; pad--)
+ *p++ = ' ';
+ }
+
+ p = end;
+ }
+
+ count = p - tmp;
+
+ if (count >= tmp_length)
+ /* tmp_length was incorrectly calculated - fix the
+ code above! */
+ abort ();
+
+ /* Make room for the result. */
+ if (count >= allocated - length)
+ {
+ size_t n = xsum (length, count);
+
+ ENSURE_ALLOCATION (n);
+ }
+
+ /* Append the result. */
+ memcpy (result + length, tmp, count * sizeof (DCHAR_T));
+ if (tmp != tmpbuf)
+ free (tmp);
+ length += count;
+ }
+#endif
+#if (NEED_PRINTF_INFINITE_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
+ else if ((dp->conversion == 'f' || dp->conversion == 'F'
+ || dp->conversion == 'e' || dp->conversion == 'E'
+ || dp->conversion == 'g' || dp->conversion == 'G'
+ || dp->conversion == 'a' || dp->conversion == 'A')
+ && (0
+# if NEED_PRINTF_DOUBLE
+ || a.arg[dp->arg_index].type == TYPE_DOUBLE
+# elif NEED_PRINTF_INFINITE_DOUBLE
+ || (a.arg[dp->arg_index].type == TYPE_DOUBLE
+ /* The systems (mingw) which produce wrong output
+ for Inf, -Inf, and NaN also do so for -0.0.
+ Therefore we treat this case here as well. */
+ && is_infinite_or_zero (a.arg[dp->arg_index].a.a_double))
+# endif
+# if NEED_PRINTF_LONG_DOUBLE
+ || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
+# elif NEED_PRINTF_INFINITE_LONG_DOUBLE
+ || (a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
+ /* Some systems produce wrong output for Inf,
+ -Inf, and NaN. Some systems in this category
+ (IRIX 5.3) also do so for -0.0. Therefore we
+ treat this case here as well. */
+ && is_infinite_or_zerol (a.arg[dp->arg_index].a.a_longdouble))
+# endif
+ ))
+ {
+# if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE)
+ arg_type type = a.arg[dp->arg_index].type;
+# endif
+ int flags = dp->flags;
+ size_t width;
+ size_t count;
+ int has_precision;
+ size_t precision;
+ size_t tmp_length;
+ DCHAR_T tmpbuf[700];
+ DCHAR_T *tmp;
+ DCHAR_T *pad_ptr;
+ DCHAR_T *p;
+
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ width = arg;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-' flag
+ followed by a positive field width." */
+ flags |= FLAG_LEFT;
+ width = -width;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ do
+ width = xsum (xtimes (width, 10), *digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+ }
+
+ has_precision = 0;
+ precision = 0;
+ if (dp->precision_start != dp->precision_end)
+ {
+ if (dp->precision_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->precision_arg_index].a.a_int;
+ /* "A negative precision is taken as if the precision
+ were omitted." */
+ if (arg >= 0)
+ {
+ precision = arg;
+ has_precision = 1;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->precision_start + 1;
+
+ precision = 0;
+ while (digitp != dp->precision_end)
+ precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+ has_precision = 1;
+ }
+ }
+
+ /* POSIX specifies the default precision to be 6 for %f, %F,
+ %e, %E, but not for %g, %G. Implementations appear to use
+ the same default precision also for %g, %G. But for %a, %A,
+ the default precision is 0. */
+ if (!has_precision)
+ if (!(dp->conversion == 'a' || dp->conversion == 'A'))
+ precision = 6;
+
+ /* Allocate a temporary buffer of sufficient size. */
+# if NEED_PRINTF_DOUBLE && NEED_PRINTF_LONG_DOUBLE
+ tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : DBL_DIG + 1);
+# elif NEED_PRINTF_INFINITE_DOUBLE && NEED_PRINTF_LONG_DOUBLE
+ tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : 0);
+# elif NEED_PRINTF_LONG_DOUBLE
+ tmp_length = LDBL_DIG + 1;
+# elif NEED_PRINTF_DOUBLE
+ tmp_length = DBL_DIG + 1;
+# else
+ tmp_length = 0;
+# endif
+ if (tmp_length < precision)
+ tmp_length = precision;
+# if NEED_PRINTF_LONG_DOUBLE
+# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
+ if (type == TYPE_LONGDOUBLE)
+# endif
+ if (dp->conversion == 'f' || dp->conversion == 'F')
+ {
+ long double arg = a.arg[dp->arg_index].a.a_longdouble;
+ if (!(isnanl (arg) || arg + arg == arg))
+ {
+ /* arg is finite and nonzero. */
+ int exponent = floorlog10l (arg < 0 ? -arg : arg);
+ if (exponent >= 0 && tmp_length < exponent + precision)
+ tmp_length = exponent + precision;
+ }
+ }
+# endif
+# if NEED_PRINTF_DOUBLE
+# if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE
+ if (type == TYPE_DOUBLE)
+# endif
+ if (dp->conversion == 'f' || dp->conversion == 'F')
+ {
+ double arg = a.arg[dp->arg_index].a.a_double;
+ if (!(isnand (arg) || arg + arg == arg))
+ {
+ /* arg is finite and nonzero. */
+ int exponent = floorlog10 (arg < 0 ? -arg : arg);
+ if (exponent >= 0 && tmp_length < exponent + precision)
+ tmp_length = exponent + precision;
+ }
+ }
+# endif
+ /* Account for sign, decimal point etc. */
+ tmp_length = xsum (tmp_length, 12);
+
+ if (tmp_length < width)
+ tmp_length = width;
+
+ tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
+
+ if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T))
+ tmp = tmpbuf;
+ else
+ {
+ size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T));
+
+ if (size_overflow_p (tmp_memsize))
+ /* Overflow, would lead to out of memory. */
+ goto out_of_memory;
+ tmp = (DCHAR_T *) malloc (tmp_memsize);
+ if (tmp == NULL)
+ /* Out of memory. */
+ goto out_of_memory;
+ }
+
+ pad_ptr = NULL;
+ p = tmp;
+
+# if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE
+# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
+ if (type == TYPE_LONGDOUBLE)
+# endif
+ {
+ long double arg = a.arg[dp->arg_index].a.a_longdouble;
+
+ if (isnanl (arg))
+ {
+ if (dp->conversion >= 'A' && dp->conversion <= 'Z')
+ {
+ *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
+ }
+ else
+ {
+ *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
+ }
+ }
+ else
+ {
+ int sign = 0;
+ DECL_LONG_DOUBLE_ROUNDING
+
+ BEGIN_LONG_DOUBLE_ROUNDING ();
+
+ if (signbit (arg)) /* arg < 0.0L or negative zero */
+ {
+ sign = -1;
+ arg = -arg;
+ }
+
+ if (sign < 0)
+ *p++ = '-';
+ else if (flags & FLAG_SHOWSIGN)
+ *p++ = '+';
+ else if (flags & FLAG_SPACE)
+ *p++ = ' ';
+
+ if (arg > 0.0L && arg + arg == arg)
+ {
+ if (dp->conversion >= 'A' && dp->conversion <= 'Z')
+ {
+ *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
+ }
+ else
+ {
+ *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
+ }
+ }
+ else
+ {
+# if NEED_PRINTF_LONG_DOUBLE
+ pad_ptr = p;
+
+ if (dp->conversion == 'f' || dp->conversion == 'F')
+ {
+ char *digits;
+ size_t ndigits;
+
+ digits =
+ scale10_round_decimal_long_double (arg, precision);
+ if (digits == NULL)
+ {
+ END_LONG_DOUBLE_ROUNDING ();
+ goto out_of_memory;
+ }
+ ndigits = strlen (digits);
+
+ if (ndigits > precision)
+ do
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ while (ndigits > precision);
+ else
+ *p++ = '0';
+ /* Here ndigits <= precision. */
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > ndigits; precision--)
+ *p++ = '0';
+ while (ndigits > 0)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+
+ free (digits);
+ }
+ else if (dp->conversion == 'e' || dp->conversion == 'E')
+ {
+ int exponent;
+
+ if (arg == 0.0L)
+ {
+ exponent = 0;
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ }
+ else
+ {
+ /* arg > 0.0L. */
+ int adjusted;
+ char *digits;
+ size_t ndigits;
+
+ exponent = floorlog10l (arg);
+ adjusted = 0;
+ for (;;)
+ {
+ digits =
+ scale10_round_decimal_long_double (arg,
+ (int)precision - exponent);
+ if (digits == NULL)
+ {
+ END_LONG_DOUBLE_ROUNDING ();
+ goto out_of_memory;
+ }
+ ndigits = strlen (digits);
+
+ if (ndigits == precision + 1)
+ break;
+ if (ndigits < precision
+ || ndigits > precision + 2)
+ /* The exponent was not guessed
+ precisely enough. */
+ abort ();
+ if (adjusted)
+ /* None of two values of exponent is
+ the right one. Prevent an endless
+ loop. */
+ abort ();
+ free (digits);
+ if (ndigits == precision)
+ exponent -= 1;
+ else
+ exponent += 1;
+ adjusted = 1;
+ }
+ /* Here ndigits = precision+1. */
+ if (is_borderline (digits, precision))
+ {
+ /* Maybe the exponent guess was too high
+ and a smaller exponent can be reached
+ by turning a 10...0 into 9...9x. */
+ char *digits2 =
+ scale10_round_decimal_long_double (arg,
+ (int)precision - exponent + 1);
+ if (digits2 == NULL)
+ {
+ free (digits);
+ END_LONG_DOUBLE_ROUNDING ();
+ goto out_of_memory;
+ }
+ if (strlen (digits2) == precision + 1)
+ {
+ free (digits);
+ digits = digits2;
+ exponent -= 1;
+ }
+ else
+ free (digits2);
+ }
+ /* Here ndigits = precision+1. */
+
+ *p++ = digits[--ndigits];
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > 0)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+
+ free (digits);
+ }
+
+ *p++ = dp->conversion; /* 'e' or 'E' */
+# if WIDE_CHAR_VERSION
+ {
+ static const wchar_t decimal_format[] =
+ { '%', '+', '.', '2', 'd', '\0' };
+ SNPRINTF (p, 6 + 1, decimal_format, exponent);
+ }
+ while (*p != '\0')
+ p++;
+# else
+ if (sizeof (DCHAR_T) == 1)
+ {
+ sprintf ((char *) p, "%+.2d", exponent);
+ while (*p != '\0')
+ p++;
+ }
+ else
+ {
+ char expbuf[6 + 1];
+ const char *ep;
+ sprintf (expbuf, "%+.2d", exponent);
+ for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+ p++;
+ }
+# endif
+ }
+ else if (dp->conversion == 'g' || dp->conversion == 'G')
+ {
+ if (precision == 0)
+ precision = 1;
+ /* precision >= 1. */
+
+ if (arg == 0.0L)
+ /* The exponent is 0, >= -4, < precision.
+ Use fixed-point notation. */
+ {
+ size_t ndigits = precision;
+ /* Number of trailing zeroes that have to be
+ dropped. */
+ size_t nzeroes =
+ (flags & FLAG_ALT ? 0 : precision - 1);
+
+ --ndigits;
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || ndigits > nzeroes)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = '0';
+ }
+ }
+ }
+ else
+ {
+ /* arg > 0.0L. */
+ int exponent;
+ int adjusted;
+ char *digits;
+ size_t ndigits;
+ size_t nzeroes;
+
+ exponent = floorlog10l (arg);
+ adjusted = 0;
+ for (;;)
+ {
+ digits =
+ scale10_round_decimal_long_double (arg,
+ (int)(precision - 1) - exponent);
+ if (digits == NULL)
+ {
+ END_LONG_DOUBLE_ROUNDING ();
+ goto out_of_memory;
+ }
+ ndigits = strlen (digits);
+
+ if (ndigits == precision)
+ break;
+ if (ndigits < precision - 1
+ || ndigits > precision + 1)
+ /* The exponent was not guessed
+ precisely enough. */
+ abort ();
+ if (adjusted)
+ /* None of two values of exponent is
+ the right one. Prevent an endless
+ loop. */
+ abort ();
+ free (digits);
+ if (ndigits < precision)
+ exponent -= 1;
+ else
+ exponent += 1;
+ adjusted = 1;
+ }
+ /* Here ndigits = precision. */
+ if (is_borderline (digits, precision - 1))
+ {
+ /* Maybe the exponent guess was too high
+ and a smaller exponent can be reached
+ by turning a 10...0 into 9...9x. */
+ char *digits2 =
+ scale10_round_decimal_long_double (arg,
+ (int)(precision - 1) - exponent + 1);
+ if (digits2 == NULL)
+ {
+ free (digits);
+ END_LONG_DOUBLE_ROUNDING ();
+ goto out_of_memory;
+ }
+ if (strlen (digits2) == precision)
+ {
+ free (digits);
+ digits = digits2;
+ exponent -= 1;
+ }
+ else
+ free (digits2);
+ }
+ /* Here ndigits = precision. */
+
+ /* Determine the number of trailing zeroes
+ that have to be dropped. */
+ nzeroes = 0;
+ if ((flags & FLAG_ALT) == 0)
+ while (nzeroes < ndigits
+ && digits[nzeroes] == '0')
+ nzeroes++;
+
+ /* The exponent is now determined. */
+ if (exponent >= -4
+ && exponent < (long)precision)
+ {
+ /* Fixed-point notation:
+ max(exponent,0)+1 digits, then the
+ decimal point, then the remaining
+ digits without trailing zeroes. */
+ if (exponent >= 0)
+ {
+ size_t ecount = exponent + 1;
+ /* Note: count <= precision = ndigits. */
+ for (; ecount > 0; ecount--)
+ *p++ = digits[--ndigits];
+ if ((flags & FLAG_ALT) || ndigits > nzeroes)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+ }
+ else
+ {
+ size_t ecount = -exponent - 1;
+ *p++ = '0';
+ *p++ = decimal_point_char ();
+ for (; ecount > 0; ecount--)
+ *p++ = '0';
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+ }
+ else
+ {
+ /* Exponential notation. */
+ *p++ = digits[--ndigits];
+ if ((flags & FLAG_ALT) || ndigits > nzeroes)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+ *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */
+# if WIDE_CHAR_VERSION
+ {
+ static const wchar_t decimal_format[] =
+ { '%', '+', '.', '2', 'd', '\0' };
+ SNPRINTF (p, 6 + 1, decimal_format, exponent);
+ }
+ while (*p != '\0')
+ p++;
+# else
+ if (sizeof (DCHAR_T) == 1)
+ {
+ sprintf ((char *) p, "%+.2d", exponent);
+ while (*p != '\0')
+ p++;
+ }
+ else
+ {
+ char expbuf[6 + 1];
+ const char *ep;
+ sprintf (expbuf, "%+.2d", exponent);
+ for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+ p++;
+ }
+# endif
+ }
+
+ free (digits);
+ }
+ }
+ else
+ abort ();
+# else
+ /* arg is finite. */
+ if (!(arg == 0.0L))
+ abort ();
+
+ pad_ptr = p;
+
+ if (dp->conversion == 'f' || dp->conversion == 'F')
+ {
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ }
+ else if (dp->conversion == 'e' || dp->conversion == 'E')
+ {
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ *p++ = dp->conversion; /* 'e' or 'E' */
+ *p++ = '+';
+ *p++ = '0';
+ *p++ = '0';
+ }
+ else if (dp->conversion == 'g' || dp->conversion == 'G')
+ {
+ *p++ = '0';
+ if (flags & FLAG_ALT)
+ {
+ size_t ndigits =
+ (precision > 0 ? precision - 1 : 0);
+ *p++ = decimal_point_char ();
+ for (; ndigits > 0; --ndigits)
+ *p++ = '0';
+ }
+ }
+ else if (dp->conversion == 'a' || dp->conversion == 'A')
+ {
+ *p++ = '0';
+ *p++ = dp->conversion - 'A' + 'X';
+ pad_ptr = p;
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ *p++ = dp->conversion - 'A' + 'P';
+ *p++ = '+';
+ *p++ = '0';
+ }
+ else
+ abort ();
+# endif
+ }
+
+ END_LONG_DOUBLE_ROUNDING ();
+ }
+ }
+# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
+ else
+# endif
+# endif
+# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
+ {
+ double arg = a.arg[dp->arg_index].a.a_double;
+
+ if (isnand (arg))
+ {
+ if (dp->conversion >= 'A' && dp->conversion <= 'Z')
+ {
+ *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
+ }
+ else
+ {
+ *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
+ }
+ }
+ else
+ {
+ int sign = 0;
+
+ if (signbit (arg)) /* arg < 0.0 or negative zero */
+ {
+ sign = -1;
+ arg = -arg;
+ }
+
+ if (sign < 0)
+ *p++ = '-';
+ else if (flags & FLAG_SHOWSIGN)
+ *p++ = '+';
+ else if (flags & FLAG_SPACE)
+ *p++ = ' ';
+
+ if (arg > 0.0 && arg + arg == arg)
+ {
+ if (dp->conversion >= 'A' && dp->conversion <= 'Z')
+ {
+ *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
+ }
+ else
+ {
+ *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
+ }
+ }
+ else
+ {
+# if NEED_PRINTF_DOUBLE
+ pad_ptr = p;
+
+ if (dp->conversion == 'f' || dp->conversion == 'F')
+ {
+ char *digits;
+ size_t ndigits;
+
+ digits =
+ scale10_round_decimal_double (arg, precision);
+ if (digits == NULL)
+ goto out_of_memory;
+ ndigits = strlen (digits);
+
+ if (ndigits > precision)
+ do
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ while (ndigits > precision);
+ else
+ *p++ = '0';
+ /* Here ndigits <= precision. */
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > ndigits; precision--)
+ *p++ = '0';
+ while (ndigits > 0)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+
+ free (digits);
+ }
+ else if (dp->conversion == 'e' || dp->conversion == 'E')
+ {
+ int exponent;
+
+ if (arg == 0.0)
+ {
+ exponent = 0;
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ }
+ else
+ {
+ /* arg > 0.0. */
+ int adjusted;
+ char *digits;
+ size_t ndigits;
+
+ exponent = floorlog10 (arg);
+ adjusted = 0;
+ for (;;)
+ {
+ digits =
+ scale10_round_decimal_double (arg,
+ (int)precision - exponent);
+ if (digits == NULL)
+ goto out_of_memory;
+ ndigits = strlen (digits);
+
+ if (ndigits == precision + 1)
+ break;
+ if (ndigits < precision
+ || ndigits > precision + 2)
+ /* The exponent was not guessed
+ precisely enough. */
+ abort ();
+ if (adjusted)
+ /* None of two values of exponent is
+ the right one. Prevent an endless
+ loop. */
+ abort ();
+ free (digits);
+ if (ndigits == precision)
+ exponent -= 1;
+ else
+ exponent += 1;
+ adjusted = 1;
+ }
+ /* Here ndigits = precision+1. */
+ if (is_borderline (digits, precision))
+ {
+ /* Maybe the exponent guess was too high
+ and a smaller exponent can be reached
+ by turning a 10...0 into 9...9x. */
+ char *digits2 =
+ scale10_round_decimal_double (arg,
+ (int)precision - exponent + 1);
+ if (digits2 == NULL)
+ {
+ free (digits);
+ goto out_of_memory;
+ }
+ if (strlen (digits2) == precision + 1)
+ {
+ free (digits);
+ digits = digits2;
+ exponent -= 1;
+ }
+ else
+ free (digits2);
+ }
+ /* Here ndigits = precision+1. */
+
+ *p++ = digits[--ndigits];
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > 0)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+
+ free (digits);
+ }
+
+ *p++ = dp->conversion; /* 'e' or 'E' */
+# if WIDE_CHAR_VERSION
+ {
+ static const wchar_t decimal_format[] =
+ /* Produce the same number of exponent digits
+ as the native printf implementation. */
+# if defined _WIN32 && ! defined __CYGWIN__
+ { '%', '+', '.', '3', 'd', '\0' };
+# else
+ { '%', '+', '.', '2', 'd', '\0' };
+# endif
+ SNPRINTF (p, 6 + 1, decimal_format, exponent);
+ }
+ while (*p != '\0')
+ p++;
+# else
+ {
+ static const char decimal_format[] =
+ /* Produce the same number of exponent digits
+ as the native printf implementation. */
+# if defined _WIN32 && ! defined __CYGWIN__
+ "%+.3d";
+# else
+ "%+.2d";
+# endif
+ if (sizeof (DCHAR_T) == 1)
+ {
+ sprintf ((char *) p, decimal_format, exponent);
+ while (*p != '\0')
+ p++;
+ }
+ else
+ {
+ char expbuf[6 + 1];
+ const char *ep;
+ sprintf (expbuf, decimal_format, exponent);
+ for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+ p++;
+ }
+ }
+# endif
+ }
+ else if (dp->conversion == 'g' || dp->conversion == 'G')
+ {
+ if (precision == 0)
+ precision = 1;
+ /* precision >= 1. */
+
+ if (arg == 0.0)
+ /* The exponent is 0, >= -4, < precision.
+ Use fixed-point notation. */
+ {
+ size_t ndigits = precision;
+ /* Number of trailing zeroes that have to be
+ dropped. */
+ size_t nzeroes =
+ (flags & FLAG_ALT ? 0 : precision - 1);
+
+ --ndigits;
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || ndigits > nzeroes)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = '0';
+ }
+ }
+ }
+ else
+ {
+ /* arg > 0.0. */
+ int exponent;
+ int adjusted;
+ char *digits;
+ size_t ndigits;
+ size_t nzeroes;
+
+ exponent = floorlog10 (arg);
+ adjusted = 0;
+ for (;;)
+ {
+ digits =
+ scale10_round_decimal_double (arg,
+ (int)(precision - 1) - exponent);
+ if (digits == NULL)
+ goto out_of_memory;
+ ndigits = strlen (digits);
+
+ if (ndigits == precision)
+ break;
+ if (ndigits < precision - 1
+ || ndigits > precision + 1)
+ /* The exponent was not guessed
+ precisely enough. */
+ abort ();
+ if (adjusted)
+ /* None of two values of exponent is
+ the right one. Prevent an endless
+ loop. */
+ abort ();
+ free (digits);
+ if (ndigits < precision)
+ exponent -= 1;
+ else
+ exponent += 1;
+ adjusted = 1;
+ }
+ /* Here ndigits = precision. */
+ if (is_borderline (digits, precision - 1))
+ {
+ /* Maybe the exponent guess was too high
+ and a smaller exponent can be reached
+ by turning a 10...0 into 9...9x. */
+ char *digits2 =
+ scale10_round_decimal_double (arg,
+ (int)(precision - 1) - exponent + 1);
+ if (digits2 == NULL)
+ {
+ free (digits);
+ goto out_of_memory;
+ }
+ if (strlen (digits2) == precision)
+ {
+ free (digits);
+ digits = digits2;
+ exponent -= 1;
+ }
+ else
+ free (digits2);
+ }
+ /* Here ndigits = precision. */
+
+ /* Determine the number of trailing zeroes
+ that have to be dropped. */
+ nzeroes = 0;
+ if ((flags & FLAG_ALT) == 0)
+ while (nzeroes < ndigits
+ && digits[nzeroes] == '0')
+ nzeroes++;
+
+ /* The exponent is now determined. */
+ if (exponent >= -4
+ && exponent < (long)precision)
+ {
+ /* Fixed-point notation:
+ max(exponent,0)+1 digits, then the
+ decimal point, then the remaining
+ digits without trailing zeroes. */
+ if (exponent >= 0)
+ {
+ size_t ecount = exponent + 1;
+ /* Note: ecount <= precision = ndigits. */
+ for (; ecount > 0; ecount--)
+ *p++ = digits[--ndigits];
+ if ((flags & FLAG_ALT) || ndigits > nzeroes)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+ }
+ else
+ {
+ size_t ecount = -exponent - 1;
+ *p++ = '0';
+ *p++ = decimal_point_char ();
+ for (; ecount > 0; ecount--)
+ *p++ = '0';
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+ }
+ else
+ {
+ /* Exponential notation. */
+ *p++ = digits[--ndigits];
+ if ((flags & FLAG_ALT) || ndigits > nzeroes)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+ *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */
+# if WIDE_CHAR_VERSION
+ {
+ static const wchar_t decimal_format[] =
+ /* Produce the same number of exponent digits
+ as the native printf implementation. */
+# if defined _WIN32 && ! defined __CYGWIN__
+ { '%', '+', '.', '3', 'd', '\0' };
+# else
+ { '%', '+', '.', '2', 'd', '\0' };
+# endif
+ SNPRINTF (p, 6 + 1, decimal_format, exponent);
+ }
+ while (*p != '\0')
+ p++;
+# else
+ {
+ static const char decimal_format[] =
+ /* Produce the same number of exponent digits
+ as the native printf implementation. */
+# if defined _WIN32 && ! defined __CYGWIN__
+ "%+.3d";
+# else
+ "%+.2d";
+# endif
+ if (sizeof (DCHAR_T) == 1)
+ {
+ sprintf ((char *) p, decimal_format, exponent);
+ while (*p != '\0')
+ p++;
+ }
+ else
+ {
+ char expbuf[6 + 1];
+ const char *ep;
+ sprintf (expbuf, decimal_format, exponent);
+ for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+ p++;
+ }
+ }
+# endif
+ }
+
+ free (digits);
+ }
+ }
+ else
+ abort ();
+# else
+ /* arg is finite. */
+ if (!(arg == 0.0))
+ abort ();
+
+ pad_ptr = p;
+
+ if (dp->conversion == 'f' || dp->conversion == 'F')
+ {
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ }
+ else if (dp->conversion == 'e' || dp->conversion == 'E')
+ {
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ *p++ = dp->conversion; /* 'e' or 'E' */
+ *p++ = '+';
+ /* Produce the same number of exponent digits as
+ the native printf implementation. */
+# if defined _WIN32 && ! defined __CYGWIN__
+ *p++ = '0';
+# endif
+ *p++ = '0';
+ *p++ = '0';
+ }
+ else if (dp->conversion == 'g' || dp->conversion == 'G')
+ {
+ *p++ = '0';
+ if (flags & FLAG_ALT)
+ {
+ size_t ndigits =
+ (precision > 0 ? precision - 1 : 0);
+ *p++ = decimal_point_char ();
+ for (; ndigits > 0; --ndigits)
+ *p++ = '0';
+ }
+ }
+ else
+ abort ();
+# endif
+ }
+ }
+ }
+# endif
+
+ /* The generated string now extends from tmp to p, with the
+ zero padding insertion point being at pad_ptr. */
+ count = p - tmp;
+
+ if (count < width)
+ {
+ size_t pad = width - count;
+ DCHAR_T *end = p + pad;
+
+ if (flags & FLAG_LEFT)
+ {
+ /* Pad with spaces on the right. */
+ for (; pad > 0; pad--)
+ *p++ = ' ';
+ }
+ else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
+ {
+ /* Pad with zeroes. */
+ DCHAR_T *q = end;
+
+ while (p > pad_ptr)
+ *--q = *--p;
+ for (; pad > 0; pad--)
+ *p++ = '0';
+ }
+ else
+ {
+ /* Pad with spaces on the left. */
+ DCHAR_T *q = end;
+
+ while (p > tmp)
+ *--q = *--p;
+ for (; pad > 0; pad--)
+ *p++ = ' ';
+ }
+
+ p = end;
+ }
+
+ count = p - tmp;
+
+ if (count >= tmp_length)
+ /* tmp_length was incorrectly calculated - fix the
+ code above! */
+ abort ();
+
+ /* Make room for the result. */
+ if (count >= allocated - length)
+ {
+ size_t n = xsum (length, count);
+
+ ENSURE_ALLOCATION (n);
+ }
+
+ /* Append the result. */
+ memcpy (result + length, tmp, count * sizeof (DCHAR_T));
+ if (tmp != tmpbuf)
+ free (tmp);
+ length += count;
+ }
+#endif
+ else
+ {
+ arg_type type = a.arg[dp->arg_index].type;
+ int flags = dp->flags;
+#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+ int has_width;
+#endif
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+ size_t width;
+#endif
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION
+ int has_precision;
+ size_t precision;
+#endif
+#if NEED_PRINTF_UNBOUNDED_PRECISION
+ int prec_ourselves;
+#else
+# define prec_ourselves 0
+#endif
+#if NEED_PRINTF_FLAG_LEFTADJUST
+# define pad_ourselves 1
+#elif !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+ int pad_ourselves;
+#else
+# define pad_ourselves 0
+#endif
+ TCHAR_T *fbp;
+ unsigned int prefix_count;
+ int prefixes[2] IF_LINT (= { 0 });
+ int orig_errno;
+#if !USE_SNPRINTF
+ size_t tmp_length;
+ TCHAR_T tmpbuf[700];
+ TCHAR_T *tmp;
+#endif
+
+#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+ has_width = 0;
+#endif
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ width = arg;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-' flag
+ followed by a positive field width." */
+ flags |= FLAG_LEFT;
+ width = -width;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ do
+ width = xsum (xtimes (width, 10), *digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+ has_width = 1;
+#endif
+ }
+#endif
+
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION
+ has_precision = 0;
+ precision = 6;
+ if (dp->precision_start != dp->precision_end)
+ {
+ if (dp->precision_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->precision_arg_index].a.a_int;
+ /* "A negative precision is taken as if the precision
+ were omitted." */
+ if (arg >= 0)
+ {
+ precision = arg;
+ has_precision = 1;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->precision_start + 1;
+
+ precision = 0;
+ while (digitp != dp->precision_end)
+ precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+ has_precision = 1;
+ }
+ }
+#endif
+
+ /* Decide whether to handle the precision ourselves. */
+#if NEED_PRINTF_UNBOUNDED_PRECISION
+ switch (dp->conversion)
+ {
+ case 'd': case 'i': case 'u':
+ case 'o':
+ case 'x': case 'X': case 'p':
+ prec_ourselves = has_precision && (precision > 0);
+ break;
+ default:
+ prec_ourselves = 0;
+ break;
+ }
+#endif
+
+ /* Decide whether to perform the padding ourselves. */
+#if !NEED_PRINTF_FLAG_LEFTADJUST && (!DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION)
+ switch (dp->conversion)
+ {
+# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
+ /* If we need conversion from TCHAR_T[] to DCHAR_T[], we need
+ to perform the padding after this conversion. Functions
+ with unistdio extensions perform the padding based on
+ character count rather than element count. */
+ case 'c': case 's':
+# endif
+# if NEED_PRINTF_FLAG_ZERO
+ case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
+ case 'a': case 'A':
+# endif
+ pad_ourselves = 1;
+ break;
+ default:
+ pad_ourselves = prec_ourselves;
+ break;
+ }
+#endif
+
+#if !USE_SNPRINTF
+ /* Allocate a temporary buffer of sufficient size for calling
+ sprintf. */
+ tmp_length =
+ MAX_ROOM_NEEDED (&a, dp->arg_index, dp->conversion, type,
+ flags, width, has_precision, precision,
+ pad_ourselves);
+
+ if (tmp_length <= sizeof (tmpbuf) / sizeof (TCHAR_T))
+ tmp = tmpbuf;
+ else
+ {
+ size_t tmp_memsize = xtimes (tmp_length, sizeof (TCHAR_T));
+
+ if (size_overflow_p (tmp_memsize))
+ /* Overflow, would lead to out of memory. */
+ goto out_of_memory;
+ tmp = (TCHAR_T *) malloc (tmp_memsize);
+ if (tmp == NULL)
+ /* Out of memory. */
+ goto out_of_memory;
+ }
+#endif
+
+ /* Construct the format string for calling snprintf or
+ sprintf. */
+ fbp = buf;
+ *fbp++ = '%';
+#if NEED_PRINTF_FLAG_GROUPING
+ /* The underlying implementation doesn't support the ' flag.
+ Produce no grouping characters in this case; this is
+ acceptable because the grouping is locale dependent. */
+#else
+ if (flags & FLAG_GROUP)
+ *fbp++ = '\'';
+#endif
+ if (flags & FLAG_LEFT)
+ *fbp++ = '-';
+ if (flags & FLAG_SHOWSIGN)
+ *fbp++ = '+';
+ if (flags & FLAG_SPACE)
+ *fbp++ = ' ';
+ if (flags & FLAG_ALT)
+ *fbp++ = '#';
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
+ if (flags & FLAG_LOCALIZED)
+ *fbp++ = 'I';
+#endif
+ if (!pad_ourselves)
+ {
+ if (flags & FLAG_ZERO)
+ *fbp++ = '0';
+ if (dp->width_start != dp->width_end)
+ {
+ size_t n = dp->width_end - dp->width_start;
+ /* The width specification is known to consist only
+ of standard ASCII characters. */
+ if (sizeof (FCHAR_T) == sizeof (TCHAR_T))
+ {
+ memcpy (fbp, dp->width_start, n * sizeof (TCHAR_T));
+ fbp += n;
+ }
+ else
+ {
+ const FCHAR_T *mp = dp->width_start;
+ do
+ *fbp++ = *mp++;
+ while (--n > 0);
+ }
+ }
+ }
+ if (!prec_ourselves)
+ {
+ if (dp->precision_start != dp->precision_end)
+ {
+ size_t n = dp->precision_end - dp->precision_start;
+ /* The precision specification is known to consist only
+ of standard ASCII characters. */
+ if (sizeof (FCHAR_T) == sizeof (TCHAR_T))
+ {
+ memcpy (fbp, dp->precision_start, n * sizeof (TCHAR_T));
+ fbp += n;
+ }
+ else
+ {
+ const FCHAR_T *mp = dp->precision_start;
+ do
+ *fbp++ = *mp++;
+ while (--n > 0);
+ }
+ }
+ }
+
+ switch (type)
+ {
+ case TYPE_LONGLONGINT:
+ case TYPE_ULONGLONGINT:
+#if defined _WIN32 && ! defined __CYGWIN__
+ *fbp++ = 'I';
+ *fbp++ = '6';
+ *fbp++ = '4';
+ break;
+#else
+ *fbp++ = 'l';
+#endif
+ FALLTHROUGH;
+ case TYPE_LONGINT:
+ case TYPE_ULONGINT:
+#if HAVE_WINT_T
+ case TYPE_WIDE_CHAR:
+#endif
+#if HAVE_WCHAR_T
+ case TYPE_WIDE_STRING:
+#endif
+ *fbp++ = 'l';
+ break;
+ case TYPE_LONGDOUBLE:
+ *fbp++ = 'L';
+ break;
+ default:
+ break;
+ }
+#if NEED_PRINTF_DIRECTIVE_F
+ if (dp->conversion == 'F')
+ *fbp = 'f';
+ else
+#endif
+ *fbp = dp->conversion;
+#if USE_SNPRINTF
+# if ((HAVE_SNPRINTF_RETVAL_C99 && HAVE_SNPRINTF_TRUNCATION_C99) \
+ || ((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) \
+ && !defined __UCLIBC__) \
+ || (defined __APPLE__ && defined __MACH__) \
+ || defined __ANDROID__ \
+ || (defined _WIN32 && ! defined __CYGWIN__))
+ /* On systems where we know that snprintf's return value
+ conforms to ISO C 99 (HAVE_SNPRINTF_RETVAL_C99) and that
+ snprintf always produces NUL-terminated strings
+ (HAVE_SNPRINTF_TRUNCATION_C99), it is possible to avoid
+ using %n. And it is desirable to do so, because more and
+ more platforms no longer support %n, for "security reasons".
+ In particular, the following platforms:
+ - On glibc2 systems from 2004-10-18 or newer, the use of
+ %n in format strings in writable memory may crash the
+ program (if compiled with _FORTIFY_SOURCE=2).
+ - On Mac OS X 10.13 or newer, the use of %n in format
+ strings in writable memory by default crashes the
+ program.
+ - On Android, starting on 2018-03-07, the use of %n in
+ format strings produces a fatal error (see
+ <https://android.googlesource.com/platform/bionic/+/41398d03b7e8e0dfb951660ae713e682e9fc0336>).
+ On these platforms, HAVE_SNPRINTF_RETVAL_C99 and
+ HAVE_SNPRINTF_TRUNCATION_C99 are 1. We have listed them
+ explicitly in the condition above, in case of cross-
+ compilation (just to be sure). */
+ /* On native Windows systems (such as mingw), we can avoid using
+ %n because:
+ - Although the gl_SNPRINTF_TRUNCATION_C99 test fails,
+ snprintf does not write more than the specified number
+ of bytes. (snprintf (buf, 3, "%d %d", 4567, 89) writes
+ '4', '5', '6' into buf, not '4', '5', '\0'.)
+ - Although the gl_SNPRINTF_RETVAL_C99 test fails, snprintf
+ allows us to recognize the case of an insufficient
+ buffer size: it returns -1 in this case.
+ On native Windows systems (such as mingw) where the OS is
+ Windows Vista, the use of %n in format strings by default
+ crashes the program. See
+ <https://gcc.gnu.org/ml/gcc/2007-06/msg00122.html> and
+ <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/set-printf-count-output>
+ So we should avoid %n in this situation. */
+ fbp[1] = '\0';
+# else /* AIX <= 5.1, HP-UX, IRIX, OSF/1, Solaris <= 9, BeOS */
+ fbp[1] = '%';
+ fbp[2] = 'n';
+ fbp[3] = '\0';
+# endif
+#else
+ fbp[1] = '\0';
+#endif
+
+ /* Construct the arguments for calling snprintf or sprintf. */
+ prefix_count = 0;
+ if (!pad_ourselves && dp->width_arg_index != ARG_NONE)
+ {
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int;
+ }
+ if (!prec_ourselves && dp->precision_arg_index != ARG_NONE)
+ {
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int;
+ }
+
+#if USE_SNPRINTF
+ /* The SNPRINTF result is appended after result[0..length].
+ The latter is an array of DCHAR_T; SNPRINTF appends an
+ array of TCHAR_T to it. This is possible because
+ sizeof (TCHAR_T) divides sizeof (DCHAR_T) and
+ alignof (TCHAR_T) <= alignof (DCHAR_T). */
+# define TCHARS_PER_DCHAR (sizeof (DCHAR_T) / sizeof (TCHAR_T))
+ /* Ensure that maxlen below will be >= 2. Needed on BeOS,
+ where an snprintf() with maxlen==1 acts like sprintf(). */
+ ENSURE_ALLOCATION (xsum (length,
+ (2 + TCHARS_PER_DCHAR - 1)
+ / TCHARS_PER_DCHAR));
+ /* Prepare checking whether snprintf returns the count
+ via %n. */
+ *(TCHAR_T *) (result + length) = '\0';
+#endif
+
+ orig_errno = errno;
+
+ for (;;)
+ {
+ int count = -1;
+
+#if USE_SNPRINTF
+ int retcount = 0;
+ size_t maxlen = allocated - length;
+ /* SNPRINTF can fail if its second argument is
+ > INT_MAX. */
+ if (maxlen > INT_MAX / TCHARS_PER_DCHAR)
+ maxlen = INT_MAX / TCHARS_PER_DCHAR;
+ maxlen = maxlen * TCHARS_PER_DCHAR;
+# define SNPRINTF_BUF(arg) \
+ switch (prefix_count) \
+ { \
+ case 0: \
+ retcount = SNPRINTF ((TCHAR_T *) (result + length), \
+ maxlen, buf, \
+ arg, &count); \
+ break; \
+ case 1: \
+ retcount = SNPRINTF ((TCHAR_T *) (result + length), \
+ maxlen, buf, \
+ prefixes[0], arg, &count); \
+ break; \
+ case 2: \
+ retcount = SNPRINTF ((TCHAR_T *) (result + length), \
+ maxlen, buf, \
+ prefixes[0], prefixes[1], arg, \
+ &count); \
+ break; \
+ default: \
+ abort (); \
+ }
+#else
+# define SNPRINTF_BUF(arg) \
+ switch (prefix_count) \
+ { \
+ case 0: \
+ count = sprintf (tmp, buf, arg); \
+ break; \
+ case 1: \
+ count = sprintf (tmp, buf, prefixes[0], arg); \
+ break; \
+ case 2: \
+ count = sprintf (tmp, buf, prefixes[0], prefixes[1],\
+ arg); \
+ break; \
+ default: \
+ abort (); \
+ }
+#endif
+
+ errno = 0;
+ switch (type)
+ {
+ case TYPE_SCHAR:
+ {
+ int arg = a.arg[dp->arg_index].a.a_schar;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_UCHAR:
+ {
+ unsigned int arg = a.arg[dp->arg_index].a.a_uchar;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_SHORT:
+ {
+ int arg = a.arg[dp->arg_index].a.a_short;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_USHORT:
+ {
+ unsigned int arg = a.arg[dp->arg_index].a.a_ushort;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_INT:
+ {
+ int arg = a.arg[dp->arg_index].a.a_int;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_UINT:
+ {
+ unsigned int arg = a.arg[dp->arg_index].a.a_uint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_LONGINT:
+ {
+ long int arg = a.arg[dp->arg_index].a.a_longint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_ULONGINT:
+ {
+ unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_LONGLONGINT:
+ {
+ long long int arg = a.arg[dp->arg_index].a.a_longlongint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_ULONGLONGINT:
+ {
+ unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_DOUBLE:
+ {
+ double arg = a.arg[dp->arg_index].a.a_double;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_LONGDOUBLE:
+ {
+ long double arg = a.arg[dp->arg_index].a.a_longdouble;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_CHAR:
+ {
+ int arg = a.arg[dp->arg_index].a.a_char;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#if HAVE_WINT_T
+ case TYPE_WIDE_CHAR:
+ {
+ wint_t arg = a.arg[dp->arg_index].a.a_wide_char;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#endif
+ case TYPE_STRING:
+ {
+ const char *arg = a.arg[dp->arg_index].a.a_string;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#if HAVE_WCHAR_T
+ case TYPE_WIDE_STRING:
+ {
+ const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#endif
+ case TYPE_POINTER:
+ {
+ void *arg = a.arg[dp->arg_index].a.a_pointer;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ default:
+ abort ();
+ }
+
+#if USE_SNPRINTF
+ /* Portability: Not all implementations of snprintf()
+ are ISO C 99 compliant. Determine the number of
+ bytes that snprintf() has produced or would have
+ produced. */
+ if (count >= 0)
+ {
+ /* Verify that snprintf() has NUL-terminated its
+ result. */
+ if ((unsigned int) count < maxlen
+ && ((TCHAR_T *) (result + length)) [count] != '\0')
+ abort ();
+ /* Portability hack. */
+ if (retcount > count)
+ count = retcount;
+ }
+ else
+ {
+ /* snprintf() doesn't understand the '%n'
+ directive. */
+ if (fbp[1] != '\0')
+ {
+ /* Don't use the '%n' directive; instead, look
+ at the snprintf() return value. */
+ fbp[1] = '\0';
+ continue;
+ }
+ else
+ {
+ /* Look at the snprintf() return value. */
+ if (retcount < 0)
+ {
+# if !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF
+ /* HP-UX 10.20 snprintf() is doubly deficient:
+ It doesn't understand the '%n' directive,
+ *and* it returns -1 (rather than the length
+ that would have been required) when the
+ buffer is too small.
+ But a failure at this point can also come
+ from other reasons than a too small buffer,
+ such as an invalid wide string argument to
+ the %ls directive, or possibly an invalid
+ floating-point argument. */
+ size_t tmp_length =
+ MAX_ROOM_NEEDED (&a, dp->arg_index,
+ dp->conversion, type, flags,
+ width,
+ has_precision,
+ precision, pad_ourselves);
+
+ if (maxlen < tmp_length)
+ {
+ /* Make more room. But try to do through
+ this reallocation only once. */
+ size_t bigger_need =
+ xsum (length,
+ xsum (tmp_length,
+ TCHARS_PER_DCHAR - 1)
+ / TCHARS_PER_DCHAR);
+ /* And always grow proportionally.
+ (There may be several arguments, each
+ needing a little more room than the
+ previous one.) */
+ size_t bigger_need2 =
+ xsum (xtimes (allocated, 2), 12);
+ if (bigger_need < bigger_need2)
+ bigger_need = bigger_need2;
+ ENSURE_ALLOCATION (bigger_need);
+ continue;
+ }
+# endif
+ }
+ else
+ count = retcount;
+ }
+ }
+#endif
+
+ /* Attempt to handle failure. */
+ if (count < 0)
+ {
+ /* SNPRINTF or sprintf failed. Use the errno that it
+ has set, if any. */
+ if (errno == 0)
+ {
+ if (dp->conversion == 'c' || dp->conversion == 's')
+ errno = EILSEQ;
+ else
+ errno = EINVAL;
+ }
+
+ goto fail_with_errno;
+ }
+
+#if USE_SNPRINTF
+ /* Handle overflow of the allocated buffer.
+ If such an overflow occurs, a C99 compliant snprintf()
+ returns a count >= maxlen. However, a non-compliant
+ snprintf() function returns only count = maxlen - 1. To
+ cover both cases, test whether count >= maxlen - 1. */
+ if ((unsigned int) count + 1 >= maxlen)
+ {
+ /* If maxlen already has attained its allowed maximum,
+ allocating more memory will not increase maxlen.
+ Instead of looping, bail out. */
+ if (maxlen == INT_MAX / TCHARS_PER_DCHAR)
+ goto overflow;
+ else
+ {
+ /* Need at least (count + 1) * sizeof (TCHAR_T)
+ bytes. (The +1 is for the trailing NUL.)
+ But ask for (count + 2) * sizeof (TCHAR_T)
+ bytes, so that in the next round, we likely get
+ maxlen > (unsigned int) count + 1
+ and so we don't get here again.
+ And allocate proportionally, to avoid looping
+ eternally if snprintf() reports a too small
+ count. */
+ size_t n =
+ xmax (xsum (length,
+ ((unsigned int) count + 2
+ + TCHARS_PER_DCHAR - 1)
+ / TCHARS_PER_DCHAR),
+ xtimes (allocated, 2));
+
+ ENSURE_ALLOCATION (n);
+ continue;
+ }
+ }
+#endif
+
+#if NEED_PRINTF_UNBOUNDED_PRECISION
+ if (prec_ourselves)
+ {
+ /* Handle the precision. */
+ TCHAR_T *prec_ptr =
+# if USE_SNPRINTF
+ (TCHAR_T *) (result + length);
+# else
+ tmp;
+# endif
+ size_t prefix_count;
+ size_t move;
+
+ prefix_count = 0;
+ /* Put the additional zeroes after the sign. */
+ if (count >= 1
+ && (*prec_ptr == '-' || *prec_ptr == '+'
+ || *prec_ptr == ' '))
+ prefix_count = 1;
+ /* Put the additional zeroes after the 0x prefix if
+ (flags & FLAG_ALT) || (dp->conversion == 'p'). */
+ else if (count >= 2
+ && prec_ptr[0] == '0'
+ && (prec_ptr[1] == 'x' || prec_ptr[1] == 'X'))
+ prefix_count = 2;
+
+ move = count - prefix_count;
+ if (precision > move)
+ {
+ /* Insert zeroes. */
+ size_t insert = precision - move;
+ TCHAR_T *prec_end;
+
+# if USE_SNPRINTF
+ size_t n =
+ xsum (length,
+ (count + insert + TCHARS_PER_DCHAR - 1)
+ / TCHARS_PER_DCHAR);
+ length += (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR;
+ ENSURE_ALLOCATION (n);
+ length -= (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR;
+ prec_ptr = (TCHAR_T *) (result + length);
+# endif
+
+ prec_end = prec_ptr + count;
+ prec_ptr += prefix_count;
+
+ while (prec_end > prec_ptr)
+ {
+ prec_end--;
+ prec_end[insert] = prec_end[0];
+ }
+
+ prec_end += insert;
+ do
+ *--prec_end = '0';
+ while (prec_end > prec_ptr);
+
+ count += insert;
+ }
+ }
+#endif
+
+#if !USE_SNPRINTF
+ if (count >= tmp_length)
+ /* tmp_length was incorrectly calculated - fix the
+ code above! */
+ abort ();
+#endif
+
+#if !DCHAR_IS_TCHAR
+ /* Convert from TCHAR_T[] to DCHAR_T[]. */
+ if (dp->conversion == 'c' || dp->conversion == 's')
+ {
+ /* type = TYPE_CHAR or TYPE_WIDE_CHAR or TYPE_STRING
+ TYPE_WIDE_STRING.
+ The result string is not certainly ASCII. */
+ const TCHAR_T *tmpsrc;
+ DCHAR_T *tmpdst;
+ size_t tmpdst_len;
+ /* This code assumes that TCHAR_T is 'char'. */
+ verify (sizeof (TCHAR_T) == 1);
+# if USE_SNPRINTF
+ tmpsrc = (TCHAR_T *) (result + length);
+# else
+ tmpsrc = tmp;
+# endif
+ tmpdst =
+ DCHAR_CONV_FROM_ENCODING (locale_charset (),
+ iconveh_question_mark,
+ tmpsrc, count,
+ NULL,
+ NULL, &tmpdst_len);
+ if (tmpdst == NULL)
+ goto fail_with_errno;
+ ENSURE_ALLOCATION_ELSE (xsum (length, tmpdst_len),
+ { free (tmpdst); goto out_of_memory; });
+ DCHAR_CPY (result + length, tmpdst, tmpdst_len);
+ free (tmpdst);
+ count = tmpdst_len;
+ }
+ else
+ {
+ /* The result string is ASCII.
+ Simple 1:1 conversion. */
+# if USE_SNPRINTF
+ /* If sizeof (DCHAR_T) == sizeof (TCHAR_T), it's a
+ no-op conversion, in-place on the array starting
+ at (result + length). */
+ if (sizeof (DCHAR_T) != sizeof (TCHAR_T))
+# endif
+ {
+ const TCHAR_T *tmpsrc;
+ DCHAR_T *tmpdst;
+ size_t n;
+
+# if USE_SNPRINTF
+ if (result == resultbuf)
+ {
+ tmpsrc = (TCHAR_T *) (result + length);
+ /* ENSURE_ALLOCATION will not move tmpsrc
+ (because it's part of resultbuf). */
+ ENSURE_ALLOCATION (xsum (length, count));
+ }
+ else
+ {
+ /* ENSURE_ALLOCATION will move the array
+ (because it uses realloc(). */
+ ENSURE_ALLOCATION (xsum (length, count));
+ tmpsrc = (TCHAR_T *) (result + length);
+ }
+# else
+ tmpsrc = tmp;
+ ENSURE_ALLOCATION (xsum (length, count));
+# endif
+ tmpdst = result + length;
+ /* Copy backwards, because of overlapping. */
+ tmpsrc += count;
+ tmpdst += count;
+ for (n = count; n > 0; n--)
+ *--tmpdst = *--tmpsrc;
+ }
+ }
+#endif
+
+#if DCHAR_IS_TCHAR && !USE_SNPRINTF
+ /* Make room for the result. */
+ if (count > allocated - length)
+ {
+ /* Need at least count elements. But allocate
+ proportionally. */
+ size_t n =
+ xmax (xsum (length, count), xtimes (allocated, 2));
+
+ ENSURE_ALLOCATION (n);
+ }
+#endif
+
+ /* Here count <= allocated - length. */
+
+ /* Perform padding. */
+#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+ if (pad_ourselves && has_width)
+ {
+ size_t w;
+# if ENABLE_UNISTDIO
+ /* Outside POSIX, it's preferable to compare the width
+ against the number of _characters_ of the converted
+ value. */
+ w = DCHAR_MBSNLEN (result + length, count);
+# else
+ /* The width is compared against the number of _bytes_
+ of the converted value, says POSIX. */
+ w = count;
+# endif
+ if (w < width)
+ {
+ size_t pad = width - w;
+
+ /* Make room for the result. */
+ if (xsum (count, pad) > allocated - length)
+ {
+ /* Need at least count + pad elements. But
+ allocate proportionally. */
+ size_t n =
+ xmax (xsum3 (length, count, pad),
+ xtimes (allocated, 2));
+
+# if USE_SNPRINTF
+ length += count;
+ ENSURE_ALLOCATION (n);
+ length -= count;
+# else
+ ENSURE_ALLOCATION (n);
+# endif
+ }
+ /* Here count + pad <= allocated - length. */
+
+ {
+# if !DCHAR_IS_TCHAR || USE_SNPRINTF
+ DCHAR_T * const rp = result + length;
+# else
+ DCHAR_T * const rp = tmp;
+# endif
+ DCHAR_T *p = rp + count;
+ DCHAR_T *end = p + pad;
+ DCHAR_T *pad_ptr;
+# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
+ if (dp->conversion == 'c'
+ || dp->conversion == 's')
+ /* No zero-padding for string directives. */
+ pad_ptr = NULL;
+ else
+# endif
+ {
+ pad_ptr = (*rp == '-' ? rp + 1 : rp);
+ /* No zero-padding of "inf" and "nan". */
+ if ((*pad_ptr >= 'A' && *pad_ptr <= 'Z')
+ || (*pad_ptr >= 'a' && *pad_ptr <= 'z'))
+ pad_ptr = NULL;
+ }
+ /* The generated string now extends from rp to p,
+ with the zero padding insertion point being at
+ pad_ptr. */
+
+ count = count + pad; /* = end - rp */
+
+ if (flags & FLAG_LEFT)
+ {
+ /* Pad with spaces on the right. */
+ for (; pad > 0; pad--)
+ *p++ = ' ';
+ }
+ else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
+ {
+ /* Pad with zeroes. */
+ DCHAR_T *q = end;
+
+ while (p > pad_ptr)
+ *--q = *--p;
+ for (; pad > 0; pad--)
+ *p++ = '0';
+ }
+ else
+ {
+ /* Pad with spaces on the left. */
+ DCHAR_T *q = end;
+
+ while (p > rp)
+ *--q = *--p;
+ for (; pad > 0; pad--)
+ *p++ = ' ';
+ }
+ }
+ }
+ }
+#endif
+
+ /* Here still count <= allocated - length. */
+
+#if !DCHAR_IS_TCHAR || USE_SNPRINTF
+ /* The snprintf() result did fit. */
+#else
+ /* Append the sprintf() result. */
+ memcpy (result + length, tmp, count * sizeof (DCHAR_T));
+#endif
+#if !USE_SNPRINTF
+ if (tmp != tmpbuf)
+ free (tmp);
+#endif
+
+#if NEED_PRINTF_DIRECTIVE_F
+ if (dp->conversion == 'F')
+ {
+ /* Convert the %f result to upper case for %F. */
+ DCHAR_T *rp = result + length;
+ size_t rc;
+ for (rc = count; rc > 0; rc--, rp++)
+ if (*rp >= 'a' && *rp <= 'z')
+ *rp = *rp - 'a' + 'A';
+ }
+#endif
+
+ length += count;
+ break;
+ }
+ errno = orig_errno;
+#undef pad_ourselves
+#undef prec_ourselves
+ }
+ }
+ }
+
+ /* Add the final NUL. */
+ ENSURE_ALLOCATION (xsum (length, 1));
+ result[length] = '\0';
+
+ if (result != resultbuf && length + 1 < allocated)
+ {
+ /* Shrink the allocated memory if possible. */
+ DCHAR_T *memory;
+
+ memory = (DCHAR_T *) realloc (result, (length + 1) * sizeof (DCHAR_T));
+ if (memory != NULL)
+ result = memory;
+ }
+
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ *lengthp = length;
+ /* Note that we can produce a big string of a length > INT_MAX. POSIX
+ says that snprintf() fails with errno = EOVERFLOW in this case, but
+ that's only because snprintf() returns an 'int'. This function does
+ not have this limitation. */
+ return result;
+
+#if USE_SNPRINTF
+ overflow:
+ errno = EOVERFLOW;
+ goto fail_with_errno;
+#endif
+
+ out_of_memory:
+ errno = ENOMEM;
+ goto fail_with_errno;
+
+#if ENABLE_UNISTDIO || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL) || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T)
+ fail_with_EILSEQ:
+ errno = EILSEQ;
+ goto fail_with_errno;
+#endif
+
+ fail_with_errno:
+ if (result != resultbuf)
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ return NULL;
+ }
+
+ out_of_memory_1:
+ errno = ENOMEM;
+ goto fail_1_with_errno;
+
+ fail_1_with_EINVAL:
+ errno = EINVAL;
+ goto fail_1_with_errno;
+
+ fail_1_with_errno:
+ CLEANUP ();
+ return NULL;
+}
+
+#undef MAX_ROOM_NEEDED
+#undef TCHARS_PER_DCHAR
+#undef SNPRINTF
+#undef USE_SNPRINTF
+#undef DCHAR_SET
+#undef DCHAR_CPY
+#undef PRINTF_PARSE
+#undef DIRECTIVES
+#undef DIRECTIVE
+#undef DCHAR_IS_TCHAR
+#undef TCHAR_T
+#undef DCHAR_T
+#undef FCHAR_T
+#undef VASNPRINTF
diff --git a/gl/lib/vasnprintf.h b/gl/lib/vasnprintf.h
new file mode 100644
index 0000000..27cf54c
--- /dev/null
+++ b/gl/lib/vasnprintf.h
@@ -0,0 +1,72 @@
+/* vsprintf with automatic memory allocation.
+ Copyright (C) 2002-2004, 2007-2022 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 2.1 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/>. */
+
+#ifndef _VASNPRINTF_H
+#define _VASNPRINTF_H
+
+/* Get va_list. */
+#include <stdarg.h>
+
+/* Get size_t. */
+#include <stddef.h>
+
+/* Get _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD. */
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Write formatted output to a string dynamically allocated with malloc().
+ You can pass a preallocated buffer for the result in RESULTBUF and its
+ size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
+ If successful, return the address of the string (this may be = RESULTBUF
+ if no dynamic memory allocation was necessary) and set *LENGTHP to the
+ number of resulting bytes, excluding the trailing NUL. Upon error, set
+ errno and return NULL.
+
+ When dynamic memory allocation occurs, the preallocated buffer is left
+ alone (with possibly modified contents). This makes it possible to use
+ a statically allocated or stack-allocated buffer, like this:
+
+ char buf[100];
+ size_t len = sizeof (buf);
+ char *output = vasnprintf (buf, &len, format, args);
+ if (output == NULL)
+ ... error handling ...;
+ else
+ {
+ ... use the output string ...;
+ if (output != buf)
+ free (output);
+ }
+ */
+#if REPLACE_VASNPRINTF
+# define asnprintf rpl_asnprintf
+# define vasnprintf rpl_vasnprintf
+#endif
+extern char * asnprintf (char *restrict resultbuf, size_t *lengthp,
+ const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 4));
+extern char * vasnprintf (char *restrict resultbuf, size_t *lengthp,
+ const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 0));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _VASNPRINTF_H */
diff --git a/gl/lib/vasprintf.c b/gl/lib/vasprintf.c
new file mode 100644
index 0000000..218275f
--- /dev/null
+++ b/gl/lib/vasprintf.c
@@ -0,0 +1,50 @@
+/* Formatted output to strings.
+ Copyright (C) 1999, 2002, 2006-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#ifdef IN_LIBASPRINTF
+# include "vasprintf.h"
+#else
+# include <stdio.h>
+#endif
+
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+
+#include "vasnprintf.h"
+
+int
+vasprintf (char **resultp, const char *format, va_list args)
+{
+ size_t length;
+ char *result = vasnprintf (NULL, &length, format, args);
+ if (result == NULL)
+ return -1;
+
+ if (length > INT_MAX)
+ {
+ free (result);
+ errno = EOVERFLOW;
+ return -1;
+ }
+
+ *resultp = result;
+ /* Return the number of resulting bytes, excluding the trailing NUL. */
+ return length;
+}
diff --git a/gl/lib/verify.h b/gl/lib/verify.h
new file mode 100644
index 0000000..c5c63ae
--- /dev/null
+++ b/gl/lib/verify.h
@@ -0,0 +1,318 @@
+/* Compile-time assert-like macros.
+
+ Copyright (C) 2005-2006, 2009-2022 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 2.1 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 Paul Eggert, Bruno Haible, and Jim Meyering. */
+
+#ifndef _GL_VERIFY_H
+#define _GL_VERIFY_H
+
+
+/* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert (R, DIAGNOSTIC)
+ works as per C11. This is supported by GCC 4.6.0+ and by clang 4+.
+
+ Define _GL_HAVE__STATIC_ASSERT1 to 1 if _Static_assert (R) works as
+ per C2x. This is supported by GCC 9.1+.
+
+ Support compilers claiming conformance to the relevant standard,
+ and also support GCC when not pedantic. If we were willing to slow
+ 'configure' down we could also use it with other compilers, but
+ since this affects only the quality of diagnostics, why bother? */
+#ifndef __cplusplus
+# if (201112L <= __STDC_VERSION__ \
+ || (!defined __STRICT_ANSI__ \
+ && (4 < __GNUC__ + (6 <= __GNUC_MINOR__) || 5 <= __clang_major__)))
+# define _GL_HAVE__STATIC_ASSERT 1
+# endif
+# if (202000L <= __STDC_VERSION__ \
+ || (!defined __STRICT_ANSI__ && 9 <= __GNUC__))
+# define _GL_HAVE__STATIC_ASSERT1 1
+# endif
+#endif
+
+/* FreeBSD 9.1 <sys/cdefs.h>, included by <stddef.h> and lots of other
+ system headers, defines a conflicting _Static_assert that is no
+ better than ours; override it. */
+#ifndef _GL_HAVE__STATIC_ASSERT
+# include <stddef.h>
+# undef _Static_assert
+#endif
+
+/* Each of these macros verifies that its argument R is nonzero. To
+ be portable, R should be an integer constant expression. Unlike
+ assert (R), there is no run-time overhead.
+
+ If _Static_assert works, verify (R) uses it directly. Similarly,
+ _GL_VERIFY_TRUE works by packaging a _Static_assert inside a struct
+ that is an operand of sizeof.
+
+ The code below uses several ideas for C++ compilers, and for C
+ compilers that do not support _Static_assert:
+
+ * The first step is ((R) ? 1 : -1). Given an expression R, of
+ integral or boolean or floating-point type, this yields an
+ expression of integral type, whose value is later verified to be
+ constant and nonnegative.
+
+ * Next this expression W is wrapped in a type
+ struct _gl_verify_type {
+ unsigned int _gl_verify_error_if_negative: W;
+ }.
+ If W is negative, this yields a compile-time error. No compiler can
+ deal with a bit-field of negative size.
+
+ One might think that an array size check would have the same
+ effect, that is, that the type struct { unsigned int dummy[W]; }
+ would work as well. However, inside a function, some compilers
+ (such as C++ compilers and GNU C) allow local parameters and
+ variables inside array size expressions. With these compilers,
+ an array size check would not properly diagnose this misuse of
+ the verify macro:
+
+ void function (int n) { verify (n < 0); }
+
+ * For the verify macro, the struct _gl_verify_type will need to
+ somehow be embedded into a declaration. To be portable, this
+ declaration must declare an object, a constant, a function, or a
+ typedef name. If the declared entity uses the type directly,
+ such as in
+
+ struct dummy {...};
+ typedef struct {...} dummy;
+ extern struct {...} *dummy;
+ extern void dummy (struct {...} *);
+ extern struct {...} *dummy (void);
+
+ two uses of the verify macro would yield colliding declarations
+ if the entity names are not disambiguated. A workaround is to
+ attach the current line number to the entity name:
+
+ #define _GL_CONCAT0(x, y) x##y
+ #define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
+ extern struct {...} * _GL_CONCAT (dummy, __LINE__);
+
+ But this has the problem that two invocations of verify from
+ within the same macro would collide, since the __LINE__ value
+ would be the same for both invocations. (The GCC __COUNTER__
+ macro solves this problem, but is not portable.)
+
+ A solution is to use the sizeof operator. It yields a number,
+ getting rid of the identity of the type. Declarations like
+
+ extern int dummy [sizeof (struct {...})];
+ extern void dummy (int [sizeof (struct {...})]);
+ extern int (*dummy (void)) [sizeof (struct {...})];
+
+ can be repeated.
+
+ * Should the implementation use a named struct or an unnamed struct?
+ Which of the following alternatives can be used?
+
+ extern int dummy [sizeof (struct {...})];
+ extern int dummy [sizeof (struct _gl_verify_type {...})];
+ extern void dummy (int [sizeof (struct {...})]);
+ extern void dummy (int [sizeof (struct _gl_verify_type {...})]);
+ extern int (*dummy (void)) [sizeof (struct {...})];
+ extern int (*dummy (void)) [sizeof (struct _gl_verify_type {...})];
+
+ In the second and sixth case, the struct type is exported to the
+ outer scope; two such declarations therefore collide. GCC warns
+ about the first, third, and fourth cases. So the only remaining
+ possibility is the fifth case:
+
+ extern int (*dummy (void)) [sizeof (struct {...})];
+
+ * GCC warns about duplicate declarations of the dummy function if
+ -Wredundant-decls is used. GCC 4.3 and later have a builtin
+ __COUNTER__ macro that can let us generate unique identifiers for
+ each dummy function, to suppress this warning.
+
+ * This implementation exploits the fact that older versions of GCC,
+ which do not support _Static_assert, also do not warn about the
+ last declaration mentioned above.
+
+ * GCC warns if -Wnested-externs is enabled and 'verify' is used
+ within a function body; but inside a function, you can always
+ arrange to use verify_expr instead.
+
+ * In C++, any struct definition inside sizeof is invalid.
+ Use a template type to work around the problem. */
+
+/* Concatenate two preprocessor tokens. */
+#define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
+#define _GL_CONCAT0(x, y) x##y
+
+/* _GL_COUNTER is an integer, preferably one that changes each time we
+ use it. Use __COUNTER__ if it works, falling back on __LINE__
+ otherwise. __LINE__ isn't perfect, but it's better than a
+ constant. */
+#if defined __COUNTER__ && __COUNTER__ != __COUNTER__
+# define _GL_COUNTER __COUNTER__
+#else
+# define _GL_COUNTER __LINE__
+#endif
+
+/* Generate a symbol with the given prefix, making it unique if
+ possible. */
+#define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER)
+
+/* Verify requirement R at compile-time, as an integer constant expression
+ that returns 1. If R is false, fail at compile-time, preferably
+ with a diagnostic that includes the string-literal DIAGNOSTIC. */
+
+#define _GL_VERIFY_TRUE(R, DIAGNOSTIC) \
+ (!!sizeof (_GL_VERIFY_TYPE (R, DIAGNOSTIC)))
+
+#ifdef __cplusplus
+# if !GNULIB_defined_struct__gl_verify_type
+template <int w>
+ struct _gl_verify_type {
+ unsigned int _gl_verify_error_if_negative: w;
+ };
+# define GNULIB_defined_struct__gl_verify_type 1
+# endif
+# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
+ _gl_verify_type<(R) ? 1 : -1>
+#elif defined _GL_HAVE__STATIC_ASSERT
+# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
+ struct { \
+ _Static_assert (R, DIAGNOSTIC); \
+ int _gl_dummy; \
+ }
+#else
+# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
+ struct { unsigned int _gl_verify_error_if_negative: (R) ? 1 : -1; }
+#endif
+
+/* Verify requirement R at compile-time, as a declaration without a
+ trailing ';'. If R is false, fail at compile-time.
+
+ This macro requires three or more arguments but uses at most the first
+ two, so that the _Static_assert macro optionally defined below supports
+ both the C11 two-argument syntax and the C2x one-argument syntax.
+
+ Unfortunately, unlike C11, this implementation must appear as an
+ ordinary declaration, and cannot appear inside struct { ... }. */
+
+#if 200410 <= __cpp_static_assert
+# define _GL_VERIFY(R, DIAGNOSTIC, ...) static_assert (R, DIAGNOSTIC)
+#elif defined _GL_HAVE__STATIC_ASSERT
+# define _GL_VERIFY(R, DIAGNOSTIC, ...) _Static_assert (R, DIAGNOSTIC)
+#else
+# define _GL_VERIFY(R, DIAGNOSTIC, ...) \
+ extern int (*_GL_GENSYM (_gl_verify_function) (void)) \
+ [_GL_VERIFY_TRUE (R, DIAGNOSTIC)]
+# if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
+# pragma GCC diagnostic ignored "-Wnested-externs"
+# endif
+#endif
+
+/* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */
+#ifdef _GL_STATIC_ASSERT_H
+# if !defined _GL_HAVE__STATIC_ASSERT1 && !defined _Static_assert
+# define _Static_assert(...) \
+ _GL_VERIFY (__VA_ARGS__, "static assertion failed", -)
+# endif
+# if __cpp_static_assert < 201411 && !defined static_assert
+# define static_assert _Static_assert /* C11 requires this #define. */
+# endif
+#endif
+
+/* @assert.h omit start@ */
+
+#if 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__))
+# define _GL_HAS_BUILTIN_TRAP 1
+#elif defined __has_builtin
+# define _GL_HAS_BUILTIN_TRAP __has_builtin (__builtin_trap)
+#else
+# define _GL_HAS_BUILTIN_TRAP 0
+#endif
+
+#if 4 < __GNUC__ + (5 <= __GNUC_MINOR__)
+# define _GL_HAS_BUILTIN_UNREACHABLE 1
+#elif defined __has_builtin
+# define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachable)
+#else
+# define _GL_HAS_BUILTIN_UNREACHABLE 0
+#endif
+
+/* Each of these macros verifies that its argument R is nonzero. To
+ be portable, R should be an integer constant expression. Unlike
+ assert (R), there is no run-time overhead.
+
+ There are two macros, since no single macro can be used in all
+ contexts in C. verify_expr (R, E) is for scalar contexts, including
+ integer constant expression contexts. verify (R) is for declaration
+ contexts, e.g., the top level. */
+
+/* Verify requirement R at compile-time. Return the value of the
+ expression E. */
+
+#define verify_expr(R, E) \
+ (_GL_VERIFY_TRUE (R, "verify_expr (" #R ", " #E ")") ? (E) : (E))
+
+/* Verify requirement R at compile-time, as a declaration without a
+ trailing ';'. verify (R) acts like static_assert (R) except that
+ it is portable to C11/C++14 and earlier, it can issue better
+ diagnostics, and its name is shorter and may be more convenient. */
+
+#ifdef __PGI
+/* PGI barfs if R is long. */
+# define verify(R) _GL_VERIFY (R, "verify (...)", -)
+#else
+# define verify(R) _GL_VERIFY (R, "verify (" #R ")", -)
+#endif
+
+/* Assume that R always holds. Behavior is undefined if R is false,
+ fails to evaluate, or has side effects.
+
+ 'assume (R)' is a directive from the programmer telling the
+ compiler that R is true so the compiler needn't generate code to
+ test R. This is why 'assume' is in verify.h: it's related to
+ static checking (in this case, static checking done by the
+ programmer), not dynamic checking.
+
+ 'assume (R)' can affect compilation of all the code, not just code
+ that happens to be executed after the assume (R) is "executed".
+ For example, if the code mistakenly does 'assert (R); assume (R);'
+ the compiler is entitled to optimize away the 'assert (R)'.
+
+ Although assuming R can help a compiler generate better code or
+ diagnostics, performance can suffer if R uses hard-to-optimize
+ features such as function calls not inlined by the compiler.
+
+ Avoid Clang's __builtin_assume, as it breaks GNU Emacs master
+ as of 2020-08-23T21:09:49Z!eggert@cs.ucla.edu; see
+ <https://bugs.gnu.org/43152#71>. It's not known whether this breakage
+ is a Clang bug or an Emacs bug; play it safe for now. */
+
+#if _GL_HAS_BUILTIN_UNREACHABLE
+# define assume(R) ((R) ? (void) 0 : __builtin_unreachable ())
+#elif 1200 <= _MSC_VER
+# define assume(R) __assume (R)
+#elif (defined GCC_LINT || defined lint) && _GL_HAS_BUILTIN_TRAP
+ /* Doing it this way helps various packages when configured with
+ --enable-gcc-warnings, which compiles with -Dlint. It's nicer
+ when 'assume' silences warnings even with older GCCs. */
+# define assume(R) ((R) ? (void) 0 : __builtin_trap ())
+#else
+ /* Some tools grok NOTREACHED, e.g., Oracle Studio 12.6. */
+# define assume(R) ((R) ? (void) 0 : /*NOTREACHED*/ (void) 0)
+#endif
+
+/* @assert.h omit end@ */
+
+#endif
diff --git a/gl/lib/verror.c b/gl/lib/verror.c
new file mode 100644
index 0000000..3b08b31
--- /dev/null
+++ b/gl/lib/verror.c
@@ -0,0 +1,80 @@
+/* va_list error handler for noninteractive utilities
+ Copyright (C) 2006-2007, 2009-2022 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 Eric Blake. */
+
+#include <config.h>
+
+/* Specification. */
+#include "verror.h"
+
+#include <errno.h>
+#include <stdarg.h>
+#include <stdlib.h>
+
+#include "error.h"
+#include "xvasprintf.h"
+
+#if ENABLE_NLS
+# include "gettext.h"
+# define _(msgid) gettext (msgid)
+#endif
+
+#ifndef _
+# define _(String) String
+#endif
+
+/* Print a message with 'vfprintf (stderr, FORMAT, ARGS)';
+ if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
+ If STATUS is nonzero, terminate the program with 'exit (STATUS)'.
+ Use the globals error_print_progname and error_message_count similarly
+ to error(). */
+void
+verror (int status, int errnum, const char *format, va_list args)
+{
+ verror_at_line (status, errnum, NULL, 0, format, args);
+}
+
+/* Print a message with 'vfprintf (stderr, FORMAT, ARGS)';
+ if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
+ If STATUS is nonzero, terminate the program with 'exit (STATUS)'.
+ If FNAME is not NULL, prepend the message with "FNAME:LINENO:".
+ Use the globals error_print_progname, error_message_count, and
+ error_one_per_line similarly to error_at_line(). */
+void
+verror_at_line (int status, int errnum, const char *file,
+ unsigned int line_number, const char *format, va_list args)
+{
+ char *message = xvasprintf (format, args);
+ if (message)
+ {
+ /* Until https://sourceware.org/bugzilla/show_bug.cgi?id=2997 is fixed,
+ glibc violates GNU Coding Standards when the file argument to
+ error_at_line is NULL. */
+ if (file)
+ error_at_line (status, errnum, file, line_number, "%s", message);
+ else
+ error (status, errnum, "%s", message);
+ }
+ else
+ {
+ /* EOVERFLOW, EINVAL, and EILSEQ from xvasprintf are signs of
+ serious programmer errors. */
+ error (0, errno, _("unable to display error message"));
+ abort ();
+ }
+ free (message);
+}
diff --git a/gl/lib/verror.h b/gl/lib/verror.h
new file mode 100644
index 0000000..e52562c
--- /dev/null
+++ b/gl/lib/verror.h
@@ -0,0 +1,55 @@
+/* Declaration for va_list error-reporting function
+ Copyright (C) 2006-2007, 2009-2022 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 _VERROR_H
+#define _VERROR_H 1
+
+#include <stdarg.h>
+
+/* Get _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD. */
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Print a message with 'vfprintf (stderr, FORMAT, ARGS)';
+ if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
+ If STATUS is nonzero, terminate the program with 'exit (STATUS)'.
+ Use the globals error_print_progname and error_message_count similarly
+ to error(). */
+
+extern void verror (int __status, int __errnum, const char *__format,
+ va_list __args)
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 0));
+
+/* Print a message with 'vfprintf (stderr, FORMAT, ARGS)';
+ if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
+ If STATUS is nonzero, terminate the program with 'exit (STATUS)'.
+ If FNAME is not NULL, prepend the message with "FNAME:LINENO:".
+ Use the globals error_print_progname, error_message_count, and
+ error_one_per_line similarly to error_at_line(). */
+
+extern void verror_at_line (int __status, int __errnum, const char *__fname,
+ unsigned int __lineno, const char *__format,
+ va_list __args)
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 5, 0));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* verror.h */
diff --git a/gl/lib/vsnprintf.c b/gl/lib/vsnprintf.c
new file mode 100644
index 0000000..80999e9
--- /dev/null
+++ b/gl/lib/vsnprintf.c
@@ -0,0 +1,70 @@
+/* Formatted output to strings.
+ Copyright (C) 2004, 2006-2022 Free Software Foundation, Inc.
+ Written by Simon Josefsson and Yoann Vandoorselaere <yoann@prelude-ids.org>.
+
+ 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 2.1 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/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Specification. */
+#include <stdio.h>
+
+#include <errno.h>
+#include <limits.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "vasnprintf.h"
+
+/* Print formatted output to string STR. Similar to vsprintf, but
+ additional length SIZE limit how much is written into STR. Returns
+ string length of formatted string (which may be larger than SIZE).
+ STR may be NULL, in which case nothing will be written. On error,
+ return a negative value. */
+int
+vsnprintf (char *str, size_t size, const char *format, va_list args)
+{
+ char *output;
+ size_t len;
+ size_t lenbuf = size;
+
+ output = vasnprintf (str, &lenbuf, format, args);
+ len = lenbuf;
+
+ if (!output)
+ return -1;
+
+ if (output != str)
+ {
+ if (size)
+ {
+ size_t pruned_len = (len < size ? len : size - 1);
+ memcpy (str, output, pruned_len);
+ str[pruned_len] = '\0';
+ }
+
+ free (output);
+ }
+
+ if (len > INT_MAX)
+ {
+ errno = EOVERFLOW;
+ return -1;
+ }
+
+ return len;
+}
diff --git a/gl/lib/w32sock.h b/gl/lib/w32sock.h
new file mode 100644
index 0000000..17db3f1
--- /dev/null
+++ b/gl/lib/w32sock.h
@@ -0,0 +1,140 @@
+/* w32sock.h --- internal auxiliary functions for Windows socket functions
+
+ Copyright (C) 2008-2022 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 2.1 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 Paolo Bonzini */
+
+#include <errno.h>
+
+/* Get O_RDWR and O_BINARY. */
+#include <fcntl.h>
+
+/* Get _open_osfhandle(). */
+#include <io.h>
+
+/* Get _get_osfhandle(). */
+#if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+#else
+# include <io.h>
+#endif
+
+#define FD_TO_SOCKET(fd) ((SOCKET) _get_osfhandle ((fd)))
+#define SOCKET_TO_FD(fh) (_open_osfhandle ((intptr_t) (fh), O_RDWR | O_BINARY))
+
+static inline void
+set_winsock_errno (void)
+{
+ int err = WSAGetLastError ();
+
+ /* Map some WSAE* errors to the runtime library's error codes. */
+ switch (err)
+ {
+ case WSA_INVALID_HANDLE:
+ errno = EBADF;
+ break;
+ case WSA_NOT_ENOUGH_MEMORY:
+ errno = ENOMEM;
+ break;
+ case WSA_INVALID_PARAMETER:
+ errno = EINVAL;
+ break;
+ case WSAENAMETOOLONG:
+ errno = ENAMETOOLONG;
+ break;
+ case WSAENOTEMPTY:
+ errno = ENOTEMPTY;
+ break;
+ case WSAEWOULDBLOCK:
+ errno = EWOULDBLOCK;
+ break;
+ case WSAEINPROGRESS:
+ errno = EINPROGRESS;
+ break;
+ case WSAEALREADY:
+ errno = EALREADY;
+ break;
+ case WSAENOTSOCK:
+ errno = ENOTSOCK;
+ break;
+ case WSAEDESTADDRREQ:
+ errno = EDESTADDRREQ;
+ break;
+ case WSAEMSGSIZE:
+ errno = EMSGSIZE;
+ break;
+ case WSAEPROTOTYPE:
+ errno = EPROTOTYPE;
+ break;
+ case WSAENOPROTOOPT:
+ errno = ENOPROTOOPT;
+ break;
+ case WSAEPROTONOSUPPORT:
+ errno = EPROTONOSUPPORT;
+ break;
+ case WSAEOPNOTSUPP:
+ errno = EOPNOTSUPP;
+ break;
+ case WSAEAFNOSUPPORT:
+ errno = EAFNOSUPPORT;
+ break;
+ case WSAEADDRINUSE:
+ errno = EADDRINUSE;
+ break;
+ case WSAEADDRNOTAVAIL:
+ errno = EADDRNOTAVAIL;
+ break;
+ case WSAENETDOWN:
+ errno = ENETDOWN;
+ break;
+ case WSAENETUNREACH:
+ errno = ENETUNREACH;
+ break;
+ case WSAENETRESET:
+ errno = ENETRESET;
+ break;
+ case WSAECONNABORTED:
+ errno = ECONNABORTED;
+ break;
+ case WSAECONNRESET:
+ errno = ECONNRESET;
+ break;
+ case WSAENOBUFS:
+ errno = ENOBUFS;
+ break;
+ case WSAEISCONN:
+ errno = EISCONN;
+ break;
+ case WSAENOTCONN:
+ errno = ENOTCONN;
+ break;
+ case WSAETIMEDOUT:
+ errno = ETIMEDOUT;
+ break;
+ case WSAECONNREFUSED:
+ errno = ECONNREFUSED;
+ break;
+ case WSAELOOP:
+ errno = ELOOP;
+ break;
+ case WSAEHOSTUNREACH:
+ errno = EHOSTUNREACH;
+ break;
+ default:
+ errno = (err > 10000 && err < 10025) ? err - 10000 : err;
+ break;
+ }
+}
diff --git a/gl/lib/warn-on-use.h b/gl/lib/warn-on-use.h
new file mode 100644
index 0000000..94f5b92
--- /dev/null
+++ b/gl/lib/warn-on-use.h
@@ -0,0 +1,149 @@
+/* A C macro for emitting warnings if a function is used.
+ Copyright (C) 2010-2022 Free Software Foundation, Inc.
+
+ This program 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 2 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
+ 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/>. */
+
+/* _GL_WARN_ON_USE (function, "literal string") issues a declaration
+ for FUNCTION which will then trigger a compiler warning containing
+ the text of "literal string" anywhere that function is called, if
+ supported by the compiler. If the compiler does not support this
+ feature, the macro expands to an unused extern declaration.
+
+ _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the
+ attribute used in _GL_WARN_ON_USE. If the compiler does not support
+ this feature, it expands to empty.
+
+ These macros are useful for marking a function as a potential
+ portability trap, with the intent that "literal string" include
+ instructions on the replacement function that should be used
+ instead.
+ _GL_WARN_ON_USE is for functions with 'extern' linkage.
+ _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
+ linkage.
+
+ However, one of the reasons that a function is a portability trap is
+ if it has the wrong signature. Declaring FUNCTION with a different
+ signature in C is a compilation error, so this macro must use the
+ same type as any existing declaration so that programs that avoid
+ the problematic FUNCTION do not fail to compile merely because they
+ included a header that poisoned the function. But this implies that
+ _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already
+ have a declaration. Use of this macro implies that there must not
+ be any other macro hiding the declaration of FUNCTION; but
+ undefining FUNCTION first is part of the poisoning process anyway
+ (although for symbols that are provided only via a macro, the result
+ is a compilation error rather than a warning containing
+ "literal string"). Also note that in C++, it is only safe to use if
+ FUNCTION has no overloads.
+
+ For an example, it is possible to poison 'getline' by:
+ - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
+ [getline]) in configure.ac, which potentially defines
+ HAVE_RAW_DECL_GETLINE
+ - adding this code to a header that wraps the system <stdio.h>:
+ #undef getline
+ #if HAVE_RAW_DECL_GETLINE
+ _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
+ "not universally present; use the gnulib module getline");
+ #endif
+
+ It is not possible to directly poison global variables. But it is
+ possible to write a wrapper accessor function, and poison that
+ (less common usage, like &environ, will cause a compilation error
+ rather than issue the nice warning, but the end result of informing
+ the developer about their portability problem is still achieved):
+ #if HAVE_RAW_DECL_ENVIRON
+ static char ***
+ rpl_environ (void) { return &environ; }
+ _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
+ # undef environ
+ # define environ (*rpl_environ ())
+ #endif
+ or better (avoiding contradictory use of 'static' and 'extern'):
+ #if HAVE_RAW_DECL_ENVIRON
+ static char ***
+ _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared")
+ rpl_environ (void) { return &environ; }
+ # undef environ
+ # define environ (*rpl_environ ())
+ #endif
+ */
+#ifndef _GL_WARN_ON_USE
+
+# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+/* A compiler attribute is available in gcc versions 4.3.0 and later. */
+# define _GL_WARN_ON_USE(function, message) \
+_GL_WARN_EXTERN_C __typeof__ (function) function __attribute__ ((__warning__ (message)))
+# define _GL_WARN_ON_USE_ATTRIBUTE(message) \
+ __attribute__ ((__warning__ (message)))
+# elif __clang_major__ >= 4
+/* Another compiler attribute is available in clang. */
+# define _GL_WARN_ON_USE(function, message) \
+_GL_WARN_EXTERN_C __typeof__ (function) function \
+ __attribute__ ((__diagnose_if__ (1, message, "warning")))
+# define _GL_WARN_ON_USE_ATTRIBUTE(message) \
+ __attribute__ ((__diagnose_if__ (1, message, "warning")))
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+/* Verify the existence of the function. */
+# define _GL_WARN_ON_USE(function, message) \
+_GL_WARN_EXTERN_C __typeof__ (function) function
+# define _GL_WARN_ON_USE_ATTRIBUTE(message)
+# else /* Unsupported. */
+# define _GL_WARN_ON_USE(function, message) \
+_GL_WARN_EXTERN_C int _gl_warn_on_use
+# define _GL_WARN_ON_USE_ATTRIBUTE(message)
+# endif
+#endif
+
+/* _GL_WARN_ON_USE_CXX (function, rettype_gcc, rettype_clang, parameters_and_attributes, "message")
+ is like _GL_WARN_ON_USE (function, "message"), except that in C++ mode the
+ function is declared with the given prototype, consisting of return type,
+ parameters, and attributes.
+ This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
+ not work in this case. */
+#ifndef _GL_WARN_ON_USE_CXX
+# if !defined __cplusplus
+# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
+ _GL_WARN_ON_USE (function, msg)
+# else
+# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+/* A compiler attribute is available in gcc versions 4.3.0 and later. */
+# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
+extern rettype_gcc function parameters_and_attributes \
+ __attribute__ ((__warning__ (msg)))
+# elif __clang_major__ >= 4
+/* Another compiler attribute is available in clang. */
+# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
+extern rettype_clang function parameters_and_attributes \
+ __attribute__ ((__diagnose_if__ (1, msg, "warning")))
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+/* Verify the existence of the function. */
+# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
+extern rettype_gcc function parameters_and_attributes
+# else /* Unsupported. */
+# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
+_GL_WARN_EXTERN_C int _gl_warn_on_use
+# endif
+# endif
+#endif
+
+/* _GL_WARN_EXTERN_C declaration;
+ performs the declaration with C linkage. */
+#ifndef _GL_WARN_EXTERN_C
+# if defined __cplusplus
+# define _GL_WARN_EXTERN_C extern "C"
+# else
+# define _GL_WARN_EXTERN_C extern
+# endif
+#endif
diff --git a/gl/lib/wchar.in.h b/gl/lib/wchar.in.h
new file mode 100644
index 0000000..835ddbe
--- /dev/null
+++ b/gl/lib/wchar.in.h
@@ -0,0 +1,1338 @@
+/* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
+
+ Copyright (C) 2007-2022 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 2.1 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 Eric Blake. */
+
+/*
+ * ISO C 99 <wchar.h> for platforms that have issues.
+ * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/wchar.h.html>
+ *
+ * For now, this just ensures proper prerequisite inclusion order and
+ * the declaration of wcwidth().
+ */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if (((defined __need_mbstate_t || defined __need_wint_t) \
+ && !defined __MINGW32__) \
+ || (defined __hpux \
+ && ((defined _INTTYPES_INCLUDED \
+ && !defined _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H) \
+ || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) \
+ || (defined __MINGW32__ && defined __STRING_H_SOURCED__) \
+ || defined _GL_ALREADY_INCLUDING_WCHAR_H)
+/* Special invocation convention:
+ - Inside glibc and uClibc header files, but not MinGW.
+ - On HP-UX 11.00 we have a sequence of nested includes
+ <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>,
+ once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h>
+ and once directly. In both situations 'wint_t' is not yet defined,
+ therefore we cannot provide the function overrides; instead include only
+ the system's <wchar.h>.
+ - With MinGW 3.22, when <string.h> includes <wchar.h>, only some part of
+ <wchar.h> is actually processed, and that doesn't include 'mbstate_t'.
+ - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and
+ the latter includes <wchar.h>. But here, we have no way to detect whether
+ <wctype.h> is completely included or is still being included. */
+
+#@INCLUDE_NEXT@ @NEXT_WCHAR_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_WCHAR_H
+
+#define _GL_ALREADY_INCLUDING_WCHAR_H
+
+#if @HAVE_FEATURES_H@
+# include <features.h> /* for __GLIBC__ */
+#endif
+
+/* In some builds of uClibc, <wchar.h> is nonexistent and wchar_t is defined
+ by <stddef.h>.
+ But avoid namespace pollution on glibc systems. */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <stddef.h>
+#endif
+
+/* Include the original <wchar.h> if it exists.
+ Some builds of uClibc lack it. */
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_WCHAR_H@
+# @INCLUDE_NEXT@ @NEXT_WCHAR_H@
+#endif
+
+#undef _GL_ALREADY_INCLUDING_WCHAR_H
+
+#ifndef _@GUARD_PREFIX@_WCHAR_H
+#define _@GUARD_PREFIX@_WCHAR_H
+
+/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
+ that can be freed by passing them as the Ith argument to the
+ function F. */
+#ifndef _GL_ATTRIBUTE_DEALLOC
+# if __GNUC__ >= 11
+# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
+# else
+# define _GL_ATTRIBUTE_DEALLOC(f, i)
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that
+ can be freed via 'free'; it can be used only after declaring 'free'. */
+/* Applies to: functions. Cannot be used on inline functions. */
+#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
+# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
+#endif
+
+/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
+ allocated memory. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_MALLOC
+# if __GNUC__ >= 3 || defined __clang__
+# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+# else
+# define _GL_ATTRIBUTE_MALLOC
+# endif
+#endif
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The attribute __pure__ was added in gcc 2.96. */
+#ifndef _GL_ATTRIBUTE_PURE
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+# define _GL_ATTRIBUTE_PURE /* empty */
+# endif
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+/* Define wint_t and WEOF. (Also done in wctype.in.h.) */
+#if !@HAVE_WINT_T@ && !defined wint_t
+# define wint_t int
+# ifndef WEOF
+# define WEOF -1
+# endif
+#else
+/* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h> or
+ <stddef.h>. This is too small: ISO C 99 section 7.24.1.(2) says that
+ wint_t must be "unchanged by default argument promotions". Override it. */
+# if @GNULIBHEADERS_OVERRIDE_WINT_T@
+# if !GNULIB_defined_wint_t
+# if @HAVE_CRTDEFS_H@
+# include <crtdefs.h>
+# else
+# include <stddef.h>
+# endif
+typedef unsigned int rpl_wint_t;
+# undef wint_t
+# define wint_t rpl_wint_t
+# define GNULIB_defined_wint_t 1
+# endif
+# endif
+# ifndef WEOF
+# define WEOF ((wint_t) -1)
+# endif
+#endif
+
+
+/* Override mbstate_t if it is too small.
+ On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
+ implementing mbrtowc for encodings like UTF-8.
+ On AIX and MSVC, mbrtowc needs to be overridden, but mbstate_t exists and is
+ large enough and overriding it would cause problems in C++ mode. */
+#if !(((defined _WIN32 && !defined __CYGWIN__) || @HAVE_MBSINIT@) && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
+# if !GNULIB_defined_mbstate_t
+# if !(defined _AIX || defined _MSC_VER)
+typedef int rpl_mbstate_t;
+# undef mbstate_t
+# define mbstate_t rpl_mbstate_t
+# endif
+# define GNULIB_defined_mbstate_t 1
+# endif
+#endif
+
+/* Make _GL_ATTRIBUTE_DEALLOC_FREE work, even though <stdlib.h> may not have
+ been included yet. */
+#if @GNULIB_FREE_POSIX@
+# if (@REPLACE_FREE@ && !defined free \
+ && !(defined __cplusplus && defined GNULIB_NAMESPACE))
+/* We can't do '#define free rpl_free' here. */
+_GL_EXTERN_C void rpl_free (void *);
+# undef _GL_ATTRIBUTE_DEALLOC_FREE
+# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (rpl_free, 1)
+# else
+# if defined _MSC_VER && !defined free
+_GL_EXTERN_C
+# if defined _DLL
+ __declspec (dllimport)
+# endif
+ void __cdecl free (void *);
+# else
+# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
+_GL_EXTERN_C void free (void *) throw ();
+# else
+_GL_EXTERN_C void free (void *);
+# endif
+# endif
+# endif
+#else
+# if defined _MSC_VER && !defined free
+_GL_EXTERN_C
+# if defined _DLL
+ __declspec (dllimport)
+# endif
+ void __cdecl free (void *);
+# else
+# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
+_GL_EXTERN_C void free (void *) throw ();
+# else
+_GL_EXTERN_C void free (void *);
+# endif
+# endif
+#endif
+
+/* Convert a single-byte character to a wide character. */
+#if @GNULIB_BTOWC@
+# if @REPLACE_BTOWC@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef btowc
+# define btowc rpl_btowc
+# endif
+_GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
+_GL_CXXALIAS_RPL (btowc, wint_t, (int c));
+# else
+# if !@HAVE_BTOWC@
+_GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
+# endif
+/* Need to cast, because on mingw, the return type is 'unsigned short'. */
+_GL_CXXALIAS_SYS_CAST (btowc, wint_t, (int c));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (btowc);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef btowc
+# if HAVE_RAW_DECL_BTOWC
+_GL_WARN_ON_USE (btowc, "btowc is unportable - "
+ "use gnulib module btowc for portability");
+# endif
+#endif
+
+
+/* Convert a wide character to a single-byte character. */
+#if @GNULIB_WCTOB@
+# if @REPLACE_WCTOB@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wctob
+# define wctob rpl_wctob
+# endif
+_GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
+_GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
+# else
+# if !defined wctob && !@HAVE_DECL_WCTOB@
+/* wctob is provided by gnulib, or wctob exists but is not declared. */
+_GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wctob);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wctob
+# if HAVE_RAW_DECL_WCTOB
+_GL_WARN_ON_USE (wctob, "wctob is unportable - "
+ "use gnulib module wctob for portability");
+# endif
+#endif
+
+
+/* Test whether *PS is in the initial state. */
+#if @GNULIB_MBSINIT@
+# if @REPLACE_MBSINIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mbsinit
+# define mbsinit rpl_mbsinit
+# endif
+_GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
+_GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
+# else
+# if !@HAVE_MBSINIT@
+_GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
+# endif
+_GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (mbsinit);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbsinit
+# if HAVE_RAW_DECL_MBSINIT
+_GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
+ "use gnulib module mbsinit for portability");
+# endif
+#endif
+
+
+/* Convert a multibyte character to a wide character. */
+#if @GNULIB_MBRTOWC@
+# if @REPLACE_MBRTOWC@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mbrtowc
+# define mbrtowc rpl_mbrtowc
+# endif
+_GL_FUNCDECL_RPL (mbrtowc, size_t,
+ (wchar_t *restrict pwc, const char *restrict s, size_t n,
+ mbstate_t *restrict ps));
+_GL_CXXALIAS_RPL (mbrtowc, size_t,
+ (wchar_t *restrict pwc, const char *restrict s, size_t n,
+ mbstate_t *restrict ps));
+# else
+# if !@HAVE_MBRTOWC@
+_GL_FUNCDECL_SYS (mbrtowc, size_t,
+ (wchar_t *restrict pwc, const char *restrict s, size_t n,
+ mbstate_t *restrict ps));
+# endif
+_GL_CXXALIAS_SYS (mbrtowc, size_t,
+ (wchar_t *restrict pwc, const char *restrict s, size_t n,
+ mbstate_t *restrict ps));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (mbrtowc);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbrtowc
+# if HAVE_RAW_DECL_MBRTOWC
+_GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
+ "use gnulib module mbrtowc for portability");
+# endif
+#endif
+
+
+/* Recognize a multibyte character. */
+#if @GNULIB_MBRLEN@
+# if @REPLACE_MBRLEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mbrlen
+# define mbrlen rpl_mbrlen
+# endif
+_GL_FUNCDECL_RPL (mbrlen, size_t,
+ (const char *restrict s, size_t n, mbstate_t *restrict ps));
+_GL_CXXALIAS_RPL (mbrlen, size_t,
+ (const char *restrict s, size_t n, mbstate_t *restrict ps));
+# else
+# if !@HAVE_MBRLEN@
+_GL_FUNCDECL_SYS (mbrlen, size_t,
+ (const char *restrict s, size_t n, mbstate_t *restrict ps));
+# endif
+_GL_CXXALIAS_SYS (mbrlen, size_t,
+ (const char *restrict s, size_t n, mbstate_t *restrict ps));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (mbrlen);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbrlen
+# if HAVE_RAW_DECL_MBRLEN
+_GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
+ "use gnulib module mbrlen for portability");
+# endif
+#endif
+
+
+/* Convert a string to a wide string. */
+#if @GNULIB_MBSRTOWCS@
+# if @REPLACE_MBSRTOWCS@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mbsrtowcs
+# define mbsrtowcs rpl_mbsrtowcs
+# endif
+_GL_FUNCDECL_RPL (mbsrtowcs, size_t,
+ (wchar_t *restrict dest,
+ const char **restrict srcp, size_t len,
+ mbstate_t *restrict ps)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (mbsrtowcs, size_t,
+ (wchar_t *restrict dest,
+ const char **restrict srcp, size_t len,
+ mbstate_t *restrict ps));
+# else
+# if !@HAVE_MBSRTOWCS@
+_GL_FUNCDECL_SYS (mbsrtowcs, size_t,
+ (wchar_t *restrict dest,
+ const char **restrict srcp, size_t len,
+ mbstate_t *restrict ps)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (mbsrtowcs, size_t,
+ (wchar_t *restrict dest,
+ const char **restrict srcp, size_t len,
+ mbstate_t *restrict ps));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (mbsrtowcs);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbsrtowcs
+# if HAVE_RAW_DECL_MBSRTOWCS
+_GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
+ "use gnulib module mbsrtowcs for portability");
+# endif
+#endif
+
+
+/* Convert a string to a wide string. */
+#if @GNULIB_MBSNRTOWCS@
+# if @REPLACE_MBSNRTOWCS@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mbsnrtowcs
+# define mbsnrtowcs rpl_mbsnrtowcs
+# endif
+_GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
+ (wchar_t *restrict dest,
+ const char **restrict srcp, size_t srclen, size_t len,
+ mbstate_t *restrict ps)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
+ (wchar_t *restrict dest,
+ const char **restrict srcp, size_t srclen, size_t len,
+ mbstate_t *restrict ps));
+# else
+# if !@HAVE_MBSNRTOWCS@
+_GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
+ (wchar_t *restrict dest,
+ const char **restrict srcp, size_t srclen, size_t len,
+ mbstate_t *restrict ps)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
+ (wchar_t *restrict dest,
+ const char **restrict srcp, size_t srclen, size_t len,
+ mbstate_t *restrict ps));
+# endif
+_GL_CXXALIASWARN (mbsnrtowcs);
+#elif defined GNULIB_POSIXCHECK
+# undef mbsnrtowcs
+# if HAVE_RAW_DECL_MBSNRTOWCS
+_GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
+ "use gnulib module mbsnrtowcs for portability");
+# endif
+#endif
+
+
+/* Convert a wide character to a multibyte character. */
+#if @GNULIB_WCRTOMB@
+# if @REPLACE_WCRTOMB@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcrtomb
+# define wcrtomb rpl_wcrtomb
+# endif
+_GL_FUNCDECL_RPL (wcrtomb, size_t,
+ (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
+_GL_CXXALIAS_RPL (wcrtomb, size_t,
+ (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
+# else
+# if !@HAVE_WCRTOMB@
+_GL_FUNCDECL_SYS (wcrtomb, size_t,
+ (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
+# endif
+_GL_CXXALIAS_SYS (wcrtomb, size_t,
+ (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcrtomb);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcrtomb
+# if HAVE_RAW_DECL_WCRTOMB
+_GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
+ "use gnulib module wcrtomb for portability");
+# endif
+#endif
+
+
+/* Convert a wide string to a string. */
+#if @GNULIB_WCSRTOMBS@
+# if @REPLACE_WCSRTOMBS@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcsrtombs
+# define wcsrtombs rpl_wcsrtombs
+# endif
+_GL_FUNCDECL_RPL (wcsrtombs, size_t,
+ (char *restrict dest, const wchar_t **restrict srcp,
+ size_t len,
+ mbstate_t *restrict ps)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (wcsrtombs, size_t,
+ (char *restrict dest, const wchar_t **restrict srcp,
+ size_t len,
+ mbstate_t *restrict ps));
+# else
+# if !@HAVE_WCSRTOMBS@
+_GL_FUNCDECL_SYS (wcsrtombs, size_t,
+ (char *restrict dest, const wchar_t **restrict srcp,
+ size_t len,
+ mbstate_t *restrict ps)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (wcsrtombs, size_t,
+ (char *restrict dest, const wchar_t **restrict srcp,
+ size_t len,
+ mbstate_t *restrict ps));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcsrtombs);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsrtombs
+# if HAVE_RAW_DECL_WCSRTOMBS
+_GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
+ "use gnulib module wcsrtombs for portability");
+# endif
+#endif
+
+
+/* Convert a wide string to a string. */
+#if @GNULIB_WCSNRTOMBS@
+# if @REPLACE_WCSNRTOMBS@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcsnrtombs
+# define wcsnrtombs rpl_wcsnrtombs
+# endif
+_GL_FUNCDECL_RPL (wcsnrtombs, size_t,
+ (char *restrict dest,
+ const wchar_t **restrict srcp, size_t srclen,
+ size_t len,
+ mbstate_t *restrict ps)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (wcsnrtombs, size_t,
+ (char *restrict dest,
+ const wchar_t **restrict srcp, size_t srclen,
+ size_t len,
+ mbstate_t *restrict ps));
+# else
+# if !@HAVE_WCSNRTOMBS@ || (defined __cplusplus && defined __sun)
+_GL_FUNCDECL_SYS (wcsnrtombs, size_t,
+ (char *restrict dest,
+ const wchar_t **restrict srcp, size_t srclen,
+ size_t len,
+ mbstate_t *restrict ps)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (wcsnrtombs, size_t,
+ (char *restrict dest,
+ const wchar_t **restrict srcp, size_t srclen,
+ size_t len,
+ mbstate_t *restrict ps));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcsnrtombs);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsnrtombs
+# if HAVE_RAW_DECL_WCSNRTOMBS
+_GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
+ "use gnulib module wcsnrtombs for portability");
+# endif
+#endif
+
+
+/* Return the number of screen columns needed for WC. */
+#if @GNULIB_WCWIDTH@
+# if @REPLACE_WCWIDTH@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcwidth
+# define wcwidth rpl_wcwidth
+# endif
+_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
+_GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
+# else
+# if !@HAVE_DECL_WCWIDTH@
+/* wcwidth exists but is not declared. */
+_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcwidth);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcwidth
+# if HAVE_RAW_DECL_WCWIDTH
+_GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
+ "use gnulib module wcwidth for portability");
+# endif
+#endif
+
+
+/* Search N wide characters of S for C. */
+#if @GNULIB_WMEMCHR@
+# if !@HAVE_WMEMCHR@
+_GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n)
+ _GL_ATTRIBUTE_PURE);
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" {
+ const wchar_t * std::wmemchr (const wchar_t *, wchar_t, size_t);
+ wchar_t * std::wmemchr (wchar_t *, wchar_t, size_t);
+ } */
+_GL_CXXALIAS_SYS_CAST2 (wmemchr,
+ wchar_t *, (const wchar_t *, wchar_t, size_t),
+ const wchar_t *, (const wchar_t *, wchar_t, size_t));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
+_GL_CXXALIASWARN1 (wmemchr, const wchar_t *,
+ (const wchar_t *s, wchar_t c, size_t n));
+# elif __GLIBC__ >= 2
+_GL_CXXALIASWARN (wmemchr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wmemchr
+# if HAVE_RAW_DECL_WMEMCHR
+_GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
+ "use gnulib module wmemchr for portability");
+# endif
+#endif
+
+
+/* Compare N wide characters of S1 and S2. */
+#if @GNULIB_WMEMCMP@
+# if !@HAVE_WMEMCMP@
+_GL_FUNCDECL_SYS (wmemcmp, int,
+ (const wchar_t *s1, const wchar_t *s2, size_t n)
+ _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wmemcmp, int,
+ (const wchar_t *s1, const wchar_t *s2, size_t n));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wmemcmp);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wmemcmp
+# if HAVE_RAW_DECL_WMEMCMP
+_GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
+ "use gnulib module wmemcmp for portability");
+# endif
+#endif
+
+
+/* Copy N wide characters of SRC to DEST. */
+#if @GNULIB_WMEMCPY@
+# if !@HAVE_WMEMCPY@
+_GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
+ (wchar_t *restrict dest,
+ const wchar_t *restrict src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
+ (wchar_t *restrict dest,
+ const wchar_t *restrict src, size_t n));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wmemcpy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wmemcpy
+# if HAVE_RAW_DECL_WMEMCPY
+_GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
+ "use gnulib module wmemcpy for portability");
+# endif
+#endif
+
+
+/* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for
+ overlapping memory areas. */
+#if @GNULIB_WMEMMOVE@
+# if !@HAVE_WMEMMOVE@
+_GL_FUNCDECL_SYS (wmemmove, wchar_t *,
+ (wchar_t *dest, const wchar_t *src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmemmove, wchar_t *,
+ (wchar_t *dest, const wchar_t *src, size_t n));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wmemmove);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wmemmove
+# if HAVE_RAW_DECL_WMEMMOVE
+_GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
+ "use gnulib module wmemmove for portability");
+# endif
+#endif
+
+
+/* Copy N wide characters of SRC to DEST.
+ Return pointer to wide characters after the last written wide character. */
+#if @GNULIB_WMEMPCPY@
+# if !@HAVE_WMEMPCPY@
+_GL_FUNCDECL_SYS (wmempcpy, wchar_t *,
+ (wchar_t *restrict dest,
+ const wchar_t *restrict src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmempcpy, wchar_t *,
+ (wchar_t *restrict dest,
+ const wchar_t *restrict src, size_t n));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wmempcpy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wmempcpy
+# if HAVE_RAW_DECL_WMEMPCPY
+_GL_WARN_ON_USE (wmempcpy, "wmempcpy is unportable - "
+ "use gnulib module wmempcpy for portability");
+# endif
+#endif
+
+
+/* Set N wide characters of S to C. */
+#if @GNULIB_WMEMSET@
+# if !@HAVE_WMEMSET@
+_GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wmemset);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wmemset
+# if HAVE_RAW_DECL_WMEMSET
+_GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
+ "use gnulib module wmemset for portability");
+# endif
+#endif
+
+
+/* Return the number of wide characters in S. */
+#if @GNULIB_WCSLEN@
+# if !@HAVE_WCSLEN@
+_GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcslen);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcslen
+# if HAVE_RAW_DECL_WCSLEN
+_GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
+ "use gnulib module wcslen for portability");
+# endif
+#endif
+
+
+/* Return the number of wide characters in S, but at most MAXLEN. */
+#if @GNULIB_WCSNLEN@
+# if !@HAVE_WCSNLEN@
+_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)
+ _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
+_GL_CXXALIASWARN (wcsnlen);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsnlen
+# if HAVE_RAW_DECL_WCSNLEN
+_GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
+ "use gnulib module wcsnlen for portability");
+# endif
+#endif
+
+
+/* Copy SRC to DEST. */
+#if @GNULIB_WCSCPY@
+# if !@HAVE_WCSCPY@
+_GL_FUNCDECL_SYS (wcscpy, wchar_t *,
+ (wchar_t *restrict dest, const wchar_t *restrict src));
+# endif
+_GL_CXXALIAS_SYS (wcscpy, wchar_t *,
+ (wchar_t *restrict dest, const wchar_t *restrict src));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcscpy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcscpy
+# if HAVE_RAW_DECL_WCSCPY
+_GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
+ "use gnulib module wcscpy for portability");
+# endif
+#endif
+
+
+/* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */
+#if @GNULIB_WCPCPY@
+# if !@HAVE_WCPCPY@
+_GL_FUNCDECL_SYS (wcpcpy, wchar_t *,
+ (wchar_t *restrict dest, const wchar_t *restrict src));
+# endif
+_GL_CXXALIAS_SYS (wcpcpy, wchar_t *,
+ (wchar_t *restrict dest, const wchar_t *restrict src));
+_GL_CXXALIASWARN (wcpcpy);
+#elif defined GNULIB_POSIXCHECK
+# undef wcpcpy
+# if HAVE_RAW_DECL_WCPCPY
+_GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
+ "use gnulib module wcpcpy for portability");
+# endif
+#endif
+
+
+/* Copy no more than N wide characters of SRC to DEST. */
+#if @GNULIB_WCSNCPY@
+# if !@HAVE_WCSNCPY@
+_GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
+ (wchar_t *restrict dest,
+ const wchar_t *restrict src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
+ (wchar_t *restrict dest,
+ const wchar_t *restrict src, size_t n));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcsncpy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsncpy
+# if HAVE_RAW_DECL_WCSNCPY
+_GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
+ "use gnulib module wcsncpy for portability");
+# endif
+#endif
+
+
+/* Copy no more than N characters of SRC to DEST, returning the address of
+ the last character written into DEST. */
+#if @GNULIB_WCPNCPY@
+# if !@HAVE_WCPNCPY@
+_GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
+ (wchar_t *restrict dest,
+ const wchar_t *restrict src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcpncpy, wchar_t *,
+ (wchar_t *restrict dest,
+ const wchar_t *restrict src, size_t n));
+_GL_CXXALIASWARN (wcpncpy);
+#elif defined GNULIB_POSIXCHECK
+# undef wcpncpy
+# if HAVE_RAW_DECL_WCPNCPY
+_GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
+ "use gnulib module wcpncpy for portability");
+# endif
+#endif
+
+
+/* Append SRC onto DEST. */
+#if @GNULIB_WCSCAT@
+# if !@HAVE_WCSCAT@
+_GL_FUNCDECL_SYS (wcscat, wchar_t *,
+ (wchar_t *restrict dest, const wchar_t *restrict src));
+# endif
+_GL_CXXALIAS_SYS (wcscat, wchar_t *,
+ (wchar_t *restrict dest, const wchar_t *restrict src));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcscat);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcscat
+# if HAVE_RAW_DECL_WCSCAT
+_GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
+ "use gnulib module wcscat for portability");
+# endif
+#endif
+
+
+/* Append no more than N wide characters of SRC onto DEST. */
+#if @GNULIB_WCSNCAT@
+# if !@HAVE_WCSNCAT@
+_GL_FUNCDECL_SYS (wcsncat, wchar_t *,
+ (wchar_t *restrict dest, const wchar_t *restrict src,
+ size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsncat, wchar_t *,
+ (wchar_t *restrict dest, const wchar_t *restrict src,
+ size_t n));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcsncat);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsncat
+# if HAVE_RAW_DECL_WCSNCAT
+_GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
+ "use gnulib module wcsncat for portability");
+# endif
+#endif
+
+
+/* Compare S1 and S2. */
+#if @GNULIB_WCSCMP@
+# if !@HAVE_WCSCMP@
+_GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)
+ _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcscmp);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcscmp
+# if HAVE_RAW_DECL_WCSCMP
+_GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
+ "use gnulib module wcscmp for portability");
+# endif
+#endif
+
+
+/* Compare no more than N wide characters of S1 and S2. */
+#if @GNULIB_WCSNCMP@
+# if !@HAVE_WCSNCMP@
+_GL_FUNCDECL_SYS (wcsncmp, int,
+ (const wchar_t *s1, const wchar_t *s2, size_t n)
+ _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcsncmp, int,
+ (const wchar_t *s1, const wchar_t *s2, size_t n));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcsncmp);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsncmp
+# if HAVE_RAW_DECL_WCSNCMP
+_GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
+ "use gnulib module wcsncmp for portability");
+# endif
+#endif
+
+
+/* Compare S1 and S2, ignoring case. */
+#if @GNULIB_WCSCASECMP@
+# if !@HAVE_WCSCASECMP@
+_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)
+ _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
+_GL_CXXALIASWARN (wcscasecmp);
+#elif defined GNULIB_POSIXCHECK
+# undef wcscasecmp
+# if HAVE_RAW_DECL_WCSCASECMP
+_GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
+ "use gnulib module wcscasecmp for portability");
+# endif
+#endif
+
+
+/* Compare no more than N chars of S1 and S2, ignoring case. */
+#if @GNULIB_WCSNCASECMP@
+# if !@HAVE_WCSNCASECMP@
+_GL_FUNCDECL_SYS (wcsncasecmp, int,
+ (const wchar_t *s1, const wchar_t *s2, size_t n)
+ _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcsncasecmp, int,
+ (const wchar_t *s1, const wchar_t *s2, size_t n));
+_GL_CXXALIASWARN (wcsncasecmp);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsncasecmp
+# if HAVE_RAW_DECL_WCSNCASECMP
+_GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
+ "use gnulib module wcsncasecmp for portability");
+# endif
+#endif
+
+
+/* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE
+ category of the current locale. */
+#if @GNULIB_WCSCOLL@
+# if !@HAVE_WCSCOLL@
+_GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
+# endif
+_GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcscoll);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcscoll
+# if HAVE_RAW_DECL_WCSCOLL
+_GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
+ "use gnulib module wcscoll for portability");
+# endif
+#endif
+
+
+/* Transform S2 into array pointed to by S1 such that if wcscmp is applied
+ to two transformed strings the result is the as applying 'wcscoll' to the
+ original strings. */
+#if @GNULIB_WCSXFRM@
+# if !@HAVE_WCSXFRM@
+_GL_FUNCDECL_SYS (wcsxfrm, size_t,
+ (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsxfrm, size_t,
+ (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcsxfrm);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsxfrm
+# if HAVE_RAW_DECL_WCSXFRM
+_GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
+ "use gnulib module wcsxfrm for portability");
+# endif
+#endif
+
+
+/* Duplicate S, returning an identical malloc'd string. */
+#if @GNULIB_WCSDUP@
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcsdup
+# define wcsdup _wcsdup
+# endif
+_GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s));
+# else
+# if !@HAVE_WCSDUP@ || __GNUC__ >= 11
+_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
+ (const wchar_t *s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+_GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
+# endif
+_GL_CXXALIASWARN (wcsdup);
+#else
+# if __GNUC__ >= 11 && !defined wcsdup
+/* For -Wmismatched-dealloc: Associate wcsdup with free or rpl_free. */
+_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
+ (const wchar_t *s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef wcsdup
+# if HAVE_RAW_DECL_WCSDUP
+_GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
+ "use gnulib module wcsdup for portability");
+# endif
+# elif @GNULIB_MDA_WCSDUP@
+/* On native Windows, map 'wcsdup' to '_wcsdup', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::wcsdup always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcsdup
+# define wcsdup _wcsdup
+# endif
+_GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s));
+# else
+_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
+ (const wchar_t *s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# if @HAVE_DECL_WCSDUP@
+_GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
+# endif
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_WCSDUP@
+_GL_CXXALIASWARN (wcsdup);
+# endif
+# endif
+#endif
+
+
+/* Find the first occurrence of WC in WCS. */
+#if @GNULIB_WCSCHR@
+# if !@HAVE_WCSCHR@
+_GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
+ _GL_ATTRIBUTE_PURE);
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" {
+ const wchar_t * std::wcschr (const wchar_t *, wchar_t);
+ wchar_t * std::wcschr (wchar_t *, wchar_t);
+ } */
+_GL_CXXALIAS_SYS_CAST2 (wcschr,
+ wchar_t *, (const wchar_t *, wchar_t),
+ const wchar_t *, (const wchar_t *, wchar_t));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc));
+_GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
+# elif __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcschr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcschr
+# if HAVE_RAW_DECL_WCSCHR
+_GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
+ "use gnulib module wcschr for portability");
+# endif
+#endif
+
+
+/* Find the last occurrence of WC in WCS. */
+#if @GNULIB_WCSRCHR@
+# if !@HAVE_WCSRCHR@
+_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
+ _GL_ATTRIBUTE_PURE);
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" {
+ const wchar_t * std::wcsrchr (const wchar_t *, wchar_t);
+ wchar_t * std::wcsrchr (wchar_t *, wchar_t);
+ } */
+_GL_CXXALIAS_SYS_CAST2 (wcsrchr,
+ wchar_t *, (const wchar_t *, wchar_t),
+ const wchar_t *, (const wchar_t *, wchar_t));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc));
+_GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
+# elif __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcsrchr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsrchr
+# if HAVE_RAW_DECL_WCSRCHR
+_GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
+ "use gnulib module wcsrchr for portability");
+# endif
+#endif
+
+
+/* Return the length of the initial segmet of WCS which consists entirely
+ of wide characters not in REJECT. */
+#if @GNULIB_WCSCSPN@
+# if !@HAVE_WCSCSPN@
+_GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)
+ _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcscspn);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcscspn
+# if HAVE_RAW_DECL_WCSCSPN
+_GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
+ "use gnulib module wcscspn for portability");
+# endif
+#endif
+
+
+/* Return the length of the initial segmet of WCS which consists entirely
+ of wide characters in ACCEPT. */
+#if @GNULIB_WCSSPN@
+# if !@HAVE_WCSSPN@
+_GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)
+ _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcsspn);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsspn
+# if HAVE_RAW_DECL_WCSSPN
+_GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
+ "use gnulib module wcsspn for portability");
+# endif
+#endif
+
+
+/* Find the first occurrence in WCS of any character in ACCEPT. */
+#if @GNULIB_WCSPBRK@
+# if !@HAVE_WCSPBRK@
+_GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
+ (const wchar_t *wcs, const wchar_t *accept)
+ _GL_ATTRIBUTE_PURE);
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" {
+ const wchar_t * std::wcspbrk (const wchar_t *, const wchar_t *);
+ wchar_t * std::wcspbrk (wchar_t *, const wchar_t *);
+ } */
+_GL_CXXALIAS_SYS_CAST2 (wcspbrk,
+ wchar_t *, (const wchar_t *, const wchar_t *),
+ const wchar_t *, (const wchar_t *, const wchar_t *));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (wcspbrk, wchar_t *,
+ (wchar_t *wcs, const wchar_t *accept));
+_GL_CXXALIASWARN1 (wcspbrk, const wchar_t *,
+ (const wchar_t *wcs, const wchar_t *accept));
+# elif __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcspbrk);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcspbrk
+# if HAVE_RAW_DECL_WCSPBRK
+_GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
+ "use gnulib module wcspbrk for portability");
+# endif
+#endif
+
+
+/* Find the first occurrence of NEEDLE in HAYSTACK. */
+#if @GNULIB_WCSSTR@
+# if !@HAVE_WCSSTR@
+_GL_FUNCDECL_SYS (wcsstr, wchar_t *,
+ (const wchar_t *restrict haystack,
+ const wchar_t *restrict needle)
+ _GL_ATTRIBUTE_PURE);
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" {
+ const wchar_t * std::wcsstr (const wchar_t *, const wchar_t *);
+ wchar_t * std::wcsstr (wchar_t *, const wchar_t *);
+ } */
+_GL_CXXALIAS_SYS_CAST2 (wcsstr,
+ wchar_t *,
+ (const wchar_t *restrict, const wchar_t *restrict),
+ const wchar_t *,
+ (const wchar_t *restrict, const wchar_t *restrict));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (wcsstr, wchar_t *,
+ (wchar_t *restrict haystack,
+ const wchar_t *restrict needle));
+_GL_CXXALIASWARN1 (wcsstr, const wchar_t *,
+ (const wchar_t *restrict haystack,
+ const wchar_t *restrict needle));
+# elif __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcsstr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsstr
+# if HAVE_RAW_DECL_WCSSTR
+_GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
+ "use gnulib module wcsstr for portability");
+# endif
+#endif
+
+
+/* Divide WCS into tokens separated by characters in DELIM. */
+#if @GNULIB_WCSTOK@
+# if @REPLACE_WCSTOK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcstok
+# define wcstok rpl_wcstok
+# endif
+_GL_FUNCDECL_RPL (wcstok, wchar_t *,
+ (wchar_t *restrict wcs, const wchar_t *restrict delim,
+ wchar_t **restrict ptr));
+_GL_CXXALIAS_RPL (wcstok, wchar_t *,
+ (wchar_t *restrict wcs, const wchar_t *restrict delim,
+ wchar_t **restrict ptr));
+# else
+# if !@HAVE_WCSTOK@
+_GL_FUNCDECL_SYS (wcstok, wchar_t *,
+ (wchar_t *restrict wcs, const wchar_t *restrict delim,
+ wchar_t **restrict ptr));
+# endif
+_GL_CXXALIAS_SYS (wcstok, wchar_t *,
+ (wchar_t *restrict wcs, const wchar_t *restrict delim,
+ wchar_t **restrict ptr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcstok);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcstok
+# if HAVE_RAW_DECL_WCSTOK
+_GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
+ "use gnulib module wcstok for portability");
+# endif
+#endif
+
+
+/* Determine number of column positions required for first N wide
+ characters (or fewer if S ends before this) in S. */
+#if @GNULIB_WCSWIDTH@
+# if @REPLACE_WCSWIDTH@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcswidth
+# define wcswidth rpl_wcswidth
+# endif
+_GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n)
+ _GL_ATTRIBUTE_PURE);
+_GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
+# else
+# if !@HAVE_WCSWIDTH@
+_GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n)
+ _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcswidth);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcswidth
+# if HAVE_RAW_DECL_WCSWIDTH
+_GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
+ "use gnulib module wcswidth for portability");
+# endif
+#endif
+
+
+/* Convert *TP to a date and time wide string. See
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/wcsftime.html>. */
+#if @GNULIB_WCSFTIME@
+# if @REPLACE_WCSFTIME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcsftime
+# define wcsftime rpl_wcsftime
+# endif
+_GL_FUNCDECL_RPL (wcsftime, size_t,
+ (wchar_t *restrict __buf, size_t __bufsize,
+ const wchar_t *restrict __fmt,
+ const struct tm *restrict __tp)
+ _GL_ARG_NONNULL ((1, 3, 4)));
+_GL_CXXALIAS_RPL (wcsftime, size_t,
+ (wchar_t *restrict __buf, size_t __bufsize,
+ const wchar_t *restrict __fmt,
+ const struct tm *restrict __tp));
+# else
+# if !@HAVE_WCSFTIME@
+_GL_FUNCDECL_SYS (wcsftime, size_t,
+ (wchar_t *restrict __buf, size_t __bufsize,
+ const wchar_t *restrict __fmt,
+ const struct tm *restrict __tp)
+ _GL_ARG_NONNULL ((1, 3, 4)));
+# endif
+_GL_CXXALIAS_SYS (wcsftime, size_t,
+ (wchar_t *restrict __buf, size_t __bufsize,
+ const wchar_t *restrict __fmt,
+ const struct tm *restrict __tp));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcsftime);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsftime
+# if HAVE_RAW_DECL_WCSFTIME
+_GL_WARN_ON_USE (wcsftime, "wcsftime is unportable - "
+ "use gnulib module wcsftime for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_WCHAR_H */
+#endif /* _@GUARD_PREFIX@_WCHAR_H */
+#endif
diff --git a/gl/lib/wcrtomb.c b/gl/lib/wcrtomb.c
new file mode 100644
index 0000000..e14d802
--- /dev/null
+++ b/gl/lib/wcrtomb.c
@@ -0,0 +1,80 @@
+/* Convert wide character to multibyte character.
+ Copyright (C) 2008-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include <errno.h>
+#include <stdlib.h>
+
+
+size_t
+wcrtomb (char *s, wchar_t wc, mbstate_t *ps)
+#undef wcrtomb
+{
+ /* This implementation of wcrtomb supports only stateless encodings.
+ ps must be in the initial state. */
+ if (ps != NULL && !mbsinit (ps))
+ {
+ errno = EINVAL;
+ return (size_t)(-1);
+ }
+
+#if !HAVE_WCRTOMB /* IRIX 6.5 */ \
+ || WCRTOMB_RETVAL_BUG /* Solaris 11.3, MSVC */ \
+ || WCRTOMB_C_LOCALE_BUG /* Android */
+ if (s == NULL)
+ /* We know the NUL wide character corresponds to the NUL character. */
+ return 1;
+ else
+#endif
+ {
+#if HAVE_WCRTOMB
+# if WCRTOMB_C_LOCALE_BUG /* Android */
+ /* Implement consistently with mbrtowc(): through a 1:1 correspondence,
+ as in ISO-8859-1. */
+ if (wc >= 0 && wc <= 0xff)
+ {
+ *s = (unsigned char) wc;
+ return 1;
+ }
+ else
+ {
+ errno = EILSEQ;
+ return (size_t)(-1);
+ }
+# else
+ return wcrtomb (s, wc, ps);
+# endif
+#else /* IRIX 6.5 */
+ /* Fallback for platforms that don't have wcrtomb().
+ Implement on top of wctomb().
+ This code is not multithread-safe. */
+ int ret = wctomb (s, wc);
+
+ if (ret >= 0)
+ return ret;
+ else
+ {
+ errno = EILSEQ;
+ return (size_t)(-1);
+ }
+#endif
+ }
+}
diff --git a/gl/lib/wctype-h.c b/gl/lib/wctype-h.c
new file mode 100644
index 0000000..1278143
--- /dev/null
+++ b/gl/lib/wctype-h.c
@@ -0,0 +1,23 @@
+/* Inline functions for <wctype.h>.
+
+ Copyright (C) 2012-2022 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 2.1 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/>. */
+
+/* Normally this would be wctype.c, but that name's already taken. */
+
+#include <config.h>
+
+#define _GL_WCTYPE_INLINE _GL_EXTERN_INLINE
+#include "wctype.h"
diff --git a/gl/lib/wctype.in.h b/gl/lib/wctype.in.h
new file mode 100644
index 0000000..98cafee
--- /dev/null
+++ b/gl/lib/wctype.in.h
@@ -0,0 +1,732 @@
+/* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
+
+ Copyright (C) 2006-2022 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 2.1 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 and Paul Eggert. */
+
+/*
+ * ISO C 99 <wctype.h> for platforms that lack it.
+ * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/wctype.h.html>
+ *
+ * iswctype, towctrans, towlower, towupper, wctrans, wctype,
+ * wctrans_t, and wctype_t are not yet implemented.
+ */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if (defined __MINGW32__ && defined __CTYPE_H_SOURCED__)
+
+/* Special invocation convention:
+ - With MinGW 3.22, when <ctype.h> includes <wctype.h>, only some part of
+ <wctype.h> is being processed, which doesn't include the idempotency
+ guard. */
+
+#@INCLUDE_NEXT@ @NEXT_WCTYPE_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_WCTYPE_H
+
+#if @HAVE_WINT_T@
+/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
+# include <wchar.h>
+#endif
+
+/* Native Windows (mingw, MSVC) have declarations of towupper, towlower, and
+ isw* functions in <ctype.h>, <wchar.h> as well as in <wctype.h>. Include
+ <ctype.h>, <wchar.h> in advance to avoid rpl_ prefix being added to the
+ declarations. */
+#if defined _WIN32 && ! defined __CYGWIN__
+# include <ctype.h>
+# include <wchar.h>
+#endif
+
+/* Include the original <wctype.h> if it exists.
+ BeOS 5 has the functions but no <wctype.h>. */
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_WCTYPE_H@
+# @INCLUDE_NEXT@ @NEXT_WCTYPE_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_WCTYPE_H
+#define _@GUARD_PREFIX@_WCTYPE_H
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GL_WCTYPE_INLINE
+# define _GL_WCTYPE_INLINE _GL_INLINE
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* Solaris 2.6 <wctype.h> includes <widec.h> which includes <euc.h> which
+ #defines a number of identifiers in the application namespace. Revert
+ these #defines. */
+#ifdef __sun
+# undef multibyte
+# undef eucw1
+# undef eucw2
+# undef eucw3
+# undef scrw1
+# undef scrw2
+# undef scrw3
+#endif
+
+/* Define wint_t and WEOF. (Also done in wchar.in.h.) */
+#if !@HAVE_WINT_T@ && !defined wint_t
+# define wint_t int
+# ifndef WEOF
+# define WEOF -1
+# endif
+#else
+/* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h> or
+ <stddef.h>. This is too small: ISO C 99 section 7.24.1.(2) says that
+ wint_t must be "unchanged by default argument promotions". Override it. */
+# if @GNULIBHEADERS_OVERRIDE_WINT_T@
+# if !GNULIB_defined_wint_t
+# if @HAVE_CRTDEFS_H@
+# include <crtdefs.h>
+# else
+# include <stddef.h>
+# endif
+typedef unsigned int rpl_wint_t;
+# undef wint_t
+# define wint_t rpl_wint_t
+# define GNULIB_defined_wint_t 1
+# endif
+# endif
+# ifndef WEOF
+# define WEOF ((wint_t) -1)
+# endif
+#endif
+
+
+#if !GNULIB_defined_wctype_functions
+
+/* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions.
+ Linux libc5 has <wctype.h> and the functions but they are broken.
+ mingw and MSVC have <wctype.h> and the functions but they take a wchar_t
+ as argument, not an rpl_wint_t.
+ Assume all 11 functions (all isw* except iswblank) are implemented the
+ same way, or not at all. */
+# if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@
+
+# if @GNULIBHEADERS_OVERRIDE_WINT_T@ /* implies @REPLACE_ISWCNTRL@ */
+
+_GL_WCTYPE_INLINE int
+rpl_iswalnum (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? iswalnum ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswalpha (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? iswalpha ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswblank (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? iswblank ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswcntrl (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? iswcntrl ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswdigit (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? wc >= '0' && wc <= '9' : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswgraph (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? iswgraph ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswlower (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? iswlower ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswprint (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? iswprint ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswpunct (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? iswpunct ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswspace (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? iswspace ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswupper (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? iswupper ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswxdigit (wint_t wc)
+{
+ return ((wchar_t) wc == wc
+ ? (wc >= '0' && wc <= '9')
+ || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F')
+ : 0);
+}
+
+_GL_WCTYPE_INLINE wint_t
+rpl_towlower (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? (wchar_t) towlower ((wchar_t) wc) : wc);
+}
+
+_GL_WCTYPE_INLINE wint_t
+rpl_towupper (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? (wchar_t) towupper ((wchar_t) wc) : wc);
+}
+
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef iswalnum
+# undef iswalpha
+# undef iswblank
+# undef iswcntrl
+# undef iswdigit
+# undef iswgraph
+# undef iswlower
+# undef iswprint
+# undef iswpunct
+# undef iswspace
+# undef iswupper
+# undef iswxdigit
+# undef towlower
+# undef towupper
+# define iswalnum rpl_iswalnum
+# define iswalpha rpl_iswalpha
+# define iswblank rpl_iswblank
+# define iswcntrl rpl_iswcntrl
+# define iswdigit rpl_iswdigit
+# define iswgraph rpl_iswgraph
+# define iswlower rpl_iswlower
+# define iswprint rpl_iswprint
+# define iswpunct rpl_iswpunct
+# define iswspace rpl_iswspace
+# define iswupper rpl_iswupper
+# define iswxdigit rpl_iswxdigit
+# define towlower rpl_towlower
+# define towupper rpl_towupper
+# endif
+
+# else
+
+/* IRIX 5.3 has macros but no functions, its isw* macros refer to an
+ undefined variable _ctmp_ and to <ctype.h> macros like _P, and they
+ refer to system functions like _iswctype that are not in the
+ standard C library. Rather than try to get ancient buggy
+ implementations like this to work, just disable them. */
+# undef iswalnum
+# undef iswalpha
+# undef iswblank
+# undef iswcntrl
+# undef iswdigit
+# undef iswgraph
+# undef iswlower
+# undef iswprint
+# undef iswpunct
+# undef iswspace
+# undef iswupper
+# undef iswxdigit
+# undef towlower
+# undef towupper
+
+/* Linux libc5 has <wctype.h> and the functions but they are broken. */
+# if @REPLACE_ISWCNTRL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define iswalnum rpl_iswalnum
+# define iswalpha rpl_iswalpha
+# define iswblank rpl_iswblank
+# define iswcntrl rpl_iswcntrl
+# define iswdigit rpl_iswdigit
+# define iswgraph rpl_iswgraph
+# define iswlower rpl_iswlower
+# define iswprint rpl_iswprint
+# define iswpunct rpl_iswpunct
+# define iswspace rpl_iswspace
+# define iswupper rpl_iswupper
+# define iswxdigit rpl_iswxdigit
+# endif
+# endif
+# if @REPLACE_TOWLOWER@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define towlower rpl_towlower
+# define towupper rpl_towupper
+# endif
+# endif
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWCNTRL@
+rpl_iswalnum
+# else
+iswalnum
+# endif
+ (wint_t wc)
+{
+ return ((wc >= '0' && wc <= '9')
+ || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'));
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWCNTRL@
+rpl_iswalpha
+# else
+iswalpha
+# endif
+ (wint_t wc)
+{
+ return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z';
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWCNTRL@
+rpl_iswblank
+# else
+iswblank
+# endif
+ (wint_t wc)
+{
+ return wc == ' ' || wc == '\t';
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWCNTRL@
+rpl_iswcntrl
+# else
+iswcntrl
+# endif
+ (wint_t wc)
+{
+ return (wc & ~0x1f) == 0 || wc == 0x7f;
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWDIGIT@
+rpl_iswdigit
+# else
+iswdigit
+# endif
+ (wint_t wc)
+{
+ return wc >= '0' && wc <= '9';
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWCNTRL@
+rpl_iswgraph
+# else
+iswgraph
+# endif
+ (wint_t wc)
+{
+ return wc >= '!' && wc <= '~';
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWCNTRL@
+rpl_iswlower
+# else
+iswlower
+# endif
+ (wint_t wc)
+{
+ return wc >= 'a' && wc <= 'z';
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWCNTRL@
+rpl_iswprint
+# else
+iswprint
+# endif
+ (wint_t wc)
+{
+ return wc >= ' ' && wc <= '~';
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWCNTRL@
+rpl_iswpunct
+# else
+iswpunct
+# endif
+ (wint_t wc)
+{
+ return (wc >= '!' && wc <= '~'
+ && !((wc >= '0' && wc <= '9')
+ || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')));
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWCNTRL@
+rpl_iswspace
+# else
+iswspace
+# endif
+ (wint_t wc)
+{
+ return (wc == ' ' || wc == '\t'
+ || wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r');
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWCNTRL@
+rpl_iswupper
+# else
+iswupper
+# endif
+ (wint_t wc)
+{
+ return wc >= 'A' && wc <= 'Z';
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWXDIGIT@
+rpl_iswxdigit
+# else
+iswxdigit
+# endif
+ (wint_t wc)
+{
+ return ((wc >= '0' && wc <= '9')
+ || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F'));
+}
+
+_GL_WCTYPE_INLINE wint_t
+# if @REPLACE_TOWLOWER@
+rpl_towlower
+# else
+towlower
+# endif
+ (wint_t wc)
+{
+ return (wc >= 'A' && wc <= 'Z' ? wc - 'A' + 'a' : wc);
+}
+
+_GL_WCTYPE_INLINE wint_t
+# if @REPLACE_TOWLOWER@
+rpl_towupper
+# else
+towupper
+# endif
+ (wint_t wc)
+{
+ return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc);
+}
+
+# endif
+
+# else
+/* Only some of the functions are missing or broken. */
+
+# if @GNULIB_ISWBLANK@ && (! @HAVE_ISWBLANK@ || @REPLACE_ISWBLANK@)
+/* Only the iswblank function is missing. */
+# if @REPLACE_ISWBLANK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define iswblank rpl_iswblank
+# endif
+_GL_FUNCDECL_RPL (iswblank, int, (wint_t wc));
+# else
+_GL_FUNCDECL_SYS (iswblank, int, (wint_t wc));
+# endif
+# endif
+
+# if @GNULIB_ISWDIGIT@
+# if @REPLACE_ISWDIGIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef iswdigit
+# define iswdigit rpl_iswdigit
+# endif
+_GL_FUNCDECL_RPL (iswdigit, int, (wint_t wc));
+# endif
+# endif
+
+# if @GNULIB_ISWXDIGIT@
+# if @REPLACE_ISWXDIGIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef iswxdigit
+# define iswxdigit rpl_iswxdigit
+# endif
+_GL_FUNCDECL_RPL (iswxdigit, int, (wint_t wc));
+# endif
+# endif
+
+# endif
+
+# if defined __MINGW32__ && !@GNULIBHEADERS_OVERRIDE_WINT_T@
+
+/* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t.
+ The functions towlower and towupper are implemented in the MSVCRT library
+ to take a wchar_t argument and return a wchar_t result. mingw declares
+ these functions to take a wint_t argument and return a wint_t result.
+ This means that:
+ 1. When the user passes an argument outside the range 0x0000..0xFFFF, the
+ function will look only at the lower 16 bits. This is allowed according
+ to POSIX.
+ 2. The return value is returned in the lower 16 bits of the result register.
+ The upper 16 bits are random: whatever happened to be in that part of the
+ result register. We need to fix this by adding a zero-extend from
+ wchar_t to wint_t after the call. */
+
+_GL_WCTYPE_INLINE wint_t
+rpl_towlower (wint_t wc)
+{
+ return (wint_t) (wchar_t) towlower (wc);
+}
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define towlower rpl_towlower
+# endif
+
+_GL_WCTYPE_INLINE wint_t
+rpl_towupper (wint_t wc)
+{
+ return (wint_t) (wchar_t) towupper (wc);
+}
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define towupper rpl_towupper
+# endif
+
+# endif /* __MINGW32__ && !@GNULIBHEADERS_OVERRIDE_WINT_T@ */
+
+# define GNULIB_defined_wctype_functions 1
+#endif
+
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswalnum, int, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (iswalnum, int, (wint_t wc));
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswalpha, int, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (iswalpha, int, (wint_t wc));
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswcntrl, int, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (iswcntrl, int, (wint_t wc));
+#endif
+#if @GNULIB_ISWDIGIT@
+# if @REPLACE_ISWDIGIT@
+_GL_CXXALIAS_RPL (iswdigit, int, (wint_t wc));
+# else
+_GL_CXXALIAS_SYS (iswdigit, int, (wint_t wc));
+# endif
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswgraph, int, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (iswgraph, int, (wint_t wc));
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswlower, int, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (iswlower, int, (wint_t wc));
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswprint, int, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (iswprint, int, (wint_t wc));
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswpunct, int, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (iswpunct, int, (wint_t wc));
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswspace, int, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (iswspace, int, (wint_t wc));
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswupper, int, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (iswupper, int, (wint_t wc));
+#endif
+#if @GNULIB_ISWXDIGIT@
+# if @REPLACE_ISWXDIGIT@
+_GL_CXXALIAS_RPL (iswxdigit, int, (wint_t wc));
+# else
+_GL_CXXALIAS_SYS (iswxdigit, int, (wint_t wc));
+# endif
+#endif
+#if __GLIBC__ >= 2
+_GL_CXXALIASWARN (iswalnum);
+_GL_CXXALIASWARN (iswalpha);
+_GL_CXXALIASWARN (iswcntrl);
+_GL_CXXALIASWARN (iswdigit);
+_GL_CXXALIASWARN (iswgraph);
+_GL_CXXALIASWARN (iswlower);
+_GL_CXXALIASWARN (iswprint);
+_GL_CXXALIASWARN (iswpunct);
+_GL_CXXALIASWARN (iswspace);
+_GL_CXXALIASWARN (iswupper);
+_GL_CXXALIASWARN (iswxdigit);
+#endif
+
+#if @GNULIB_ISWBLANK@
+# if @REPLACE_ISWCNTRL@ || @REPLACE_ISWBLANK@
+_GL_CXXALIAS_RPL (iswblank, int, (wint_t wc));
+# else
+_GL_CXXALIAS_SYS (iswblank, int, (wint_t wc));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (iswblank);
+# endif
+#endif
+
+#if !@HAVE_WCTYPE_T@
+# if !GNULIB_defined_wctype_t
+typedef void * wctype_t;
+# define GNULIB_defined_wctype_t 1
+# endif
+#endif
+
+/* Get a descriptor for a wide character property. */
+#if @GNULIB_WCTYPE@
+# if !@HAVE_WCTYPE_T@
+_GL_FUNCDECL_SYS (wctype, wctype_t, (const char *name));
+# endif
+_GL_CXXALIAS_SYS (wctype, wctype_t, (const char *name));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wctype);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wctype
+# if HAVE_RAW_DECL_WCTYPE
+_GL_WARN_ON_USE (wctype, "wctype is unportable - "
+ "use gnulib module wctype for portability");
+# endif
+#endif
+
+/* Test whether a wide character has a given property.
+ The argument WC must be either a wchar_t value or WEOF.
+ The argument DESC must have been returned by the wctype() function. */
+#if @GNULIB_ISWCTYPE@
+# if @GNULIBHEADERS_OVERRIDE_WINT_T@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef iswctype
+# define iswctype rpl_iswctype
+# endif
+_GL_FUNCDECL_RPL (iswctype, int, (wint_t wc, wctype_t desc));
+_GL_CXXALIAS_RPL (iswctype, int, (wint_t wc, wctype_t desc));
+# else
+# if !@HAVE_WCTYPE_T@
+_GL_FUNCDECL_SYS (iswctype, int, (wint_t wc, wctype_t desc));
+# endif
+_GL_CXXALIAS_SYS (iswctype, int, (wint_t wc, wctype_t desc));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (iswctype);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef iswctype
+# if HAVE_RAW_DECL_ISWCTYPE
+_GL_WARN_ON_USE (iswctype, "iswctype is unportable - "
+ "use gnulib module iswctype for portability");
+# endif
+#endif
+
+#if @REPLACE_TOWLOWER@ || defined __MINGW32__
+_GL_CXXALIAS_RPL (towlower, wint_t, (wint_t wc));
+_GL_CXXALIAS_RPL (towupper, wint_t, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (towlower, wint_t, (wint_t wc));
+_GL_CXXALIAS_SYS (towupper, wint_t, (wint_t wc));
+#endif
+#if __GLIBC__ >= 2
+_GL_CXXALIASWARN (towlower);
+_GL_CXXALIASWARN (towupper);
+#endif
+
+#if !@HAVE_WCTRANS_T@
+# if !GNULIB_defined_wctrans_t
+typedef void * wctrans_t;
+# define GNULIB_defined_wctrans_t 1
+# endif
+#endif
+
+/* Get a descriptor for a wide character case conversion. */
+#if @GNULIB_WCTRANS@
+# if !@HAVE_WCTRANS_T@
+_GL_FUNCDECL_SYS (wctrans, wctrans_t, (const char *name));
+# endif
+_GL_CXXALIAS_SYS (wctrans, wctrans_t, (const char *name));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wctrans);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wctrans
+# if HAVE_RAW_DECL_WCTRANS
+_GL_WARN_ON_USE (wctrans, "wctrans is unportable - "
+ "use gnulib module wctrans for portability");
+# endif
+#endif
+
+/* Perform a given case conversion on a wide character.
+ The argument WC must be either a wchar_t value or WEOF.
+ The argument DESC must have been returned by the wctrans() function. */
+#if @GNULIB_TOWCTRANS@
+# if !@HAVE_WCTRANS_T@
+_GL_FUNCDECL_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc));
+# endif
+_GL_CXXALIAS_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (towctrans);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef towctrans
+# if HAVE_RAW_DECL_TOWCTRANS
+_GL_WARN_ON_USE (towctrans, "towctrans is unportable - "
+ "use gnulib module towctrans for portability");
+# endif
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif /* _@GUARD_PREFIX@_WCTYPE_H */
+#endif /* _@GUARD_PREFIX@_WCTYPE_H */
+#endif
diff --git a/gl/lib/windows-initguard.h b/gl/lib/windows-initguard.h
new file mode 100644
index 0000000..a29d7e9
--- /dev/null
+++ b/gl/lib/windows-initguard.h
@@ -0,0 +1,35 @@
+/* Init guards, somewhat like spinlocks (native Windows implementation).
+ Copyright (C) 2005-2022 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 2.1 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>, 2005.
+ Based on GCC's gthr-win32.h. */
+
+#ifndef _WINDOWS_INITGUARD_H
+#define _WINDOWS_INITGUARD_H
+
+#define WIN32_LEAN_AND_MEAN /* avoid including junk */
+#include <windows.h>
+
+typedef struct
+ {
+ volatile int done;
+ volatile LONG started;
+ }
+ glwthread_initguard_t;
+
+#define GLWTHREAD_INITGUARD_INIT { 0, -1 }
+
+#endif /* _WINDOWS_INITGUARD_H */
diff --git a/gl/lib/windows-mutex.c b/gl/lib/windows-mutex.c
new file mode 100644
index 0000000..28e429c
--- /dev/null
+++ b/gl/lib/windows-mutex.c
@@ -0,0 +1,95 @@
+/* Plain mutexes (native Windows implementation).
+ Copyright (C) 2005-2022 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 2.1 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>, 2005.
+ Based on GCC's gthr-win32.h. */
+
+#include <config.h>
+
+/* Specification. */
+#include "windows-mutex.h"
+
+#include <errno.h>
+
+void
+glwthread_mutex_init (glwthread_mutex_t *mutex)
+{
+ InitializeCriticalSection (&mutex->lock);
+ mutex->guard.done = 1;
+}
+
+int
+glwthread_mutex_lock (glwthread_mutex_t *mutex)
+{
+ if (!mutex->guard.done)
+ {
+ if (InterlockedIncrement (&mutex->guard.started) == 0)
+ /* This thread is the first one to need this mutex. Initialize it. */
+ glwthread_mutex_init (mutex);
+ else
+ {
+ /* Don't let mutex->guard.started grow and wrap around. */
+ InterlockedDecrement (&mutex->guard.started);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this mutex. */
+ while (!mutex->guard.done)
+ Sleep (0);
+ }
+ }
+ EnterCriticalSection (&mutex->lock);
+ return 0;
+}
+
+int
+glwthread_mutex_trylock (glwthread_mutex_t *mutex)
+{
+ if (!mutex->guard.done)
+ {
+ if (InterlockedIncrement (&mutex->guard.started) == 0)
+ /* This thread is the first one to need this mutex. Initialize it. */
+ glwthread_mutex_init (mutex);
+ else
+ {
+ /* Don't let mutex->guard.started grow and wrap around. */
+ InterlockedDecrement (&mutex->guard.started);
+ /* Let another thread finish initializing this mutex, and let it also
+ lock this mutex. */
+ return EBUSY;
+ }
+ }
+ if (!TryEnterCriticalSection (&mutex->lock))
+ return EBUSY;
+ return 0;
+}
+
+int
+glwthread_mutex_unlock (glwthread_mutex_t *mutex)
+{
+ if (!mutex->guard.done)
+ return EINVAL;
+ LeaveCriticalSection (&mutex->lock);
+ return 0;
+}
+
+int
+glwthread_mutex_destroy (glwthread_mutex_t *mutex)
+{
+ if (!mutex->guard.done)
+ return EINVAL;
+ DeleteCriticalSection (&mutex->lock);
+ mutex->guard.done = 0;
+ return 0;
+}
diff --git a/gl/lib/windows-mutex.h b/gl/lib/windows-mutex.h
new file mode 100644
index 0000000..7aedfdf
--- /dev/null
+++ b/gl/lib/windows-mutex.h
@@ -0,0 +1,51 @@
+/* Plain mutexes (native Windows implementation).
+ Copyright (C) 2005-2022 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 2.1 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>, 2005.
+ Based on GCC's gthr-win32.h. */
+
+#ifndef _WINDOWS_MUTEX_H
+#define _WINDOWS_MUTEX_H
+
+#define WIN32_LEAN_AND_MEAN /* avoid including junk */
+#include <windows.h>
+
+#include "windows-initguard.h"
+
+typedef struct
+ {
+ glwthread_initguard_t guard; /* protects the initialization */
+ CRITICAL_SECTION lock;
+ }
+ glwthread_mutex_t;
+
+#define GLWTHREAD_MUTEX_INIT { GLWTHREAD_INITGUARD_INIT }
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void glwthread_mutex_init (glwthread_mutex_t *mutex);
+extern int glwthread_mutex_lock (glwthread_mutex_t *mutex);
+extern int glwthread_mutex_trylock (glwthread_mutex_t *mutex);
+extern int glwthread_mutex_unlock (glwthread_mutex_t *mutex);
+extern int glwthread_mutex_destroy (glwthread_mutex_t *mutex);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WINDOWS_MUTEX_H */
diff --git a/gl/lib/windows-once.c b/gl/lib/windows-once.c
new file mode 100644
index 0000000..deea548
--- /dev/null
+++ b/gl/lib/windows-once.c
@@ -0,0 +1,62 @@
+/* Once-only control (native Windows implementation).
+ Copyright (C) 2005-2022 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 2.1 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>, 2005.
+ Based on GCC's gthr-win32.h. */
+
+#include <config.h>
+
+/* Specification. */
+#include "windows-once.h"
+
+#include <stdlib.h>
+
+void
+glwthread_once (glwthread_once_t *once_control, void (*initfunction) (void))
+{
+ if (once_control->inited <= 0)
+ {
+ if (InterlockedIncrement (&once_control->started) == 0)
+ {
+ /* This thread is the first one to come to this once_control. */
+ InitializeCriticalSection (&once_control->lock);
+ EnterCriticalSection (&once_control->lock);
+ once_control->inited = 0;
+ initfunction ();
+ once_control->inited = 1;
+ LeaveCriticalSection (&once_control->lock);
+ }
+ else
+ {
+ /* Don't let once_control->started grow and wrap around. */
+ InterlockedDecrement (&once_control->started);
+ /* Some other thread has already started the initialization.
+ Yield the CPU while waiting for the other thread to finish
+ initializing and taking the lock. */
+ while (once_control->inited < 0)
+ Sleep (0);
+ if (once_control->inited <= 0)
+ {
+ /* Take the lock. This blocks until the other thread has
+ finished calling the initfunction. */
+ EnterCriticalSection (&once_control->lock);
+ LeaveCriticalSection (&once_control->lock);
+ if (!(once_control->inited > 0))
+ abort ();
+ }
+ }
+ }
+}
diff --git a/gl/lib/windows-once.h b/gl/lib/windows-once.h
new file mode 100644
index 0000000..85534c9
--- /dev/null
+++ b/gl/lib/windows-once.h
@@ -0,0 +1,47 @@
+/* Once-only control (native Windows implementation).
+ Copyright (C) 2005-2022 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 2.1 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>, 2005.
+ Based on GCC's gthr-win32.h. */
+
+#ifndef _WINDOWS_ONCE_H
+#define _WINDOWS_ONCE_H
+
+#define WIN32_LEAN_AND_MEAN /* avoid including junk */
+#include <windows.h>
+
+typedef struct
+ {
+ volatile int inited;
+ volatile LONG started;
+ CRITICAL_SECTION lock;
+ }
+ glwthread_once_t;
+
+#define GLWTHREAD_ONCE_INIT { -1, -1 }
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void glwthread_once (glwthread_once_t *once_control,
+ void (*initfunction) (void));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WINDOWS_ONCE_H */
diff --git a/gl/lib/windows-recmutex.c b/gl/lib/windows-recmutex.c
new file mode 100644
index 0000000..d8087ac
--- /dev/null
+++ b/gl/lib/windows-recmutex.c
@@ -0,0 +1,127 @@
+/* Plain recursive mutexes (native Windows implementation).
+ Copyright (C) 2005-2022 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 2.1 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>, 2005.
+ Based on GCC's gthr-win32.h. */
+
+#include <config.h>
+
+/* Specification. */
+#include "windows-recmutex.h"
+
+#include <errno.h>
+
+void
+glwthread_recmutex_init (glwthread_recmutex_t *mutex)
+{
+ mutex->owner = 0;
+ mutex->depth = 0;
+ InitializeCriticalSection (&mutex->lock);
+ mutex->guard.done = 1;
+}
+
+int
+glwthread_recmutex_lock (glwthread_recmutex_t *mutex)
+{
+ if (!mutex->guard.done)
+ {
+ if (InterlockedIncrement (&mutex->guard.started) == 0)
+ /* This thread is the first one to need this mutex. Initialize it. */
+ glwthread_recmutex_init (mutex);
+ else
+ {
+ /* Don't let mutex->guard.started grow and wrap around. */
+ InterlockedDecrement (&mutex->guard.started);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this mutex. */
+ while (!mutex->guard.done)
+ Sleep (0);
+ }
+ }
+ {
+ DWORD self = GetCurrentThreadId ();
+ if (mutex->owner != self)
+ {
+ EnterCriticalSection (&mutex->lock);
+ mutex->owner = self;
+ }
+ if (++(mutex->depth) == 0) /* wraparound? */
+ {
+ mutex->depth--;
+ return EAGAIN;
+ }
+ }
+ return 0;
+}
+
+int
+glwthread_recmutex_trylock (glwthread_recmutex_t *mutex)
+{
+ if (!mutex->guard.done)
+ {
+ if (InterlockedIncrement (&mutex->guard.started) == 0)
+ /* This thread is the first one to need this mutex. Initialize it. */
+ glwthread_recmutex_init (mutex);
+ else
+ {
+ /* Don't let mutex->guard.started grow and wrap around. */
+ InterlockedDecrement (&mutex->guard.started);
+ /* Let another thread finish initializing this mutex, and let it also
+ lock this mutex. */
+ return EBUSY;
+ }
+ }
+ {
+ DWORD self = GetCurrentThreadId ();
+ if (mutex->owner != self)
+ {
+ if (!TryEnterCriticalSection (&mutex->lock))
+ return EBUSY;
+ mutex->owner = self;
+ }
+ if (++(mutex->depth) == 0) /* wraparound? */
+ {
+ mutex->depth--;
+ return EAGAIN;
+ }
+ }
+ return 0;
+}
+
+int
+glwthread_recmutex_unlock (glwthread_recmutex_t *mutex)
+{
+ if (mutex->owner != GetCurrentThreadId ())
+ return EPERM;
+ if (mutex->depth == 0)
+ return EINVAL;
+ if (--(mutex->depth) == 0)
+ {
+ mutex->owner = 0;
+ LeaveCriticalSection (&mutex->lock);
+ }
+ return 0;
+}
+
+int
+glwthread_recmutex_destroy (glwthread_recmutex_t *mutex)
+{
+ if (mutex->owner != 0)
+ return EBUSY;
+ DeleteCriticalSection (&mutex->lock);
+ mutex->guard.done = 0;
+ return 0;
+}
diff --git a/gl/lib/windows-recmutex.h b/gl/lib/windows-recmutex.h
new file mode 100644
index 0000000..746e75c
--- /dev/null
+++ b/gl/lib/windows-recmutex.h
@@ -0,0 +1,57 @@
+/* Plain recursive mutexes (native Windows implementation).
+ Copyright (C) 2005-2022 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 2.1 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>, 2005.
+ Based on GCC's gthr-win32.h. */
+
+#ifndef _WINDOWS_RECMUTEX_H
+#define _WINDOWS_RECMUTEX_H
+
+#define WIN32_LEAN_AND_MEAN /* avoid including junk */
+#include <windows.h>
+
+#include "windows-initguard.h"
+
+/* The native Windows documentation says that CRITICAL_SECTION already
+ implements a recursive lock. But we need not rely on it: It's easy to
+ implement a recursive lock without this assumption. */
+
+typedef struct
+ {
+ glwthread_initguard_t guard; /* protects the initialization */
+ DWORD owner;
+ unsigned long depth;
+ CRITICAL_SECTION lock;
+ }
+ glwthread_recmutex_t;
+
+#define GLWTHREAD_RECMUTEX_INIT { GLWTHREAD_INITGUARD_INIT, 0, 0 }
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void glwthread_recmutex_init (glwthread_recmutex_t *mutex);
+extern int glwthread_recmutex_lock (glwthread_recmutex_t *mutex);
+extern int glwthread_recmutex_trylock (glwthread_recmutex_t *mutex);
+extern int glwthread_recmutex_unlock (glwthread_recmutex_t *mutex);
+extern int glwthread_recmutex_destroy (glwthread_recmutex_t *mutex);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WINDOWS_RECMUTEX_H */
diff --git a/gl/lib/windows-rwlock.c b/gl/lib/windows-rwlock.c
new file mode 100644
index 0000000..d186e03
--- /dev/null
+++ b/gl/lib/windows-rwlock.c
@@ -0,0 +1,377 @@
+/* Read-write locks (native Windows implementation).
+ Copyright (C) 2005-2022 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 2.1 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>, 2005.
+ Based on GCC's gthr-win32.h. */
+
+#include <config.h>
+
+/* Specification. */
+#include "windows-rwlock.h"
+
+#include <errno.h>
+#include <stdlib.h>
+
+/* Don't assume that UNICODE is not defined. */
+#undef CreateEvent
+#define CreateEvent CreateEventA
+
+/* In this file, the waitqueues are implemented as circular arrays. */
+#define glwthread_waitqueue_t glwthread_carray_waitqueue_t
+
+static void
+glwthread_waitqueue_init (glwthread_waitqueue_t *wq)
+{
+ wq->array = NULL;
+ wq->count = 0;
+ wq->alloc = 0;
+ wq->offset = 0;
+}
+
+/* Enqueues the current thread, represented by an event, in a wait queue.
+ Returns INVALID_HANDLE_VALUE if an allocation failure occurs. */
+static HANDLE
+glwthread_waitqueue_add (glwthread_waitqueue_t *wq)
+{
+ HANDLE event;
+ unsigned int index;
+
+ if (wq->count == wq->alloc)
+ {
+ unsigned int new_alloc = 2 * wq->alloc + 1;
+ HANDLE *new_array =
+ (HANDLE *) realloc (wq->array, new_alloc * sizeof (HANDLE));
+ if (new_array == NULL)
+ /* No more memory. */
+ return INVALID_HANDLE_VALUE;
+ /* Now is a good opportunity to rotate the array so that its contents
+ starts at offset 0. */
+ if (wq->offset > 0)
+ {
+ unsigned int old_count = wq->count;
+ unsigned int old_alloc = wq->alloc;
+ unsigned int old_offset = wq->offset;
+ unsigned int i;
+ if (old_offset + old_count > old_alloc)
+ {
+ unsigned int limit = old_offset + old_count - old_alloc;
+ for (i = 0; i < limit; i++)
+ new_array[old_alloc + i] = new_array[i];
+ }
+ for (i = 0; i < old_count; i++)
+ new_array[i] = new_array[old_offset + i];
+ wq->offset = 0;
+ }
+ wq->array = new_array;
+ wq->alloc = new_alloc;
+ }
+ /* Whether the created event is a manual-reset one or an auto-reset one,
+ does not matter, since we will wait on it only once. */
+ event = CreateEvent (NULL, TRUE, FALSE, NULL);
+ if (event == INVALID_HANDLE_VALUE)
+ /* No way to allocate an event. */
+ return INVALID_HANDLE_VALUE;
+ index = wq->offset + wq->count;
+ if (index >= wq->alloc)
+ index -= wq->alloc;
+ wq->array[index] = event;
+ wq->count++;
+ return event;
+}
+
+/* Notifies the first thread from a wait queue and dequeues it. */
+static void
+glwthread_waitqueue_notify_first (glwthread_waitqueue_t *wq)
+{
+ SetEvent (wq->array[wq->offset + 0]);
+ wq->offset++;
+ wq->count--;
+ if (wq->count == 0 || wq->offset == wq->alloc)
+ wq->offset = 0;
+}
+
+/* Notifies all threads from a wait queue and dequeues them all. */
+static void
+glwthread_waitqueue_notify_all (glwthread_waitqueue_t *wq)
+{
+ unsigned int i;
+
+ for (i = 0; i < wq->count; i++)
+ {
+ unsigned int index = wq->offset + i;
+ if (index >= wq->alloc)
+ index -= wq->alloc;
+ SetEvent (wq->array[index]);
+ }
+ wq->count = 0;
+ wq->offset = 0;
+}
+
+void
+glwthread_rwlock_init (glwthread_rwlock_t *lock)
+{
+ InitializeCriticalSection (&lock->lock);
+ glwthread_waitqueue_init (&lock->waiting_readers);
+ glwthread_waitqueue_init (&lock->waiting_writers);
+ lock->runcount = 0;
+ lock->guard.done = 1;
+}
+
+int
+glwthread_rwlock_rdlock (glwthread_rwlock_t *lock)
+{
+ if (!lock->guard.done)
+ {
+ if (InterlockedIncrement (&lock->guard.started) == 0)
+ /* This thread is the first one to need this lock. Initialize it. */
+ glwthread_rwlock_init (lock);
+ else
+ {
+ /* Don't let lock->guard.started grow and wrap around. */
+ InterlockedDecrement (&lock->guard.started);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this lock. */
+ while (!lock->guard.done)
+ Sleep (0);
+ }
+ }
+ EnterCriticalSection (&lock->lock);
+ /* Test whether only readers are currently running, and whether the runcount
+ field will not overflow, and whether no writer is waiting. The latter
+ condition is because POSIX recommends that "write locks shall take
+ precedence over read locks", to avoid "writer starvation". */
+ if (!(lock->runcount + 1 > 0 && lock->waiting_writers.count == 0))
+ {
+ /* This thread has to wait for a while. Enqueue it among the
+ waiting_readers. */
+ HANDLE event = glwthread_waitqueue_add (&lock->waiting_readers);
+ if (event != INVALID_HANDLE_VALUE)
+ {
+ DWORD result;
+ LeaveCriticalSection (&lock->lock);
+ /* Wait until another thread signals this event. */
+ result = WaitForSingleObject (event, INFINITE);
+ if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
+ abort ();
+ CloseHandle (event);
+ /* The thread which signalled the event already did the bookkeeping:
+ removed us from the waiting_readers, incremented lock->runcount. */
+ if (!(lock->runcount > 0))
+ abort ();
+ return 0;
+ }
+ else
+ {
+ /* Allocation failure. Weird. */
+ do
+ {
+ LeaveCriticalSection (&lock->lock);
+ Sleep (1);
+ EnterCriticalSection (&lock->lock);
+ }
+ while (!(lock->runcount + 1 > 0));
+ }
+ }
+ lock->runcount++;
+ LeaveCriticalSection (&lock->lock);
+ return 0;
+}
+
+int
+glwthread_rwlock_wrlock (glwthread_rwlock_t *lock)
+{
+ if (!lock->guard.done)
+ {
+ if (InterlockedIncrement (&lock->guard.started) == 0)
+ /* This thread is the first one to need this lock. Initialize it. */
+ glwthread_rwlock_init (lock);
+ else
+ {
+ /* Don't let lock->guard.started grow and wrap around. */
+ InterlockedDecrement (&lock->guard.started);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this lock. */
+ while (!lock->guard.done)
+ Sleep (0);
+ }
+ }
+ EnterCriticalSection (&lock->lock);
+ /* Test whether no readers or writers are currently running. */
+ if (!(lock->runcount == 0))
+ {
+ /* This thread has to wait for a while. Enqueue it among the
+ waiting_writers. */
+ HANDLE event = glwthread_waitqueue_add (&lock->waiting_writers);
+ if (event != INVALID_HANDLE_VALUE)
+ {
+ DWORD result;
+ LeaveCriticalSection (&lock->lock);
+ /* Wait until another thread signals this event. */
+ result = WaitForSingleObject (event, INFINITE);
+ if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
+ abort ();
+ CloseHandle (event);
+ /* The thread which signalled the event already did the bookkeeping:
+ removed us from the waiting_writers, set lock->runcount = -1. */
+ if (!(lock->runcount == -1))
+ abort ();
+ return 0;
+ }
+ else
+ {
+ /* Allocation failure. Weird. */
+ do
+ {
+ LeaveCriticalSection (&lock->lock);
+ Sleep (1);
+ EnterCriticalSection (&lock->lock);
+ }
+ while (!(lock->runcount == 0));
+ }
+ }
+ lock->runcount--; /* runcount becomes -1 */
+ LeaveCriticalSection (&lock->lock);
+ return 0;
+}
+
+int
+glwthread_rwlock_tryrdlock (glwthread_rwlock_t *lock)
+{
+ if (!lock->guard.done)
+ {
+ if (InterlockedIncrement (&lock->guard.started) == 0)
+ /* This thread is the first one to need this lock. Initialize it. */
+ glwthread_rwlock_init (lock);
+ else
+ {
+ /* Don't let lock->guard.started grow and wrap around. */
+ InterlockedDecrement (&lock->guard.started);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this lock. */
+ while (!lock->guard.done)
+ Sleep (0);
+ }
+ }
+ /* It's OK to wait for this critical section, because it is never taken for a
+ long time. */
+ EnterCriticalSection (&lock->lock);
+ /* Test whether only readers are currently running, and whether the runcount
+ field will not overflow, and whether no writer is waiting. The latter
+ condition is because POSIX recommends that "write locks shall take
+ precedence over read locks", to avoid "writer starvation". */
+ if (!(lock->runcount + 1 > 0 && lock->waiting_writers.count == 0))
+ {
+ /* This thread would have to wait for a while. Return instead. */
+ LeaveCriticalSection (&lock->lock);
+ return EBUSY;
+ }
+ lock->runcount++;
+ LeaveCriticalSection (&lock->lock);
+ return 0;
+}
+
+int
+glwthread_rwlock_trywrlock (glwthread_rwlock_t *lock)
+{
+ if (!lock->guard.done)
+ {
+ if (InterlockedIncrement (&lock->guard.started) == 0)
+ /* This thread is the first one to need this lock. Initialize it. */
+ glwthread_rwlock_init (lock);
+ else
+ {
+ /* Don't let lock->guard.started grow and wrap around. */
+ InterlockedDecrement (&lock->guard.started);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this lock. */
+ while (!lock->guard.done)
+ Sleep (0);
+ }
+ }
+ /* It's OK to wait for this critical section, because it is never taken for a
+ long time. */
+ EnterCriticalSection (&lock->lock);
+ /* Test whether no readers or writers are currently running. */
+ if (!(lock->runcount == 0))
+ {
+ /* This thread would have to wait for a while. Return instead. */
+ LeaveCriticalSection (&lock->lock);
+ return EBUSY;
+ }
+ lock->runcount--; /* runcount becomes -1 */
+ LeaveCriticalSection (&lock->lock);
+ return 0;
+}
+
+int
+glwthread_rwlock_unlock (glwthread_rwlock_t *lock)
+{
+ if (!lock->guard.done)
+ return EINVAL;
+ EnterCriticalSection (&lock->lock);
+ if (lock->runcount < 0)
+ {
+ /* Drop a writer lock. */
+ if (!(lock->runcount == -1))
+ abort ();
+ lock->runcount = 0;
+ }
+ else
+ {
+ /* Drop a reader lock. */
+ if (!(lock->runcount > 0))
+ {
+ LeaveCriticalSection (&lock->lock);
+ return EPERM;
+ }
+ lock->runcount--;
+ }
+ if (lock->runcount == 0)
+ {
+ /* POSIX recommends that "write locks shall take precedence over read
+ locks", to avoid "writer starvation". */
+ if (lock->waiting_writers.count > 0)
+ {
+ /* Wake up one of the waiting writers. */
+ lock->runcount--;
+ glwthread_waitqueue_notify_first (&lock->waiting_writers);
+ }
+ else
+ {
+ /* Wake up all waiting readers. */
+ lock->runcount += lock->waiting_readers.count;
+ glwthread_waitqueue_notify_all (&lock->waiting_readers);
+ }
+ }
+ LeaveCriticalSection (&lock->lock);
+ return 0;
+}
+
+int
+glwthread_rwlock_destroy (glwthread_rwlock_t *lock)
+{
+ if (!lock->guard.done)
+ return EINVAL;
+ if (lock->runcount != 0)
+ return EBUSY;
+ DeleteCriticalSection (&lock->lock);
+ if (lock->waiting_readers.array != NULL)
+ free (lock->waiting_readers.array);
+ if (lock->waiting_writers.array != NULL)
+ free (lock->waiting_writers.array);
+ lock->guard.done = 0;
+ return 0;
+}
diff --git a/gl/lib/windows-rwlock.h b/gl/lib/windows-rwlock.h
new file mode 100644
index 0000000..65c5ab4
--- /dev/null
+++ b/gl/lib/windows-rwlock.h
@@ -0,0 +1,68 @@
+/* Read-write locks (native Windows implementation).
+ Copyright (C) 2005-2022 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 2.1 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>, 2005.
+ Based on GCC's gthr-win32.h. */
+
+#ifndef _WINDOWS_RWLOCK_H
+#define _WINDOWS_RWLOCK_H
+
+#define WIN32_LEAN_AND_MEAN /* avoid including junk */
+#include <windows.h>
+
+#include "windows-initguard.h"
+
+/* It is impossible to implement read-write locks using plain locks, without
+ introducing an extra thread dedicated to managing read-write locks.
+ Therefore here we need to use the low-level Event type. */
+
+typedef struct
+ {
+ HANDLE *array; /* array of waiting threads, each represented by an event */
+ unsigned int count; /* number of waiting threads */
+ unsigned int alloc; /* length of allocated array */
+ unsigned int offset; /* index of first waiting thread in array */
+ }
+ glwthread_carray_waitqueue_t;
+typedef struct
+ {
+ glwthread_initguard_t guard; /* protects the initialization */
+ CRITICAL_SECTION lock; /* protects the remaining fields */
+ glwthread_carray_waitqueue_t waiting_readers; /* waiting readers */
+ glwthread_carray_waitqueue_t waiting_writers; /* waiting writers */
+ int runcount; /* number of readers running, or -1 when a writer runs */
+ }
+ glwthread_rwlock_t;
+
+#define GLWTHREAD_RWLOCK_INIT { GLWTHREAD_INITGUARD_INIT }
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void glwthread_rwlock_init (glwthread_rwlock_t *lock);
+extern int glwthread_rwlock_rdlock (glwthread_rwlock_t *lock);
+extern int glwthread_rwlock_wrlock (glwthread_rwlock_t *lock);
+extern int glwthread_rwlock_tryrdlock (glwthread_rwlock_t *lock);
+extern int glwthread_rwlock_trywrlock (glwthread_rwlock_t *lock);
+extern int glwthread_rwlock_unlock (glwthread_rwlock_t *lock);
+extern int glwthread_rwlock_destroy (glwthread_rwlock_t *lock);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WINDOWS_RWLOCK_H */
diff --git a/gl/lib/wmemchr-impl.h b/gl/lib/wmemchr-impl.h
new file mode 100644
index 0000000..f92a362
--- /dev/null
+++ b/gl/lib/wmemchr-impl.h
@@ -0,0 +1,27 @@
+/* Search wide character array for a wide character.
+ Copyright (C) 1999, 2011-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 1999.
+
+ 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 2.1 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/>. */
+
+wchar_t *
+wmemchr (const wchar_t *s, wchar_t c, size_t n)
+{
+ for (; n > 0; s++, n--)
+ {
+ if (*s == c)
+ return (wchar_t *) s;
+ }
+ return NULL;
+}
diff --git a/gl/lib/wmemchr.c b/gl/lib/wmemchr.c
new file mode 100644
index 0000000..127e1a5
--- /dev/null
+++ b/gl/lib/wmemchr.c
@@ -0,0 +1,23 @@
+/* Search wide character array for a wide character.
+ Copyright (C) 2011-2022 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include "wmemchr-impl.h"
diff --git a/gl/lib/wmempcpy.c b/gl/lib/wmempcpy.c
new file mode 100644
index 0000000..cdfa913
--- /dev/null
+++ b/gl/lib/wmempcpy.c
@@ -0,0 +1,28 @@
+/* Copy wide character array, return pointer after last written wide character.
+ Copyright (C) 2020-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+/* Copy N wide characters of SRC to DEST.
+ Return pointer to wide characters after the last written wide character. */
+wchar_t *
+wmempcpy (wchar_t *dest, const wchar_t *src, size_t n)
+{
+ return wmemcpy (dest, src, n) + n;
+}
diff --git a/gl/lib/xalloc-die.c b/gl/lib/xalloc-die.c
new file mode 100644
index 0000000..5b947f1
--- /dev/null
+++ b/gl/lib/xalloc-die.c
@@ -0,0 +1,41 @@
+/* Report a memory allocation failure and exit.
+
+ Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2022 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 "xalloc.h"
+
+#include <stdlib.h>
+
+#include "error.h"
+#include "exitfail.h"
+
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
+void
+xalloc_die (void)
+{
+ error (exit_failure, 0, "%s", _("memory exhausted"));
+
+ /* _Noreturn cannot be given to error, since it may return if
+ its first argument is 0. To help compilers understand the
+ xalloc_die does not return, call abort. Also, the abort is a
+ safety feature if exit_failure is 0 (which shouldn't happen). */
+ abort ();
+}
diff --git a/gl/lib/xalloc-oversized.h b/gl/lib/xalloc-oversized.h
new file mode 100644
index 0000000..aefa6fd
--- /dev/null
+++ b/gl/lib/xalloc-oversized.h
@@ -0,0 +1,65 @@
+/* xalloc-oversized.h -- memory allocation size checking
+
+ Copyright (C) 1990-2000, 2003-2004, 2006-2022 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 2.1 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/>. */
+
+#ifndef XALLOC_OVERSIZED_H_
+#define XALLOC_OVERSIZED_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+/* True if N * S does not fit into both ptrdiff_t and size_t.
+ N and S should be nonnegative and free of side effects.
+ This expands to a constant expression if N and S are both constants.
+ By gnulib convention, SIZE_MAX represents overflow in size_t
+ calculations, so the conservative size_t-based dividend to use here
+ is SIZE_MAX - 1. */
+#define __xalloc_oversized(n, s) \
+ ((s) != 0 \
+ && ((size_t) (PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : SIZE_MAX - 1) / (s) \
+ < (n)))
+
+/* Return 1 if and only if an array of N objects, each of size S,
+ cannot exist reliably because its total size in bytes would exceed
+ MIN (PTRDIFF_MAX, SIZE_MAX - 1).
+
+ N and S should be nonnegative and free of side effects.
+
+ Warning: (xalloc_oversized (N, S) ? NULL : malloc (N * S)) can
+ misbehave if N and S are both narrower than ptrdiff_t and size_t,
+ and can be rewritten as (xalloc_oversized (N, S) ? NULL
+ : malloc (N * (size_t) S)).
+
+ This is a macro, not a function, so that it works even if an
+ argument exceeds MAX (PTRDIFF_MAX, SIZE_MAX). */
+#if 7 <= __GNUC__ && !defined __clang__ && PTRDIFF_MAX < SIZE_MAX
+# define xalloc_oversized(n, s) \
+ __builtin_mul_overflow_p (n, s, (ptrdiff_t) 1)
+#elif (5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__ \
+ && PTRDIFF_MAX < SIZE_MAX)
+# define xalloc_oversized(n, s) \
+ (__builtin_constant_p (n) && __builtin_constant_p (s) \
+ ? __xalloc_oversized (n, s) \
+ : ({ ptrdiff_t __xalloc_count; \
+ __builtin_mul_overflow (n, s, &__xalloc_count); }))
+
+/* Other compilers use integer division; this may be slower but is
+ more portable. */
+#else
+# define xalloc_oversized(n, s) __xalloc_oversized (n, s)
+#endif
+
+#endif /* !XALLOC_OVERSIZED_H_ */
diff --git a/gl/lib/xalloc.h b/gl/lib/xalloc.h
new file mode 100644
index 0000000..9f4bf8d
--- /dev/null
+++ b/gl/lib/xalloc.h
@@ -0,0 +1,213 @@
+/* xalloc.h -- malloc with out-of-memory checking
+
+ Copyright (C) 1990-2000, 2003-2004, 2006-2022 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 XALLOC_H_
+#define XALLOC_H_
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdint.h>
+
+#if GNULIB_XALLOC
+# include "idx.h"
+# include "intprops.h"
+#endif
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef XALLOC_INLINE
+# define XALLOC_INLINE _GL_INLINE
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#if GNULIB_XALLOC_DIE
+
+/* This function is always triggered when memory is exhausted.
+ It must be defined by the application, either explicitly
+ or by using gnulib's xalloc-die module. This is the
+ function to call when one wants the program to die because of a
+ memory allocation failure. */
+/*extern*/ _Noreturn void xalloc_die (void);
+
+#endif /* GNULIB_XALLOC_DIE */
+
+#if GNULIB_XALLOC
+
+void *xmalloc (size_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((1)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *ximalloc (idx_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((1)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *xinmalloc (idx_t n, idx_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((1, 2)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *xzalloc (size_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((1)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *xizalloc (idx_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((1)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *xcalloc (size_t n, size_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((1, 2)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *xicalloc (idx_t n, idx_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((1, 2)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *xrealloc (void *p, size_t s)
+ _GL_ATTRIBUTE_ALLOC_SIZE ((2));
+void *xirealloc (void *p, idx_t s)
+ _GL_ATTRIBUTE_ALLOC_SIZE ((2)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *xreallocarray (void *p, size_t n, size_t s)
+ _GL_ATTRIBUTE_ALLOC_SIZE ((2, 3));
+void *xireallocarray (void *p, idx_t n, idx_t s)
+ _GL_ATTRIBUTE_ALLOC_SIZE ((2, 3)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *x2realloc (void *p, size_t *ps) /* superseded by xpalloc */
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *x2nrealloc (void *p, size_t *pn, size_t s) /* superseded by xpalloc */
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *xpalloc (void *pa, idx_t *pn, idx_t n_incr_min, ptrdiff_t n_max, idx_t s)
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *xmemdup (void const *p, size_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((2)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *ximemdup (void const *p, idx_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((2)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+char *ximemdup0 (void const *p, idx_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+char *xstrdup (char const *str)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+
+/* In the following macros, T must be an elementary or structure/union or
+ typedef'ed type, or a pointer to such a type. To apply one of the
+ following macros to a function pointer or array type, you need to typedef
+ it first and use the typedef name. */
+
+/* Allocate an object of type T dynamically, with error checking. */
+/* extern t *XMALLOC (typename t); */
+# define XMALLOC(t) ((t *) xmalloc (sizeof (t)))
+
+/* Allocate memory for N elements of type T, with error checking. */
+/* extern t *XNMALLOC (size_t n, typename t); */
+# define XNMALLOC(n, t) \
+ ((t *) (sizeof (t) == 1 ? xmalloc (n) : xnmalloc (n, sizeof (t))))
+
+/* Allocate an object of type T dynamically, with error checking,
+ and zero it. */
+/* extern t *XZALLOC (typename t); */
+# define XZALLOC(t) ((t *) xzalloc (sizeof (t)))
+
+/* Allocate memory for N elements of type T, with error checking,
+ and zero it. */
+/* extern t *XCALLOC (size_t n, typename t); */
+# define XCALLOC(n, t) \
+ ((t *) (sizeof (t) == 1 ? xzalloc (n) : xcalloc (n, sizeof (t))))
+
+
+/* Allocate an array of N objects, each with S bytes of memory,
+ dynamically, with error checking. S must be nonzero. */
+
+void *xnmalloc (size_t n, size_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((1, 2)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+
+/* FIXME: Deprecate this in favor of xreallocarray? */
+/* Change the size of an allocated block of memory P to an array of N
+ objects each of S bytes, with error checking. S must be nonzero. */
+
+XALLOC_INLINE void *xnrealloc (void *p, size_t n, size_t s)
+ _GL_ATTRIBUTE_ALLOC_SIZE ((2, 3));
+XALLOC_INLINE void *
+xnrealloc (void *p, size_t n, size_t s)
+{
+ return xreallocarray (p, n, s);
+}
+
+/* Return a pointer to a new buffer of N bytes. This is like xmalloc,
+ except it returns char *. */
+
+char *xcharalloc (size_t n)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((1)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+
+#endif /* GNULIB_XALLOC */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#if GNULIB_XALLOC && defined __cplusplus
+
+/* C++ does not allow conversions from void * to other pointer types
+ without a cast. Use templates to work around the problem when
+ possible. */
+
+template <typename T> inline T *
+xrealloc (T *p, size_t s)
+{
+ return (T *) xrealloc ((void *) p, s);
+}
+
+template <typename T> inline T *
+xreallocarray (T *p, size_t n, size_t s)
+{
+ return (T *) xreallocarray ((void *) p, n, s);
+}
+
+/* FIXME: Deprecate this in favor of xreallocarray? */
+template <typename T> inline T *
+xnrealloc (T *p, size_t n, size_t s)
+{
+ return xreallocarray (p, n, s);
+}
+
+template <typename T> inline T *
+x2realloc (T *p, size_t *pn)
+{
+ return (T *) x2realloc ((void *) p, pn);
+}
+
+template <typename T> inline T *
+x2nrealloc (T *p, size_t *pn, size_t s)
+{
+ return (T *) x2nrealloc ((void *) p, pn, s);
+}
+
+template <typename T> inline T *
+xmemdup (T const *p, size_t s)
+{
+ return (T *) xmemdup ((void const *) p, s);
+}
+
+#endif /* GNULIB_XALLOC && C++ */
+
+
+_GL_INLINE_HEADER_END
+
+#endif /* !XALLOC_H_ */
diff --git a/gl/lib/xasprintf.c b/gl/lib/xasprintf.c
new file mode 100644
index 0000000..01ad878
--- /dev/null
+++ b/gl/lib/xasprintf.c
@@ -0,0 +1,34 @@
+/* vasprintf and asprintf with out-of-memory checking.
+ Copyright (C) 1999, 2002-2004, 2006, 2009-2022 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>
+
+/* Specification. */
+#include "xvasprintf.h"
+
+char *
+xasprintf (const char *format, ...)
+{
+ va_list args;
+ char *result;
+
+ va_start (args, format);
+ result = xvasprintf (format, args);
+ va_end (args);
+
+ return result;
+}
diff --git a/gl/lib/xgetcwd.c b/gl/lib/xgetcwd.c
new file mode 100644
index 0000000..619c770
--- /dev/null
+++ b/gl/lib/xgetcwd.c
@@ -0,0 +1,41 @@
+/* xgetcwd.c -- return current directory with unlimited length
+
+ Copyright (C) 2001, 2003-2004, 2006-2007, 2009-2022 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 "xgetcwd.h"
+
+#include <errno.h>
+#include <unistd.h>
+
+#include "xalloc.h"
+
+/* Return the current directory, newly allocated.
+ Upon an out-of-memory error, call xalloc_die.
+ Upon any other type of error, return NULL with errno set. */
+
+char *
+xgetcwd (void)
+{
+ char *cwd = getcwd (NULL, 0);
+ if (! cwd && errno == ENOMEM)
+ xalloc_die ();
+ return cwd;
+}
diff --git a/gl/lib/xgetcwd.h b/gl/lib/xgetcwd.h
new file mode 100644
index 0000000..65f1635
--- /dev/null
+++ b/gl/lib/xgetcwd.h
@@ -0,0 +1,20 @@
+/* prototype for xgetcwd
+ Copyright (C) 1995, 2001, 2003, 2009-2022 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 <stdlib.h>
+
+extern char *xgetcwd (void)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
diff --git a/gl/lib/xmalloc.c b/gl/lib/xmalloc.c
new file mode 100644
index 0000000..993c1ee
--- /dev/null
+++ b/gl/lib/xmalloc.c
@@ -0,0 +1,339 @@
+/* xmalloc.c -- malloc with out of memory checking
+
+ Copyright (C) 1990-2000, 2002-2006, 2008-2022 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 XALLOC_INLINE _GL_EXTERN_INLINE
+
+#include "xalloc.h"
+
+#include "ialloc.h"
+#include "intprops.h"
+#include "minmax.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+static void * _GL_ATTRIBUTE_PURE
+nonnull (void *p)
+{
+ if (!p)
+ xalloc_die ();
+ return p;
+}
+
+/* Allocate S bytes of memory dynamically, with error checking. */
+
+void *
+xmalloc (size_t s)
+{
+ return nonnull (malloc (s));
+}
+
+void *
+ximalloc (idx_t s)
+{
+ return nonnull (imalloc (s));
+}
+
+char *
+xcharalloc (size_t n)
+{
+ return XNMALLOC (n, char);
+}
+
+/* Change the size of an allocated block of memory P to S bytes,
+ with error checking. */
+
+void *
+xrealloc (void *p, size_t s)
+{
+ void *r = realloc (p, s);
+ if (!r && (!p || s))
+ xalloc_die ();
+ return r;
+}
+
+void *
+xirealloc (void *p, idx_t s)
+{
+ return nonnull (irealloc (p, s));
+}
+
+/* Change the size of an allocated block of memory P to an array of N
+ objects each of S bytes, with error checking. */
+
+void *
+xreallocarray (void *p, size_t n, size_t s)
+{
+ void *r = reallocarray (p, n, s);
+ if (!r && (!p || (n && s)))
+ xalloc_die ();
+ return r;
+}
+
+void *
+xireallocarray (void *p, idx_t n, idx_t s)
+{
+ return nonnull (ireallocarray (p, n, s));
+}
+
+/* Allocate an array of N objects, each with S bytes of memory,
+ dynamically, with error checking. S must be nonzero. */
+
+void *
+xnmalloc (size_t n, size_t s)
+{
+ return xreallocarray (NULL, n, s);
+}
+
+void *
+xinmalloc (idx_t n, idx_t s)
+{
+ return xireallocarray (NULL, n, s);
+}
+
+/* If P is null, allocate a block of at least *PS bytes; otherwise,
+ reallocate P so that it contains more than *PS bytes. *PS must be
+ nonzero unless P is null. Set *PS to the new block's size, and
+ return the pointer to the new block. *PS is never set to zero, and
+ the returned pointer is never null. */
+
+void *
+x2realloc (void *p, size_t *ps)
+{
+ return x2nrealloc (p, ps, 1);
+}
+
+/* If P is null, allocate a block of at least *PN such objects;
+ otherwise, reallocate P so that it contains more than *PN objects
+ each of S bytes. S must be nonzero. Set *PN to the new number of
+ objects, and return the pointer to the new block. *PN is never set
+ to zero, and the returned pointer is never null.
+
+ Repeated reallocations are guaranteed to make progress, either by
+ allocating an initial block with a nonzero size, or by allocating a
+ larger block.
+
+ In the following implementation, nonzero sizes are increased by a
+ factor of approximately 1.5 so that repeated reallocations have
+ O(N) overall cost rather than O(N**2) cost, but the
+ specification for this function does not guarantee that rate.
+
+ Here is an example of use:
+
+ int *p = NULL;
+ size_t used = 0;
+ size_t allocated = 0;
+
+ void
+ append_int (int value)
+ {
+ if (used == allocated)
+ p = x2nrealloc (p, &allocated, sizeof *p);
+ p[used++] = value;
+ }
+
+ This causes x2nrealloc to allocate a block of some nonzero size the
+ first time it is called.
+
+ To have finer-grained control over the initial size, set *PN to a
+ nonzero value before calling this function with P == NULL. For
+ example:
+
+ int *p = NULL;
+ size_t used = 0;
+ size_t allocated = 0;
+ size_t allocated1 = 1000;
+
+ void
+ append_int (int value)
+ {
+ if (used == allocated)
+ {
+ p = x2nrealloc (p, &allocated1, sizeof *p);
+ allocated = allocated1;
+ }
+ p[used++] = value;
+ }
+
+ */
+
+void *
+x2nrealloc (void *p, size_t *pn, size_t s)
+{
+ size_t n = *pn;
+
+ if (! p)
+ {
+ if (! n)
+ {
+ /* The approximate size to use for initial small allocation
+ requests, when the invoking code specifies an old size of
+ zero. This is the largest "small" request for the GNU C
+ library malloc. */
+ enum { DEFAULT_MXFAST = 64 * sizeof (size_t) / 4 };
+
+ n = DEFAULT_MXFAST / s;
+ n += !n;
+ }
+ }
+ else
+ {
+ /* Set N = floor (1.5 * N) + 1 to make progress even if N == 0. */
+ if (INT_ADD_WRAPV (n, (n >> 1) + 1, &n))
+ xalloc_die ();
+ }
+
+ p = xreallocarray (p, n, s);
+ *pn = n;
+ return p;
+}
+
+/* Grow PA, which points to an array of *PN items, and return the
+ location of the reallocated array, updating *PN to reflect its
+ new size. The new array will contain at least N_INCR_MIN more
+ items, but will not contain more than N_MAX items total.
+ S is the size of each item, in bytes.
+
+ S and N_INCR_MIN must be positive. *PN must be
+ nonnegative. If N_MAX is -1, it is treated as if it were
+ infinity.
+
+ If PA is null, then allocate a new array instead of reallocating
+ the old one.
+
+ Thus, to grow an array A without saving its old contents, do
+ { free (A); A = xpalloc (NULL, &AITEMS, ...); }. */
+
+void *
+xpalloc (void *pa, idx_t *pn, idx_t n_incr_min, ptrdiff_t n_max, idx_t s)
+{
+ idx_t n0 = *pn;
+
+ /* The approximate size to use for initial small allocation
+ requests. This is the largest "small" request for the GNU C
+ library malloc. */
+ enum { DEFAULT_MXFAST = 64 * sizeof (size_t) / 4 };
+
+ /* If the array is tiny, grow it to about (but no greater than)
+ DEFAULT_MXFAST bytes. Otherwise, grow it by about 50%.
+ Adjust the growth according to three constraints: N_INCR_MIN,
+ N_MAX, and what the C language can represent safely. */
+
+ idx_t n;
+ if (INT_ADD_WRAPV (n0, n0 >> 1, &n))
+ n = IDX_MAX;
+ if (0 <= n_max && n_max < n)
+ n = n_max;
+
+ /* NBYTES is of a type suitable for holding the count of bytes in an object.
+ This is typically idx_t, but it should be size_t on (theoretical?)
+ platforms where SIZE_MAX < IDX_MAX so xpalloc does not pass
+ values greater than SIZE_MAX to xrealloc. */
+#if IDX_MAX <= SIZE_MAX
+ idx_t nbytes;
+#else
+ size_t nbytes;
+#endif
+ idx_t adjusted_nbytes
+ = (INT_MULTIPLY_WRAPV (n, s, &nbytes)
+ ? MIN (IDX_MAX, SIZE_MAX)
+ : nbytes < DEFAULT_MXFAST ? DEFAULT_MXFAST : 0);
+ if (adjusted_nbytes)
+ {
+ n = adjusted_nbytes / s;
+ nbytes = adjusted_nbytes - adjusted_nbytes % s;
+ }
+
+ if (! pa)
+ *pn = 0;
+ if (n - n0 < n_incr_min
+ && (INT_ADD_WRAPV (n0, n_incr_min, &n)
+ || (0 <= n_max && n_max < n)
+ || INT_MULTIPLY_WRAPV (n, s, &nbytes)))
+ xalloc_die ();
+ pa = xrealloc (pa, nbytes);
+ *pn = n;
+ return pa;
+}
+
+/* Allocate S bytes of zeroed memory dynamically, with error checking.
+ There's no need for xnzalloc (N, S), since it would be equivalent
+ to xcalloc (N, S). */
+
+void *
+xzalloc (size_t s)
+{
+ return xcalloc (s, 1);
+}
+
+void *
+xizalloc (idx_t s)
+{
+ return xicalloc (s, 1);
+}
+
+/* Allocate zeroed memory for N elements of S bytes, with error
+ checking. S must be nonzero. */
+
+void *
+xcalloc (size_t n, size_t s)
+{
+ return nonnull (calloc (n, s));
+}
+
+void *
+xicalloc (idx_t n, idx_t s)
+{
+ return nonnull (icalloc (n, s));
+}
+
+/* Clone an object P of size S, with error checking. There's no need
+ for xnmemdup (P, N, S), since xmemdup (P, N * S) works without any
+ need for an arithmetic overflow check. */
+
+void *
+xmemdup (void const *p, size_t s)
+{
+ return memcpy (xmalloc (s), p, s);
+}
+
+void *
+ximemdup (void const *p, idx_t s)
+{
+ return memcpy (ximalloc (s), p, s);
+}
+
+/* Clone an object P of size S, with error checking. Append
+ a terminating NUL byte. */
+
+char *
+ximemdup0 (void const *p, idx_t s)
+{
+ char *result = ximalloc (s + 1);
+ result[s] = 0;
+ return memcpy (result, p, s);
+}
+
+/* Clone STRING. */
+
+char *
+xstrdup (char const *string)
+{
+ return xmemdup (string, strlen (string) + 1);
+}
diff --git a/gl/lib/xsize.c b/gl/lib/xsize.c
new file mode 100644
index 0000000..761e343
--- /dev/null
+++ b/gl/lib/xsize.c
@@ -0,0 +1,21 @@
+/* Checked size_t computations.
+
+ Copyright (C) 2012-2022 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 2.1 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/>. */
+
+#include <config.h>
+
+#define XSIZE_INLINE _GL_EXTERN_INLINE
+#include "xsize.h"
diff --git a/gl/lib/xsize.h b/gl/lib/xsize.h
new file mode 100644
index 0000000..0bfa4c8
--- /dev/null
+++ b/gl/lib/xsize.h
@@ -0,0 +1,108 @@
+/* xsize.h -- Checked size_t computations.
+
+ Copyright (C) 2003, 2008-2022 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 2.1 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/>. */
+
+#ifndef _XSIZE_H
+#define _XSIZE_H
+
+/* Get size_t. */
+#include <stddef.h>
+
+/* Get SIZE_MAX. */
+#include <limits.h>
+#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+
+/* Get ATTRIBUTE_PURE. */
+#include "attribute.h"
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef XSIZE_INLINE
+# define XSIZE_INLINE _GL_INLINE
+#endif
+
+/* The size of memory objects is often computed through expressions of
+ type size_t. Example:
+ void* p = malloc (header_size + n * element_size).
+ These computations can lead to overflow. When this happens, malloc()
+ returns a piece of memory that is way too small, and the program then
+ crashes while attempting to fill the memory.
+ To avoid this, the functions and macros in this file check for overflow.
+ The convention is that SIZE_MAX represents overflow.
+ malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc
+ implementation that uses mmap --, it's recommended to use size_overflow_p()
+ or size_in_bounds_p() before invoking malloc().
+ The example thus becomes:
+ size_t size = xsum (header_size, xtimes (n, element_size));
+ void *p = (size_in_bounds_p (size) ? malloc (size) : NULL);
+*/
+
+/* Convert an arbitrary value >= 0 to type size_t. */
+#define xcast_size_t(N) \
+ ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
+
+/* Sum of two sizes, with overflow check. */
+XSIZE_INLINE size_t ATTRIBUTE_PURE
+xsum (size_t size1, size_t size2)
+{
+ size_t sum = size1 + size2;
+ return (sum >= size1 ? sum : SIZE_MAX);
+}
+
+/* Sum of three sizes, with overflow check. */
+XSIZE_INLINE size_t ATTRIBUTE_PURE
+xsum3 (size_t size1, size_t size2, size_t size3)
+{
+ return xsum (xsum (size1, size2), size3);
+}
+
+/* Sum of four sizes, with overflow check. */
+XSIZE_INLINE size_t ATTRIBUTE_PURE
+xsum4 (size_t size1, size_t size2, size_t size3, size_t size4)
+{
+ return xsum (xsum (xsum (size1, size2), size3), size4);
+}
+
+/* Maximum of two sizes, with overflow check. */
+XSIZE_INLINE size_t ATTRIBUTE_PURE
+xmax (size_t size1, size_t size2)
+{
+ /* No explicit check is needed here, because for any n:
+ max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */
+ return (size1 >= size2 ? size1 : size2);
+}
+
+/* Multiplication of a count with an element size, with overflow check.
+ The count must be >= 0 and the element size must be > 0.
+ This is a macro, not a function, so that it works correctly even
+ when N is of a wider type and N > SIZE_MAX. */
+#define xtimes(N, ELSIZE) \
+ ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)
+
+/* Check for overflow. */
+#define size_overflow_p(SIZE) \
+ ((SIZE) == SIZE_MAX)
+/* Check against overflow. */
+#define size_in_bounds_p(SIZE) \
+ ((SIZE) != SIZE_MAX)
+
+_GL_INLINE_HEADER_END
+
+#endif /* _XSIZE_H */
diff --git a/gl/lib/xstdopen.c b/gl/lib/xstdopen.c
new file mode 100644
index 0000000..844512a
--- /dev/null
+++ b/gl/lib/xstdopen.c
@@ -0,0 +1,35 @@
+/* Ensure that stdin, stdout, stderr are open.
+ Copyright (C) 2019-2022 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>
+
+/* Specification. */
+#include "xstdopen.h"
+
+#include "stdopen.h"
+#include "error.h"
+#include "exitfail.h"
+
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
+void
+xstdopen (void)
+{
+ int stdopen_errno = stdopen ();
+ if (stdopen_errno != 0)
+ error (exit_failure, stdopen_errno, _("standard file descriptors"));
+}
diff --git a/gl/lib/xstdopen.h b/gl/lib/xstdopen.h
new file mode 100644
index 0000000..0c18209
--- /dev/null
+++ b/gl/lib/xstdopen.h
@@ -0,0 +1,28 @@
+/* Ensure that stdin, stdout, stderr are open.
+ Copyright (C) 2019-2022 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
+
+/* Ensures that the file descriptors of stdin, stdout, stderr (0, 1, 2) are
+ open. Exits the program with an error message upon failure; the error
+ message may not appear if stderr is closed. */
+extern void xstdopen (void);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/gl/lib/xstrndup.c b/gl/lib/xstrndup.c
new file mode 100644
index 0000000..a420212
--- /dev/null
+++ b/gl/lib/xstrndup.c
@@ -0,0 +1,36 @@
+/* Duplicate a bounded initial segment of a string, with out-of-memory
+ checking.
+ Copyright (C) 2003, 2006-2007, 2009-2022 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>
+
+/* Specification. */
+#include "xstrndup.h"
+
+#include <string.h>
+#include "xalloc.h"
+
+/* Return a newly allocated copy of at most N bytes of STRING.
+ In other words, return a copy of the initial segment of length N of
+ STRING. */
+char *
+xstrndup (const char *string, size_t n)
+{
+ char *s = strndup (string, n);
+ if (! s)
+ xalloc_die ();
+ return s;
+}
diff --git a/gl/lib/xstrndup.h b/gl/lib/xstrndup.h
new file mode 100644
index 0000000..fdd6573
--- /dev/null
+++ b/gl/lib/xstrndup.h
@@ -0,0 +1,25 @@
+/* Duplicate a bounded initial segment of a string, with out-of-memory
+ checking.
+ Copyright (C) 2003, 2009-2022 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 <stdlib.h>
+
+/* Return a newly allocated copy of at most N bytes of STRING.
+ In other words, return a copy of the initial segment of length N of
+ STRING. */
+extern char *xstrndup (const char *string, size_t n)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
diff --git a/gl/lib/xvasprintf.c b/gl/lib/xvasprintf.c
new file mode 100644
index 0000000..faca818
--- /dev/null
+++ b/gl/lib/xvasprintf.c
@@ -0,0 +1,110 @@
+/* vasprintf and asprintf with out-of-memory checking.
+ Copyright (C) 1999, 2002-2004, 2006-2022 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>
+
+/* Specification. */
+#include "xvasprintf.h"
+
+#include <errno.h>
+#include <limits.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "xalloc.h"
+
+/* Checked size_t computations. */
+#include "xsize.h"
+
+static char *
+xstrcat (size_t argcount, va_list args)
+{
+ char *result;
+ va_list ap;
+ size_t totalsize;
+ size_t i;
+ char *p;
+
+ /* Determine the total size. */
+ totalsize = 0;
+ va_copy (ap, args);
+ for (i = argcount; i > 0; i--)
+ {
+ const char *next = va_arg (ap, const char *);
+ totalsize = xsum (totalsize, strlen (next));
+ }
+ va_end (ap);
+
+ /* Test for overflow in the summing pass above or in (totalsize + 1) below.
+ Also, don't return a string longer than INT_MAX, for consistency with
+ vasprintf(). */
+ if (totalsize == SIZE_MAX || totalsize > INT_MAX)
+ {
+ errno = EOVERFLOW;
+ return NULL;
+ }
+
+ /* Allocate and fill the result string. */
+ result = XNMALLOC (totalsize + 1, char);
+ p = result;
+ for (i = argcount; i > 0; i--)
+ {
+ const char *next = va_arg (args, const char *);
+ size_t len = strlen (next);
+ memcpy (p, next, len);
+ p += len;
+ }
+ *p = '\0';
+
+ return result;
+}
+
+char *
+xvasprintf (const char *format, va_list args)
+{
+ char *result;
+
+ /* Recognize the special case format = "%s...%s". It is a frequently used
+ idiom for string concatenation and needs to be fast. We don't want to
+ have a separate function xstrcat() for this purpose. */
+ {
+ size_t argcount = 0;
+ const char *f;
+
+ for (f = format;;)
+ {
+ if (*f == '\0')
+ /* Recognized the special case of string concatenation. */
+ return xstrcat (argcount, args);
+ if (*f != '%')
+ break;
+ f++;
+ if (*f != 's')
+ break;
+ f++;
+ argcount++;
+ }
+ }
+
+ if (vasprintf (&result, format, args) < 0)
+ {
+ if (errno == ENOMEM)
+ xalloc_die ();
+ return NULL;
+ }
+
+ return result;
+}
diff --git a/gl/lib/xvasprintf.h b/gl/lib/xvasprintf.h
new file mode 100644
index 0000000..e5d76fd
--- /dev/null
+++ b/gl/lib/xvasprintf.h
@@ -0,0 +1,51 @@
+/* vasprintf and asprintf with out-of-memory checking.
+ Copyright (C) 2002-2004, 2006-2022 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 _XVASPRINTF_H
+#define _XVASPRINTF_H
+
+/* Get va_list. */
+#include <stdarg.h>
+
+/* Get _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD. */
+#include <stdio.h>
+
+/* Get 'free'. */
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Write formatted output to a string dynamically allocated with malloc(),
+ and return it. Upon [ENOMEM] memory allocation error, call xalloc_die.
+ On some other error
+ - [EOVERFLOW] resulting string length is > INT_MAX,
+ - [EINVAL] invalid format string,
+ - [EILSEQ] error during conversion between wide and multibyte characters,
+ return NULL. */
+extern char *xasprintf (const char *format, ...)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 1, 2));
+extern char *xvasprintf (const char *format, va_list args)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 1, 0));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _XVASPRINTF_H */
diff --git a/gl/m4/00gnulib.m4 b/gl/m4/00gnulib.m4
new file mode 100644
index 0000000..dea34e8
--- /dev/null
+++ b/gl/m4/00gnulib.m4
@@ -0,0 +1,85 @@
+# 00gnulib.m4 serial 8
+dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This file must be named something that sorts before all other
+dnl gnulib-provided .m4 files. It is needed until the clang fix has
+dnl been included in Autoconf.
+
+# The following definitions arrange to use a compiler option
+# -Werror=implicit-function-declaration in AC_CHECK_DECL, when the
+# compiler is clang. Without it, clang implicitly declares "known"
+# library functions in C mode, but not in C++ mode, which would cause
+# Gnulib to omit a declaration and thus later produce an error in C++
+# mode. As of clang 9.0, these "known" functions are identified through
+# LIBBUILTIN invocations in the LLVM source file
+# llvm/tools/clang/include/clang/Basic/Builtins.def.
+# It's not possible to AC_REQUIRE the extra tests from AC_CHECK_DECL,
+# because AC_CHECK_DECL, like other Autoconf built-ins, is not supposed
+# to AC_REQUIRE anything: some configure.ac files have their first
+# AC_CHECK_DECL executed conditionally. Therefore append the extra tests
+# to AC_PROG_CC.
+AC_DEFUN([gl_COMPILER_CLANG],
+[
+dnl AC_REQUIRE([AC_PROG_CC])
+ AC_CACHE_CHECK([whether the compiler is clang],
+ [gl_cv_compiler_clang],
+ [dnl Use _AC_COMPILE_IFELSE instead of AC_EGREP_CPP, to avoid error
+ dnl "circular dependency of AC_LANG_COMPILER(C)" if AC_PROG_CC has
+ dnl not yet been invoked.
+ _AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #ifdef __clang__
+ barfbarf
+ #endif
+ ]],[[]])
+ ],
+ [gl_cv_compiler_clang=no],
+ [gl_cv_compiler_clang=yes])
+ ])
+])
+AC_DEFUN([gl_COMPILER_PREPARE_CHECK_DECL],
+[
+dnl AC_REQUIRE([AC_PROG_CC])
+dnl AC_REQUIRE([gl_COMPILER_CLANG])
+ AC_CACHE_CHECK([for compiler option needed when checking for declarations],
+ [gl_cv_compiler_check_decl_option],
+ [if test $gl_cv_compiler_clang = yes; then
+ dnl Test whether the compiler supports the option
+ dnl '-Werror=implicit-function-declaration'.
+ save_ac_compile="$ac_compile"
+ ac_compile="$ac_compile -Werror=implicit-function-declaration"
+ dnl Use _AC_COMPILE_IFELSE instead of AC_COMPILE_IFELSE, to avoid a
+ dnl warning "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
+ _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
+ [gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'],
+ [gl_cv_compiler_check_decl_option=none])
+ ac_compile="$save_ac_compile"
+ else
+ gl_cv_compiler_check_decl_option=none
+ fi
+ ])
+ if test "x$gl_cv_compiler_check_decl_option" != xnone; then
+ ac_compile_for_check_decl="$ac_compile $gl_cv_compiler_check_decl_option"
+ else
+ ac_compile_for_check_decl="$ac_compile"
+ fi
+])
+dnl Redefine _AC_CHECK_DECL_BODY so that it references ac_compile_for_check_decl
+dnl instead of ac_compile. If, for whatever reason, the override of AC_PROG_CC
+dnl in zzgnulib.m4 is inactive, use the original ac_compile.
+m4_define([_AC_CHECK_DECL_BODY],
+[ ac_save_ac_compile="$ac_compile"
+ if test -n "$ac_compile_for_check_decl"; then
+ ac_compile="$ac_compile_for_check_decl"
+ fi]
+m4_defn([_AC_CHECK_DECL_BODY])[ ac_compile="$ac_save_ac_compile"
+])
+
+# gl_00GNULIB
+# -----------
+# Witness macro that this file has been included. Needed to force
+# Automake to include this file prior to all other gnulib .m4 files.
+AC_DEFUN([gl_00GNULIB])
diff --git a/gl/m4/__inline.m4 b/gl/m4/__inline.m4
new file mode 100644
index 0000000..fbe2098
--- /dev/null
+++ b/gl/m4/__inline.m4
@@ -0,0 +1,22 @@
+# Test for __inline keyword
+dnl Copyright 2017-2022 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___INLINE],
+[
+ AC_CACHE_CHECK([whether the compiler supports the __inline keyword],
+ [gl_cv_c___inline],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[typedef int foo_t;
+ static __inline foo_t foo (void) { return 0; }]],
+ [[return foo ();]])],
+ [gl_cv_c___inline=yes],
+ [gl_cv_c___inline=no])])
+ if test $gl_cv_c___inline = yes; then
+ AC_DEFINE([HAVE___INLINE], [1],
+ [Define to 1 if the compiler supports the keyword '__inline'.])
+ fi
+])
diff --git a/gl/m4/absolute-header.m4 b/gl/m4/absolute-header.m4
new file mode 100644
index 0000000..67d6507
--- /dev/null
+++ b/gl/m4/absolute-header.m4
@@ -0,0 +1,100 @@
+# absolute-header.m4 serial 17
+dnl Copyright (C) 2006-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Derek Price.
+
+# gl_ABSOLUTE_HEADER(HEADER1 HEADER2 ...)
+# ---------------------------------------
+# Find the absolute name of a header file, testing first if the header exists.
+# If the header were sys/inttypes.h, this macro would define
+# ABSOLUTE_SYS_INTTYPES_H to the '""' quoted absolute name of sys/inttypes.h
+# in config.h
+# (e.g. '#define ABSOLUTE_SYS_INTTYPES_H "///usr/include/sys/inttypes.h"').
+# The three "///" are to pacify Sun C 5.8, which otherwise would say
+# "warning: #include of /usr/include/... may be non-portable".
+# Use '""', not '<>', so that the /// cannot be confused with a C99 comment.
+# Note: This macro assumes that the header file is not empty after
+# preprocessing, i.e. it does not only define preprocessor macros but also
+# provides some type/enum definitions or function/variable declarations.
+AC_DEFUN([gl_ABSOLUTE_HEADER],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_PREPROC_REQUIRE()dnl
+m4_foreach_w([gl_HEADER_NAME], [$1],
+ [AS_VAR_PUSHDEF([gl_absolute_header],
+ [gl_cv_absolute_]m4_defn([gl_HEADER_NAME]))dnl
+ AC_CACHE_CHECK([absolute name of <]m4_defn([gl_HEADER_NAME])[>],
+ [gl_absolute_header],
+ [AS_VAR_PUSHDEF([ac_header_exists],
+ [ac_cv_header_]m4_defn([gl_HEADER_NAME]))dnl
+ AC_CHECK_HEADERS_ONCE(m4_defn([gl_HEADER_NAME]))dnl
+ if test AS_VAR_GET([ac_header_exists]) = yes; then
+ gl_ABSOLUTE_HEADER_ONE(m4_defn([gl_HEADER_NAME]))
+ fi
+ AS_VAR_POPDEF([ac_header_exists])dnl
+ ])dnl
+ AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_defn([gl_HEADER_NAME])),
+ ["AS_VAR_GET([gl_absolute_header])"],
+ [Define this to an absolute name of <]m4_defn([gl_HEADER_NAME])[>.])
+ AS_VAR_POPDEF([gl_absolute_header])dnl
+])dnl
+])# gl_ABSOLUTE_HEADER
+
+# gl_ABSOLUTE_HEADER_ONE(HEADER)
+# ------------------------------
+# Like gl_ABSOLUTE_HEADER, except that:
+# - it assumes that the header exists,
+# - it uses the current CPPFLAGS,
+# - it does not cache the result,
+# - it is silent.
+AC_DEFUN([gl_ABSOLUTE_HEADER_ONE],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <]]m4_dquote([$1])[[>]])])
+ dnl AIX "xlc -E" and "cc -E" omit #line directives for header files
+ dnl that contain only a #include of other header files and no
+ dnl non-comment tokens of their own. This leads to a failure to
+ dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
+ dnl and others. The workaround is to force preservation of comments
+ dnl through option -C. This ensures all necessary #line directives
+ dnl are present. GCC supports option -C as well.
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+changequote(,)
+ case "$host_os" in
+ mingw*)
+ dnl For the sake of native Windows compilers (excluding gcc),
+ dnl treat backslash as a directory separator, like /.
+ dnl Actually, these compilers use a double-backslash as
+ dnl directory separator, inside the
+ dnl # line "filename"
+ dnl directives.
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ dnl A sed expression that turns a string into a basic regular
+ dnl expression, for use within "/.../".
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo '$1' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+changequote([,])
+ dnl eval is necessary to expand gl_absname_cpp.
+ dnl Ultrix and Pyramid sh refuse to redirect output of eval,
+ dnl so use subshell.
+ AS_VAR_SET([gl_cv_absolute_]AS_TR_SH([[$1]]),
+[`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+ sed -n "$gl_absolute_header_sed"`])
+])
diff --git a/gl/m4/alloca.m4 b/gl/m4/alloca.m4
new file mode 100644
index 0000000..dc6f47e
--- /dev/null
+++ b/gl/m4/alloca.m4
@@ -0,0 +1,106 @@
+# alloca.m4 serial 21
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2022 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_ALLOCA],
+[
+ AC_REQUIRE([AC_FUNC_ALLOCA])
+ if test $ac_cv_func_alloca_works = no; then
+ gl_PREREQ_ALLOCA
+ fi
+
+ # Define an additional variable used in the Makefile substitution.
+ if test $ac_cv_working_alloca_h = yes; then
+ AC_CACHE_CHECK([for alloca as a compiler built-in], [gl_cv_rpl_alloca], [
+ AC_EGREP_CPP([Need own alloca], [
+#if defined __GNUC__ || defined _AIX || defined _MSC_VER
+ Need own alloca
+#endif
+ ], [gl_cv_rpl_alloca=yes], [gl_cv_rpl_alloca=no])
+ ])
+ if test $gl_cv_rpl_alloca = yes; then
+ dnl OK, alloca can be implemented through a compiler built-in.
+ AC_DEFINE([HAVE_ALLOCA], [1],
+ [Define to 1 if you have 'alloca' after including <alloca.h>,
+ a header that may be supplied by this distribution.])
+ GL_GENERATE_ALLOCA_H=true
+ else
+ dnl alloca exists as a library function, i.e. it is slow and probably
+ dnl a memory leak. Don't define HAVE_ALLOCA in this case.
+ GL_GENERATE_ALLOCA_H=false
+ fi
+ else
+ GL_GENERATE_ALLOCA_H=true
+ fi
+
+ if test $ac_cv_working_alloca_h = yes; then
+ HAVE_ALLOCA_H=1
+ else
+ HAVE_ALLOCA_H=0
+ fi
+ AC_SUBST([HAVE_ALLOCA_H])
+])
+
+# Prerequisites of lib/alloca.c.
+# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
+AC_DEFUN([gl_PREREQ_ALLOCA], [:])
+
+m4_version_prereq([2.70], [], [
+
+# This works around a bug in autoconf <= 2.68 and has simplifications
+# from 2.70. See:
+# https://lists.gnu.org/r/bug-gnulib/2011-06/msg00277.html
+# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497
+# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=15edf7fd8094fd14a89d9891dd72a9624762597a
+
+# _AC_LIBOBJ_ALLOCA
+# -----------------
+# Set up the LIBOBJ replacement of 'alloca'. Well, not exactly
+# AC_LIBOBJ since we actually set the output variable 'ALLOCA'.
+# Nevertheless, for Automake, AC_LIBSOURCES it.
+m4_define([_AC_LIBOBJ_ALLOCA],
+[# The SVR3 libPW and SVR4 libucb both contain incompatible functions
+# that cause trouble. Some versions do not even contain alloca or
+# contain a buggy version. If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+AC_LIBSOURCES(alloca.c)
+AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext])dnl
+AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using 'alloca.c'.])
+
+AC_CACHE_CHECK([stack direction for C alloca],
+ [ac_cv_c_stack_direction],
+[AC_RUN_IFELSE([AC_LANG_SOURCE(
+[AC_INCLUDES_DEFAULT
+int
+find_stack_direction (int *addr, int depth)
+{
+ int dir, dummy = 0;
+ if (! addr)
+ addr = &dummy;
+ *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
+ dir = depth ? find_stack_direction (addr, depth - 1) : 0;
+ return dir + dummy;
+}
+
+int
+main (int argc, char **argv)
+{
+ return find_stack_direction (0, argc + !argv + 20) < 0;
+}])],
+ [ac_cv_c_stack_direction=1],
+ [ac_cv_c_stack_direction=-1],
+ [ac_cv_c_stack_direction=0])])
+AH_VERBATIM([STACK_DIRECTION],
+[/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at runtime.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION])dnl
+AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
+])# _AC_LIBOBJ_ALLOCA
+])
diff --git a/gl/m4/argp.m4 b/gl/m4/argp.m4
new file mode 100644
index 0000000..a6f7b8e
--- /dev/null
+++ b/gl/m4/argp.m4
@@ -0,0 +1,70 @@
+# argp.m4 serial 16
+dnl Copyright (C) 2003-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_ARGP],
+[
+ AC_REQUIRE([AC_C_INLINE])
+ AC_REQUIRE([AC_C_RESTRICT])
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_DECLS([program_invocation_name],
+ [],
+ [AC_DEFINE([GNULIB_PROGRAM_INVOCATION_NAME], [1],
+ [Define to 1 to add extern declaration of program_invocation_name to argp.h])],
+ [[#include <errno.h>]])
+ AC_CHECK_DECLS([program_invocation_short_name],
+ [],
+ [AC_DEFINE([GNULIB_PROGRAM_INVOCATION_SHORT_NAME], [1],
+ [Define to 1 to add extern declaration of program_invocation_short_name to argp.h])],
+ [[#include <errno.h>]])
+
+ # Check if program_invocation_name and program_invocation_short_name
+ # are defined elsewhere. It is improbable that only one of them will
+ # be defined and other not, I prefer to stay on the safe side and to
+ # test each one separately.
+ AC_MSG_CHECKING([whether program_invocation_name is defined])
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern char *program_invocation_name;]],
+ [[program_invocation_name = "test";]])],
+ [AC_DEFINE([HAVE_PROGRAM_INVOCATION_NAME], [1],
+ [Define if program_invocation_name is defined])
+ AC_MSG_RESULT([yes])
+ ],
+ [AC_MSG_RESULT([no])])
+
+ AC_MSG_CHECKING([whether program_invocation_short_name is defined])
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern char *program_invocation_short_name;]],
+ [[program_invocation_short_name = "test";]])],
+ [AC_DEFINE([HAVE_PROGRAM_INVOCATION_SHORT_NAME], [1],
+ [Define if program_invocation_short_name is defined])
+ AC_MSG_RESULT([yes])
+ ],
+ [AC_MSG_RESULT([no])])
+
+ AC_CHECK_DECLS_ONCE([clearerr_unlocked])
+ AC_CHECK_DECLS_ONCE([feof_unlocked])
+ AC_CHECK_DECLS_ONCE([ferror_unlocked])
+ AC_CHECK_DECLS_ONCE([fflush_unlocked])
+ AC_CHECK_DECLS_ONCE([fgets_unlocked])
+ AC_CHECK_DECLS_ONCE([fputc_unlocked])
+ AC_CHECK_DECLS_ONCE([fputs_unlocked])
+ AC_CHECK_DECLS_ONCE([fread_unlocked])
+ AC_CHECK_DECLS_ONCE([fwrite_unlocked])
+ AC_CHECK_DECLS_ONCE([getc_unlocked])
+ AC_CHECK_DECLS_ONCE([getchar_unlocked])
+ AC_CHECK_DECLS_ONCE([putc_unlocked])
+ AC_CHECK_DECLS_ONCE([putchar_unlocked])
+ AC_CHECK_FUNCS_ONCE([flockfile funlockfile])
+ AC_CHECK_HEADERS_ONCE([features.h linewrap.h])
+ AC_REQUIRE([AC_FUNC_STRERROR_R])
+])
+
+dnl argp-parse.c depends on GNU getopt internals, therefore use GNU getopt
+dnl always.
+AC_DEFUN([gl_REPLACE_GETOPT_ALWAYS], [])
diff --git a/gl/m4/asm-underscore.m4 b/gl/m4/asm-underscore.m4
new file mode 100644
index 0000000..950aa8d
--- /dev/null
+++ b/gl/m4/asm-underscore.m4
@@ -0,0 +1,83 @@
+# asm-underscore.m4 serial 5
+dnl Copyright (C) 2010-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible. Based on as-underscore.m4 in GNU clisp.
+
+# gl_ASM_SYMBOL_PREFIX
+# Tests for the prefix of C symbols at the assembly language level and the
+# linker level. This prefix is either an underscore or empty. Defines the
+# C macro USER_LABEL_PREFIX to this prefix, and sets ASM_SYMBOL_PREFIX to
+# a stringified variant of this prefix.
+
+AC_DEFUN([gl_ASM_SYMBOL_PREFIX],
+[
+ AC_REQUIRE([AC_PROG_EGREP])
+ dnl We don't use GCC's __USER_LABEL_PREFIX__ here, because
+ dnl 1. It works only for GCC.
+ dnl 2. It is incorrectly defined on some platforms, in some GCC versions.
+ AC_REQUIRE([gl_C_ASM])
+ AC_CACHE_CHECK(
+ [whether C symbols are prefixed with underscore at the linker level],
+ [gl_cv_prog_as_underscore],
+ [cat > conftest.c <<EOF
+#ifdef __cplusplus
+extern "C" int foo (void);
+#endif
+int foo(void) { return 0; }
+EOF
+ # Look for the assembly language name in the .s file.
+ AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1
+ if LC_ALL=C $EGREP '(^|[[^a-zA-Z0-9_]])_foo([[^a-zA-Z0-9_]]|$)' conftest.$gl_asmext >/dev/null; then
+ gl_cv_prog_as_underscore=yes
+ else
+ gl_cv_prog_as_underscore=no
+ fi
+ rm -f conftest*
+ ])
+ if test $gl_cv_prog_as_underscore = yes; then
+ USER_LABEL_PREFIX=_
+ else
+ USER_LABEL_PREFIX=
+ fi
+ AC_DEFINE_UNQUOTED([USER_LABEL_PREFIX], [$USER_LABEL_PREFIX],
+ [Define to the prefix of C symbols at the assembler and linker level,
+ either an underscore or empty.])
+ ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"'
+ AC_SUBST([ASM_SYMBOL_PREFIX])
+])
+
+# gl_C_ASM
+# Determines how to produce an assembly language file from C source code.
+# Sets the variables:
+# gl_asmext - the extension of assembly language output,
+# gl_c_asm_opt - the C compiler option that produces assembly language output.
+
+AC_DEFUN([gl_C_ASM],
+[
+ AC_EGREP_CPP([MicrosoftCompiler],
+ [
+#ifdef _MSC_VER
+MicrosoftCompiler
+#endif
+ ],
+ [dnl Microsoft's 'cl' and 'clang-cl' produce an .asm file, whereas 'clang'
+ dnl produces a .s file. Need to distinguish 'clang' and 'clang-cl'.
+ rm -f conftest*
+ echo 'int dummy;' > conftest.c
+ AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c) >/dev/null 2>&1
+ if test -f conftest.o; then
+ gl_asmext='s'
+ gl_c_asm_opt='-S'
+ else
+ gl_asmext='asm'
+ gl_c_asm_opt='-c -Fa'
+ fi
+ rm -f conftest*
+ ],
+ [gl_asmext='s'
+ gl_c_asm_opt='-S'
+ ])
+])
diff --git a/gl/m4/btowc.m4 b/gl/m4/btowc.m4
new file mode 100644
index 0000000..45a61f5
--- /dev/null
+++ b/gl/m4/btowc.m4
@@ -0,0 +1,105 @@
+# btowc.m4 serial 12
+dnl Copyright (C) 2008-2022 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_BTOWC],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+
+ dnl Check whether <wchar.h> is usable at all, first. Otherwise the test
+ dnl program below may lead to an endless loop. See
+ dnl <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>.
+ AC_REQUIRE([gl_WCHAR_H_INLINE_OK])
+
+ AC_CHECK_FUNCS_ONCE([btowc])
+ if test $ac_cv_func_btowc = no; then
+ HAVE_BTOWC=0
+ else
+
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gt_LOCALE_FR])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ dnl Cygwin 1.7.2 btowc('\0') is WEOF, not 0.
+ AC_CACHE_CHECK([whether btowc(0) is correct],
+ [gl_cv_func_btowc_nul],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <wchar.h>
+int main ()
+{
+ if (btowc ('\0') != 0)
+ return 1;
+ return 0;
+}]])],
+ [gl_cv_func_btowc_nul=yes],
+ [gl_cv_func_btowc_nul=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on Cygwin.
+ cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_btowc_nul="guessing yes" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_btowc_nul="guessing yes" ;;
+ esac
+changequote([,])dnl
+ ])
+ ])
+
+ dnl IRIX 6.5 btowc(EOF) is 0xFF, not WEOF.
+ AC_CACHE_CHECK([whether btowc(EOF) is correct],
+ [gl_cv_func_btowc_eof],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on IRIX.
+ irix*) gl_cv_func_btowc_eof="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_btowc_eof="guessing yes" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_btowc_eof="guessing yes" ;;
+ esac
+changequote([,])dnl
+ if test $LOCALE_FR != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <stdio.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+ {
+ if (btowc (EOF) != WEOF)
+ return 1;
+ }
+ return 0;
+}]])],
+ [gl_cv_func_btowc_eof=yes],
+ [gl_cv_func_btowc_eof=no],
+ [:])
+ fi
+ ])
+
+ case "$gl_cv_func_btowc_nul" in
+ *yes) ;;
+ *) REPLACE_BTOWC=1 ;;
+ esac
+ case "$gl_cv_func_btowc_eof" in
+ *yes) ;;
+ *) REPLACE_BTOWC=1 ;;
+ esac
+ fi
+])
+
+# Prerequisites of lib/btowc.c.
+AC_DEFUN([gl_PREREQ_BTOWC], [
+ :
+])
diff --git a/gl/m4/builtin-expect.m4 b/gl/m4/builtin-expect.m4
new file mode 100644
index 0000000..b1fb12a
--- /dev/null
+++ b/gl/m4/builtin-expect.m4
@@ -0,0 +1,49 @@
+dnl Check for __builtin_expect.
+
+dnl Copyright 2016-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Paul Eggert.
+
+AC_DEFUN([gl___BUILTIN_EXPECT],
+[
+ AC_CACHE_CHECK([for __builtin_expect],
+ [gl_cv___builtin_expect],
+ [AC_LINK_IFELSE(
+ [AC_LANG_SOURCE([[
+ int
+ main (int argc, char **argv)
+ {
+ argc = __builtin_expect (argc, 100);
+ return argv[argc != 100][0];
+ }]])],
+ [gl_cv___builtin_expect=yes],
+ [AC_LINK_IFELSE(
+ [AC_LANG_SOURCE([[
+ #include <builtins.h>
+ int
+ main (int argc, char **argv)
+ {
+ argc = __builtin_expect (argc, 100);
+ return argv[argc != 100][0];
+ }]])],
+ [gl_cv___builtin_expect="in <builtins.h>"],
+ [gl_cv___builtin_expect=no])])])
+ if test "$gl_cv___builtin_expect" = yes; then
+ AC_DEFINE([HAVE___BUILTIN_EXPECT], [1])
+ elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then
+ AC_DEFINE([HAVE___BUILTIN_EXPECT], [2])
+ fi
+ AH_VERBATIM([HAVE___BUILTIN_EXPECT],
+ [/* Define to 1 if the compiler supports __builtin_expect,
+ and to 2 if <builtins.h> does. */
+#undef HAVE___BUILTIN_EXPECT
+#ifndef HAVE___BUILTIN_EXPECT
+# define __builtin_expect(e, c) (e)
+#elif HAVE___BUILTIN_EXPECT == 2
+# include <builtins.h>
+#endif
+ ])
+])
diff --git a/gl/m4/calloc.m4 b/gl/m4/calloc.m4
new file mode 100644
index 0000000..c01520e
--- /dev/null
+++ b/gl/m4/calloc.m4
@@ -0,0 +1,83 @@
+# calloc.m4 serial 29
+
+# Copyright (C) 2004-2022 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 Jim Meyering.
+
+# Determine whether calloc (N, S) returns non-NULL when N*S is zero,
+# and returns NULL when N*S overflows.
+# If so, define HAVE_CALLOC. Otherwise, define calloc to rpl_calloc
+# and arrange to use a calloc wrapper function that does work in that case.
+
+# _AC_FUNC_CALLOC_IF([IF-WORKS], [IF-NOT])
+# -------------------------------------
+# If calloc is compatible with GNU calloc, run IF-WORKS, otherwise, IF-NOT.
+AC_DEFUN([_AC_FUNC_CALLOC_IF],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether calloc (0, n) and calloc (n, 0) return nonnull],
+ [ac_cv_func_calloc_0_nonnull],
+ [if test $cross_compiling != yes; then
+ ac_cv_func_calloc_0_nonnull=yes
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [AC_INCLUDES_DEFAULT],
+ [[int result = 0;
+ char * volatile p = calloc (0, 0);
+ if (!p)
+ result |= 1;
+ free (p);
+ return result;
+ ]])],
+ [],
+ [ac_cv_func_calloc_0_nonnull=no])
+ else
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) ac_cv_func_calloc_0_nonnull="$gl_cross_guess_normal" ;;
+ esac
+ fi
+ ])
+ AS_CASE([$ac_cv_func_calloc_0_nonnull], [*yes], [$1], [$2])
+])
+
+
+# gl_FUNC_CALLOC_GNU
+# ------------------
+# Replace calloc if it is not compatible with GNU libc.
+AC_DEFUN([gl_FUNC_CALLOC_GNU],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_CALLOC_POSIX])
+ REPLACE_CALLOC_FOR_CALLOC_GNU="$REPLACE_CALLOC_FOR_CALLOC_POSIX"
+ if test $REPLACE_CALLOC_FOR_CALLOC_GNU = 0; then
+ _AC_FUNC_CALLOC_IF([], [REPLACE_CALLOC_FOR_CALLOC_GNU=1])
+ fi
+])# gl_FUNC_CALLOC_GNU
+
+# gl_FUNC_CALLOC_POSIX
+# --------------------
+# Test whether 'calloc' is POSIX compliant (sets errno to ENOMEM when it
+# fails, and doesn't mess up with ptrdiff_t or size_t overflow),
+# and replace calloc if it is not.
+AC_DEFUN([gl_FUNC_CALLOC_POSIX],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_MALLOC_POSIX])
+ if test $REPLACE_MALLOC_FOR_MALLOC_POSIX = 1; then
+ REPLACE_CALLOC_FOR_CALLOC_POSIX=1
+ fi
+ dnl Although in theory we should also test for size_t overflow,
+ dnl in practice testing for ptrdiff_t overflow suffices
+ dnl since PTRDIFF_MAX <= SIZE_MAX on all known Gnulib porting targets.
+ dnl A separate size_t test would slow down 'configure'.
+])
diff --git a/gl/m4/canonicalize.m4 b/gl/m4/canonicalize.m4
new file mode 100644
index 0000000..b55d5c0
--- /dev/null
+++ b/gl/m4/canonicalize.m4
@@ -0,0 +1,183 @@
+# canonicalize.m4 serial 37
+
+dnl Copyright (C) 2003-2007, 2009-2022 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.
+
+# Provides canonicalize_file_name and canonicalize_filename_mode, but does
+# not provide or fix realpath.
+AC_DEFUN([gl_FUNC_CANONICALIZE_FILENAME_MODE],
+[
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+ AC_CHECK_FUNCS_ONCE([canonicalize_file_name faccessat])
+ AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
+ AC_REQUIRE([gl_FUNC_REALPATH_WORKS])
+ if test $ac_cv_func_canonicalize_file_name = no; then
+ HAVE_CANONICALIZE_FILE_NAME=0
+ else
+ case "$gl_cv_func_realpath_works" in
+ *yes) ;;
+ *) REPLACE_CANONICALIZE_FILE_NAME=1 ;;
+ esac
+ fi
+])
+
+# Provides canonicalize_file_name and realpath.
+AC_DEFUN([gl_CANONICALIZE_LGPL],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([gl_CANONICALIZE_LGPL_SEPARATE])
+ if test $ac_cv_func_canonicalize_file_name = no; then
+ HAVE_CANONICALIZE_FILE_NAME=0
+ if test $ac_cv_func_realpath = no; then
+ HAVE_REALPATH=0
+ else
+ case "$gl_cv_func_realpath_works" in
+ *yes) ;;
+ *) REPLACE_REALPATH=1 ;;
+ esac
+ fi
+ else
+ case "$gl_cv_func_realpath_works" in
+ *yes)
+ ;;
+ *)
+ REPLACE_CANONICALIZE_FILE_NAME=1
+ REPLACE_REALPATH=1
+ ;;
+ esac
+ fi
+])
+
+# Like gl_CANONICALIZE_LGPL, except prepare for separate compilation
+# (no REPLACE_CANONICALIZE_FILE_NAME, no REPLACE_REALPATH, no AC_LIBOBJ).
+AC_DEFUN([gl_CANONICALIZE_LGPL_SEPARATE],
+[
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+ AC_CHECK_FUNCS_ONCE([canonicalize_file_name faccessat])
+
+ dnl On native Windows, we use _getcwd(), regardless whether getcwd() is
+ dnl available through the linker option '-loldnames'.
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ mingw*) ;;
+ *) AC_CHECK_FUNCS([getcwd]) ;;
+ esac
+
+ AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
+ AC_REQUIRE([gl_FUNC_REALPATH_WORKS])
+ AC_CHECK_HEADERS_ONCE([sys/param.h])
+])
+
+# Check whether realpath works. Assume that if a platform has both
+# realpath and canonicalize_file_name, but the former is broken, then
+# so is the latter.
+AC_DEFUN([gl_FUNC_REALPATH_WORKS],
+[
+ AC_CHECK_FUNCS_ONCE([realpath lstat])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether realpath works], [gl_cv_func_realpath_works], [
+ rm -rf conftest.a conftest.d
+ touch conftest.a
+ # Assume that if we have lstat, we can also check symlinks.
+ if test $ac_cv_func_lstat = yes; then
+ ln -s conftest.a conftest.l
+ fi
+ mkdir conftest.d
+ AC_RUN_IFELSE([
+ AC_LANG_PROGRAM([[
+ ]GL_NOCRASH[
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <string.h>
+ ]], [[
+ int result = 0;
+ /* This test fails on Solaris 10. */
+ {
+ char *name = realpath ("conftest.a", NULL);
+ if (!(name && *name == '/'))
+ result |= 1;
+ free (name);
+ }
+ /* This test fails on older versions of Cygwin. */
+ {
+ char *name = realpath ("conftest.b/../conftest.a", NULL);
+ if (name != NULL)
+ result |= 2;
+ free (name);
+ }
+ /* This test fails on Cygwin 2.9. */
+ #if HAVE_LSTAT
+ {
+ char *name = realpath ("conftest.l/../conftest.a", NULL);
+ if (name != NULL || errno != ENOTDIR)
+ result |= 4;
+ free (name);
+ }
+ #endif
+ /* This test fails on Mac OS X 10.13, OpenBSD 6.0. */
+ {
+ char *name = realpath ("conftest.a/", NULL);
+ if (name != NULL)
+ result |= 8;
+ free (name);
+ }
+ /* This test fails on AIX 7, Solaris 10. */
+ {
+ char *name1 = realpath (".", NULL);
+ char *name2 = realpath ("conftest.d//./..", NULL);
+ if (! name1 || ! name2 || strcmp (name1, name2))
+ result |= 16;
+ free (name1);
+ free (name2);
+ }
+ #ifdef __linux__
+ /* On Linux, // is the same as /. See also double-slash-root.m4.
+ realpath() should respect this.
+ This test fails on musl libc 1.2.2. */
+ {
+ char *name = realpath ("//", NULL);
+ if (! name || strcmp (name, "/"))
+ result |= 32;
+ free (name);
+ }
+ #endif
+ return result;
+ ]])
+ ],
+ [gl_cv_func_realpath_works=yes],
+ [case $? in
+ 32) gl_cv_func_realpath_works=nearly ;;
+ *) gl_cv_func_realpath_works=no ;;
+ esac
+ ],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;;
+ # Guess 'nearly' on musl systems.
+ *-musl*) gl_cv_func_realpath_works="guessing nearly" ;;
+ # Guess no on Cygwin.
+ cygwin*) gl_cv_func_realpath_works="guessing no" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_realpath_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_realpath_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -rf conftest.a conftest.l conftest.d
+ ])
+ case "$gl_cv_func_realpath_works" in
+ *yes)
+ AC_DEFINE([FUNC_REALPATH_WORKS], [1],
+ [Define to 1 if realpath() can malloc memory, always gives an absolute path, and handles leading slashes and a trailing slash correctly.])
+ ;;
+ *nearly)
+ AC_DEFINE([FUNC_REALPATH_NEARLY_WORKS], [1],
+ [Define to 1 if realpath() can malloc memory, always gives an absolute path, and handles a trailing slash correctly.])
+ ;;
+ esac
+])
diff --git a/gl/m4/chdir-long.m4 b/gl/m4/chdir-long.m4
new file mode 100644
index 0000000..4cadc3f
--- /dev/null
+++ b/gl/m4/chdir-long.m4
@@ -0,0 +1,30 @@
+#serial 17
+
+# Use Gnulib's robust chdir function.
+# It can handle arbitrarily long directory names, which means
+# that when it is given the name of an existing directory, it
+# never fails with ENAMETOOLONG.
+# Arrange to compile chdir-long.c only on systems that define PATH_MAX.
+
+dnl Copyright (C) 2004-2007, 2009-2022 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.
+
+# Written by Jim Meyering.
+
+AC_DEFUN([gl_FUNC_CHDIR_LONG],
+[
+ AC_REQUIRE([gl_PATHMAX_SNIPPET_PREREQ])
+ AC_CACHE_CHECK([whether this system supports file names of any length],
+ [gl_cv_have_unlimited_file_name_length],
+ [AC_EGREP_CPP([have_arbitrary_file_name_length_limit],
+ gl_PATHMAX_SNIPPET[
+#ifdef PATH_MAX
+have_arbitrary_file_name_length_limit
+#endif],
+ [gl_cv_have_unlimited_file_name_length=no],
+ [gl_cv_have_unlimited_file_name_length=yes])])
+])
+
+AC_DEFUN([gl_PREREQ_CHDIR_LONG], [:])
diff --git a/gl/m4/chown.m4 b/gl/m4/chown.m4
new file mode 100644
index 0000000..56dda0a
--- /dev/null
+++ b/gl/m4/chown.m4
@@ -0,0 +1,218 @@
+# serial 35
+# Determine whether we need the chown wrapper.
+
+dnl Copyright (C) 1997-2001, 2003-2005, 2007, 2009-2022 Free Software
+dnl 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.
+
+# chown should accept arguments of -1 for uid and gid, and it should
+# dereference symlinks. If it doesn't, arrange to use the replacement
+# function.
+
+# From Jim Meyering.
+
+# This is taken from the following Autoconf patch:
+# https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9
+AC_DEFUN([AC_FUNC_CHOWN],
+[
+ AC_REQUIRE([AC_TYPE_UID_T])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
+ AC_CHECK_HEADERS([unistd.h])
+ AC_CACHE_CHECK([for working chown],
+ [ac_cv_func_chown_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [AC_INCLUDES_DEFAULT
+ [#include <fcntl.h>
+ ]GL_MDA_DEFINES],
+ [[
+ char *f = "conftest.chown";
+ struct stat before, after;
+
+ if (creat (f, 0600) < 0)
+ return 1;
+ if (stat (f, &before) < 0)
+ return 1;
+ if (chown (f, (uid_t) -1, (gid_t) -1) == -1)
+ return 1;
+ if (stat (f, &after) < 0)
+ return 1;
+ return ! (before.st_uid == after.st_uid && before.st_gid == after.st_gid);
+ ]])
+ ],
+ [ac_cv_func_chown_works=yes],
+ [ac_cv_func_chown_works=no],
+ [case "$host_os" in # ((
+ # Guess yes on Linux systems.
+ linux-* | linux) ac_cv_func_chown_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) ac_cv_func_chown_works="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) ac_cv_func_chown_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) ac_cv_func_chown_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -f conftest.chown
+ ])
+ case "$ac_cv_func_chown_works" in
+ *yes)
+ AC_DEFINE([HAVE_CHOWN], [1],
+ [Define to 1 if your system has a working `chown' function.])
+ ;;
+ esac
+])# AC_FUNC_CHOWN
+
+AC_DEFUN_ONCE([gl_FUNC_CHOWN],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_TYPE_UID_T])
+ AC_REQUIRE([AC_FUNC_CHOWN])
+ AC_REQUIRE([gl_FUNC_CHOWN_FOLLOWS_SYMLINK])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_FUNCS_ONCE([chown fchown])
+
+ dnl mingw lacks chown altogether.
+ if test $ac_cv_func_chown = no; then
+ HAVE_CHOWN=0
+ else
+ dnl Some old systems treated chown like lchown.
+ case "$gl_cv_func_chown_follows_symlink" in
+ *yes) ;;
+ *) REPLACE_CHOWN=1 ;;
+ esac
+
+ dnl Some old systems tried to use uid/gid -1 literally.
+ case "$ac_cv_func_chown_works" in
+ *no)
+ AC_DEFINE([CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE], [1],
+ [Define if chown is not POSIX compliant regarding IDs of -1.])
+ REPLACE_CHOWN=1
+ ;;
+ esac
+
+ dnl Solaris 9 ignores trailing slash.
+ dnl FreeBSD 7.2 mishandles trailing slash on symlinks.
+ dnl Likewise for AIX 7.1.
+ AC_CACHE_CHECK([whether chown honors trailing slash],
+ [gl_cv_func_chown_slash_works],
+ [touch conftest.file && rm -f conftest.link
+ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <errno.h>
+]GL_MDA_DEFINES],
+ [[if (symlink ("conftest.file", "conftest.link")) return 1;
+ if (chown ("conftest.link/", getuid (), getgid ()) == 0) return 2;
+ ]])],
+ [gl_cv_func_chown_slash_works=yes],
+ [gl_cv_func_chown_slash_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_chown_slash_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_chown_slash_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_chown_slash_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -f conftest.link conftest.file])
+ case "$gl_cv_func_chown_slash_works" in
+ *yes) ;;
+ *)
+ AC_DEFINE([CHOWN_TRAILING_SLASH_BUG], [1],
+ [Define to 1 if chown mishandles trailing slash.])
+ REPLACE_CHOWN=1
+ ;;
+ esac
+
+ dnl OpenBSD fails to update ctime if ownership does not change.
+ AC_CACHE_CHECK([whether chown always updates ctime],
+ [gl_cv_func_chown_ctime_works],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+]GL_MDA_DEFINES],
+ [[struct stat st1, st2;
+ if (close (creat ("conftest.file", 0600))) return 1;
+ if (stat ("conftest.file", &st1)) return 2;
+ sleep (1);
+ if (chown ("conftest.file", st1.st_uid, st1.st_gid)) return 3;
+ if (stat ("conftest.file", &st2)) return 4;
+ if (st2.st_ctime <= st1.st_ctime) return 5;
+ ]])],
+ [gl_cv_func_chown_ctime_works=yes],
+ [gl_cv_func_chown_ctime_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_chown_ctime_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_chown_ctime_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_chown_ctime_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -f conftest.file])
+ case "$gl_cv_func_chown_ctime_works" in
+ *yes) ;;
+ *)
+ AC_DEFINE([CHOWN_CHANGE_TIME_BUG], [1], [Define to 1 if chown fails
+ to change ctime when at least one argument was not -1.])
+ REPLACE_CHOWN=1
+ ;;
+ esac
+ fi
+])
+
+# Determine whether chown follows symlinks (it should).
+AC_DEFUN_ONCE([gl_FUNC_CHOWN_FOLLOWS_SYMLINK],
+[
+ AC_CACHE_CHECK(
+ [whether chown dereferences symlinks],
+ [gl_cv_func_chown_follows_symlink],
+ [
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <errno.h>
+]GL_MDA_DEFINES[
+ int
+ main ()
+ {
+ int result = 0;
+ char const *dangling_symlink = "conftest.dangle";
+
+ unlink (dangling_symlink);
+ if (symlink ("conftest.no-such", dangling_symlink))
+ abort ();
+
+ /* Exit successfully on a conforming system,
+ i.e., where chown must fail with ENOENT. */
+ if (chown (dangling_symlink, getuid (), getgid ()) == 0)
+ result |= 1;
+ if (errno != ENOENT)
+ result |= 2;
+ return result;
+ }
+ ]])],
+ [gl_cv_func_chown_follows_symlink=yes],
+ [gl_cv_func_chown_follows_symlink=no],
+ [gl_cv_func_chown_follows_symlink="guessing yes"]
+ )
+ ]
+ )
+
+ case "$gl_cv_func_chown_follows_symlink" in
+ *yes) ;;
+ *)
+ AC_DEFINE([CHOWN_MODIFIES_SYMLINK], [1],
+ [Define if chown modifies symlinks.])
+ ;;
+ esac
+])
diff --git a/gl/m4/clock_time.m4 b/gl/m4/clock_time.m4
new file mode 100644
index 0000000..2253553
--- /dev/null
+++ b/gl/m4/clock_time.m4
@@ -0,0 +1,32 @@
+# clock_time.m4 serial 11
+dnl Copyright (C) 2002-2006, 2009-2022 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.
+
+# Check for clock_getres, clock_gettime and clock_settime,
+# and set LIB_CLOCK_GETTIME.
+# For a program named, say foo, you should add a line like the following
+# in the corresponding Makefile.am file:
+# foo_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
+
+AC_DEFUN([gl_CLOCK_TIME],
+[
+ dnl Persuade glibc and Solaris <time.h> to declare these functions.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
+ # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
+
+ # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
+ # programs in the package would end up linked with that potentially-shared
+ # library, inducing unnecessary run-time overhead.
+ LIB_CLOCK_GETTIME=
+ AC_SUBST([LIB_CLOCK_GETTIME])
+ gl_saved_libs=$LIBS
+ AC_SEARCH_LIBS([clock_gettime], [rt posix4],
+ [test "$ac_cv_search_clock_gettime" = "none required" ||
+ LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
+ AC_CHECK_FUNCS([clock_getres clock_gettime clock_settime])
+ LIBS=$gl_saved_libs
+])
diff --git a/gl/m4/close.m4 b/gl/m4/close.m4
new file mode 100644
index 0000000..f95dbc9
--- /dev/null
+++ b/gl/m4/close.m4
@@ -0,0 +1,35 @@
+# close.m4 serial 9
+dnl Copyright (C) 2008-2022 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_CLOSE],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ m4_ifdef([gl_MSVC_INVAL], [
+ AC_REQUIRE([gl_MSVC_INVAL])
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_CLOSE=1
+ fi
+ ])
+ m4_ifdef([gl_PREREQ_SYS_H_WINSOCK2], [
+ gl_PREREQ_SYS_H_WINSOCK2
+ if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
+ dnl Even if the 'socket' module is not used here, another part of the
+ dnl application may use it and pass file descriptors that refer to
+ dnl sockets to the close() function. So enable the support for sockets.
+ REPLACE_CLOSE=1
+ fi
+ ])
+ dnl Replace close() for supporting the gnulib-defined fchdir() function,
+ dnl to keep fchdir's bookkeeping up-to-date.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ if test $REPLACE_CLOSE = 0; then
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ REPLACE_CLOSE=1
+ fi
+ fi
+ ])
+])
diff --git a/gl/m4/closedir.m4 b/gl/m4/closedir.m4
new file mode 100644
index 0000000..cac29d6
--- /dev/null
+++ b/gl/m4/closedir.m4
@@ -0,0 +1,31 @@
+# closedir.m4 serial 6
+dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_CLOSEDIR],
+[
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ AC_CHECK_FUNCS([closedir])
+ if test $ac_cv_func_closedir = no; then
+ HAVE_CLOSEDIR=0
+ fi
+ dnl Replace closedir() for supporting the gnulib-defined fchdir() function,
+ dnl to keep fchdir's bookkeeping up-to-date.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ if test $HAVE_CLOSEDIR = 1; then
+ REPLACE_CLOSEDIR=1
+ fi
+ fi
+ ])
+ dnl Replace closedir() for supporting the gnulib-defined dirfd() function.
+ case $host_os,$HAVE_CLOSEDIR in
+ os2*,1)
+ REPLACE_CLOSEDIR=1;;
+ esac
+])
diff --git a/gl/m4/codeset.m4 b/gl/m4/codeset.m4
new file mode 100644
index 0000000..eb73260
--- /dev/null
+++ b/gl/m4/codeset.m4
@@ -0,0 +1,24 @@
+# codeset.m4 serial 5 (gettext-0.18.2)
+dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2022 Free Software
+dnl Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_LANGINFO_CODESET],
+[
+ AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <langinfo.h>]],
+ [[char* cs = nl_langinfo(CODESET); return !cs;]])],
+ [am_cv_langinfo_codeset=yes],
+ [am_cv_langinfo_codeset=no])
+ ])
+ if test $am_cv_langinfo_codeset = yes; then
+ AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
+ [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
+ fi
+])
diff --git a/gl/m4/ctype_h.m4 b/gl/m4/ctype_h.m4
new file mode 100644
index 0000000..6f420de
--- /dev/null
+++ b/gl/m4/ctype_h.m4
@@ -0,0 +1,47 @@
+# ctype_h.m4 serial 9
+dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_CTYPE_H],
+[
+ AC_REQUIRE([gl_CTYPE_H_DEFAULTS])
+
+ dnl <ctype.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_NEXT_HEADERS([ctype.h])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <ctype.h>
+ ]], [isblank])
+])
+
+# gl_CTYPE_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_CTYPE_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_CTYPE_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_CTYPE_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_CTYPE_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISBLANK])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_CTYPE_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_CTYPE_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_CTYPE_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_ISBLANK=1; AC_SUBST([HAVE_ISBLANK])
+])
diff --git a/gl/m4/d-ino.m4 b/gl/m4/d-ino.m4
new file mode 100644
index 0000000..daefce9
--- /dev/null
+++ b/gl/m4/d-ino.m4
@@ -0,0 +1,60 @@
+# serial 20
+
+dnl From Jim Meyering.
+dnl
+dnl Check whether struct dirent has a member named d_ino.
+dnl
+
+# Copyright (C) 1997, 1999-2001, 2003-2004, 2006-2007, 2009-2022 Free Software
+# Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO],
+ [AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([for d_ino member in directory struct],
+ [gl_cv_struct_dirent_d_ino],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ #include <sys/stat.h>
+ #include <dirent.h>
+ ]],
+ [[DIR *dp = opendir (".");
+ struct dirent *e;
+ struct stat st;
+ if (! dp)
+ return 1;
+ e = readdir (dp);
+ if (! e)
+ { closedir (dp); return 2; }
+ if (lstat (e->d_name, &st) != 0)
+ { closedir (dp); return 3; }
+ if (e->d_ino != st.st_ino)
+ { closedir (dp); return 4; }
+ closedir (dp);
+ return 0;
+ ]])],
+ [gl_cv_struct_dirent_d_ino=yes],
+ [gl_cv_struct_dirent_d_ino=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems with Linux kernel.
+ linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
+ # Guess yes on musl systems with Linux kernel.
+ linux*-musl*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_struct_dirent_d_ino="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_struct_dirent_d_ino="$gl_cross_guess_normal" ;;
+ esac
+ ])])
+ case "$gl_cv_struct_dirent_d_ino" in
+ *yes)
+ AC_DEFINE([D_INO_IN_DIRENT], [1],
+ [Define if struct dirent has a member d_ino that actually works.])
+ ;;
+ esac
+ ]
+)
diff --git a/gl/m4/d-type.m4 b/gl/m4/d-type.m4
new file mode 100644
index 0000000..b8858b1
--- /dev/null
+++ b/gl/m4/d-type.m4
@@ -0,0 +1,32 @@
+# serial 12
+
+dnl From Jim Meyering.
+dnl
+dnl Check whether struct dirent has a member named d_type.
+dnl
+
+# Copyright (C) 1997, 1999-2004, 2006, 2009-2022 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE],
+ [AC_CACHE_CHECK([for d_type member in directory struct],
+ [gl_cv_struct_dirent_d_type],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/types.h>
+#include <dirent.h>
+ ]],
+ [[struct dirent dp; dp.d_type = 0;]])],
+ [gl_cv_struct_dirent_d_type=yes],
+ [gl_cv_struct_dirent_d_type=no])
+ ]
+ )
+ if test $gl_cv_struct_dirent_d_type = yes; then
+ AC_DEFINE([HAVE_STRUCT_DIRENT_D_TYPE], [1],
+ [Define if there is a member named d_type in the struct describing
+ directory headers.])
+ fi
+ ]
+)
diff --git a/gl/m4/dirent_h.m4 b/gl/m4/dirent_h.m4
new file mode 100644
index 0000000..ddaca16
--- /dev/null
+++ b/gl/m4/dirent_h.m4
@@ -0,0 +1,79 @@
+# dirent_h.m4 serial 19
+dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Bruno Haible.
+
+AC_DEFUN_ONCE([gl_DIRENT_H],
+[
+ dnl Ensure to expand the default settings once only, before all statements
+ dnl that occur in other macros.
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+
+ dnl <dirent.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([dirent.h])
+ if test $ac_cv_header_dirent_h = yes; then
+ HAVE_DIRENT_H=1
+ else
+ HAVE_DIRENT_H=0
+ fi
+ AC_SUBST([HAVE_DIRENT_H])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <dirent.h>
+ ]], [alphasort closedir dirfd fdopendir opendir readdir rewinddir scandir])
+])
+
+# gl_DIRENT_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_DIRENT_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_DIRENT_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_DIRENT_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_DIRENT_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_UNISTD_H_REQUIRE_DEFAULTS dnl for REPLACE_FCHDIR
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OPENDIR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_READDIR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REWINDDIR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CLOSEDIR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DIRFD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FDOPENDIR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SCANDIR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ALPHASORT])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_DIRENT_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_DIRENT_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_OPENDIR=1; AC_SUBST([HAVE_OPENDIR])
+ HAVE_READDIR=1; AC_SUBST([HAVE_READDIR])
+ HAVE_REWINDDIR=1; AC_SUBST([HAVE_REWINDDIR])
+ HAVE_CLOSEDIR=1; AC_SUBST([HAVE_CLOSEDIR])
+ HAVE_DECL_DIRFD=1; AC_SUBST([HAVE_DECL_DIRFD])
+ HAVE_DECL_FDOPENDIR=1;AC_SUBST([HAVE_DECL_FDOPENDIR])
+ HAVE_FDOPENDIR=1; AC_SUBST([HAVE_FDOPENDIR])
+ HAVE_SCANDIR=1; AC_SUBST([HAVE_SCANDIR])
+ HAVE_ALPHASORT=1; AC_SUBST([HAVE_ALPHASORT])
+ REPLACE_OPENDIR=0; AC_SUBST([REPLACE_OPENDIR])
+ REPLACE_CLOSEDIR=0; AC_SUBST([REPLACE_CLOSEDIR])
+ REPLACE_DIRFD=0; AC_SUBST([REPLACE_DIRFD])
+ REPLACE_FDOPENDIR=0; AC_SUBST([REPLACE_FDOPENDIR])
+])
diff --git a/gl/m4/dirfd.m4 b/gl/m4/dirfd.m4
new file mode 100644
index 0000000..9200170
--- /dev/null
+++ b/gl/m4/dirfd.m4
@@ -0,0 +1,86 @@
+# serial 26 -*- Autoconf -*-
+
+dnl Find out how to get the file descriptor associated with an open DIR*.
+
+# Copyright (C) 2001-2006, 2008-2022 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+dnl From Jim Meyering
+
+AC_DEFUN([gl_FUNC_DIRFD],
+[
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ dnl Persuade glibc <dirent.h> to declare dirfd().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_FUNCS([dirfd])
+ AC_CHECK_DECLS([dirfd], , ,
+ [[#include <sys/types.h>
+ #include <dirent.h>]])
+ if test $ac_cv_have_decl_dirfd = no; then
+ HAVE_DECL_DIRFD=0
+ fi
+
+ AC_CACHE_CHECK([whether dirfd is a macro],
+ [gl_cv_func_dirfd_macro],
+ [AC_EGREP_CPP([dirent_header_defines_dirfd], [
+#include <sys/types.h>
+#include <dirent.h>
+#ifdef dirfd
+ dirent_header_defines_dirfd
+#endif],
+ [gl_cv_func_dirfd_macro=yes],
+ [gl_cv_func_dirfd_macro=no])])
+
+ # Use the replacement if we have no function or macro with that name,
+ # or if OS/2 kLIBC whose dirfd() does not work.
+ # Replace only if the system declares dirfd already.
+ case $ac_cv_func_dirfd,$gl_cv_func_dirfd_macro,$host_os,$ac_cv_have_decl_dirfd in
+ no,no,*,yes | *,*,os2*,yes)
+ REPLACE_DIRFD=1
+ AC_DEFINE([REPLACE_DIRFD], [1],
+ [Define to 1 if gnulib's dirfd() replacement is used.]);;
+ esac
+])
+
+dnl Prerequisites of lib/dirfd.c.
+AC_DEFUN([gl_PREREQ_DIRFD],
+[
+ AC_CACHE_CHECK([how to get the file descriptor associated with an open DIR*],
+ [gl_cv_sys_dir_fd_member_name],
+ [
+ dirfd_save_CFLAGS=$CFLAGS
+ for ac_expr in d_fd dd_fd; do
+
+ CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include <sys/types.h>
+ #include <dirent.h>]],
+ [[DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;]])],
+ [dir_fd_found=yes]
+ )
+ CFLAGS=$dirfd_save_CFLAGS
+ test "$dir_fd_found" = yes && break
+ done
+ test "$dir_fd_found" = yes || ac_expr=no_such_member
+
+ gl_cv_sys_dir_fd_member_name=$ac_expr
+ ]
+ )
+ if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
+ AC_DEFINE_UNQUOTED([DIR_FD_MEMBER_NAME],
+ [$gl_cv_sys_dir_fd_member_name],
+ [the name of the file descriptor member of DIR])
+ fi
+ AH_VERBATIM([DIR_TO_FD],
+ [#ifdef DIR_FD_MEMBER_NAME
+# define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME)
+#else
+# define DIR_TO_FD(Dir_p) -1
+#endif
+])
+])
diff --git a/gl/m4/double-slash-root.m4 b/gl/m4/double-slash-root.m4
new file mode 100644
index 0000000..09ff5f0
--- /dev/null
+++ b/gl/m4/double-slash-root.m4
@@ -0,0 +1,38 @@
+# double-slash-root.m4 serial 4 -*- Autoconf -*-
+dnl Copyright (C) 2006, 2008-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_DOUBLE_SLASH_ROOT],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([whether // is distinct from /], [gl_cv_double_slash_root],
+ [ if test x"$cross_compiling" = xyes ; then
+ # When cross-compiling, there is no way to tell whether // is special
+ # short of a list of hosts. However, the only known hosts to date
+ # that have a distinct // are Apollo DomainOS (too old to port to),
+ # Cygwin, and z/OS. If anyone knows of another system for which // has
+ # special semantics and is distinct from /, please report it to
+ # <bug-gnulib@gnu.org>.
+ case $host in
+ *-cygwin | i370-ibm-openedition)
+ gl_cv_double_slash_root=yes ;;
+ *)
+ # Be optimistic and assume that / and // are the same when we
+ # don't know.
+ gl_cv_double_slash_root='unknown, assuming no' ;;
+ esac
+ else
+ set x `ls -di / // 2>/dev/null`
+ if test "$[2]" = "$[4]" && wc //dev/null >/dev/null 2>&1; then
+ gl_cv_double_slash_root=no
+ else
+ gl_cv_double_slash_root=yes
+ fi
+ fi])
+ if test "$gl_cv_double_slash_root" = yes; then
+ AC_DEFINE([DOUBLE_SLASH_IS_DISTINCT_ROOT], [1],
+ [Define to 1 if // is a file system root distinct from /.])
+ fi
+])
diff --git a/gl/m4/dup.m4 b/gl/m4/dup.m4
new file mode 100644
index 0000000..3109a65
--- /dev/null
+++ b/gl/m4/dup.m4
@@ -0,0 +1,54 @@
+# dup.m4 serial 7
+dnl Copyright (C) 2011-2022 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_DUP],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ m4_ifdef([gl_MSVC_INVAL], [
+ AC_REQUIRE([gl_MSVC_INVAL])
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_DUP=1
+ fi
+ ])
+ dnl Replace dup() for supporting the gnulib-defined fchdir() function,
+ dnl to keep fchdir's bookkeeping up-to-date.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ REPLACE_DUP=1
+ fi
+ ])
+ AC_CACHE_CHECK([whether dup works], [gl_cv_func_dup_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[#include <unistd.h>
+ #include <fcntl.h>
+ #include <errno.h>
+ ]GL_MDA_DEFINES],
+ [[/* On OS/2 kLIBC, dup does not work on a directory fd. */
+ int fd = open (".", O_RDONLY);
+ return fd < 0 ? 1 : dup (fd) < 0 ? 2 : 0;
+ ]])
+ ],
+ [gl_cv_func_dup_works=yes],
+ [gl_cv_func_dup_works=no],
+ [case "$host_os" in
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_dup_works="guessing no" ;;
+ *) gl_cv_func_dup_works="guessing yes" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_dup_works" in
+ *yes) ;;
+ *)
+ REPLACE_DUP=1
+ ;;
+ esac
+])
+
+# Prerequisites of lib/dup.c.
+AC_DEFUN([gl_PREREQ_DUP], [:])
diff --git a/gl/m4/dup2.m4 b/gl/m4/dup2.m4
new file mode 100644
index 0000000..7e777cd
--- /dev/null
+++ b/gl/m4/dup2.m4
@@ -0,0 +1,105 @@
+#serial 27
+dnl Copyright (C) 2002, 2005, 2007, 2009-2022 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_DUP2],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([whether dup2 works], [gl_cv_func_dup2_works],
+ [AC_RUN_IFELSE([
+ AC_LANG_PROGRAM(
+ [[#include <errno.h>
+ #include <fcntl.h>
+ #include <limits.h>
+ #include <sys/resource.h>
+ #include <unistd.h>
+ ]GL_MDA_DEFINES[
+ #ifndef RLIM_SAVED_CUR
+ # define RLIM_SAVED_CUR RLIM_INFINITY
+ #endif
+ #ifndef RLIM_SAVED_MAX
+ # define RLIM_SAVED_MAX RLIM_INFINITY
+ #endif
+ ]],
+ [[int result = 0;
+ int bad_fd = INT_MAX;
+ struct rlimit rlim;
+ if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
+ && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
+ && rlim.rlim_cur != RLIM_INFINITY
+ && rlim.rlim_cur != RLIM_SAVED_MAX
+ && rlim.rlim_cur != RLIM_SAVED_CUR)
+ bad_fd = rlim.rlim_cur;
+ #ifdef FD_CLOEXEC
+ if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
+ result |= 1;
+ #endif
+ if (dup2 (1, 1) != 1)
+ result |= 2;
+ #ifdef FD_CLOEXEC
+ if (fcntl (1, F_GETFD) != FD_CLOEXEC)
+ result |= 4;
+ #endif
+ close (0);
+ if (dup2 (0, 0) != -1)
+ result |= 8;
+ /* Many gnulib modules require POSIX conformance of EBADF. */
+ if (dup2 (2, bad_fd) == -1 && errno != EBADF)
+ result |= 16;
+ /* Flush out some cygwin core dumps. */
+ if (dup2 (2, -1) != -1 || errno != EBADF)
+ result |= 32;
+ dup2 (2, 255);
+ dup2 (2, 256);
+ /* On OS/2 kLIBC, dup2() does not work on a directory fd. */
+ {
+ int fd = open (".", O_RDONLY);
+ if (fd == -1)
+ result |= 64;
+ else if (dup2 (fd, fd + 1) == -1)
+ result |= 128;
+ close (fd);
+ }
+ return result;]])
+ ],
+ [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no],
+ [case "$host_os" in
+ mingw*) # on this platform, dup2 always returns 0 for success
+ gl_cv_func_dup2_works="guessing no" ;;
+ cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
+ gl_cv_func_dup2_works="guessing no" ;;
+ aix* | freebsd*)
+ # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
+ # not EBADF.
+ gl_cv_func_dup2_works="guessing no" ;;
+ haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
+ gl_cv_func_dup2_works="guessing no" ;;
+ *-android*) # implemented using dup3(), which fails if oldfd == newfd
+ gl_cv_func_dup2_works="guessing no" ;;
+ os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd.
+ gl_cv_func_dup2_works="guessing no" ;;
+ *) gl_cv_func_dup2_works="guessing yes" ;;
+ esac])
+ ])
+ case "$gl_cv_func_dup2_works" in
+ *yes) ;;
+ *)
+ REPLACE_DUP2=1
+ AC_CHECK_FUNCS([setdtablesize])
+ ;;
+ esac
+ dnl Replace dup2() for supporting the gnulib-defined fchdir() function,
+ dnl to keep fchdir's bookkeeping up-to-date.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ REPLACE_DUP2=1
+ fi
+ ])
+])
+
+# Prerequisites of lib/dup2.c.
+AC_DEFUN([gl_PREREQ_DUP2], [])
diff --git a/gl/m4/eealloc.m4 b/gl/m4/eealloc.m4
new file mode 100644
index 0000000..a6aa2f8
--- /dev/null
+++ b/gl/m4/eealloc.m4
@@ -0,0 +1,31 @@
+# eealloc.m4 serial 3
+dnl Copyright (C) 2003, 2009-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_EEALLOC],
+[
+ AC_REQUIRE([gl_EEMALLOC])
+ AC_REQUIRE([gl_EEREALLOC])
+])
+
+AC_DEFUN([gl_EEMALLOC],
+[
+ _AC_FUNC_MALLOC_IF(
+ [gl_cv_func_malloc_0_nonnull=1],
+ [gl_cv_func_malloc_0_nonnull=0])
+ AC_DEFINE_UNQUOTED([MALLOC_0_IS_NONNULL], [$gl_cv_func_malloc_0_nonnull],
+ [If malloc(0) is != NULL, define this to 1. Otherwise define this
+ to 0.])
+])
+
+AC_DEFUN([gl_EEREALLOC],
+[
+ _AC_FUNC_REALLOC_IF(
+ [gl_cv_func_realloc_0_nonnull=1],
+ [gl_cv_func_realloc_0_nonnull=0])
+ AC_DEFINE_UNQUOTED([REALLOC_0_IS_NONNULL], [$gl_cv_func_realloc_0_nonnull],
+ [If realloc(NULL,0) is != NULL, define this to 1. Otherwise define this
+ to 0.])
+])
diff --git a/gl/m4/environ.m4 b/gl/m4/environ.m4
new file mode 100644
index 0000000..583dac3
--- /dev/null
+++ b/gl/m4/environ.m4
@@ -0,0 +1,46 @@
+# environ.m4 serial 8
+dnl Copyright (C) 2001-2004, 2006-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_ENVIRON],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ dnl Persuade glibc <unistd.h> to declare environ.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ gt_CHECK_VAR_DECL(
+ [#if HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
+ /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
+ #include <stdlib.h>
+ ],
+ [environ])
+ if test $gt_cv_var_environ_declaration != yes; then
+ HAVE_DECL_ENVIRON=0
+ fi
+])
+
+# Check if a variable is properly declared.
+# gt_CHECK_VAR_DECL(includes,variable)
+AC_DEFUN([gt_CHECK_VAR_DECL],
+[
+ define([gt_cv_var], [gt_cv_var_]$2[_declaration])
+ AC_CACHE_CHECK([if $2 is properly declared], [gt_cv_var],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[$1
+ typedef struct { int foo; } foo_t;
+ extern foo_t $2;]],
+ [[$2.foo = 1;]])],
+ [gt_cv_var=no],
+ [gt_cv_var=yes])])
+ if test $gt_cv_var = yes; then
+ AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1,
+ [Define if you have the declaration of $2.])
+ fi
+ undefine([gt_cv_var])
+])
diff --git a/gl/m4/errno_h.m4 b/gl/m4/errno_h.m4
new file mode 100644
index 0000000..4be9780
--- /dev/null
+++ b/gl/m4/errno_h.m4
@@ -0,0 +1,131 @@
+# errno_h.m4 serial 14
+dnl Copyright (C) 2004, 2006, 2008-2022 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_PREREQ([2.61])
+
+AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [
+ AC_EGREP_CPP([booboo],[
+#include <errno.h>
+#if !defined ETXTBSY
+booboo
+#endif
+#if !defined ENOMSG
+booboo
+#endif
+#if !defined EIDRM
+booboo
+#endif
+#if !defined ENOLINK
+booboo
+#endif
+#if !defined EPROTO
+booboo
+#endif
+#if !defined EMULTIHOP
+booboo
+#endif
+#if !defined EBADMSG
+booboo
+#endif
+#if !defined EOVERFLOW
+booboo
+#endif
+#if !defined ENOTSUP
+booboo
+#endif
+#if !defined ENETRESET
+booboo
+#endif
+#if !defined ECONNABORTED
+booboo
+#endif
+#if !defined ESTALE
+booboo
+#endif
+#if !defined EDQUOT
+booboo
+#endif
+#if !defined ECANCELED
+booboo
+#endif
+#if !defined EOWNERDEAD
+booboo
+#endif
+#if !defined ENOTRECOVERABLE
+booboo
+#endif
+#if !defined EILSEQ
+booboo
+#endif
+ ],
+ [gl_cv_header_errno_h_complete=no],
+ [gl_cv_header_errno_h_complete=yes])
+ ])
+ if test $gl_cv_header_errno_h_complete = yes; then
+ GL_GENERATE_ERRNO_H=false
+ else
+ gl_NEXT_HEADERS([errno.h])
+ GL_GENERATE_ERRNO_H=true
+ fi
+ gl_REPLACE_ERRNO_VALUE([EMULTIHOP])
+ gl_REPLACE_ERRNO_VALUE([ENOLINK])
+ gl_REPLACE_ERRNO_VALUE([EOVERFLOW])
+])
+
+# Assuming $1 = EOVERFLOW.
+# The EOVERFLOW errno value ought to be defined in <errno.h>, according to
+# POSIX. But some systems (like OpenBSD 4.0 or AIX 3) don't define it, and
+# some systems (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined.
+# Check for the value of EOVERFLOW.
+# Set the variables EOVERFLOW_HIDDEN and EOVERFLOW_VALUE.
+AC_DEFUN([gl_REPLACE_ERRNO_VALUE],
+[
+ if $GL_GENERATE_ERRNO_H; then
+ AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [
+ AC_EGREP_CPP([yes],[
+#include <errno.h>
+#ifdef ]$1[
+yes
+#endif
+ ],
+ [gl_cv_header_errno_h_]$1[=yes],
+ [gl_cv_header_errno_h_]$1[=no])
+ if test $gl_cv_header_errno_h_]$1[ = no; then
+ AC_EGREP_CPP([yes],[
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+#ifdef ]$1[
+yes
+#endif
+ ], [gl_cv_header_errno_h_]$1[=hidden])
+ if test $gl_cv_header_errno_h_]$1[ = hidden; then
+ dnl The macro exists but is hidden.
+ dnl Define it to the same value.
+ AC_COMPUTE_INT([gl_cv_header_errno_h_]$1, $1, [
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+/* The following two lines are a workaround against an autoconf-2.52 bug. */
+#include <stdio.h>
+#include <stdlib.h>
+])
+ fi
+ fi
+ ])
+ case $gl_cv_header_errno_h_]$1[ in
+ yes | no)
+ ]$1[_HIDDEN=0; ]$1[_VALUE=
+ ;;
+ *)
+ ]$1[_HIDDEN=1; ]$1[_VALUE="$gl_cv_header_errno_h_]$1["
+ ;;
+ esac
+ AC_SUBST($1[_HIDDEN])
+ AC_SUBST($1[_VALUE])
+ fi
+])
diff --git a/gl/m4/error.m4 b/gl/m4/error.m4
new file mode 100644
index 0000000..7a10344
--- /dev/null
+++ b/gl/m4/error.m4
@@ -0,0 +1,31 @@
+#serial 15
+
+# Copyright (C) 1996-1998, 2001-2004, 2009-2022 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_ERROR],
+[
+ dnl We don't use AC_FUNC_ERROR_AT_LINE any more, because it is no longer
+ dnl maintained in Autoconf and because it invokes AC_LIBOBJ.
+ AC_CACHE_CHECK([for error_at_line], [ac_cv_lib_error_at_line],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <error.h>]],
+ [[error_at_line (0, 0, "", 0, "an error occurred");]])],
+ [ac_cv_lib_error_at_line=yes],
+ [ac_cv_lib_error_at_line=no])])
+])
+
+# Prerequisites of lib/error.c.
+AC_DEFUN([gl_PREREQ_ERROR],
+[
+ dnl Use system extensions on Android, so that AC_FUNC_STRERROR_R
+ dnl discovers the GNU API for strerror_r on Android API level 23 and later.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([AC_FUNC_STRERROR_R])
+ :
+])
diff --git a/gl/m4/exponentd.m4 b/gl/m4/exponentd.m4
new file mode 100644
index 0000000..83ac08b
--- /dev/null
+++ b/gl/m4/exponentd.m4
@@ -0,0 +1,116 @@
+# exponentd.m4 serial 3
+dnl Copyright (C) 2007-2008, 2010-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+AC_DEFUN([gl_DOUBLE_EXPONENT_LOCATION],
+[
+ AC_CACHE_CHECK([where to find the exponent in a 'double'],
+ [gl_cv_cc_double_expbit0],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <float.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#define NWORDS \
+ ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { double value; unsigned int word[NWORDS]; } memory_double;
+static unsigned int ored_words[NWORDS];
+static unsigned int anded_words[NWORDS];
+static void add_to_ored_words (double x)
+{
+ memory_double m;
+ size_t i;
+ /* Clear it first, in case sizeof (double) < sizeof (memory_double). */
+ memset (&m, 0, sizeof (memory_double));
+ m.value = x;
+ for (i = 0; i < NWORDS; i++)
+ {
+ ored_words[i] |= m.word[i];
+ anded_words[i] &= m.word[i];
+ }
+}
+int main ()
+{
+ size_t j;
+ FILE *fp = fopen ("conftest.out", "w");
+ if (fp == NULL)
+ return 1;
+ for (j = 0; j < NWORDS; j++)
+ anded_words[j] = ~ (unsigned int) 0;
+ add_to_ored_words (0.25);
+ add_to_ored_words (0.5);
+ add_to_ored_words (1.0);
+ add_to_ored_words (2.0);
+ add_to_ored_words (4.0);
+ /* Remove bits that are common (e.g. if representation of the first mantissa
+ bit is explicit). */
+ for (j = 0; j < NWORDS; j++)
+ ored_words[j] &= ~anded_words[j];
+ /* Now find the nonzero word. */
+ for (j = 0; j < NWORDS; j++)
+ if (ored_words[j] != 0)
+ break;
+ if (j < NWORDS)
+ {
+ size_t i;
+ for (i = j + 1; i < NWORDS; i++)
+ if (ored_words[i] != 0)
+ {
+ fprintf (fp, "unknown");
+ return (fclose (fp) != 0);
+ }
+ for (i = 0; ; i++)
+ if ((ored_words[j] >> i) & 1)
+ {
+ fprintf (fp, "word %d bit %d", (int) j, (int) i);
+ return (fclose (fp) != 0);
+ }
+ }
+ fprintf (fp, "unknown");
+ return (fclose (fp) != 0);
+}
+ ]])],
+ [gl_cv_cc_double_expbit0=`cat conftest.out`],
+ [gl_cv_cc_double_expbit0="unknown"],
+ [
+ dnl On ARM, there are two 'double' floating-point formats, used by
+ dnl different sets of instructions: The older FPA instructions assume
+ dnl that they are stored in big-endian word order, while the words
+ dnl (like integer types) are stored in little-endian byte order.
+ dnl The newer VFP instructions assume little-endian order
+ dnl consistently.
+ AC_EGREP_CPP([mixed_endianness], [
+#if defined arm || defined __arm || defined __arm__
+ mixed_endianness
+#endif
+ ],
+ [gl_cv_cc_double_expbit0="unknown"],
+ [
+ pushdef([AC_MSG_CHECKING],[:])dnl
+ pushdef([AC_MSG_RESULT],[:])dnl
+ pushdef([AC_MSG_RESULT_UNQUOTED],[:])dnl
+ AC_C_BIGENDIAN(
+ [gl_cv_cc_double_expbit0="word 0 bit 20"],
+ [gl_cv_cc_double_expbit0="word 1 bit 20"],
+ [gl_cv_cc_double_expbit0="unknown"])
+ popdef([AC_MSG_RESULT_UNQUOTED])dnl
+ popdef([AC_MSG_RESULT])dnl
+ popdef([AC_MSG_CHECKING])dnl
+ ])
+ ])
+ rm -f conftest.out
+ ])
+ case "$gl_cv_cc_double_expbit0" in
+ word*bit*)
+ word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
+ bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
+ AC_DEFINE_UNQUOTED([DBL_EXPBIT0_WORD], [$word],
+ [Define as the word index where to find the exponent of 'double'.])
+ AC_DEFINE_UNQUOTED([DBL_EXPBIT0_BIT], [$bit],
+ [Define as the bit index in the word where to find bit 0 of the exponent of 'double'.])
+ ;;
+ esac
+])
diff --git a/gl/m4/extensions.m4 b/gl/m4/extensions.m4
new file mode 100644
index 0000000..0b3e4b5
--- /dev/null
+++ b/gl/m4/extensions.m4
@@ -0,0 +1,227 @@
+# serial 22 -*- Autoconf -*-
+# Enable extensions on systems that normally disable them.
+
+# Copyright (C) 2003, 2006-2022 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+dnl Define to empty for the benefit of Autoconf 2.69 and earlier, so that
+dnl AC_USE_SYSTEM_EXTENSIONS (below) can be used unchanged from Autoconf 2.70+.
+m4_ifndef([AC_CHECK_INCLUDES_DEFAULT],
+ [AC_DEFUN([AC_CHECK_INCLUDES_DEFAULT], [])])
+
+# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git
+# Autoconf. Perhaps we can remove this once we can assume Autoconf
+# is recent-enough everywhere, but since Autoconf mutates rapidly
+# enough in this area it's likely we'll need to redefine
+# AC_USE_SYSTEM_EXTENSIONS for quite some time.
+
+# If autoconf reports a warning
+# warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
+# or warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
+# the fix is
+# 1) to ensure that AC_USE_SYSTEM_EXTENSIONS is never directly invoked
+# but always AC_REQUIREd,
+# 2) to ensure that for each occurrence of
+# AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+# or
+# AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+# the corresponding gnulib module description has 'extensions' among
+# its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS
+# invocation occurs in gl_EARLY, not in gl_INIT.
+
+m4_version_prereq([2.70.1], [], [
+
+# AC_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+# We unconditionally define as many of the known feature-enabling
+# as possible, reserving conditional behavior for macros that are
+# known to cause problems on some platforms (such as __EXTENSIONS__).
+AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
+[AC_BEFORE([$0], [AC_PREPROC_IFELSE])dnl
+AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+AC_BEFORE([$0], [AC_LINK_IFELSE])dnl
+AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+AC_BEFORE([$0], [AC_CHECK_INCLUDES_DEFAULT])dnl
+dnl #undef in AH_VERBATIM gets replaced with #define by AC_DEFINE.
+dnl Use a different key than __EXTENSIONS__, as that name broke existing
+dnl configure.ac when using autoheader 2.62.
+dnl The macros below are in alphabetical order ignoring leading _ or __
+dnl prefixes.
+AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
+[/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable general extensions on macOS. */
+#ifndef _DARWIN_C_SOURCE
+# undef _DARWIN_C_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable X/Open compliant socket functions that do not require linking
+ with -lxnet on HP-UX 11.11. */
+#ifndef _HPUX_ALT_XOPEN_SOCKET_API
+# undef _HPUX_ALT_XOPEN_SOCKET_API
+#endif
+/* Identify the host operating system as Minix.
+ This macro does not affect the system headers' behavior.
+ A future release of Autoconf may stop defining this macro. */
+#ifndef _MINIX
+# undef _MINIX
+#endif
+/* Enable general extensions on NetBSD.
+ Enable NetBSD compatibility extensions on Minix. */
+#ifndef _NETBSD_SOURCE
+# undef _NETBSD_SOURCE
+#endif
+/* Enable OpenBSD compatibility extensions on NetBSD.
+ Oddly enough, this does nothing on OpenBSD. */
+#ifndef _OPENBSD_SOURCE
+# undef _OPENBSD_SOURCE
+#endif
+/* Define to 1 if needed for POSIX-compatible behavior. */
+#ifndef _POSIX_SOURCE
+# undef _POSIX_SOURCE
+#endif
+/* Define to 2 if needed for POSIX-compatible behavior. */
+#ifndef _POSIX_1_SOURCE
+# undef _POSIX_1_SOURCE
+#endif
+/* Enable POSIX-compatible threading on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */
+#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
+# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */
+#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+# undef __STDC_WANT_IEC_60559_BFP_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */
+#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
+# undef __STDC_WANT_IEC_60559_DFP_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */
+#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
+# undef __STDC_WANT_IEC_60559_FUNCS_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */
+#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
+# undef __STDC_WANT_IEC_60559_TYPES_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */
+#ifndef __STDC_WANT_LIB_EXT2__
+# undef __STDC_WANT_LIB_EXT2__
+#endif
+/* Enable extensions specified by ISO/IEC 24747:2009. */
+#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
+# undef __STDC_WANT_MATH_SPEC_FUNCS__
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable X/Open extensions. Define to 500 only if necessary
+ to make mbstate_t available. */
+#ifndef _XOPEN_SOURCE
+# undef _XOPEN_SOURCE
+#endif
+])dnl
+
+ AC_REQUIRE([AC_CHECK_INCLUDES_DEFAULT])dnl
+ _AC_CHECK_HEADER_ONCE([wchar.h])
+ _AC_CHECK_HEADER_ONCE([minix/config.h])
+
+dnl Defining __EXTENSIONS__ may break the system headers on some systems.
+dnl (FIXME: Which ones?)
+ AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+ [ac_cv_safe_to_define___extensions__],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+# define __EXTENSIONS__ 1
+ ]AC_INCLUDES_DEFAULT])],
+ [ac_cv_safe_to_define___extensions__=yes],
+ [ac_cv_safe_to_define___extensions__=no])])
+
+dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to
+dnl 500, regardless of whether compiling with -Ae or -D_HPUX_SOURCE=1.
+dnl But defining _XOPEN_SOURCE may turn *off* extensions on platforms
+dnl not covered by turn-on-extensions macros (notably Dragonfly, Free,
+dnl and OpenBSD, which don't have any equivalent of _NETBSD_SOURCE) so
+dnl it should only be defined when necessary.
+ AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
+ [ac_cv_should_define__xopen_source],
+ [ac_cv_should_define__xopen_source=no
+ AS_IF([test $ac_cv_header_wchar_h = yes],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <wchar.h>
+ mbstate_t x;]])],
+ [],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #define _XOPEN_SOURCE 500
+ #include <wchar.h>
+ mbstate_t x;]])],
+ [ac_cv_should_define__xopen_source=yes])])])])
+
+ AC_DEFINE([_ALL_SOURCE])
+ AC_DEFINE([_DARWIN_C_SOURCE])
+ AC_DEFINE([_GNU_SOURCE])
+ AC_DEFINE([_HPUX_ALT_XOPEN_SOCKET_API])
+ AC_DEFINE([_NETBSD_SOURCE])
+ AC_DEFINE([_OPENBSD_SOURCE])
+ AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+ AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__])
+ AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__])
+ AC_DEFINE([__STDC_WANT_IEC_60559_DFP_EXT__])
+ AC_DEFINE([__STDC_WANT_IEC_60559_FUNCS_EXT__])
+ AC_DEFINE([__STDC_WANT_IEC_60559_TYPES_EXT__])
+ AC_DEFINE([__STDC_WANT_LIB_EXT2__])
+ AC_DEFINE([__STDC_WANT_MATH_SPEC_FUNCS__])
+ AC_DEFINE([_TANDEM_SOURCE])
+ AS_IF([test $ac_cv_header_minix_config_h = yes],
+ [MINIX=yes
+ AC_DEFINE([_MINIX])
+ AC_DEFINE([_POSIX_SOURCE])
+ AC_DEFINE([_POSIX_1_SOURCE], [2])],
+ [MINIX=])
+ AS_IF([test $ac_cv_safe_to_define___extensions__ = yes],
+ [AC_DEFINE([__EXTENSIONS__])])
+ AS_IF([test $ac_cv_should_define__xopen_source = yes],
+ [AC_DEFINE([_XOPEN_SOURCE], [500])])
+])# AC_USE_SYSTEM_EXTENSIONS
+])
+
+# gl_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
+[
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ dnl On OpenBSD 6.8 with GCC, the include files contain a couple of
+ dnl definitions that are only activated with an explicit -D_ISOC11_SOURCE.
+ dnl That's because this version of GCC (4.2.1) supports the option
+ dnl '-std=gnu99' but not the option '-std=gnu11'.
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ openbsd*)
+ AC_DEFINE([_ISOC11_SOURCE], [1],
+ [Define to enable the declarations of ISO C 11 types and functions.])
+ ;;
+ esac
+])
diff --git a/gl/m4/extern-inline.m4 b/gl/m4/extern-inline.m4
new file mode 100644
index 0000000..8a12bdd
--- /dev/null
+++ b/gl/m4/extern-inline.m4
@@ -0,0 +1,130 @@
+dnl 'extern inline' a la ISO C99.
+
+dnl Copyright 2012-2022 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_EXTERN_INLINE],
+[
+ AC_CACHE_CHECK([whether ctype.h defines __header_inline],
+ [gl_cv_have___header_inline],
+ [AC_PREPROC_IFELSE(
+ [AC_LANG_SOURCE([[#include <ctype.h>
+ #ifndef __header_inline
+ #error "<ctype.h> does not define __header_inline"
+ #endif
+ ]])],
+ [gl_cv_have___header_inline=yes],
+ [gl_cv_have___header_inline=no])])
+ if test "$gl_cv_have___header_inline" = yes; then
+ AC_DEFINE([HAVE___HEADER_INLINE], [1],
+ [Define to 1 if ctype.h defines __header_inline.])
+ fi
+
+ AH_VERBATIM([HAVE___HEADER_INLINE_1],
+[/* Please see the Gnulib manual for how to use these macros.
+
+ Suppress extern inline with HP-UX cc, as it appears to be broken; see
+ <https://lists.gnu.org/r/bug-texinfo/2013-02/msg00030.html>.
+
+ Suppress extern inline with Sun C in standards-conformance mode, as it
+ mishandles inline functions that call each other. E.g., for 'inline void f
+ (void) { } inline void g (void) { f (); }', c99 incorrectly complains
+ 'reference to static identifier "f" in extern inline function'.
+ This bug was observed with Oracle Developer Studio 12.6
+ (Sun C 5.15 SunOS_sparc 2017/05/30).
+
+ Suppress extern inline (with or without __attribute__ ((__gnu_inline__)))
+ on configurations that mistakenly use 'static inline' to implement
+ functions or macros in standard C headers like <ctype.h>. For example,
+ if isdigit is mistakenly implemented via a static inline function,
+ a program containing an extern inline function that calls isdigit
+ may not work since the C standard prohibits extern inline functions
+ from calling static functions (ISO C 99 section 6.7.4.(3).
+ This bug is known to occur on:
+
+ OS X 10.8 and earlier; see:
+ https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html
+
+ DragonFly; see
+ http://muscles.dragonflybsd.org/bulk/clang-master-potential/20141111_102002/logs/ah-tty-0.3.12.log
+
+ FreeBSD; see:
+ https://lists.gnu.org/r/bug-gnulib/2014-07/msg00104.html
+
+ OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
+ for clang but remains for g++; see <https://trac.macports.org/ticket/41033>.
+ Assume DragonFly and FreeBSD will be similar.
+
+ GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
+ inline semantics, unless -fgnu89-inline is used. It defines a macro
+ __GNUC_STDC_INLINE__ to indicate this situation or a macro
+ __GNUC_GNU_INLINE__ to indicate the opposite situation.
+ GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline
+ semantics but warns, unless -fgnu89-inline is used:
+ warning: C99 inline functions are not supported; using GNU89
+ warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute
+ It defines a macro __GNUC_GNU_INLINE__ to indicate this situation.
+ */
+#if (((defined __APPLE__ && defined __MACH__) \
+ || defined __DragonFly__ || defined __FreeBSD__) \
+ && (defined HAVE___HEADER_INLINE \
+ ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \
+ && ! defined __clang__) \
+ : ((! defined _DONT_USE_CTYPE_INLINE_ \
+ && (defined __GNUC__ || defined __cplusplus)) \
+ || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \
+ && defined __GNUC__ && ! defined __cplusplus))))
+# define _GL_EXTERN_INLINE_STDHEADER_BUG
+#endif
+#if ((__GNUC__ \
+ ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
+ : (199901L <= __STDC_VERSION__ \
+ && !defined __HP_cc \
+ && !defined __PGI \
+ && !(defined __SUNPRO_C && __STDC__))) \
+ && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
+# define _GL_INLINE inline
+# define _GL_EXTERN_INLINE extern inline
+# define _GL_EXTERN_INLINE_IN_USE
+#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
+ && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
+# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__
+ /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
+# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
+# else
+# define _GL_INLINE extern inline
+# endif
+# define _GL_EXTERN_INLINE extern
+# define _GL_EXTERN_INLINE_IN_USE
+#else
+# define _GL_INLINE _GL_UNUSED static
+# define _GL_EXTERN_INLINE _GL_UNUSED static
+#endif
+
+/* In GCC 4.6 (inclusive) to 5.1 (exclusive),
+ suppress bogus "no previous prototype for 'FOO'"
+ and "no previous declaration for 'FOO'" diagnostics,
+ when FOO is an inline function in the header; see
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113> and
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63877>. */
+#if __GNUC__ == 4 && 6 <= __GNUC_MINOR__
+# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
+# define _GL_INLINE_HEADER_CONST_PRAGMA
+# else
+# define _GL_INLINE_HEADER_CONST_PRAGMA \
+ _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
+# endif
+# define _GL_INLINE_HEADER_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
+ _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
+ _GL_INLINE_HEADER_CONST_PRAGMA
+# define _GL_INLINE_HEADER_END \
+ _Pragma ("GCC diagnostic pop")
+#else
+# define _GL_INLINE_HEADER_BEGIN
+# define _GL_INLINE_HEADER_END
+#endif])
+])
diff --git a/gl/m4/fchdir.m4 b/gl/m4/fchdir.m4
new file mode 100644
index 0000000..f85549a
--- /dev/null
+++ b/gl/m4/fchdir.m4
@@ -0,0 +1,66 @@
+# fchdir.m4 serial 27
+dnl Copyright (C) 2006-2022 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_FCHDIR],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ AC_CHECK_DECLS_ONCE([fchdir])
+ if test $ac_cv_have_decl_fchdir = no; then
+ HAVE_DECL_FCHDIR=0
+ fi
+
+ AC_REQUIRE([gl_TEST_FCHDIR])
+ if test $HAVE_FCHDIR = 0; then
+ AC_DEFINE([REPLACE_FCHDIR], [1],
+ [Define to 1 if gnulib's fchdir() replacement is used.])
+ dnl We must also replace anything that can manipulate a directory fd,
+ dnl to keep our bookkeeping up-to-date. We don't have to replace
+ dnl fstatat, since no platform has fstatat but lacks fchdir.
+ AC_CACHE_CHECK([whether open can visit directories],
+ [gl_cv_func_open_directory_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <fcntl.h>
+ ]GL_MDA_DEFINES],
+ [[return open(".", O_RDONLY) < 0;]])],
+ [gl_cv_func_open_directory_works=yes],
+ [gl_cv_func_open_directory_works=no],
+ [case "$host_os" in
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_open_directory_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_open_directory_works="$gl_cross_guess_normal" ;;
+ esac
+ ])])
+ case "$gl_cv_func_open_directory_works" in
+ *yes) ;;
+ *)
+ AC_DEFINE([REPLACE_OPEN_DIRECTORY], [1], [Define to 1 if open() should
+work around the inability to open a directory.])
+ ;;
+ esac
+ fi
+])
+
+# Determine whether to use the overrides in lib/fchdir.c.
+AC_DEFUN([gl_TEST_FCHDIR],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([fchdir])
+ if test $ac_cv_func_fchdir = no; then
+ HAVE_FCHDIR=0
+ fi
+])
+
+# Prerequisites of lib/fchdir.c.
+AC_DEFUN([gl_PREREQ_FCHDIR], [:])
diff --git a/gl/m4/fcntl-o.m4 b/gl/m4/fcntl-o.m4
new file mode 100644
index 0000000..4dcde9e
--- /dev/null
+++ b/gl/m4/fcntl-o.m4
@@ -0,0 +1,140 @@
+# fcntl-o.m4 serial 7
+dnl Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Paul Eggert.
+
+AC_PREREQ([2.60])
+
+# Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
+# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
+# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
+AC_DEFUN([gl_FCNTL_O_FLAGS],
+[
+ dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ AC_CHECK_FUNCS_ONCE([symlink])
+ AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ #include <sys/stat.h>
+ #if HAVE_UNISTD_H
+ # include <unistd.h>
+ #else /* on Windows with MSVC */
+ # include <io.h>
+ # include <stdlib.h>
+ # defined sleep(n) _sleep ((n) * 1000)
+ #endif
+ #include <fcntl.h>
+ ]GL_MDA_DEFINES[
+ #ifndef O_NOATIME
+ #define O_NOATIME 0
+ #endif
+ #ifndef O_NOFOLLOW
+ #define O_NOFOLLOW 0
+ #endif
+ static int const constants[] =
+ {
+ O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
+ O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
+ };
+ ]],
+ [[
+ int result = !constants;
+ #if HAVE_SYMLINK
+ {
+ static char const sym[] = "conftest.sym";
+ if (symlink ("/dev/null", sym) != 0)
+ result |= 2;
+ else
+ {
+ int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
+ if (fd >= 0)
+ {
+ close (fd);
+ result |= 4;
+ }
+ }
+ if (unlink (sym) != 0 || symlink (".", sym) != 0)
+ result |= 2;
+ else
+ {
+ int fd = open (sym, O_RDONLY | O_NOFOLLOW);
+ if (fd >= 0)
+ {
+ close (fd);
+ result |= 4;
+ }
+ }
+ unlink (sym);
+ }
+ #endif
+ {
+ static char const file[] = "confdefs.h";
+ int fd = open (file, O_RDONLY | O_NOATIME);
+ if (fd < 0)
+ result |= 8;
+ else
+ {
+ struct stat st0;
+ if (fstat (fd, &st0) != 0)
+ result |= 16;
+ else
+ {
+ char c;
+ sleep (1);
+ if (read (fd, &c, 1) != 1)
+ result |= 24;
+ else
+ {
+ if (close (fd) != 0)
+ result |= 32;
+ else
+ {
+ struct stat st1;
+ if (stat (file, &st1) != 0)
+ result |= 40;
+ else
+ if (st0.st_atime != st1.st_atime)
+ result |= 64;
+ }
+ }
+ }
+ }
+ }
+ return result;]])],
+ [gl_cv_header_working_fcntl_h=yes],
+ [case $? in #(
+ 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
+ 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
+ 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
+ *) gl_cv_header_working_fcntl_h='no';;
+ esac],
+ [case "$host_os" in
+ # Guess 'no' on native Windows.
+ mingw*) gl_cv_header_working_fcntl_h='no' ;;
+ *) gl_cv_header_working_fcntl_h=cross-compiling ;;
+ esac
+ ])
+ ])
+
+ case $gl_cv_header_working_fcntl_h in #(
+ *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
+ *) ac_val=1;;
+ esac
+ AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val],
+ [Define to 1 if O_NOATIME works.])
+
+ case $gl_cv_header_working_fcntl_h in #(
+ *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
+ *) ac_val=1;;
+ esac
+ AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val],
+ [Define to 1 if O_NOFOLLOW works.])
+])
diff --git a/gl/m4/fcntl.m4 b/gl/m4/fcntl.m4
new file mode 100644
index 0000000..428e570
--- /dev/null
+++ b/gl/m4/fcntl.m4
@@ -0,0 +1,151 @@
+# fcntl.m4 serial 11
+dnl Copyright (C) 2009-2022 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.
+
+# For now, this module ensures that fcntl()
+# - supports F_DUPFD correctly
+# - supports or emulates F_DUPFD_CLOEXEC
+# - supports F_GETFD
+# Still to be ported to mingw:
+# - F_SETFD
+# - F_GETFL, F_SETFL
+# - F_GETOWN, F_SETOWN
+# - F_GETLK, F_SETLK, F_SETLKW
+AC_DEFUN([gl_FUNC_FCNTL],
+[
+ dnl Persuade glibc to expose F_DUPFD_CLOEXEC.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CHECK_FUNCS_ONCE([fcntl])
+ if test $ac_cv_func_fcntl = no; then
+ gl_REPLACE_FCNTL
+ else
+ dnl cygwin 1.5.x F_DUPFD has wrong errno, and allows negative target
+ dnl haiku alpha 2 F_DUPFD has wrong errno
+ AC_CACHE_CHECK([whether fcntl handles F_DUPFD correctly],
+ [gl_cv_func_fcntl_f_dupfd_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <errno.h>
+ #include <fcntl.h>
+ #include <limits.h>
+ #include <sys/resource.h>
+ #include <unistd.h>
+ ]GL_MDA_DEFINES[
+ #ifndef RLIM_SAVED_CUR
+ # define RLIM_SAVED_CUR RLIM_INFINITY
+ #endif
+ #ifndef RLIM_SAVED_MAX
+ # define RLIM_SAVED_MAX RLIM_INFINITY
+ #endif
+ ]],
+ [[int result = 0;
+ int bad_fd = INT_MAX;
+ struct rlimit rlim;
+ if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
+ && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
+ && rlim.rlim_cur != RLIM_INFINITY
+ && rlim.rlim_cur != RLIM_SAVED_MAX
+ && rlim.rlim_cur != RLIM_SAVED_CUR)
+ bad_fd = rlim.rlim_cur;
+ if (fcntl (0, F_DUPFD, -1) != -1) result |= 1;
+ if (errno != EINVAL) result |= 2;
+ if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4;
+ if (errno != EINVAL) result |= 8;
+ /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */
+ {
+ int fd;
+ fd = open (".", O_RDONLY);
+ if (fd == -1)
+ result |= 16;
+ else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1)
+ result |= 32;
+
+ close (fd);
+ }
+ return result;]])],
+ [gl_cv_func_fcntl_f_dupfd_works=yes],
+ [gl_cv_func_fcntl_f_dupfd_works=no],
+ [case $host_os in
+ aix* | cygwin* | haiku*)
+ gl_cv_func_fcntl_f_dupfd_works="guessing no" ;;
+ *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;;
+ esac])])
+ case $gl_cv_func_fcntl_f_dupfd_works in
+ *yes) ;;
+ *) gl_REPLACE_FCNTL
+ AC_DEFINE([FCNTL_DUPFD_BUGGY], [1], [Define this to 1 if F_DUPFD
+ behavior does not match POSIX]) ;;
+ esac
+
+ dnl Many systems lack F_DUPFD_CLOEXEC.
+ dnl NetBSD 9.0 declares F_DUPFD_CLOEXEC but it works only like F_DUPFD.
+ AC_CACHE_CHECK([whether fcntl understands F_DUPFD_CLOEXEC],
+ [gl_cv_func_fcntl_f_dupfd_cloexec],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#include <fcntl.h>
+ #include <unistd.h>
+ int main (int argc, char *argv[])
+ {
+ if (argc == 1)
+ /* parent process */
+ {
+ if (fcntl (1, F_DUPFD_CLOEXEC, 10) < 0)
+ return 1;
+ return execl ("./conftest", "./conftest", "child", NULL);
+ }
+ else
+ /* child process */
+ return (fcntl (10, F_GETFL) < 0 ? 0 : 42);
+ }
+ ]])
+ ],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#ifdef __linux__
+/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace
+ it to support the semantics on older kernels that failed with EINVAL. */
+choke me
+#endif
+ ]])],
+ [gl_cv_func_fcntl_f_dupfd_cloexec=yes],
+ [gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"])
+ ],
+ [gl_cv_func_fcntl_f_dupfd_cloexec=no],
+ [case "$host_os" in
+ # Guess no on NetBSD.
+ netbsd*) gl_cv_func_fcntl_f_dupfd_cloexec="guessing no" ;;
+ *) gl_cv_func_fcntl_f_dupfd_cloexec="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_fcntl_f_dupfd_cloexec" in
+ *yes) ;;
+ *) gl_REPLACE_FCNTL
+ dnl No witness macro needed for this bug.
+ ;;
+ esac
+ fi
+ dnl Replace fcntl() for supporting the gnulib-defined fchdir() function,
+ dnl to keep fchdir's bookkeeping up-to-date.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ gl_REPLACE_FCNTL
+ fi
+ ])
+])
+
+AC_DEFUN([gl_REPLACE_FCNTL],
+[
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([fcntl])
+ if test $ac_cv_func_fcntl = no; then
+ HAVE_FCNTL=0
+ else
+ REPLACE_FCNTL=1
+ fi
+])
diff --git a/gl/m4/fcntl_h.m4 b/gl/m4/fcntl_h.m4
new file mode 100644
index 0000000..267f98b
--- /dev/null
+++ b/gl/m4/fcntl_h.m4
@@ -0,0 +1,70 @@
+# serial 20
+# Configure fcntl.h.
+dnl Copyright (C) 2006-2007, 2009-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Paul Eggert.
+
+AC_DEFUN_ONCE([gl_FCNTL_H],
+[
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+ AC_REQUIRE([gl_FCNTL_O_FLAGS])
+ gl_NEXT_HEADERS([fcntl.h])
+
+ dnl Ensure the type pid_t gets defined.
+ AC_REQUIRE([AC_TYPE_PID_T])
+
+ dnl Ensure the type mode_t gets defined.
+ AC_REQUIRE([AC_TYPE_MODE_T])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use, if it is not common
+ dnl enough to be declared everywhere.
+ gl_WARN_ON_USE_PREPARE([[#include <fcntl.h>
+ ]], [fcntl openat])
+])
+
+# gl_FCNTL_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_FCNTL_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_FCNTL_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_FCNTL_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_FCNTL_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CREAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCNTL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NONBLOCKING])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OPEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OPENAT])
+ dnl Support Microsoft deprecated alias function names by default.
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CREAT], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_OPEN], [1])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_FCNTL_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_FCNTL_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL])
+ HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT])
+ REPLACE_CREAT=0; AC_SUBST([REPLACE_CREAT])
+ REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL])
+ REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN])
+ REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT])
+])
diff --git a/gl/m4/fdopendir.m4 b/gl/m4/fdopendir.m4
new file mode 100644
index 0000000..3001608
--- /dev/null
+++ b/gl/m4/fdopendir.m4
@@ -0,0 +1,67 @@
+# serial 14
+# See if we need to provide fdopendir.
+
+dnl Copyright (C) 2009-2022 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.
+
+# Written by Eric Blake.
+
+AC_DEFUN([gl_FUNC_FDOPENDIR],
+[
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ dnl FreeBSD 7.3 has the function, but failed to declare it.
+ AC_CHECK_DECLS([fdopendir], [], [HAVE_DECL_FDOPENDIR=0], [[
+#include <dirent.h>
+ ]])
+ AC_CHECK_FUNCS_ONCE([fdopendir])
+ if test $ac_cv_func_fdopendir = no; then
+ HAVE_FDOPENDIR=0
+ else
+ AC_CACHE_CHECK([whether fdopendir works],
+ [gl_cv_func_fdopendir_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+#include <dirent.h>
+#include <fcntl.h>
+#include <unistd.h>
+]GL_MDA_DEFINES[
+#if !HAVE_DECL_FDOPENDIR
+extern
+# ifdef __cplusplus
+"C"
+# endif
+DIR *fdopendir (int);
+#endif
+]],
+ [[int result = 0;
+ int fd = open ("conftest.c", O_RDONLY);
+ if (fd < 0) result |= 1;
+ if (fdopendir (fd)) result |= 2;
+ if (close (fd)) result |= 4;
+ return result;
+ ]])],
+ [gl_cv_func_fdopendir_works=yes],
+ [gl_cv_func_fdopendir_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_fdopendir_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_fdopendir_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_fdopendir_works="$gl_cross_guess_normal" ;;
+ esac
+ ])])
+ case "$gl_cv_func_fdopendir_works" in
+ *yes) ;;
+ *)
+ REPLACE_FDOPENDIR=1
+ ;;
+ esac
+ fi
+])
diff --git a/gl/m4/filenamecat.m4 b/gl/m4/filenamecat.m4
new file mode 100644
index 0000000..4546b83
--- /dev/null
+++ b/gl/m4/filenamecat.m4
@@ -0,0 +1,16 @@
+# filenamecat.m4 serial 11
+dnl Copyright (C) 2002-2006, 2009-2022 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_FILE_NAME_CONCAT],
+[
+ AC_REQUIRE([gl_FILE_NAME_CONCAT_LGPL])
+])
+
+AC_DEFUN([gl_FILE_NAME_CONCAT_LGPL],
+[
+ dnl Prerequisites of lib/filenamecat-lgpl.c.
+ AC_CHECK_FUNCS_ONCE([mempcpy])
+])
diff --git a/gl/m4/flexmember.m4 b/gl/m4/flexmember.m4
new file mode 100644
index 0000000..3b4237e
--- /dev/null
+++ b/gl/m4/flexmember.m4
@@ -0,0 +1,44 @@
+# serial 5
+# Check for flexible array member support.
+
+# Copyright (C) 2006, 2009-2022 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.
+
+AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER],
+[
+ AC_CACHE_CHECK([for flexible array member],
+ ac_cv_c_flexmember,
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdlib.h>
+ #include <stdio.h>
+ #include <stddef.h>
+ struct m { struct m *next, **list; char name[]; };
+ struct s { struct s *p; struct m *m; int n; double d[]; };]],
+ [[int m = getchar ();
+ size_t nbytes = offsetof (struct s, d) + m * sizeof (double);
+ nbytes += sizeof (struct s) - 1;
+ nbytes -= nbytes % sizeof (struct s);
+ struct s *p = malloc (nbytes);
+ p->p = p;
+ p->m = NULL;
+ p->d[0] = 0.0;
+ return p->d != (double *) NULL;]])],
+ [ac_cv_c_flexmember=yes],
+ [ac_cv_c_flexmember=no])])
+ if test $ac_cv_c_flexmember = yes; then
+ AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [],
+ [Define to nothing if C supports flexible array members, and to
+ 1 if it does not. That way, with a declaration like 'struct s
+ { int n; short d@<:@FLEXIBLE_ARRAY_MEMBER@:>@; };', the struct hack
+ can be used with pre-C99 compilers.
+ Use 'FLEXSIZEOF (struct s, d, N * sizeof (short))' to calculate
+ the size in bytes of such a struct containing an N-element array.])
+ else
+ AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [1])
+ fi
+])
diff --git a/gl/m4/float_h.m4 b/gl/m4/float_h.m4
new file mode 100644
index 0000000..0e84572
--- /dev/null
+++ b/gl/m4/float_h.m4
@@ -0,0 +1,106 @@
+# float_h.m4 serial 13
+dnl Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FLOAT_H],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ GL_GENERATE_FLOAT_H=false
+ REPLACE_FLOAT_LDBL=0
+ case "$host_os" in
+ aix* | beos* | openbsd* | mirbsd* | irix*)
+ GL_GENERATE_FLOAT_H=true
+ ;;
+ freebsd* | dragonfly*)
+ case "$host_cpu" in
+changequote(,)dnl
+ i[34567]86 )
+changequote([,])dnl
+ GL_GENERATE_FLOAT_H=true
+ ;;
+ x86_64 )
+ # On x86_64 systems, the C compiler may still be generating
+ # 32-bit code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__ || defined __x86_64__ || defined __amd64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [],
+ [GL_GENERATE_FLOAT_H=true])
+ ;;
+ esac
+ ;;
+ linux*)
+ case "$host_cpu" in
+ powerpc*)
+ GL_GENERATE_FLOAT_H=true
+ ;;
+ esac
+ ;;
+ esac
+ case "$host_os" in
+ aix* | freebsd* | dragonfly* | linux*)
+ if $GL_GENERATE_FLOAT_H; then
+ REPLACE_FLOAT_LDBL=1
+ fi
+ ;;
+ esac
+
+ dnl Test against glibc-2.7 Linux/SPARC64 bug.
+ REPLACE_ITOLD=0
+ AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works],
+ [gl_cv_func_itold_works],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+int i = -1;
+volatile long double ld;
+int main ()
+{
+ ld += i * 1.0L;
+ if (ld > 0)
+ return 1;
+ return 0;
+}]])],
+ [gl_cv_func_itold_works=yes],
+ [gl_cv_func_itold_works=no],
+ [case "$host" in
+ sparc*-*-linux*)
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__ || defined __arch64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_func_itold_works="guessing no"],
+ [gl_cv_func_itold_works="guessing yes"])
+ ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_itold_works="guessing yes" ;;
+ *) gl_cv_func_itold_works="guessing yes" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_itold_works" in
+ *no)
+ REPLACE_ITOLD=1
+ dnl We add the workaround to <float.h> but also to <math.h>,
+ dnl to increase the chances that the fix function gets pulled in.
+ GL_GENERATE_FLOAT_H=true
+ ;;
+ esac
+
+ if $GL_GENERATE_FLOAT_H; then
+ gl_NEXT_HEADERS([float.h])
+ fi
+ AC_SUBST([REPLACE_ITOLD])
+])
diff --git a/gl/m4/flock.m4 b/gl/m4/flock.m4
new file mode 100644
index 0000000..655395e
--- /dev/null
+++ b/gl/m4/flock.m4
@@ -0,0 +1,24 @@
+# flock.m4 serial 4
+dnl Copyright (C) 2008-2022 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_FLOCK],
+[
+ AC_REQUIRE([gl_SYS_FILE_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([flock])
+ if test $ac_cv_func_flock = no; then
+ HAVE_FLOCK=0
+ fi
+])
+
+dnl Prerequisites of lib/flock.c.
+AC_DEFUN([gl_PREREQ_FLOCK],
+[
+ AC_CHECK_FUNCS_ONCE([fcntl])
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+
+ dnl Do we have a POSIX fcntl lock implementation?
+ AC_CHECK_MEMBERS([struct flock.l_type],[],[],[[#include <fcntl.h>]])
+])
diff --git a/gl/m4/fnmatch.m4 b/gl/m4/fnmatch.m4
new file mode 100644
index 0000000..9c60559
--- /dev/null
+++ b/gl/m4/fnmatch.m4
@@ -0,0 +1,153 @@
+# Check for fnmatch - serial 15. -*- coding: utf-8 -*-
+
+# Copyright (C) 2000-2007, 2009-2022 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.
+
+# Autoconf defines AC_FUNC_FNMATCH, but that is obsolescent.
+# New applications should use the macros below instead.
+
+# Request a POSIX compliant fnmatch function.
+AC_DEFUN([gl_FUNC_FNMATCH_POSIX],
+[
+ m4_divert_text([DEFAULTS], [gl_fnmatch_required=POSIX])
+
+ AC_REQUIRE([gl_FNMATCH_H])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ gl_fnmatch_required_lowercase=`
+ echo $gl_fnmatch_required | LC_ALL=C tr '[[A-Z]]' '[[a-z]]'
+ `
+ AC_CHECK_FUNCS_ONCE([fnmatch])
+ if test $ac_cv_func_fnmatch = no; then
+ HAVE_FNMATCH=0
+ else
+ gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}"
+ AC_CACHE_CHECK([for working $gl_fnmatch_required fnmatch],
+ [$gl_fnmatch_cache_var],
+ [dnl Some versions of Solaris, SCO, and the GNU C Library
+ dnl have a broken or incompatible fnmatch.
+ dnl So we run a test program. If we are cross-compiling, take no chance.
+ dnl Thanks to John Oleynick, François Pinard, and Paul Eggert for this
+ dnl test.
+ if test $gl_fnmatch_required = GNU; then
+ gl_fnmatch_gnu_start=
+ gl_fnmatch_gnu_end=
+ else
+ gl_fnmatch_gnu_start='#if 0'
+ gl_fnmatch_gnu_end='#endif'
+ fi
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <fnmatch.h>
+ static int
+ y (char const *pattern, char const *string, int flags)
+ {
+ return fnmatch (pattern, string, flags) == 0;
+ }
+ static int
+ n (char const *pattern, char const *string, int flags)
+ {
+ return fnmatch (pattern, string, flags) == FNM_NOMATCH;
+ }
+ ]],
+ [[char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]";
+ char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]";
+ static char const A_1[] = { 'A' - 1, 0 };
+ static char const A01[] = { 'A' + 1, 0 };
+ static char const a_1[] = { 'a' - 1, 0 };
+ static char const a01[] = { 'a' + 1, 0 };
+ static char const bs_1[] = { '\\\\' - 1, 0 };
+ static char const bs01[] = { '\\\\' + 1, 0 };
+ int result = 0;
+ if (!n ("a*", "", 0))
+ return 1;
+ if (!y ("a*", "abc", 0))
+ return 1;
+ if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */
+ return 1;
+ if (!n ("d*/*1", "d/s/1", FNM_PATHNAME))
+ return 2;
+ if (!y ("a\\\\bc", "abc", 0))
+ return 3;
+ if (!n ("a\\\\bc", "abc", FNM_NOESCAPE))
+ return 3;
+ if (!y ("*x", ".x", 0))
+ return 4;
+ if (!n ("*x", ".x", FNM_PERIOD))
+ return 4;
+ if (!y (Apat, "\\\\", 0))
+ return 5;
+ if (!y (Apat, "A", 0))
+ return 5;
+ if (!y (apat, "\\\\", 0))
+ return 5;
+ if (!y (apat, "a", 0))
+ return 5;
+ if (!(n (Apat, A_1, 0) == ('A' < '\\\\')))
+ return 5;
+ if (!(n (apat, a_1, 0) == ('a' < '\\\\')))
+ return 5;
+ if (!(y (Apat, A01, 0) == ('A' < '\\\\')))
+ return 5;
+ if (!(y (apat, a01, 0) == ('a' < '\\\\')))
+ return 5;
+ if (!(y (Apat, bs_1, 0) == ('A' < '\\\\')))
+ return 5;
+ if (!(y (apat, bs_1, 0) == ('a' < '\\\\')))
+ return 5;
+ if (!(n (Apat, bs01, 0) == ('A' < '\\\\')))
+ return 5;
+ if (!(n (apat, bs01, 0) == ('a' < '\\\\')))
+ return 5;
+ $gl_fnmatch_gnu_start
+ if (!y ("xxXX", "xXxX", FNM_CASEFOLD))
+ result |= 8;
+ if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH))
+ result |= 16;
+ if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME))
+ result |= 32;
+ if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR))
+ result |= 64;
+ if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR))
+ result |= 64;
+ if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR))
+ result |= 64;
+ $gl_fnmatch_gnu_end
+ return result;
+ ]])],
+ [eval "$gl_fnmatch_cache_var=yes"],
+ [eval "$gl_fnmatch_cache_var=no"],
+ [case "$host_os" in
+ # Guess yes on musl systems.
+ *-musl*) eval "$gl_fnmatch_cache_var=\"guessing yes\"" ;;
+ # Guess no otherwise, even on glibc systems.
+ *) eval "$gl_fnmatch_cache_var=\"guessing no\"" ;;
+ esac
+ ])
+ ])
+ eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\""
+ case "$gl_fnmatch_result" in
+ *yes) ;;
+ *) REPLACE_FNMATCH=1 ;;
+ esac
+ fi
+ if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
+ gl_REPLACE_FNMATCH_H
+ fi
+])
+
+# Request a POSIX compliant fnmatch function with GNU extensions.
+AC_DEFUN([gl_FUNC_FNMATCH_GNU],
+[
+ m4_divert_text([INIT_PREPARE], [gl_fnmatch_required=GNU])
+
+ AC_REQUIRE([gl_FUNC_FNMATCH_POSIX])
+])
+
+AC_DEFUN([gl_PREREQ_FNMATCH],
+[
+ dnl Prerequisites of lib/fnmatch.c.
+ AC_REQUIRE([AC_TYPE_MBSTATE_T])
+ AC_CHECK_FUNCS_ONCE([mbsrtowcs])
+])
diff --git a/gl/m4/fnmatch_h.m4 b/gl/m4/fnmatch_h.m4
new file mode 100644
index 0000000..ae5cd86
--- /dev/null
+++ b/gl/m4/fnmatch_h.m4
@@ -0,0 +1,87 @@
+# fnmatch_h.m4 serial 8
+dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN_ONCE([gl_FNMATCH_H],
+[
+ AC_REQUIRE([gl_FNMATCH_H_DEFAULTS])
+ m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])])
+ AC_CHECK_HEADERS_ONCE([fnmatch.h])
+ gl_CHECK_NEXT_HEADERS([fnmatch.h])
+
+ dnl Persuade glibc <fnmatch.h> to declare FNM_CASEFOLD etc.
+ dnl This is only needed if gl_fnmatch_required = GNU. It would be possible
+ dnl to avoid this dependency for gl_FUNC_FNMATCH_POSIX by putting
+ dnl gl_FUNC_FNMATCH_GNU into a separate .m4 file.
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ if test $ac_cv_header_fnmatch_h = yes; then
+ HAVE_FNMATCH_H=1
+ else
+ HAVE_FNMATCH_H=0
+ fi
+ AC_SUBST([HAVE_FNMATCH_H])
+
+ m4_ifdef([gl_POSIXCHECK],
+ [GL_GENERATE_FNMATCH_H=true],
+ [GL_GENERATE_FNMATCH_H=false
+ if m4_ifdef([gl_ANSI_CXX], [test "$CXX" != no], [false]); then
+ dnl Override <fnmatch.h> always, to support the C++ GNULIB_NAMESPACE.
+ GL_GENERATE_FNMATCH_H=true
+ else
+ if test $ac_cv_header_fnmatch_h != yes; then
+ dnl Provide a substitute <fnmatch.h> file.
+ GL_GENERATE_FNMATCH_H=true
+ fi
+ fi
+ ])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <fnmatch.h>
+ ]],
+ [fnmatch])
+])
+
+dnl Unconditionally enables the replacement of <fnmatch.h>.
+AC_DEFUN([gl_REPLACE_FNMATCH_H],
+[
+ gl_FNMATCH_H_REQUIRE_DEFAULTS
+ GL_GENERATE_FNMATCH_H=true
+])
+
+# gl_FNMATCH_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_FNMATCH_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_FNMATCH_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_FNMATCH_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_FNMATCH_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FNMATCH])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_FNMATCH_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_FNMATCH_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_FNMATCH_H_DEFAULTS],
+[
+ dnl Assume POSIX behavior unless another module says otherwise.
+ HAVE_FNMATCH=1; AC_SUBST([HAVE_FNMATCH])
+ REPLACE_FNMATCH=0; AC_SUBST([REPLACE_FNMATCH])
+])
diff --git a/gl/m4/free.m4 b/gl/m4/free.m4
new file mode 100644
index 0000000..dfeecd2
--- /dev/null
+++ b/gl/m4/free.m4
@@ -0,0 +1,52 @@
+# free.m4 serial 6
+# Copyright (C) 2003-2005, 2009-2022 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 and Bruno Haible.
+
+AC_DEFUN([gl_FUNC_FREE],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+
+ dnl In the next release of POSIX, free must preserve errno.
+ dnl https://www.austingroupbugs.net/view.php?id=385
+ dnl https://sourceware.org/bugzilla/show_bug.cgi?id=17924
+ dnl So far, we know of three platforms that do this:
+ dnl * glibc >= 2.33, thanks to the fix for this bug:
+ dnl <https://sourceware.org/bugzilla/show_bug.cgi?id=17924>
+ dnl * OpenBSD >= 4.5, thanks to this commit:
+ dnl <https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdlib/malloc.c.diff?r1=1.100&r2=1.101&f=h>
+ dnl * Solaris, because its malloc() implementation is based on brk(),
+ dnl not mmap(); hence its free() implementation makes no system calls.
+ dnl For other platforms, you can only be sure if they state it in their
+ dnl documentation, or by code inspection of the free() implementation in libc.
+ AC_CACHE_CHECK([whether free is known to preserve errno],
+ [gl_cv_func_free_preserves_errno],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdlib.h>
+ ]],
+ [[#if 2 < __GLIBC__ + (33 <= __GLIBC_MINOR__)
+ #elif defined __OpenBSD__
+ #elif defined __sun
+ #else
+ #error "'free' is not known to preserve errno"
+ #endif
+ ]])],
+ [gl_cv_func_free_preserves_errno=yes],
+ [gl_cv_func_free_preserves_errno=no])
+ ])
+
+ case $gl_cv_func_free_preserves_errno in
+ *yes)
+ AC_DEFINE([HAVE_FREE_POSIX], [1],
+ [Define if the 'free' function is guaranteed to preserve errno.])
+ ;;
+ *) REPLACE_FREE=1 ;;
+ esac
+])
+
+# Prerequisites of lib/free.c.
+AC_DEFUN([gl_PREREQ_FREE], [:])
diff --git a/gl/m4/fstat.m4 b/gl/m4/fstat.m4
new file mode 100644
index 0000000..9e61bcc
--- /dev/null
+++ b/gl/m4/fstat.m4
@@ -0,0 +1,40 @@
+# fstat.m4 serial 8
+dnl Copyright (C) 2011-2022 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_FSTAT],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+
+ case "$host_os" in
+ mingw* | solaris*)
+ dnl On MinGW, the original stat() returns st_atime, st_mtime,
+ dnl st_ctime values that are affected by the time zone.
+ dnl Solaris stat can return a negative tv_nsec.
+ REPLACE_FSTAT=1
+ ;;
+ esac
+
+ dnl Replace fstat() for supporting the gnulib-defined open() on directories.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ case "$gl_cv_func_open_directory_works" in
+ *yes) ;;
+ *)
+ REPLACE_FSTAT=1
+ ;;
+ esac
+ fi
+ ])
+])
+
+# Prerequisites of lib/fstat.c and lib/stat-w32.c.
+AC_DEFUN([gl_PREREQ_FSTAT], [
+ AC_REQUIRE([gl_SYS_STAT_H])
+ AC_REQUIRE([gl_PREREQ_STAT_W32])
+ :
+])
diff --git a/gl/m4/fstatat.m4 b/gl/m4/fstatat.m4
new file mode 100644
index 0000000..e8604a6
--- /dev/null
+++ b/gl/m4/fstatat.m4
@@ -0,0 +1,65 @@
+# fstatat.m4 serial 4
+dnl Copyright (C) 2004-2022 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.
+
+# Written by Jim Meyering.
+
+# If we have the fstatat function, and it has the bug (in AIX 7.1)
+# that it does not fill in st_size correctly, use the replacement function.
+AC_DEFUN([gl_FUNC_FSTATAT],
+[
+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CHECK_FUNCS_ONCE([fstatat])
+
+ if test $ac_cv_func_fstatat = no; then
+ HAVE_FSTATAT=0
+ else
+ dnl Test for an AIX 7.1 bug; see
+ dnl <https://lists.gnu.org/r/bug-tar/2011-09/msg00015.html>.
+ AC_CACHE_CHECK([whether fstatat (..., 0) works],
+ [gl_cv_func_fstatat_zero_flag],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE(
+ [[
+ #include <fcntl.h>
+ #include <sys/stat.h>
+ int
+ main (void)
+ {
+ struct stat a;
+ return fstatat (AT_FDCWD, ".", &a, 0) != 0;
+ }
+ ]])],
+ [gl_cv_func_fstatat_zero_flag=yes],
+ [gl_cv_func_fstatat_zero_flag=no],
+ [case "$host_os" in
+ aix*) gl_cv_func_fstatat_zero_flag="guessing no";;
+ *) gl_cv_func_fstatat_zero_flag="guessing yes";;
+ esac
+ ])
+ ])
+
+ case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in
+ *yes+*yes) ;;
+ *) REPLACE_FSTATAT=1 ;;
+ esac
+
+ case $host_os in
+ solaris*)
+ REPLACE_FSTATAT=1 ;;
+ esac
+
+ case $REPLACE_FSTATAT,$gl_cv_func_fstatat_zero_flag in
+ 1,*yes)
+ AC_DEFINE([HAVE_WORKING_FSTATAT_ZERO_FLAG], [1],
+ [Define to 1 if fstatat (..., 0) works.
+ For example, it does not work in AIX 7.1.])
+ ;;
+ esac
+ fi
+])
diff --git a/gl/m4/getcwd-abort-bug.m4 b/gl/m4/getcwd-abort-bug.m4
new file mode 100644
index 0000000..2174e3f
--- /dev/null
+++ b/gl/m4/getcwd-abort-bug.m4
@@ -0,0 +1,158 @@
+# serial 16
+# Determine whether getcwd aborts when the length of the working directory
+# name is unusually large. Any length between 4k and 16k trigger the bug
+# when using glibc-2.4.90-9 or older.
+
+# Copyright (C) 2006, 2009-2022 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.
+
+# From Jim Meyering
+
+# gl_FUNC_GETCWD_ABORT_BUG([ACTION-IF-BUGGY[, ACTION-IF-WORKS]])
+AC_DEFUN([gl_FUNC_GETCWD_ABORT_BUG],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_DECLS_ONCE([getcwd])
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ AC_REQUIRE([gl_PATHMAX_SNIPPET_PREREQ])
+
+ gl_CHECK_FUNC_GETPAGESIZE
+ if test $gl_cv_func_getpagesize = yes; then
+ AC_DEFINE_UNQUOTED([HAVE_GETPAGESIZE], [1],
+ [Define to 1 if the system has the 'getpagesize' function.])
+ fi
+
+ AC_CACHE_CHECK([whether getcwd succeeds when 4k < cwd_length < 16k],
+ [gl_cv_func_getcwd_succeeds_beyond_4k],
+ [# Remove any remnants of a previous test.
+ rm -rf confdir-14B---
+ # Arrange for deletion of the temporary directory this test creates.
+ ac_clean_files="$ac_clean_files confdir-14B---"
+ dnl Please keep this in sync with tests/test-getcwd.c.
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE(
+ [[
+#include <errno.h>
+#include <stdlib.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <direct.h>
+#endif
+#include <string.h>
+#include <sys/stat.h>
+
+]gl_PATHMAX_SNIPPET[
+]GL_MDA_DEFINES[
+
+#ifndef S_IRWXU
+# define S_IRWXU 0700
+#endif
+
+/* FIXME: skip the run-test altogether on systems without getpagesize. */
+#if ! HAVE_GETPAGESIZE
+# define getpagesize() 0
+#endif
+
+/* This size is chosen to be larger than PATH_MAX (4k), yet smaller than
+ the 16kB pagesize on ia64 linux. Those conditions make the code below
+ trigger a bug in glibc's getcwd implementation before 2.4.90-10. */
+#define TARGET_LEN (5 * 1024)
+
+int
+main ()
+{
+ char *cwd;
+ size_t initial_cwd_len;
+ int fail = 0;
+
+ /* The bug is triggered when PATH_MAX < getpagesize (), so skip
+ this relatively expensive and invasive test if that's not true. */
+#ifdef PATH_MAX
+ int bug_possible = PATH_MAX < getpagesize ();
+#else
+ int bug_possible = 0;
+#endif
+ if (! bug_possible)
+ return 0;
+
+ cwd = getcwd (NULL, 0);
+ if (cwd == NULL)
+ return 2;
+
+ initial_cwd_len = strlen (cwd);
+ free (cwd);
+
+ if (1)
+ {
+ static char const dir_name[] = "confdir-14B---";
+ size_t desired_depth = ((TARGET_LEN - 1 - initial_cwd_len)
+ / sizeof dir_name);
+ size_t d;
+ for (d = 0; d < desired_depth; d++)
+ {
+ if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0)
+ {
+ if (! (errno == ERANGE || errno == ENAMETOOLONG
+ || errno == ENOENT))
+ fail = 3; /* Unable to construct deep hierarchy. */
+ break;
+ }
+ }
+
+ /* If libc has the bug in question, this invocation of getcwd
+ results in a failed assertion. */
+ cwd = getcwd (NULL, 0);
+ if (cwd == NULL)
+ fail = 4; /* getcwd didn't assert, but it failed for a long name
+ where the answer could have been learned. */
+ free (cwd);
+
+ /* Call rmdir first, in case the above chdir failed. */
+ rmdir (dir_name);
+ while (0 < d--)
+ {
+ if (chdir ("..") < 0)
+ {
+ fail = 5;
+ break;
+ }
+ rmdir (dir_name);
+ }
+ }
+
+ return fail;
+}
+ ]])],
+ [gl_cv_func_getcwd_succeeds_beyond_4k=yes],
+ [dnl An abort will provoke an exit code of something like 134 (128 + 6).
+ dnl An exit code of 4 can also occur (for example in
+ dnl musl libc 1.2.2/powerpc64le, NetBSD 9.0, OpenBSD 6.7:
+ dnl getcwd (NULL, 0) fails rather than returning a string longer than
+ dnl PATH_MAX. This may be POSIX compliant (in some interpretations of
+ dnl POSIX). But gnulib's getcwd module wants to provide a non-NULL
+ dnl value in this case.
+ ret=$?
+ if test $ret -ge 128 || test $ret = 4; then
+ gl_cv_func_getcwd_succeeds_beyond_4k=no
+ else
+ gl_cv_func_getcwd_succeeds_beyond_4k=yes
+ fi
+ ],
+ [case "$host_os" in
+ # Guess no otherwise, even on glibc systems and musl systems.
+ *) gl_cv_func_getcwd_succeeds_beyond_4k="guessing no"
+ esac
+ ])
+ ])
+ case "$gl_cv_func_getcwd_succeeds_beyond_4k" in
+ *no)
+ $1
+ ;;
+ *)
+ $2
+ ;;
+ esac
+])
diff --git a/gl/m4/getcwd-path-max.m4 b/gl/m4/getcwd-path-max.m4
new file mode 100644
index 0000000..e120455
--- /dev/null
+++ b/gl/m4/getcwd-path-max.m4
@@ -0,0 +1,236 @@
+# serial 25
+# Check for several getcwd bugs with long file names.
+# If so, arrange to compile the wrapper function.
+
+# This is necessary for at least GNU libc on linux-2.4.19 and 2.4.20.
+# I've heard that this is due to a Linux kernel bug, and that it has
+# been fixed between 2.4.21-pre3 and 2.4.21-pre4.
+
+# Copyright (C) 2003-2007, 2009-2022 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.
+
+# From Jim Meyering
+
+AC_DEFUN([gl_FUNC_GETCWD_PATH_MAX],
+[
+ AC_CHECK_DECLS_ONCE([getcwd])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ AC_REQUIRE([gl_PATHMAX_SNIPPET_PREREQ])
+ AC_CACHE_CHECK([whether getcwd handles long file names properly],
+ [gl_cv_func_getcwd_path_max],
+ [# Arrange for deletion of the temporary directory this test creates.
+ ac_clean_files="$ac_clean_files confdir3"
+ dnl Please keep this in sync with tests/test-getcwd.c.
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE(
+ [[
+#include <errno.h>
+#include <stdlib.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else
+# include <direct.h>
+#endif
+#include <string.h>
+#include <limits.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+
+]gl_PATHMAX_SNIPPET[
+
+#ifndef AT_FDCWD
+# define AT_FDCWD 0
+#endif
+#ifdef ENAMETOOLONG
+# define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG)
+#else
+# define is_ENAMETOOLONG(x) 0
+#endif
+
+/* Use the getcwd function, not any macro. */
+#undef getcwd
+
+]GL_MDA_DEFINES[
+
+#ifndef S_IRWXU
+# define S_IRWXU 0700
+#endif
+
+/* The length of this name must be 8. */
+#define DIR_NAME "confdir3"
+#define DIR_NAME_LEN 8
+#define DIR_NAME_SIZE (DIR_NAME_LEN + 1)
+
+/* The length of "../". */
+#define DOTDOTSLASH_LEN 3
+
+/* Leftover bytes in the buffer, to work around library or OS bugs. */
+#define BUF_SLOP 20
+
+int
+main ()
+{
+#ifndef PATH_MAX
+ /* The Hurd doesn't define this, so getcwd can't exhibit the bug --
+ at least not on a local file system. And if we were to start worrying
+ about remote file systems, we'd have to enable the wrapper function
+ all of the time, just to be safe. That's not worth the cost. */
+ exit (0);
+#elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \
+ - DIR_NAME_SIZE - BUF_SLOP) \
+ <= PATH_MAX)
+ /* FIXME: Assuming there's a system for which this is true,
+ this should be done in a compile test. */
+ exit (0);
+#else
+ char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1)
+ + DIR_NAME_SIZE + BUF_SLOP];
+ char *cwd = getcwd (buf, PATH_MAX);
+ size_t initial_cwd_len;
+ size_t cwd_len;
+ int fail = 0;
+ size_t n_chdirs = 0;
+
+ if (cwd == NULL)
+ exit (10);
+
+ cwd_len = initial_cwd_len = strlen (cwd);
+
+ while (1)
+ {
+ size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN);
+ char *c = NULL;
+
+ cwd_len += DIR_NAME_SIZE;
+ /* If mkdir or chdir fails, it could be that this system cannot create
+ any file with an absolute name longer than PATH_MAX, such as cygwin.
+ If so, leave fail as 0, because the current working directory can't
+ be too long for getcwd if it can't even be created. On Linux with
+ the 9p file system, mkdir fails with error EINVAL when cwd_len gets
+ too long; ignore this failure because the getcwd() system call
+ produces good results whereas the gnulib substitute calls getdents64
+ which fails with error EPROTO.
+ For other errors, be pessimistic and consider that as a failure,
+ too. */
+ if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0)
+ {
+ if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
+ #ifdef __linux__
+ if (! (errno == EINVAL))
+ #endif
+ fail = 20;
+ break;
+ }
+
+ if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE)
+ {
+ struct stat sb;
+
+ c = getcwd (buf, PATH_MAX);
+ if (!c && errno == ENOENT)
+ {
+ fail = 11;
+ break;
+ }
+ if (c)
+ {
+ fail = 31;
+ break;
+ }
+ if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
+ {
+ fail = 21;
+ break;
+ }
+
+ /* Our replacement needs to be able to stat() long ../../paths,
+ so generate a path larger than PATH_MAX to check,
+ avoiding the replacement if we can't stat(). */
+ c = getcwd (buf, cwd_len + 1);
+ if (c && !AT_FDCWD && stat (c, &sb) != 0 && is_ENAMETOOLONG (errno))
+ {
+ fail = 32;
+ break;
+ }
+ }
+
+ if (dotdot_max <= cwd_len - initial_cwd_len)
+ {
+ if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len)
+ break;
+ c = getcwd (buf, cwd_len + 1);
+ if (!c)
+ {
+ if (! (errno == ERANGE || errno == ENOENT
+ || is_ENAMETOOLONG (errno)))
+ {
+ fail = 22;
+ break;
+ }
+ if (AT_FDCWD || errno == ERANGE || errno == ENOENT)
+ {
+ fail = 12;
+ break;
+ }
+ }
+ }
+
+ if (c && strlen (c) != cwd_len)
+ {
+ fail = 23;
+ break;
+ }
+ ++n_chdirs;
+ }
+
+ /* Leaving behind such a deep directory is not polite.
+ So clean up here, right away, even though the driving
+ shell script would also clean up. */
+ {
+ size_t i;
+
+ /* Try rmdir first, in case the chdir failed. */
+ rmdir (DIR_NAME);
+ for (i = 0; i <= n_chdirs; i++)
+ {
+ if (chdir ("..") < 0)
+ break;
+ if (rmdir (DIR_NAME) != 0)
+ break;
+ }
+ }
+
+ exit (fail);
+#endif
+}
+ ]])],
+ [gl_cv_func_getcwd_path_max=yes],
+ [case $? in
+ 10|11|12) gl_cv_func_getcwd_path_max='no, but it is partly working';;
+ 31) gl_cv_func_getcwd_path_max='no, it has the AIX bug';;
+ 32) gl_cv_func_getcwd_path_max='yes, but with shorter paths';;
+ *) gl_cv_func_getcwd_path_max=no;;
+ esac],
+ [# Cross-compilation guesses:
+ case "$host_os" in
+ aix*) # On AIX, it has the AIX bug.
+ gl_cv_func_getcwd_path_max='guessing no, it has the AIX bug' ;;
+ gnu*) # On Hurd, it is 'yes'.
+ gl_cv_func_getcwd_path_max='guessing yes' ;;
+ linux* | kfreebsd*)
+ # On older Linux+glibc it's 'no, but it is partly working',
+ # on newer Linux+glibc it's 'yes'.
+ # On Linux+musl libc, it's 'no, but it is partly working'.
+ # On kFreeBSD+glibc, it's 'no, but it is partly working'.
+ gl_cv_func_getcwd_path_max='guessing no, but it is partly working' ;;
+ *) # If we don't know, obey --enable-cross-guesses.
+ gl_cv_func_getcwd_path_max="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+])
diff --git a/gl/m4/getcwd.m4 b/gl/m4/getcwd.m4
new file mode 100644
index 0000000..076ca31
--- /dev/null
+++ b/gl/m4/getcwd.m4
@@ -0,0 +1,166 @@
+# getcwd.m4 - check for working getcwd that is compatible with glibc
+
+# Copyright (C) 2001, 2003-2007, 2009-2022 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.
+# serial 19
+
+AC_DEFUN([gl_FUNC_GETCWD_NULL],
+ [
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
+ [gl_cv_func_getcwd_null],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+# include <stdlib.h>
+# if HAVE_UNISTD_H
+# include <unistd.h>
+# else /* on Windows with MSVC */
+# include <direct.h>
+# endif
+ ]GL_MDA_DEFINES[
+# ifndef getcwd
+ char *getcwd ();
+# endif
+]], [[
+#if defined _WIN32 && ! defined __CYGWIN__
+/* mingw cwd does not start with '/', but _getcwd does allocate.
+ However, mingw fails to honor non-zero size. */
+#else
+ if (chdir ("/") != 0)
+ return 1;
+ else
+ {
+ char *f = getcwd (NULL, 0);
+ if (! f)
+ return 2;
+ if (f[0] != '/')
+ { free (f); return 3; }
+ if (f[1] != '\0')
+ { free (f); return 4; }
+ free (f);
+ return 0;
+ }
+#endif
+ ]])],
+ [gl_cv_func_getcwd_null=yes],
+ [gl_cv_func_getcwd_null=no],
+ [[case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_getcwd_null="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_getcwd_null="guessing yes";;
+ # Guess yes on Cygwin.
+ cygwin*) gl_cv_func_getcwd_null="guessing yes";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_getcwd_null="$gl_cross_guess_normal";;
+ esac
+ ]])])
+])
+
+AC_DEFUN([gl_FUNC_GETCWD_SIGNATURE],
+[
+ AC_CACHE_CHECK([for getcwd with POSIX signature],
+ [gl_cv_func_getcwd_posix_signature],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <unistd.h>
+ ]GL_MDA_DEFINES],
+ [[extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ char *getcwd (char *, size_t);
+ ]])
+ ],
+ [gl_cv_func_getcwd_posix_signature=yes],
+ [gl_cv_func_getcwd_posix_signature=no])
+ ])
+])
+
+dnl Guarantee that getcwd will malloc with a NULL first argument. Assumes
+dnl that either the system getcwd is robust, or that calling code is okay
+dnl with spurious failures when run from a directory with an absolute name
+dnl larger than 4k bytes.
+dnl
+dnl Assumes that getcwd exists; if you are worried about obsolete
+dnl platforms that lacked getcwd(), then you need to use the GPL module.
+AC_DEFUN([gl_FUNC_GETCWD_LGPL],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_GETCWD_NULL])
+ AC_REQUIRE([gl_FUNC_GETCWD_SIGNATURE])
+
+ case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in
+ *yes,yes) ;;
+ *)
+ dnl Minimal replacement lib/getcwd-lgpl.c.
+ REPLACE_GETCWD=1
+ ;;
+ esac
+])
+
+dnl Check for all known getcwd bugs; useful for a program likely to be
+dnl executed from an arbitrary location.
+AC_DEFUN([gl_FUNC_GETCWD],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_GETCWD_NULL])
+ AC_REQUIRE([gl_FUNC_GETCWD_SIGNATURE])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ gl_abort_bug=no
+ case "$host_os" in
+ mingw*)
+ gl_cv_func_getcwd_path_max=yes
+ ;;
+ *)
+ gl_FUNC_GETCWD_PATH_MAX
+ case "$gl_cv_func_getcwd_null" in
+ *yes)
+ gl_FUNC_GETCWD_ABORT_BUG([gl_abort_bug=yes])
+ ;;
+ esac
+ ;;
+ esac
+ dnl Define HAVE_MINIMALLY_WORKING_GETCWD and HAVE_PARTLY_WORKING_GETCWD
+ dnl if appropriate.
+ case "$gl_cv_func_getcwd_path_max" in
+ *"no" | *"no, it has the AIX bug") ;;
+ *)
+ AC_DEFINE([HAVE_MINIMALLY_WORKING_GETCWD], [1],
+ [Define to 1 if getcwd minimally works, that is, its result can be
+ trusted when it succeeds.])
+ ;;
+ esac
+ case "$gl_cv_func_getcwd_path_max" in
+ *"no, but it is partly working")
+ AC_DEFINE([HAVE_PARTLY_WORKING_GETCWD], [1],
+ [Define to 1 if getcwd works, except it sometimes fails when it
+ shouldn't, setting errno to ERANGE, ENAMETOOLONG, or ENOENT.])
+ ;;
+ *"yes, but with shorter paths")
+ AC_DEFINE([HAVE_GETCWD_SHORTER], [1],
+ [Define to 1 if getcwd works, but with shorter paths
+ than is generally tested with the replacement.])
+ ;;
+ esac
+
+ if { case "$gl_cv_func_getcwd_null" in *yes) false;; *) true;; esac; } \
+ || test $gl_cv_func_getcwd_posix_signature != yes \
+ || { case "$gl_cv_func_getcwd_path_max" in *yes*) false;; *) true;; esac; } \
+ || test $gl_abort_bug = yes; then
+ REPLACE_GETCWD=1
+ fi
+])
+
+# Prerequisites of lib/getcwd.c, when full replacement is in effect.
+AC_DEFUN([gl_PREREQ_GETCWD],
+[
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO])
+ :
+])
diff --git a/gl/m4/getdelim.m4 b/gl/m4/getdelim.m4
new file mode 100644
index 0000000..0b63b55
--- /dev/null
+++ b/gl/m4/getdelim.m4
@@ -0,0 +1,99 @@
+# getdelim.m4 serial 15
+
+dnl Copyright (C) 2005-2007, 2009-2022 Free Software Foundation, Inc.
+dnl
+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_PREREQ([2.59])
+
+AC_DEFUN([gl_FUNC_GETDELIM],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ dnl Persuade glibc <stdio.h> to declare getdelim().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_DECLS_ONCE([getdelim])
+
+ AC_CHECK_FUNCS_ONCE([getdelim])
+ if test $ac_cv_func_getdelim = yes; then
+ HAVE_GETDELIM=1
+ dnl Found it in some library. Verify that it works.
+ AC_CACHE_CHECK([for working getdelim function],
+ [gl_cv_func_working_getdelim],
+ [echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+ int main ()
+ {
+ FILE *in = fopen ("./conftest.data", "r");
+ if (!in)
+ return 1;
+ {
+ /* Test result for a NULL buffer and a zero size.
+ Based on a test program from Karl Heuer. */
+ char *line = NULL;
+ size_t siz = 0;
+ int len = getdelim (&line, &siz, '\n', in);
+ if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
+ { free (line); fclose (in); return 2; }
+ free (line);
+ }
+ {
+ /* Test result for a NULL buffer and a non-zero size.
+ This crashes on FreeBSD 8.0. */
+ char *line = NULL;
+ size_t siz = (size_t)(~0) / 4;
+ if (getdelim (&line, &siz, '\n', in) == -1)
+ { fclose (in); return 3; }
+ free (line);
+ }
+ fclose (in);
+ return 0;
+ }
+ ]])],
+ [gl_cv_func_working_getdelim=yes],
+ [gl_cv_func_working_getdelim=no],
+ [dnl We're cross compiling.
+ dnl Guess it works on glibc2 systems and musl systems.
+ AC_EGREP_CPP([Lucky GNU user],
+ [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ >= 2) && !defined __UCLIBC__
+ Lucky GNU user
+ #endif
+#endif
+ ],
+ [gl_cv_func_working_getdelim="guessing yes"],
+ [case "$host_os" in
+ *-musl*) gl_cv_func_working_getdelim="guessing yes" ;;
+ *) gl_cv_func_working_getdelim="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ ])
+ case "$gl_cv_func_working_getdelim" in
+ *yes) ;;
+ *) REPLACE_GETDELIM=1 ;;
+ esac
+ else
+ HAVE_GETDELIM=0
+ fi
+
+ if test $ac_cv_have_decl_getdelim = no; then
+ HAVE_DECL_GETDELIM=0
+ fi
+])
+
+# Prerequisites of lib/getdelim.c.
+AC_DEFUN([gl_PREREQ_GETDELIM],
+[
+ AC_CHECK_FUNCS([flockfile funlockfile])
+ AC_CHECK_DECLS([getc_unlocked])
+])
diff --git a/gl/m4/getdtablesize.m4 b/gl/m4/getdtablesize.m4
new file mode 100644
index 0000000..6134eaa
--- /dev/null
+++ b/gl/m4/getdtablesize.m4
@@ -0,0 +1,63 @@
+# getdtablesize.m4 serial 8
+dnl Copyright (C) 2008-2022 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_GETDTABLESIZE],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CHECK_FUNCS_ONCE([getdtablesize])
+ AC_CHECK_DECLS_ONCE([getdtablesize])
+ if test $ac_cv_func_getdtablesize = yes &&
+ test $ac_cv_have_decl_getdtablesize = yes; then
+ AC_CACHE_CHECK([whether getdtablesize works],
+ [gl_cv_func_getdtablesize_works],
+ [dnl There are two concepts: the "maximum possible file descriptor value + 1"
+ dnl and the "maximum number of open file descriptors in a process".
+ dnl Per SUSv2 and POSIX, getdtablesize() should return the first one.
+ dnl On most platforms, the first and the second concept are the same.
+ dnl On OpenVMS, however, they are different and getdtablesize() returns
+ dnl the second one; thus the test below fails. But we don't care
+ dnl because there's no good way to write a replacement getdtablesize().
+ case "$host_os" in
+ vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;;
+ *)
+ dnl Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft
+ dnl limit up to an unchangeable hard limit; all other platforms
+ dnl correctly require setrlimit before getdtablesize() can report
+ dnl a larger value.
+ AC_RUN_IFELSE([
+ AC_LANG_PROGRAM(
+ [[#include <unistd.h>]
+ GL_MDA_DEFINES
+ ],
+ [[int size = getdtablesize();
+ if (dup2 (0, getdtablesize()) != -1)
+ return 1;
+ if (size != getdtablesize())
+ return 2;
+ ]])],
+ [gl_cv_func_getdtablesize_works=yes],
+ [gl_cv_func_getdtablesize_works=no],
+ [case "$host_os" in
+ cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
+ gl_cv_func_getdtablesize_works="guessing no" ;;
+ *) gl_cv_func_getdtablesize_works="guessing yes" ;;
+ esac
+ ])
+ ;;
+ esac
+ ])
+ case "$gl_cv_func_getdtablesize_works" in
+ *yes | "no (limitation)") ;;
+ *) REPLACE_GETDTABLESIZE=1 ;;
+ esac
+ else
+ HAVE_GETDTABLESIZE=0
+ fi
+])
+
+# Prerequisites of lib/getdtablesize.c.
+AC_DEFUN([gl_PREREQ_GETDTABLESIZE], [:])
diff --git a/gl/m4/getline.m4 b/gl/m4/getline.m4
new file mode 100644
index 0000000..ca0301d
--- /dev/null
+++ b/gl/m4/getline.m4
@@ -0,0 +1,109 @@
+# getline.m4 serial 30
+
+dnl Copyright (C) 1998-2003, 2005-2007, 2009-2022 Free Software Foundation,
+dnl Inc.
+dnl
+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_PREREQ([2.59])
+
+dnl See if there's a working, system-supplied version of the getline function.
+dnl We can't just do AC_REPLACE_FUNCS([getline]) because some systems
+dnl have a function by that name in -linet that doesn't have anything
+dnl to do with the function we need.
+AC_DEFUN([gl_FUNC_GETLINE],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ dnl Persuade glibc <stdio.h> to declare getline().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_DECLS_ONCE([getline])
+
+ gl_getline_needs_run_time_check=no
+ AC_CHECK_FUNC([getline],
+ [dnl Found it in some library. Verify that it works.
+ gl_getline_needs_run_time_check=yes],
+ [am_cv_func_working_getline=no])
+ if test $gl_getline_needs_run_time_check = yes; then
+ AC_CACHE_CHECK([for working getline function],
+ [am_cv_func_working_getline],
+ [echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+ int main ()
+ {
+ FILE *in = fopen ("./conftest.data", "r");
+ if (!in)
+ return 1;
+ {
+ /* Test result for a NULL buffer and a zero size.
+ Based on a test program from Karl Heuer. */
+ char *line = NULL;
+ size_t siz = 0;
+ int len = getline (&line, &siz, in);
+ if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
+ { free (line); fclose (in); return 2; }
+ free (line);
+ }
+ {
+ /* Test result for a NULL buffer and a non-zero size.
+ This crashes on FreeBSD 8.0. */
+ char *line = NULL;
+ size_t siz = (size_t)(~0) / 4;
+ if (getline (&line, &siz, in) == -1)
+ { fclose (in); return 3; }
+ free (line);
+ }
+ fclose (in);
+ return 0;
+ }
+ ]])],
+ [am_cv_func_working_getline=yes],
+ [am_cv_func_working_getline=no],
+ [dnl We're cross compiling.
+ dnl Guess it works on glibc2 systems and musl systems.
+ AC_EGREP_CPP([Lucky GNU user],
+ [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ >= 2) && !defined __UCLIBC__
+ Lucky GNU user
+ #endif
+#endif
+ ],
+ [am_cv_func_working_getline="guessing yes"],
+ [case "$host_os" in
+ *-musl*) am_cv_func_working_getline="guessing yes" ;;
+ *) am_cv_func_working_getline="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ ])
+ fi
+
+ if test $ac_cv_have_decl_getline = no; then
+ HAVE_DECL_GETLINE=0
+ fi
+
+ case "$am_cv_func_working_getline" in
+ *yes) ;;
+ *)
+ dnl Set REPLACE_GETLINE always: Even if we have not found the broken
+ dnl getline function among $LIBS, it may exist in libinet and the
+ dnl executable may be linked with -linet.
+ REPLACE_GETLINE=1
+ ;;
+ esac
+])
+
+# Prerequisites of lib/getline.c.
+AC_DEFUN([gl_PREREQ_GETLINE],
+[
+ :
+])
diff --git a/gl/m4/getlogin.m4 b/gl/m4/getlogin.m4
new file mode 100644
index 0000000..d51d6cf
--- /dev/null
+++ b/gl/m4/getlogin.m4
@@ -0,0 +1,32 @@
+# getlogin.m4 serial 5
+dnl Copyright (C) 2010-2022 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_GETLOGIN],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_CHECK_DECLS_ONCE([getlogin])
+ if test $ac_cv_have_decl_getlogin = no; then
+ HAVE_DECL_GETLOGIN=0
+ fi
+ AC_CHECK_FUNCS_ONCE([getlogin])
+ if test $ac_cv_func_getlogin = no; then
+ HAVE_GETLOGIN=0
+ fi
+])
+
+dnl Determines the library needed by the implementation of the
+dnl getlogin and getlogin_r functions.
+AC_DEFUN([gl_LIB_GETLOGIN],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case $host_os in
+ mingw*)
+ LIB_GETLOGIN='-ladvapi32' ;;
+ *)
+ LIB_GETLOGIN= ;;
+ esac
+ AC_SUBST([LIB_GETLOGIN])
+])
diff --git a/gl/m4/getlogin_r.m4 b/gl/m4/getlogin_r.m4
new file mode 100644
index 0000000..c60ef34
--- /dev/null
+++ b/gl/m4/getlogin_r.m4
@@ -0,0 +1,92 @@
+#serial 13
+
+# Copyright (C) 2005-2007, 2009-2022 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+dnl From Derek Price
+dnl
+dnl Provide getlogin_r when the system lacks it.
+dnl
+
+AC_DEFUN([gl_FUNC_GETLOGIN_R],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+
+ dnl Persuade glibc <unistd.h> to declare getlogin_r().
+ dnl Persuade Solaris <unistd.h> to provide the POSIX compliant declaration of
+ dnl getlogin_r().
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_DECLS_ONCE([getlogin_r])
+ if test $ac_cv_have_decl_getlogin_r = no; then
+ HAVE_DECL_GETLOGIN_R=0
+ fi
+
+ AC_CHECK_FUNCS_ONCE([getlogin_r])
+ if test $ac_cv_func_getlogin_r = no; then
+ HAVE_GETLOGIN_R=0
+ else
+ HAVE_GETLOGIN_R=1
+ dnl On Mac OS X 10.13 and OSF/1 5.1, getlogin_r returns a truncated result
+ dnl if the buffer is not large enough.
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([whether getlogin_r works with small buffers],
+ [gl_cv_func_getlogin_r_works],
+ [
+ dnl Initial guess, used when cross-compiling.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on Mac OS X, OSF/1.
+ darwin* | osf*) gl_cv_func_getlogin_r_works="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_getlogin_r_works="guessing yes" ;;
+ esac
+changequote([,])dnl
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stddef.h>
+#include <string.h>
+#include <unistd.h>
+#if !HAVE_DECL_GETLOGIN_R
+extern
+# ifdef __cplusplus
+"C"
+# endif
+int getlogin_r (char *, size_t);
+#endif
+int
+main (void)
+{
+ int result = 0;
+ char buf[100];
+
+ if (getlogin_r (buf, 0) == 0)
+ result |= 1;
+ if (getlogin_r (buf, 1) == 0)
+ result |= 2;
+ if (getlogin_r (buf, 100) == 0)
+ {
+ size_t n = strlen (buf);
+ if (getlogin_r (buf, n) == 0)
+ result |= 4;
+ }
+ return result;
+}]])],
+ [gl_cv_func_getlogin_r_works=yes],
+ [gl_cv_func_getlogin_r_works=no],
+ [:])
+ ])
+ case "$gl_cv_func_getlogin_r_works" in
+ *yes) ;;
+ *) REPLACE_GETLOGIN_R=1 ;;
+ esac
+ fi
+])
+
+AC_DEFUN([gl_PREREQ_GETLOGIN_R],
+[
+ AC_CHECK_DECLS_ONCE([getlogin])
+])
diff --git a/gl/m4/getopt.m4 b/gl/m4/getopt.m4
new file mode 100644
index 0000000..ff78ed5
--- /dev/null
+++ b/gl/m4/getopt.m4
@@ -0,0 +1,381 @@
+# getopt.m4 serial 48
+dnl Copyright (C) 2002-2006, 2008-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Request a POSIX compliant getopt function.
+AC_DEFUN([gl_FUNC_GETOPT_POSIX],
+[
+ m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX])
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
+ dnl Other modules can request the gnulib implementation of the getopt
+ dnl functions unconditionally, by defining gl_REPLACE_GETOPT_ALWAYS.
+ dnl argp.m4 does this.
+ m4_ifdef([gl_REPLACE_GETOPT_ALWAYS], [
+ REPLACE_GETOPT=1
+ ], [
+ REPLACE_GETOPT=0
+ if test -n "$gl_replace_getopt"; then
+ REPLACE_GETOPT=1
+ fi
+ ])
+ GL_GENERATE_GETOPT_H=false
+ GL_GENERATE_GETOPT_CDEFS_H=false
+ if test $REPLACE_GETOPT = 1; then
+ dnl Arrange for getopt.h to be created.
+ gl_GETOPT_SUBSTITUTE_HEADER
+ fi
+])
+
+# Request a POSIX compliant getopt function with GNU extensions (such as
+# options with optional arguments) and the functions getopt_long,
+# getopt_long_only.
+AC_DEFUN([gl_FUNC_GETOPT_GNU],
+[
+ dnl Set the variable gl_getopt_required, so that all invocations of
+ dnl gl_GETOPT_CHECK_HEADERS in the scope of the current configure file
+ dnl will check for getopt with GNU extensions.
+ dnl This means that if one gnulib-tool invocation requests getopt-posix
+ dnl and another gnulib-tool invocation requests getopt-gnu, it is as if
+ dnl both had requested getopt-gnu.
+ m4_divert_text([INIT_PREPARE], [gl_getopt_required=GNU])
+
+ dnl No need to invoke gl_FUNC_GETOPT_POSIX here; this is automatically
+ dnl done through the module dependency getopt-gnu -> getopt-posix.
+])
+
+# Determine whether to replace the entire getopt facility.
+AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([AC_PROG_AWK]) dnl for awk that supports ENVIRON
+
+ dnl Persuade Solaris <unistd.h> to declare optarg, optind, opterr, optopt.
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ gl_CHECK_NEXT_HEADERS([getopt.h])
+ if test $ac_cv_header_getopt_h = yes; then
+ HAVE_GETOPT_H=1
+ else
+ HAVE_GETOPT_H=0
+ fi
+ AC_SUBST([HAVE_GETOPT_H])
+
+ gl_replace_getopt=
+
+ dnl Test whether <getopt.h> is available.
+ if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+ AC_CHECK_HEADERS([getopt.h], [], [gl_replace_getopt=yes])
+ fi
+
+ dnl Test whether the function getopt_long is available.
+ if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+ AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes])
+ fi
+
+ dnl POSIX 2008 does not specify leading '+' behavior, but see
+ dnl http://austingroupbugs.net/view.php?id=191 for a recommendation on
+ dnl the next version of POSIX. For now, we only guarantee leading '+'
+ dnl behavior with getopt-gnu.
+ if test -z "$gl_replace_getopt"; then
+ AC_CACHE_CHECK([whether getopt is POSIX compatible],
+ [gl_cv_func_getopt_posix],
+ [
+ dnl Merging these three different test programs into a single one
+ dnl would require a reset mechanism. On BSD systems, it can be done
+ dnl through 'optreset'; on some others (glibc), it can be done by
+ dnl setting 'optind' to 0; on others again (HP-UX, IRIX, OSF/1,
+ dnl Solaris 9, musl libc), there is no such mechanism.
+ if test $cross_compiling = no; then
+ dnl Sanity check. Succeeds everywhere (except on MSVC,
+ dnl which lacks <unistd.h> and getopt() entirely).
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+main ()
+{
+ static char program[] = "program";
+ static char a[] = "-a";
+ static char foo[] = "foo";
+ static char bar[] = "bar";
+ char *argv[] = { program, a, foo, bar, NULL };
+ int c;
+
+ c = getopt (4, argv, "ab");
+ if (!(c == 'a'))
+ return 1;
+ c = getopt (4, argv, "ab");
+ if (!(c == -1))
+ return 2;
+ if (!(optind == 2))
+ return 3;
+ return 0;
+}
+]])],
+ [gl_cv_func_getopt_posix=maybe],
+ [gl_cv_func_getopt_posix=no])
+ if test $gl_cv_func_getopt_posix = maybe; then
+ dnl Sanity check with '+'. Succeeds everywhere (except on MSVC,
+ dnl which lacks <unistd.h> and getopt() entirely).
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+main ()
+{
+ static char program[] = "program";
+ static char donald[] = "donald";
+ static char p[] = "-p";
+ static char billy[] = "billy";
+ static char duck[] = "duck";
+ static char a[] = "-a";
+ static char bar[] = "bar";
+ char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
+ int c;
+
+ c = getopt (7, argv, "+abp:q:");
+ if (!(c == -1))
+ return 4;
+ if (!(strcmp (argv[0], "program") == 0))
+ return 5;
+ if (!(strcmp (argv[1], "donald") == 0))
+ return 6;
+ if (!(strcmp (argv[2], "-p") == 0))
+ return 7;
+ if (!(strcmp (argv[3], "billy") == 0))
+ return 8;
+ if (!(strcmp (argv[4], "duck") == 0))
+ return 9;
+ if (!(strcmp (argv[5], "-a") == 0))
+ return 10;
+ if (!(strcmp (argv[6], "bar") == 0))
+ return 11;
+ if (!(optind == 1))
+ return 12;
+ return 0;
+}
+]])],
+ [gl_cv_func_getopt_posix=maybe],
+ [gl_cv_func_getopt_posix=no])
+ fi
+ if test $gl_cv_func_getopt_posix = maybe; then
+ dnl Detect Mac OS X 10.5, AIX 7.1, mingw bug.
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+main ()
+{
+ static char program[] = "program";
+ static char ab[] = "-ab";
+ char *argv[3] = { program, ab, NULL };
+ if (getopt (2, argv, "ab:") != 'a')
+ return 13;
+ if (getopt (2, argv, "ab:") != '?')
+ return 14;
+ if (optopt != 'b')
+ return 15;
+ if (optind != 2)
+ return 16;
+ return 0;
+}
+]])],
+ [gl_cv_func_getopt_posix=yes],
+ [gl_cv_func_getopt_posix=no])
+ fi
+ else
+ case "$host_os" in
+ darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";;
+ *) gl_cv_func_getopt_posix="guessing yes";;
+ esac
+ fi
+ ])
+ case "$gl_cv_func_getopt_posix" in
+ *no) gl_replace_getopt=yes ;;
+ esac
+ fi
+
+ if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+ AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_getopt_gnu],
+ [# Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the
+ # optstring is necessary for programs like m4 that have POSIX-mandated
+ # semantics for supporting options interspersed with files.
+ # Also, since getopt_long is a GNU extension, we require optind=0.
+ # Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT;
+ # so take care to revert to the correct (non-)export state.
+dnl GNU Coding Standards currently allow awk but not env; besides, env
+dnl is ambiguous with environment values that contain newlines.
+ gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }'
+ case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" </dev/null` in
+ xx) gl_had_POSIXLY_CORRECT=exported ;;
+ x) gl_had_POSIXLY_CORRECT=yes ;;
+ *) gl_had_POSIXLY_CORRECT= ;;
+ esac
+ POSIXLY_CORRECT=1
+ export POSIXLY_CORRECT
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[#include <getopt.h>
+ #include <stddef.h>
+ #include <string.h>
+ ]GL_NOCRASH[
+ ]], [[
+ int result = 0;
+
+ nocrash_init();
+
+ /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
+ and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
+ OSF/1 5.1, Solaris 10. */
+ {
+ static char conftest[] = "conftest";
+ static char plus[] = "-+";
+ char *argv[3] = { conftest, plus, NULL };
+ opterr = 0;
+ if (getopt (2, argv, "+a") != '?')
+ result |= 1;
+ }
+ /* This code succeeds on glibc 2.8, mingw,
+ and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+ IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */
+ {
+ static char program[] = "program";
+ static char p[] = "-p";
+ static char foo[] = "foo";
+ static char bar[] = "bar";
+ char *argv[] = { program, p, foo, bar, NULL };
+
+ optind = 1;
+ if (getopt (4, argv, "p::") != 'p')
+ result |= 2;
+ else if (optarg != NULL)
+ result |= 4;
+ else if (getopt (4, argv, "p::") != -1)
+ result |= 6;
+ else if (optind != 2)
+ result |= 8;
+ }
+ /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0. */
+ {
+ static char program[] = "program";
+ static char foo[] = "foo";
+ static char p[] = "-p";
+ char *argv[] = { program, foo, p, NULL };
+ optind = 0;
+ if (getopt (3, argv, "-p") != 1)
+ result |= 16;
+ else if (getopt (3, argv, "-p") != 'p')
+ result |= 16;
+ }
+ /* This code fails on glibc 2.11. */
+ {
+ static char program[] = "program";
+ static char b[] = "-b";
+ static char a[] = "-a";
+ char *argv[] = { program, b, a, NULL };
+ optind = opterr = 0;
+ if (getopt (3, argv, "+:a:b") != 'b')
+ result |= 32;
+ else if (getopt (3, argv, "+:a:b") != ':')
+ result |= 32;
+ }
+ /* This code dumps core on glibc 2.14. */
+ {
+ static char program[] = "program";
+ static char w[] = "-W";
+ static char dummy[] = "dummy";
+ char *argv[] = { program, w, dummy, NULL };
+ optind = opterr = 1;
+ if (getopt (3, argv, "W;") != 'W')
+ result |= 64;
+ }
+ return result;
+ ]])],
+ [gl_cv_func_getopt_gnu=yes],
+ [gl_cv_func_getopt_gnu=no],
+ [dnl Cross compiling.
+ dnl Assume the worst, even on glibc platforms.
+ dnl But obey --enable-cross-guesses.
+ gl_cv_func_getopt_gnu="$gl_cross_guess_normal"
+ ])
+ case $gl_had_POSIXLY_CORRECT in
+ exported) ;;
+ yes) AS_UNSET([POSIXLY_CORRECT]); POSIXLY_CORRECT=1 ;;
+ *) AS_UNSET([POSIXLY_CORRECT]) ;;
+ esac
+ ])
+ if test "$gl_cv_func_getopt_gnu" != yes; then
+ gl_replace_getopt=yes
+ else
+ AC_CACHE_CHECK([for working GNU getopt_long function],
+ [gl_cv_func_getopt_long_gnu],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <getopt.h>
+ #include <stddef.h>
+ #include <string.h>
+ ]],
+ [[static const struct option long_options[] =
+ {
+ { "xtremely-",no_argument, NULL, 1003 },
+ { "xtra", no_argument, NULL, 1001 },
+ { "xtreme", no_argument, NULL, 1002 },
+ { "xtremely", no_argument, NULL, 1003 },
+ { NULL, 0, NULL, 0 }
+ };
+ /* This code fails on OpenBSD 5.0. */
+ {
+ static char program[] = "program";
+ static char xtremel[] = "--xtremel";
+ char *argv[] = { program, xtremel, NULL };
+ int option_index;
+ optind = 1; opterr = 0;
+ if (getopt_long (2, argv, "", long_options, &option_index) != 1003)
+ return 1;
+ }
+ return 0;
+ ]])],
+ [gl_cv_func_getopt_long_gnu=yes],
+ [gl_cv_func_getopt_long_gnu=no],
+ [dnl Cross compiling. Guess no on OpenBSD, yes otherwise.
+ case "$host_os" in
+ openbsd*) gl_cv_func_getopt_long_gnu="guessing no";;
+ *) gl_cv_func_getopt_long_gnu="guessing yes";;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_getopt_long_gnu" in
+ *yes) ;;
+ *) gl_replace_getopt=yes ;;
+ esac
+ fi
+ fi
+])
+
+AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
+[
+ AC_CHECK_HEADERS_ONCE([sys/cdefs.h])
+ if test $ac_cv_header_sys_cdefs_h = yes; then
+ HAVE_SYS_CDEFS_H=1
+ else
+ HAVE_SYS_CDEFS_H=0
+ fi
+ AC_SUBST([HAVE_SYS_CDEFS_H])
+
+ AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
+ [Define to rpl_ if the getopt replacement functions and variables
+ should be used.])
+ GL_GENERATE_GETOPT_H=true
+ GL_GENERATE_GETOPT_CDEFS_H=true
+])
diff --git a/gl/m4/getpagesize.m4 b/gl/m4/getpagesize.m4
new file mode 100644
index 0000000..19f894c
--- /dev/null
+++ b/gl/m4/getpagesize.m4
@@ -0,0 +1,49 @@
+# getpagesize.m4 serial 10
+dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2022 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_GETPAGESIZE],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ gl_CHECK_FUNC_GETPAGESIZE
+ if test $gl_cv_func_getpagesize = no; then
+ HAVE_GETPAGESIZE=0
+ AC_CHECK_HEADERS([OS.h])
+ if test $ac_cv_header_OS_h = yes; then
+ HAVE_OS_H=1
+ fi
+ AC_CHECK_HEADERS([sys/param.h])
+ if test $ac_cv_header_sys_param_h = yes; then
+ HAVE_SYS_PARAM_H=1
+ fi
+ fi
+ case "$host_os" in
+ mingw*)
+ REPLACE_GETPAGESIZE=1
+ ;;
+ esac
+ dnl Also check whether it's declared.
+ dnl mingw has getpagesize() in libgcc.a but doesn't declare it.
+ AC_CHECK_DECL([getpagesize], , [HAVE_DECL_GETPAGESIZE=0])
+])
+
+dnl Tests whether the function getpagesize() exists.
+dnl Sets gl_cv_func_getpagesize.
+AC_DEFUN([gl_CHECK_FUNC_GETPAGESIZE],
+[
+ dnl We can't use AC_CHECK_FUNC here, because getpagesize() is defined as a
+ dnl static inline function when compiling for Android 4.4 or older.
+ AC_CACHE_CHECK([for getpagesize], [gl_cv_func_getpagesize],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <unistd.h>]],
+ [[return getpagesize();]])
+ ],
+ [gl_cv_func_getpagesize=yes],
+ [gl_cv_func_getpagesize=no])
+ ])
+])
diff --git a/gl/m4/getprogname.m4 b/gl/m4/getprogname.m4
new file mode 100644
index 0000000..b26146e
--- /dev/null
+++ b/gl/m4/getprogname.m4
@@ -0,0 +1,43 @@
+# getprogname.m4 - check for getprogname or replacements for it
+
+# Copyright (C) 2016-2022 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.
+
+# serial 4
+
+AC_DEFUN([gl_FUNC_GETPROGNAME],
+[
+ AC_CHECK_FUNCS_ONCE([getprogname getexecname])
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ ac_found=0
+ AC_CHECK_DECLS([program_invocation_name], [ac_found=1], [],
+ [#include <errno.h>])
+ AC_CHECK_DECLS([program_invocation_short_name], [ac_found=1], [],
+ [#include <errno.h>])
+ AC_CHECK_DECLS([__argv], [ac_found=1], [], [#include <stdlib.h>])
+
+ # Incur the cost of this test only if none of the above worked.
+ if test $ac_found = 0; then
+ # On OpenBSD 5.1, using the global __progname variable appears to be
+ # the only way to implement getprogname.
+ AC_CACHE_CHECK([whether __progname is defined in default libraries],
+ [gl_cv_var___progname],
+ [
+ gl_cv_var___progname=
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern char *__progname;]],
+ [[return *__progname;]]
+ )],
+ [gl_cv_var___progname=yes]
+ )
+ ]
+ )
+ if test "$gl_cv_var___progname" = yes; then
+ AC_DEFINE([HAVE_VAR___PROGNAME], 1,
+ [Define if you have a global __progname variable])
+ fi
+ fi
+])
diff --git a/gl/m4/getrandom.m4 b/gl/m4/getrandom.m4
new file mode 100644
index 0000000..6ca7150
--- /dev/null
+++ b/gl/m4/getrandom.m4
@@ -0,0 +1,68 @@
+# getrandom.m4 serial 8
+dnl Copyright 2020-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Paul Eggert.
+
+AC_DEFUN([gl_FUNC_GETRANDOM],
+[
+ AC_REQUIRE([gl_SYS_RANDOM_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([getrandom])
+ if test "$ac_cv_func_getrandom" != yes; then
+ HAVE_GETRANDOM=0
+ else
+ dnl On Solaris 11.4 the return type is 'int', not 'ssize_t'.
+ AC_CACHE_CHECK([whether getrandom is compatible with its GNU+BSD signature],
+ [gl_cv_func_getrandom_ok],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[/* Additional includes are needed before <sys/random.h> on uClibc
+ and Mac OS X. */
+ #include <sys/types.h>
+ #include <stdlib.h>
+ #include <sys/random.h>
+ ssize_t getrandom (void *, size_t, unsigned int);
+ ]],
+ [[]])
+ ],
+ [gl_cv_func_getrandom_ok=yes],
+ [gl_cv_func_getrandom_ok=no])
+ ])
+ if test $gl_cv_func_getrandom_ok = no; then
+ REPLACE_GETRANDOM=1
+ fi
+ fi
+
+ case "$host_os" in
+ mingw*)
+ AC_CHECK_HEADERS([bcrypt.h], [], [],
+ [[#include <windows.h>
+ ]])
+ AC_CACHE_CHECK([whether the bcrypt library is guaranteed to be present],
+ [gl_cv_lib_assume_bcrypt],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <windows.h>]],
+ [[#if !(_WIN32_WINNT >= _WIN32_WINNT_WIN7)
+ cannot assume it
+ #endif
+ ]])
+ ],
+ [gl_cv_lib_assume_bcrypt=yes],
+ [gl_cv_lib_assume_bcrypt=no])
+ ])
+ if test $gl_cv_lib_assume_bcrypt = yes; then
+ AC_DEFINE([HAVE_LIB_BCRYPT], [1],
+ [Define to 1 if the bcrypt library is guaranteed to be present.])
+ LIB_GETRANDOM='-lbcrypt'
+ else
+ LIB_GETRANDOM='-ladvapi32'
+ fi
+ ;;
+ *)
+ LIB_GETRANDOM= ;;
+ esac
+ AC_SUBST([LIB_GETRANDOM])
+])
diff --git a/gl/m4/gettext.m4 b/gl/m4/gettext.m4
new file mode 100644
index 0000000..8d1f066
--- /dev/null
+++ b/gl/m4/gettext.m4
@@ -0,0 +1,401 @@
+# gettext.m4 serial 66 (gettext-0.18.2)
+dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
+
+dnl Macro to add for using GNU gettext.
+
+dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
+dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
+dnl default (if it is not specified or empty) is 'no-libtool'.
+dnl INTLSYMBOL should be 'external' for packages with no intl directory,
+dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
+dnl If INTLSYMBOL is 'use-libtool', then a libtool library
+dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
+dnl depending on --{enable,disable}-{shared,static} and on the presence of
+dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
+dnl $(top_builddir)/intl/libintl.a will be created.
+dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
+dnl implementations (in libc or libintl) without the ngettext() function
+dnl will be ignored. If NEEDSYMBOL is specified and is
+dnl 'need-formatstring-macros', then GNU gettext implementations that don't
+dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
+dnl INTLDIR is used to find the intl libraries. If empty,
+dnl the value '$(top_builddir)/intl/' is used.
+dnl
+dnl The result of the configuration is one of three cases:
+dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
+dnl and used.
+dnl Catalog format: GNU --> install in $(datadir)
+dnl Catalog extension: .mo after installation, .gmo in source tree
+dnl 2) GNU gettext has been found in the system's C library.
+dnl Catalog format: GNU --> install in $(datadir)
+dnl Catalog extension: .mo after installation, .gmo in source tree
+dnl 3) No internationalization, always use English msgid.
+dnl Catalog format: none
+dnl Catalog extension: none
+dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
+dnl The use of .gmo is historical (it was needed to avoid overwriting the
+dnl GNU format catalogs when building on a platform with an X/Open gettext),
+dnl but we keep it in order not to force irrelevant filename changes on the
+dnl maintainers.
+dnl
+AC_DEFUN([AM_GNU_GETTEXT],
+[
+ dnl Argument checking.
+ ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
+ [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
+])])])])])
+ ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
+ [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])])
+ ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
+ [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
+])])])])
+ define([gt_included_intl],
+ ifelse([$1], [external],
+ ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
+ [yes]))
+ define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
+ gt_NEEDS_INIT
+ AM_GNU_GETTEXT_NEED([$2])
+
+ AC_REQUIRE([AM_PO_SUBDIRS])dnl
+ ifelse(gt_included_intl, yes, [
+ AC_REQUIRE([AM_INTL_SUBDIR])dnl
+ ])
+
+ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+
+ dnl Sometimes libintl requires libiconv, so first search for libiconv.
+ dnl Ideally we would do this search only after the
+ dnl if test "$USE_NLS" = "yes"; then
+ dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
+ dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
+ dnl the configure script would need to contain the same shell code
+ dnl again, outside any 'if'. There are two solutions:
+ dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
+ dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
+ dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
+ dnl documented, we avoid it.
+ ifelse(gt_included_intl, yes, , [
+ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+ ])
+
+ dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
+ gt_INTL_MACOSX
+
+ dnl Set USE_NLS.
+ AC_REQUIRE([AM_NLS])
+
+ ifelse(gt_included_intl, yes, [
+ BUILD_INCLUDED_LIBINTL=no
+ USE_INCLUDED_LIBINTL=no
+ ])
+ LIBINTL=
+ LTLIBINTL=
+ POSUB=
+
+ dnl Add a version number to the cache macros.
+ case " $gt_needs " in
+ *" need-formatstring-macros "*) gt_api_version=3 ;;
+ *" need-ngettext "*) gt_api_version=2 ;;
+ *) gt_api_version=1 ;;
+ esac
+ gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
+ gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
+
+ dnl If we use NLS figure out what method
+ if test "$USE_NLS" = "yes"; then
+ gt_use_preinstalled_gnugettext=no
+ ifelse(gt_included_intl, yes, [
+ AC_MSG_CHECKING([whether included gettext is requested])
+ AC_ARG_WITH([included-gettext],
+ [ --with-included-gettext use the GNU gettext library included here],
+ nls_cv_force_use_gnu_gettext=$withval,
+ nls_cv_force_use_gnu_gettext=no)
+ AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
+
+ nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+ if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+ ])
+ dnl User does not insist on using GNU NLS library. Figure out what
+ dnl to use. If GNU gettext is available we use this. Else we have
+ dnl to fall back to GNU NLS library.
+
+ if test $gt_api_version -ge 3; then
+ gt_revision_test_code='
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+'
+ else
+ gt_revision_test_code=
+ fi
+ if test $gt_api_version -ge 2; then
+ gt_expression_test_code=' + * ngettext ("", "", 0)'
+ else
+ gt_expression_test_code=
+ fi
+
+ AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern int *_nl_domain_bindings;
+ ]],
+ [[
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings
+ ]])],
+ [eval "$gt_func_gnugettext_libc=yes"],
+ [eval "$gt_func_gnugettext_libc=no"])])
+
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
+ dnl Sometimes libintl requires libiconv, so first search for libiconv.
+ ifelse(gt_included_intl, yes, , [
+ AM_ICONV_LINK
+ ])
+ dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
+ dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
+ dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
+ dnl even if libiconv doesn't exist.
+ AC_LIB_LINKFLAGS_BODY([intl])
+ AC_CACHE_CHECK([for GNU gettext in libintl],
+ [$gt_func_gnugettext_libintl],
+ [gt_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $INCINTL"
+ gt_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBINTL"
+ dnl Now see whether libintl exists and does not depend on libiconv.
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);
+ ]],
+ [[
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+ ]])],
+ [eval "$gt_func_gnugettext_libintl=yes"],
+ [eval "$gt_func_gnugettext_libintl=no"])
+ dnl Now see whether libintl exists and depends on libiconv.
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
+ LIBS="$LIBS $LIBICONV"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);
+ ]],
+ [[
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+ ]])],
+ [LIBINTL="$LIBINTL $LIBICONV"
+ LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+ eval "$gt_func_gnugettext_libintl=yes"
+ ])
+ fi
+ CPPFLAGS="$gt_save_CPPFLAGS"
+ LIBS="$gt_save_LIBS"])
+ fi
+
+ dnl If an already present or preinstalled GNU gettext() is found,
+ dnl use it. But if this macro is used in GNU gettext, and GNU
+ dnl gettext is already preinstalled in libintl, we update this
+ dnl libintl. (Cf. the install rule in intl/Makefile.in.)
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
+ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
+ && test "$PACKAGE" != gettext-runtime \
+ && test "$PACKAGE" != gettext-tools; }; then
+ gt_use_preinstalled_gnugettext=yes
+ else
+ dnl Reset the values set by searching for libintl.
+ LIBINTL=
+ LTLIBINTL=
+ INCINTL=
+ fi
+
+ ifelse(gt_included_intl, yes, [
+ if test "$gt_use_preinstalled_gnugettext" != "yes"; then
+ dnl GNU gettext is not found in the C library.
+ dnl Fall back on included GNU gettext library.
+ nls_cv_use_gnu_gettext=yes
+ fi
+ fi
+
+ if test "$nls_cv_use_gnu_gettext" = "yes"; then
+ dnl Mark actions used to generate GNU NLS library.
+ BUILD_INCLUDED_LIBINTL=yes
+ USE_INCLUDED_LIBINTL=yes
+ LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
+ LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
+ LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
+ fi
+
+ CATOBJEXT=
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ dnl Mark actions to use GNU gettext tools.
+ CATOBJEXT=.gmo
+ fi
+ ])
+
+ if test -n "$INTL_MACOSX_LIBS"; then
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ dnl Some extra flags are needed during linking.
+ LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
+ LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
+ fi
+ fi
+
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ AC_DEFINE([ENABLE_NLS], [1],
+ [Define to 1 if translation of program messages to the user's native language
+ is requested.])
+ else
+ USE_NLS=no
+ fi
+ fi
+
+ AC_MSG_CHECKING([whether to use NLS])
+ AC_MSG_RESULT([$USE_NLS])
+ if test "$USE_NLS" = "yes"; then
+ AC_MSG_CHECKING([where the gettext function comes from])
+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
+ gt_source="external libintl"
+ else
+ gt_source="libc"
+ fi
+ else
+ gt_source="included intl directory"
+ fi
+ AC_MSG_RESULT([$gt_source])
+ fi
+
+ if test "$USE_NLS" = "yes"; then
+
+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
+ AC_MSG_CHECKING([how to link with libintl])
+ AC_MSG_RESULT([$LIBINTL])
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
+ fi
+
+ dnl For backward compatibility. Some packages may be using this.
+ AC_DEFINE([HAVE_GETTEXT], [1],
+ [Define if the GNU gettext() function is already present or preinstalled.])
+ AC_DEFINE([HAVE_DCGETTEXT], [1],
+ [Define if the GNU dcgettext() function is already present or preinstalled.])
+ fi
+
+ dnl We need to process the po/ directory.
+ POSUB=po
+ fi
+
+ ifelse(gt_included_intl, yes, [
+ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
+ dnl to 'yes' because some of the testsuite requires it.
+ if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
+ BUILD_INCLUDED_LIBINTL=yes
+ fi
+
+ dnl Make all variables we use known to autoconf.
+ AC_SUBST([BUILD_INCLUDED_LIBINTL])
+ AC_SUBST([USE_INCLUDED_LIBINTL])
+ AC_SUBST([CATOBJEXT])
+
+ dnl For backward compatibility. Some configure.ins may be using this.
+ nls_cv_header_intl=
+ nls_cv_header_libgt=
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ DATADIRNAME=share
+ AC_SUBST([DATADIRNAME])
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ INSTOBJEXT=.mo
+ AC_SUBST([INSTOBJEXT])
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ GENCAT=gencat
+ AC_SUBST([GENCAT])
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ INTLOBJS=
+ if test "$USE_INCLUDED_LIBINTL" = yes; then
+ INTLOBJS="\$(GETTOBJS)"
+ fi
+ AC_SUBST([INTLOBJS])
+
+ dnl Enable libtool support if the surrounding package wishes it.
+ INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
+ AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
+ ])
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ INTLLIBS="$LIBINTL"
+ AC_SUBST([INTLLIBS])
+
+ dnl Make all documented variables known to autoconf.
+ AC_SUBST([LIBINTL])
+ AC_SUBST([LTLIBINTL])
+ AC_SUBST([POSUB])
+])
+
+
+dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
+m4_define([gt_NEEDS_INIT],
+[
+ m4_divert_text([DEFAULTS], [gt_needs=])
+ m4_define([gt_NEEDS_INIT], [])
+])
+
+
+dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
+AC_DEFUN([AM_GNU_GETTEXT_NEED],
+[
+ m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
+])
+
+
+dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
+AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
diff --git a/gl/m4/gettime.m4 b/gl/m4/gettime.m4
new file mode 100644
index 0000000..f0aeb4d
--- /dev/null
+++ b/gl/m4/gettime.m4
@@ -0,0 +1,21 @@
+# gettime.m4 serial 11
+dnl Copyright (C) 2002, 2004-2006, 2009-2022 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_GETTIME],
+[
+ dnl Prerequisites of lib/gettime.c.
+ AC_REQUIRE([gl_CLOCK_TIME])
+ AC_REQUIRE([gl_TIMESPEC])
+ AC_CHECK_FUNCS_ONCE([timespec_get])
+])
+
+AC_DEFUN([gl_GETTIME_RES],
+[
+ dnl Prerequisites of lib/gettime-res.c.
+ AC_REQUIRE([gl_CLOCK_TIME])
+ AC_REQUIRE([gl_TIMESPEC])
+ AC_CHECK_FUNCS_ONCE([timespec_getres])
+])
diff --git a/gl/m4/gettimeofday.m4 b/gl/m4/gettimeofday.m4
new file mode 100644
index 0000000..f729601
--- /dev/null
+++ b/gl/m4/gettimeofday.m4
@@ -0,0 +1,69 @@
+# serial 29
+
+# Copyright (C) 2001-2003, 2005, 2007, 2009-2022 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+dnl From Jim Meyering.
+
+AC_DEFUN([gl_FUNC_GETTIMEOFDAY],
+[
+ AC_REQUIRE([gl_SYS_TIME_H_DEFAULTS])
+ AC_REQUIRE([AC_C_RESTRICT])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_SYS_TIME_H])
+ AC_CHECK_FUNCS_ONCE([gettimeofday])
+
+ gl_gettimeofday_timezone=void
+ if test $ac_cv_func_gettimeofday != yes; then
+ HAVE_GETTIMEOFDAY=0
+ else
+ AC_CACHE_CHECK([for gettimeofday with POSIX signature],
+ [gl_cv_func_gettimeofday_posix_signature],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/time.h>
+ struct timeval c;
+ int gettimeofday (struct timeval *restrict, void *restrict);
+ ]],
+ [[/* glibc uses struct timezone * rather than the POSIX void *
+ if _GNU_SOURCE is defined. However, since the only portable
+ use of gettimeofday uses NULL as the second parameter, and
+ since the glibc definition is actually more typesafe, it is
+ not worth wrapping this to get a compliant signature. */
+ int (*f) (struct timeval *restrict, void *restrict)
+ = gettimeofday;
+ int x = f (&c, 0);
+ return !(x | c.tv_sec | c.tv_usec);
+ ]])],
+ [gl_cv_func_gettimeofday_posix_signature=yes],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/time.h>
+int gettimeofday (struct timeval *restrict, struct timezone *restrict);
+ ]])],
+ [gl_cv_func_gettimeofday_posix_signature=almost],
+ [gl_cv_func_gettimeofday_posix_signature=no])])])
+ if test $gl_cv_func_gettimeofday_posix_signature = almost; then
+ gl_gettimeofday_timezone='struct timezone'
+ elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
+ REPLACE_GETTIMEOFDAY=1
+ fi
+ dnl If we override 'struct timeval', we also have to override gettimeofday.
+ if test $REPLACE_STRUCT_TIMEVAL = 1; then
+ REPLACE_GETTIMEOFDAY=1
+ fi
+ dnl On mingw, the original gettimeofday has only a precision of 15.6
+ dnl milliseconds. So override it.
+ case "$host_os" in
+ mingw*) REPLACE_GETTIMEOFDAY=1 ;;
+ esac
+ fi
+ AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone],
+ [Define this to 'void' or 'struct timezone' to match the system's
+ declaration of the second argument to gettimeofday.])
+])
+
+# Prerequisites of lib/gettimeofday.c.
+AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [:])
diff --git a/gl/m4/glibc2.m4 b/gl/m4/glibc2.m4
new file mode 100644
index 0000000..0e50682
--- /dev/null
+++ b/gl/m4/glibc2.m4
@@ -0,0 +1,31 @@
+# glibc2.m4 serial 3
+dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2013 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Test for the GNU C Library, version 2.0 or newer.
+# From Bruno Haible.
+
+AC_DEFUN([gt_GLIBC2],
+ [
+ AC_CACHE_CHECK([whether we are using the GNU C Library 2 or newer],
+ [ac_cv_gnu_library_2],
+ [AC_EGREP_CPP([Lucky GNU user],
+ [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ >= 2) && !defined __UCLIBC__
+ Lucky GNU user
+ #endif
+#endif
+ ],
+ [ac_cv_gnu_library_2=yes],
+ [ac_cv_gnu_library_2=no])
+ ]
+ )
+ AC_SUBST([GLIBC2])
+ GLIBC2="$ac_cv_gnu_library_2"
+ ]
+)
diff --git a/gl/m4/glob.m4 b/gl/m4/glob.m4
new file mode 100644
index 0000000..f59b84f
--- /dev/null
+++ b/gl/m4/glob.m4
@@ -0,0 +1,129 @@
+# glob.m4 serial 26
+dnl Copyright (C) 2005-2007, 2009-2022 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.
+
+# The glob module assumes you want GNU glob, with glob_pattern_p etc,
+# rather than vanilla POSIX glob. This means your code should
+# always include <glob.h> for the glob prototypes.
+
+AC_DEFUN([gl_GLOB],
+[
+ AC_REQUIRE([gl_GLOB_H])
+
+ AC_CHECK_FUNCS_ONCE([glob glob_pattern_p])
+ if test $ac_cv_func_glob = no; then
+ HAVE_GLOB=0
+ else
+
+ AC_CACHE_CHECK([for GNU glob interface version 1 or 2],
+ [gl_cv_gnu_glob_interface_version_1_2],
+[ AC_COMPILE_IFELSE([AC_LANG_SOURCE(
+[[#include <gnu-versions.h>
+char a[_GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 ? 1 : -1];]])],
+ [gl_cv_gnu_glob_interface_version_1_2=yes],
+ [gl_cv_gnu_glob_interface_version_1_2=no])])
+ if test "$gl_cv_gnu_glob_interface_version_1_2" = "no"; then
+ REPLACE_GLOB=1
+ fi
+
+ if test $REPLACE_GLOB = 0; then
+ AC_CACHE_CHECK([whether glob lists broken symlinks],
+ [gl_cv_glob_lists_symlinks],
+ [if test $cross_compiling != yes; then
+ if ln -s conf-doesntexist conf$$-globtest 2>/dev/null; then
+ gl_cv_glob_lists_symlinks=maybe
+ else
+ # If we can't make a symlink, then we cannot test this issue. Be
+ # pessimistic about this.
+ gl_cv_glob_lists_symlinks=no
+ fi
+ if test $gl_cv_glob_lists_symlinks = maybe; then
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stddef.h>
+ #include <glob.h>]],
+ [[glob_t found;
+ if (glob ("conf*-globtest", 0, NULL, &found) == GLOB_NOMATCH)
+ return 1;
+ globfree (&found);
+ ]])],
+ [gl_cv_glob_lists_symlinks=yes],
+ [gl_cv_glob_lists_symlinks=no],
+ [dnl We don't get here.
+ :
+ ])
+ fi
+ rm -f conf$$-globtest
+ else
+ gl_cv_glob_lists_symlinks="$gl_cross_guess_normal"
+ fi
+ ])
+ case "$gl_cv_glob_lists_symlinks" in
+ *yes) ;;
+ *) REPLACE_GLOB=1 ;;
+ esac
+ fi
+
+ if test $REPLACE_GLOB = 0; then
+ AC_CACHE_CHECK([whether glob NOTDIR*/ omits symlink to nondir],
+ [gl_cv_glob_omit_nondir_symlinks],
+ [if test $cross_compiling != yes; then
+ if ln -s conf$$-file conf$$-globtest 2>/dev/null && touch conf$$-file
+ then
+ gl_cv_glob_omit_nondir_symlinks=maybe
+ else
+ # If we can't make a symlink, then we cannot test this issue. Be
+ # pessimistic about this.
+ gl_cv_glob_omit_nondir_symlinks=no
+ fi
+ if test $gl_cv_glob_omit_nondir_symlinks = maybe; then
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stddef.h>
+ #include <glob.h>]],
+ [[glob_t found;
+ if (glob ("conf*-globtest/", 0, NULL, &found) != GLOB_NOMATCH)
+ return 1;
+ globfree (&found);
+ ]])],
+ [gl_cv_glob_omit_nondir_symlinks=yes],
+ [gl_cv_glob_omit_nondir_symlinks=no],
+ [dnl We don't get here.
+ :
+ ])
+ fi
+ rm -f conf$$-file conf$$-globtest
+ else
+ gl_cv_glob_omit_nondir_symlinks="$gl_cross_guess_normal"
+ fi
+ ])
+ case "$gl_cv_glob_omit_nondir_symlinks" in
+ *yes) ;;
+ *) REPLACE_GLOB=1 ;;
+ esac
+ fi
+
+ fi
+
+ if test $ac_cv_func_glob_pattern_p = no; then
+ HAVE_GLOB_PATTERN_P=0
+ else
+ if test $REPLACE_GLOB = 1; then
+ REPLACE_GLOB_PATTERN_P=1
+ fi
+ fi
+
+ if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then
+ gl_REPLACE_GLOB_H
+ fi
+])
+
+# Prerequisites of lib/glob.c and lib/globfree.c.
+AC_DEFUN([gl_PREREQ_GLOB],
+[
+ AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ AC_CHECK_FUNCS_ONCE([getlogin_r getpwnam_r])
+])
diff --git a/gl/m4/glob_h.m4 b/gl/m4/glob_h.m4
new file mode 100644
index 0000000..41ffde2
--- /dev/null
+++ b/gl/m4/glob_h.m4
@@ -0,0 +1,84 @@
+# glob_h.m4 serial 9
+dnl Copyright (C) 2018-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN_ONCE([gl_GLOB_H],
+[
+ AC_REQUIRE([gl_GLOB_H_DEFAULTS])
+ m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])])
+ AC_REQUIRE([AC_C_RESTRICT])
+ AC_CHECK_HEADERS_ONCE([glob.h])
+ gl_CHECK_NEXT_HEADERS([glob.h])
+
+ if test $ac_cv_header_glob_h = yes; then
+ HAVE_GLOB_H=1
+ else
+ HAVE_GLOB_H=0
+ fi
+ AC_SUBST([HAVE_GLOB_H])
+
+ m4_ifdef([gl_POSIXCHECK],
+ [GL_GENERATE_GLOB_H=true],
+ [GL_GENERATE_GLOB_H=false
+ if m4_ifdef([gl_ANSI_CXX], [test "$CXX" != no], [false]); then
+ dnl Override <glob.h> always, to support the C++ GNULIB_NAMESPACE.
+ GL_GENERATE_GLOB_H=true
+ else
+ if test $ac_cv_header_glob_h != yes; then
+ dnl Provide a substitute <glob.h> file.
+ GL_GENERATE_GLOB_H=true
+ fi
+ fi
+ ])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <glob.h>
+ ]],
+ [glob globfree glob_pattern_p])
+])
+
+dnl Unconditionally enables the replacement of <glob.h>.
+AC_DEFUN([gl_REPLACE_GLOB_H],
+[
+ gl_GLOB_H_REQUIRE_DEFAULTS
+ GL_GENERATE_GLOB_H=true
+])
+
+# gl_GLOB_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_GLOB_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_GLOB_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_GLOB_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_GLOB_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GLOB])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_GLOB_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_GLOB_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_GLOB_H_DEFAULTS],
+[
+ dnl Assume POSIX and GNU behavior unless another module says otherwise.
+ HAVE_GLOB=1; AC_SUBST([HAVE_GLOB])
+ HAVE_GLOB_PATTERN_P=1; AC_SUBST([HAVE_GLOB_PATTERN_P])
+ REPLACE_GLOB=0; AC_SUBST([REPLACE_GLOB])
+ REPLACE_GLOB_PATTERN_P=0; AC_SUBST([REPLACE_GLOB_PATTERN_P])
+])
diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
new file mode 100644
index 0000000..30911d1
--- /dev/null
+++ b/gl/m4/gnulib-common.m4
@@ -0,0 +1,1075 @@
+# gnulib-common.m4 serial 73
+dnl Copyright (C) 2007-2022 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_PREREQ([2.62])
+
+# gl_COMMON
+# is expanded unconditionally through gnulib-tool magic.
+AC_DEFUN([gl_COMMON], [
+ dnl Use AC_REQUIRE here, so that the code is expanded once only.
+ AC_REQUIRE([gl_00GNULIB])
+ AC_REQUIRE([gl_COMMON_BODY])
+ AC_REQUIRE([gl_ZZGNULIB])
+])
+AC_DEFUN([gl_COMMON_BODY], [
+ AH_VERBATIM([_GL_GNUC_PREREQ],
+[/* True if the compiler says it groks GNU C version MAJOR.MINOR. */
+#if defined __GNUC__ && defined __GNUC_MINOR__
+# define _GL_GNUC_PREREQ(major, minor) \
+ ((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__))
+#else
+# define _GL_GNUC_PREREQ(major, minor) 0
+#endif
+])
+ AH_VERBATIM([_Noreturn],
+[/* The _Noreturn keyword of C11. */
+#ifndef _Noreturn
+# if (defined __cplusplus \
+ && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
+ || (defined _MSC_VER && 1900 <= _MSC_VER)) \
+ && 0)
+ /* [[noreturn]] is not practically usable, because with it the syntax
+ extern _Noreturn void func (...);
+ would not be valid; such a declaration would only be valid with 'extern'
+ and '_Noreturn' swapped, or without the 'extern' keyword. However, some
+ AIX system header files and several gnulib header files use precisely
+ this syntax with 'extern'. */
+# define _Noreturn [[noreturn]]
+# elif ((!defined __cplusplus || defined __clang__) \
+ && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
+ || (!defined __STRICT_ANSI__ \
+ && (_GL_GNUC_PREREQ (4, 7) \
+ || (defined __apple_build_version__ \
+ ? 6000000 <= __apple_build_version__ \
+ : 3 < __clang_major__ + (5 <= __clang_minor__))))))
+ /* _Noreturn works as-is. */
+# elif _GL_GNUC_PREREQ (2, 8) || defined __clang__ || 0x5110 <= __SUNPRO_C
+# define _Noreturn __attribute__ ((__noreturn__))
+# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
+# define _Noreturn __declspec (noreturn)
+# else
+# define _Noreturn
+# endif
+#endif
+])
+ AH_VERBATIM([isoc99_inline],
+[/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
+ the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
+ earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
+ __APPLE__ && __MACH__ test for Mac OS X.
+ __APPLE_CC__ tests for the Apple compiler and its version.
+ __STDC_VERSION__ tests for the C99 mode. */
+#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
+# define __GNUC_STDC_INLINE__ 1
+#endif])
+ AH_VERBATIM([attribute],
+[/* Attributes. */
+#if (defined __has_attribute \
+ && (!defined __clang_minor__ \
+ || (defined __apple_build_version__ \
+ ? 6000000 <= __apple_build_version__ \
+ : 3 < __clang_major__ + (5 <= __clang_minor__))))
+# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
+#else
+# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr
+# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2)
+# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95)
+# define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1)
+# define _GL_ATTR_diagnose_if 0
+# define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1)
+# define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0)
+# define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6)
+# define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0)
+# ifdef _ICC
+# define _GL_ATTR_may_alias 0
+# else
+# define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3)
+# endif
+# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1)
+# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3)
+# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0)
+# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3)
+# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96)
+# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9)
+# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0)
+# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4)
+#endif
+
+#ifdef __has_c_attribute
+# if ((defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) <= 201710 \
+ && _GL_GNUC_PREREQ (4, 6))
+# pragma GCC diagnostic ignored "-Wpedantic"
+# endif
+# define _GL_HAS_C_ATTRIBUTE(attr) __has_c_attribute (__##attr##__)
+#else
+# define _GL_HAS_C_ATTRIBUTE(attr) 0
+#endif
+
+]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's _Alignas instead.
+[
+/* _GL_ATTRIBUTE_ALLOC_SIZE ((N)) declares that the Nth argument of the function
+ is the size of the returned memory block.
+ _GL_ATTRIBUTE_ALLOC_SIZE ((M, N)) declares that the Mth argument multiplied
+ by the Nth argument of the function is the size of the returned memory block.
+ */
+/* Applies to: function, pointer to function, function types. */
+#if _GL_HAS_ATTRIBUTE (alloc_size)
+# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
+#else
+# define _GL_ATTRIBUTE_ALLOC_SIZE(args)
+#endif
+
+/* _GL_ATTRIBUTE_ALWAYS_INLINE tells that the compiler should always inline the
+ function and report an error if it cannot do so. */
+/* Applies to: function. */
+#if _GL_HAS_ATTRIBUTE (always_inline)
+# define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__))
+#else
+# define _GL_ATTRIBUTE_ALWAYS_INLINE
+#endif
+
+/* _GL_ATTRIBUTE_ARTIFICIAL declares that the function is not important to show
+ in stack traces when debugging. The compiler should omit the function from
+ stack traces. */
+/* Applies to: function. */
+#if _GL_HAS_ATTRIBUTE (artificial)
+# define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__))
+#else
+# define _GL_ATTRIBUTE_ARTIFICIAL
+#endif
+
+/* _GL_ATTRIBUTE_COLD declares that the function is rarely executed. */
+/* Applies to: functions. */
+/* Avoid __attribute__ ((cold)) on MinGW; see thread starting at
+ <https://lists.gnu.org/r/emacs-devel/2019-04/msg01152.html>.
+ Also, Oracle Studio 12.6 requires 'cold' not '__cold__'. */
+#if _GL_HAS_ATTRIBUTE (cold) && !defined __MINGW32__
+# ifndef __SUNPRO_C
+# define _GL_ATTRIBUTE_COLD __attribute__ ((__cold__))
+# else
+# define _GL_ATTRIBUTE_COLD __attribute__ ((cold))
+# endif
+#else
+# define _GL_ATTRIBUTE_COLD
+#endif
+
+/* _GL_ATTRIBUTE_CONST declares that it is OK for a compiler to omit duplicate
+ calls to the function with the same arguments.
+ This attribute is safe for a function that neither depends on nor affects
+ observable state, and always returns exactly once - e.g., does not loop
+ forever, and does not call longjmp.
+ (This attribute is stricter than _GL_ATTRIBUTE_PURE.) */
+/* Applies to: functions. */
+#if _GL_HAS_ATTRIBUTE (const)
+# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
+#else
+# define _GL_ATTRIBUTE_CONST
+#endif
+
+/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
+ that can be freed by passing them as the Ith argument to the
+ function F.
+ _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that
+ can be freed via 'free'; it can be used only after declaring 'free'. */
+/* Applies to: functions. Cannot be used on inline functions. */
+#if _GL_GNUC_PREREQ (11, 0)
+# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
+#else
+# define _GL_ATTRIBUTE_DEALLOC(f, i)
+#endif
+/* If gnulib's <string.h> or <wchar.h> has already defined this macro, continue
+ to use this earlier definition, since <stdlib.h> may not have been included
+ yet. */
+#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
+# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
+#endif
+
+/* _GL_ATTRIBUTE_DEPRECATED: Declares that an entity is deprecated.
+ The compiler may warn if the entity is used. */
+/* Applies to:
+ - function, variable,
+ - struct, union, struct/union member,
+ - enumeration, enumeration item,
+ - typedef,
+ in C++ also: namespace, class, template specialization. */
+#if _GL_HAS_C_ATTRIBUTE (deprecated)
+# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]]
+#elif _GL_HAS_ATTRIBUTE (deprecated)
+# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
+#else
+# define _GL_ATTRIBUTE_DEPRECATED
+#endif
+
+/* _GL_ATTRIBUTE_ERROR(msg) requests an error if a function is called and
+ the function call is not optimized away.
+ _GL_ATTRIBUTE_WARNING(msg) requests a warning if a function is called and
+ the function call is not optimized away. */
+/* Applies to: functions. */
+#if _GL_HAS_ATTRIBUTE (error)
+# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__error__ (msg)))
+# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__warning__ (msg)))
+#elif _GL_HAS_ATTRIBUTE (diagnose_if)
+# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__diagnose_if__ (1, msg, "error")))
+# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__diagnose_if__ (1, msg, "warning")))
+#else
+# define _GL_ATTRIBUTE_ERROR(msg)
+# define _GL_ATTRIBUTE_WARNING(msg)
+#endif
+
+/* _GL_ATTRIBUTE_EXTERNALLY_VISIBLE declares that the entity should remain
+ visible to debuggers etc., even with '-fwhole-program'. */
+/* Applies to: functions, variables. */
+#if _GL_HAS_ATTRIBUTE (externally_visible)
+# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((externally_visible))
+#else
+# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
+#endif
+
+/* _GL_ATTRIBUTE_FALLTHROUGH declares that it is not a programming mistake if
+ the control flow falls through to the immediately following 'case' or
+ 'default' label. The compiler should not warn in this case. */
+/* Applies to: Empty statement (;), inside a 'switch' statement. */
+/* Always expands to something. */
+#if _GL_HAS_C_ATTRIBUTE (fallthrough)
+# define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]]
+#elif _GL_HAS_ATTRIBUTE (fallthrough)
+# define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__))
+#else
+# define _GL_ATTRIBUTE_FALLTHROUGH ((void) 0)
+#endif
+
+/* _GL_ATTRIBUTE_FORMAT ((ARCHETYPE, STRING-INDEX, FIRST-TO-CHECK))
+ declares that the STRING-INDEXth function argument is a format string of
+ style ARCHETYPE, which is one of:
+ printf, gnu_printf
+ scanf, gnu_scanf,
+ strftime, gnu_strftime,
+ strfmon,
+ or the same thing prefixed and suffixed with '__'.
+ If FIRST-TO-CHECK is not 0, arguments starting at FIRST-TO_CHECK
+ are suitable for the format string. */
+/* Applies to: functions. */
+#if _GL_HAS_ATTRIBUTE (format)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#else
+# define _GL_ATTRIBUTE_FORMAT(spec)
+#endif
+
+/* _GL_ATTRIBUTE_LEAF declares that if the function is called from some other
+ compilation unit, it executes code from that unit only by return or by
+ exception handling. This declaration lets the compiler optimize that unit
+ more aggressively. */
+/* Applies to: functions. */
+#if _GL_HAS_ATTRIBUTE (leaf)
+# define _GL_ATTRIBUTE_LEAF __attribute__ ((__leaf__))
+#else
+# define _GL_ATTRIBUTE_LEAF
+#endif
+
+/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
+ allocated memory. */
+/* Applies to: functions. */
+#if _GL_HAS_ATTRIBUTE (malloc)
+# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+#else
+# define _GL_ATTRIBUTE_MALLOC
+#endif
+
+/* _GL_ATTRIBUTE_MAY_ALIAS declares that pointers to the type may point to the
+ same storage as pointers to other types. Thus this declaration disables
+ strict aliasing optimization. */
+/* Applies to: types. */
+/* Oracle Studio 12.6 mishandles may_alias despite __has_attribute OK. */
+#if _GL_HAS_ATTRIBUTE (may_alias) && !defined __SUNPRO_C
+# define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__))
+#else
+# define _GL_ATTRIBUTE_MAY_ALIAS
+#endif
+
+/* _GL_ATTRIBUTE_MAYBE_UNUSED declares that it is not a programming mistake if
+ the entity is not used. The compiler should not warn if the entity is not
+ used. */
+/* Applies to:
+ - function, variable,
+ - struct, union, struct/union member,
+ - enumeration, enumeration item,
+ - typedef,
+ in C++ also: class. */
+/* In C++ and C2x, this is spelled [[__maybe_unused__]].
+ GCC's syntax is __attribute__ ((__unused__)).
+ clang supports both syntaxes. */
+#if _GL_HAS_C_ATTRIBUTE (maybe_unused)
+# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
+#else
+# define _GL_ATTRIBUTE_MAYBE_UNUSED _GL_ATTRIBUTE_UNUSED
+#endif
+/* Alternative spelling of this macro, for convenience. */
+#define _GL_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
+/* Earlier spellings of this macro. */
+#define _UNUSED_PARAMETER_ _GL_ATTRIBUTE_MAYBE_UNUSED
+
+/* _GL_ATTRIBUTE_NODISCARD declares that the caller of the function should not
+ discard the return value. The compiler may warn if the caller does not use
+ the return value, unless the caller uses something like ignore_value. */
+/* Applies to: function, enumeration, class. */
+#if _GL_HAS_C_ATTRIBUTE (nodiscard)
+# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
+#elif _GL_HAS_ATTRIBUTE (warn_unused_result)
+# define _GL_ATTRIBUTE_NODISCARD __attribute__ ((__warn_unused_result__))
+#else
+# define _GL_ATTRIBUTE_NODISCARD
+#endif
+
+/* _GL_ATTRIBUTE_NOINLINE tells that the compiler should not inline the
+ function. */
+/* Applies to: functions. */
+#if _GL_HAS_ATTRIBUTE (noinline)
+# define _GL_ATTRIBUTE_NOINLINE __attribute__ ((__noinline__))
+#else
+# define _GL_ATTRIBUTE_NOINLINE
+#endif
+
+/* _GL_ATTRIBUTE_NONNULL ((N1, N2,...)) declares that the arguments N1, N2,...
+ must not be NULL.
+ _GL_ATTRIBUTE_NONNULL () declares that all pointer arguments must not be
+ null. */
+/* Applies to: functions. */
+#if _GL_HAS_ATTRIBUTE (nonnull)
+# define _GL_ATTRIBUTE_NONNULL(args) __attribute__ ((__nonnull__ args))
+#else
+# define _GL_ATTRIBUTE_NONNULL(args)
+#endif
+
+/* _GL_ATTRIBUTE_NONSTRING declares that the contents of a character array is
+ not meant to be NUL-terminated. */
+/* Applies to: struct/union members and variables that are arrays of element
+ type '[[un]signed] char'. */
+#if _GL_HAS_ATTRIBUTE (nonstring)
+# define _GL_ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__))
+#else
+# define _GL_ATTRIBUTE_NONSTRING
+#endif
+
+/* There is no _GL_ATTRIBUTE_NORETURN; use _Noreturn instead. */
+
+/* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions.
+ */
+/* Applies to: functions. */
+#if _GL_HAS_ATTRIBUTE (nothrow) && !defined __cplusplus
+# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__))
+#else
+# define _GL_ATTRIBUTE_NOTHROW
+#endif
+
+/* _GL_ATTRIBUTE_PACKED declares:
+ For struct members: The member has the smallest possible alignment.
+ For struct, union, class: All members have the smallest possible alignment,
+ minimizing the memory required. */
+/* Applies to: struct members, struct, union,
+ in C++ also: class. */
+#if _GL_HAS_ATTRIBUTE (packed)
+# define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__))
+#else
+# define _GL_ATTRIBUTE_PACKED
+#endif
+
+/* _GL_ATTRIBUTE_PURE declares that It is OK for a compiler to omit duplicate
+ calls to the function with the same arguments if observable state is not
+ changed between calls.
+ This attribute is safe for a function that does not affect
+ observable state, and always returns exactly once.
+ (This attribute is looser than _GL_ATTRIBUTE_CONST.) */
+/* Applies to: functions. */
+#if _GL_HAS_ATTRIBUTE (pure)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE
+#endif
+
+/* _GL_ATTRIBUTE_RETURNS_NONNULL declares that the function's return value is
+ a non-NULL pointer. */
+/* Applies to: functions. */
+#if _GL_HAS_ATTRIBUTE (returns_nonnull)
+# define _GL_ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__))
+#else
+# define _GL_ATTRIBUTE_RETURNS_NONNULL
+#endif
+
+/* _GL_ATTRIBUTE_SENTINEL(pos) declares that the variadic function expects a
+ trailing NULL argument.
+ _GL_ATTRIBUTE_SENTINEL () - The last argument is NULL (requires C99).
+ _GL_ATTRIBUTE_SENTINEL ((N)) - The (N+1)st argument from the end is NULL. */
+/* Applies to: functions. */
+#if _GL_HAS_ATTRIBUTE (sentinel)
+# define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__ ((__sentinel__ pos))
+#else
+# define _GL_ATTRIBUTE_SENTINEL(pos)
+#endif
+
+/* A helper macro. Don't use it directly. */
+#if _GL_HAS_ATTRIBUTE (unused)
+# define _GL_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+#else
+# define _GL_ATTRIBUTE_UNUSED
+#endif
+
+]dnl There is no _GL_ATTRIBUTE_VISIBILITY; see m4/visibility.m4 instead.
+[
+/* _GL_UNUSED_LABEL; declares that it is not a programming mistake if the
+ immediately preceding label is not used. The compiler should not warn
+ if the label is not used. */
+/* Applies to: label (both in C and C++). */
+/* Note that g++ < 4.5 does not support the '__attribute__ ((__unused__)) ;'
+ syntax. But clang does. */
+#if !(defined __cplusplus && !_GL_GNUC_PREREQ (4, 5)) || defined __clang__
+# define _GL_UNUSED_LABEL _GL_ATTRIBUTE_UNUSED
+#else
+# define _GL_UNUSED_LABEL
+#endif
+])
+ AH_VERBATIM([async_safe],
+[/* The _GL_ASYNC_SAFE marker should be attached to functions that are
+ signal handlers (for signals other than SIGABRT, SIGPIPE) or can be
+ invoked from such signal handlers. Such functions have some restrictions:
+ * All functions that it calls should be marked _GL_ASYNC_SAFE as well,
+ or should be listed as async-signal-safe in POSIX
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04>
+ section 2.4.3. Note that malloc(), sprintf(), and fwrite(), in
+ particular, are NOT async-signal-safe.
+ * All memory locations (variables and struct fields) that these functions
+ access must be marked 'volatile'. This holds for both read and write
+ accesses. Otherwise the compiler might optimize away stores to and
+ reads from such locations that occur in the program, depending on its
+ data flow analysis. For example, when the program contains a loop
+ that is intended to inspect a variable set from within a signal handler
+ while (!signal_occurred)
+ ;
+ the compiler is allowed to transform this into an endless loop if the
+ variable 'signal_occurred' is not declared 'volatile'.
+ Additionally, recall that:
+ * A signal handler should not modify errno (except if it is a handler
+ for a fatal signal and ends by raising the same signal again, thus
+ provoking the termination of the process). If it invokes a function
+ that may clobber errno, it needs to save and restore the value of
+ errno. */
+#define _GL_ASYNC_SAFE
+])
+ AH_VERBATIM([micro_optimizations],
+[/* _GL_CMP (n1, n2) performs a three-valued comparison on n1 vs. n2, where
+ n1 and n2 are expressions without side effects, that evaluate to real
+ numbers (excluding NaN).
+ It returns
+ 1 if n1 > n2
+ 0 if n1 == n2
+ -1 if n1 < n2
+ The naïve code (n1 > n2 ? 1 : n1 < n2 ? -1 : 0) produces a conditional
+ jump with nearly all GCC versions up to GCC 10.
+ This variant (n1 < n2 ? -1 : n1 > n2) produces a conditional with many
+ GCC versions up to GCC 9.
+ The better code (n1 > n2) - (n1 < n2) from Hacker's Delight § 2-9
+ avoids conditional jumps in all GCC versions >= 3.4. */
+#define _GL_CMP(n1, n2) (((n1) > (n2)) - ((n1) < (n2)))
+])
+ dnl Hint which direction to take regarding cross-compilation guesses:
+ dnl When a user installs a program on a platform they are not intimately
+ dnl familiar with, --enable-cross-guesses=conservative is the appropriate
+ dnl choice. It implements the "If we don't know, assume the worst" principle.
+ dnl However, when an operating system developer (on a platform which is not
+ dnl yet known to gnulib) builds packages for their platform, they want to
+ dnl expose, not hide, possible platform bugs; in this case,
+ dnl --enable-cross-guesses=risky is the appropriate choice.
+ dnl Sets the variables
+ dnl gl_cross_guess_normal (to be used when 'yes' is good and 'no' is bad),
+ dnl gl_cross_guess_inverted (to be used when 'no' is good and 'yes' is bad).
+ AC_ARG_ENABLE([cross-guesses],
+ [AS_HELP_STRING([--enable-cross-guesses={conservative|risky}],
+ [specify policy for cross-compilation guesses])],
+ [if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then
+ AC_MSG_WARN([invalid argument supplied to --enable-cross-guesses])
+ enableval=conservative
+ fi
+ gl_cross_guesses="$enableval"],
+ [gl_cross_guesses=conservative])
+ if test $gl_cross_guesses = risky; then
+ gl_cross_guess_normal="guessing yes"
+ gl_cross_guess_inverted="guessing no"
+ else
+ gl_cross_guess_normal="guessing no"
+ gl_cross_guess_inverted="guessing yes"
+ fi
+ dnl Preparation for running test programs:
+ dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
+ dnl to /dev/tty, so they can be redirected to log files. Such diagnostics
+ dnl arise e.g., in the macros gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N.
+ LIBC_FATAL_STDERR_=1
+ export LIBC_FATAL_STDERR_
+])
+
+# gl_MODULE_INDICATOR_INIT_VARIABLE([variablename])
+# gl_MODULE_INDICATOR_INIT_VARIABLE([variablename], [initialvalue])
+# initializes the shell variable that indicates the presence of the given module
+# as a C preprocessor expression.
+AC_DEFUN([gl_MODULE_INDICATOR_INIT_VARIABLE],
+[
+ GL_MODULE_INDICATOR_PREFIX[]_[$1]=m4_if([$2], , [0], [$2])
+ AC_SUBST(GL_MODULE_INDICATOR_PREFIX[]_[$1])
+])
+
+# gl_MODULE_INDICATOR_CONDITION
+# expands to a C preprocessor expression that evaluates to 1 or 0, depending
+# whether a gnulib module that has been requested shall be considered present
+# or not.
+m4_define([gl_MODULE_INDICATOR_CONDITION], [1])
+
+# gl_MODULE_INDICATOR_SET_VARIABLE([modulename])
+# sets the shell variable that indicates the presence of the given module to
+# a C preprocessor expression that will evaluate to 1.
+AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE],
+[
+ gl_MODULE_INDICATOR_SET_VARIABLE_AUX(
+ [GL_MODULE_INDICATOR_PREFIX[]_GNULIB_[]m4_translit([[$1]],
+ [abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])],
+ [gl_MODULE_INDICATOR_CONDITION])
+])
+
+# gl_MODULE_INDICATOR_SET_VARIABLE_AUX([variable])
+# modifies the shell variable to include the gl_MODULE_INDICATOR_CONDITION.
+# The shell variable's value is a C preprocessor expression that evaluates
+# to 0 or 1.
+AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX],
+[
+ m4_if(m4_defn([gl_MODULE_INDICATOR_CONDITION]), [1],
+ [
+ dnl Simplify the expression VALUE || 1 to 1.
+ $1=1
+ ],
+ [gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([$1],
+ [gl_MODULE_INDICATOR_CONDITION])])
+])
+
+# gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([variable], [condition])
+# modifies the shell variable to include the given condition. The shell
+# variable's value is a C preprocessor expression that evaluates to 0 or 1.
+AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR],
+[
+ dnl Simplify the expression 1 || CONDITION to 1.
+ if test "$[]$1" != 1; then
+ dnl Simplify the expression 0 || CONDITION to CONDITION.
+ if test "$[]$1" = 0; then
+ $1=$2
+ else
+ $1="($[]$1 || $2)"
+ fi
+ fi
+])
+
+# gl_MODULE_INDICATOR([modulename])
+# defines a C macro indicating the presence of the given module
+# in a location where it can be used.
+# | Value | Value |
+# | in lib/ | in tests/ |
+# --------------------------------------------+---------+-----------+
+# Module present among main modules: | 1 | 1 |
+# --------------------------------------------+---------+-----------+
+# Module present among tests-related modules: | 0 | 1 |
+# --------------------------------------------+---------+-----------+
+# Module not present at all: | 0 | 0 |
+# --------------------------------------------+---------+-----------+
+AC_DEFUN([gl_MODULE_INDICATOR],
+[
+ AC_DEFINE_UNQUOTED([GNULIB_]m4_translit([[$1]],
+ [abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]),
+ [gl_MODULE_INDICATOR_CONDITION],
+ [Define to a C preprocessor expression that evaluates to 1 or 0,
+ depending whether the gnulib module $1 shall be considered present.])
+])
+
+# gl_MODULE_INDICATOR_FOR_TESTS([modulename])
+# defines a C macro indicating the presence of the given module
+# in lib or tests. This is useful to determine whether the module
+# should be tested.
+# | Value | Value |
+# | in lib/ | in tests/ |
+# --------------------------------------------+---------+-----------+
+# Module present among main modules: | 1 | 1 |
+# --------------------------------------------+---------+-----------+
+# Module present among tests-related modules: | 1 | 1 |
+# --------------------------------------------+---------+-----------+
+# Module not present at all: | 0 | 0 |
+# --------------------------------------------+---------+-----------+
+AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS],
+[
+ AC_DEFINE([GNULIB_TEST_]m4_translit([[$1]],
+ [abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1],
+ [Define to 1 when the gnulib module $1 should be tested.])
+])
+
+# gl_ASSERT_NO_GNULIB_POSIXCHECK
+# asserts that there will never be a need to #define GNULIB_POSIXCHECK.
+# and thereby enables an optimization of configure and config.h.
+# Used by Emacs.
+AC_DEFUN([gl_ASSERT_NO_GNULIB_POSIXCHECK],
+[
+ dnl Override gl_WARN_ON_USE_PREPARE.
+ dnl But hide this definition from 'aclocal'.
+ AC_DEFUN([gl_W][ARN_ON_USE_PREPARE], [])
+])
+
+# gl_ASSERT_NO_GNULIB_TESTS
+# asserts that there will be no gnulib tests in the scope of the configure.ac
+# and thereby enables an optimization of config.h.
+# Used by Emacs.
+AC_DEFUN([gl_ASSERT_NO_GNULIB_TESTS],
+[
+ dnl Override gl_MODULE_INDICATOR_FOR_TESTS.
+ AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], [])
+])
+
+# Test whether <features.h> exists.
+# Set HAVE_FEATURES_H.
+AC_DEFUN([gl_FEATURES_H],
+[
+ AC_CHECK_HEADERS_ONCE([features.h])
+ if test $ac_cv_header_features_h = yes; then
+ HAVE_FEATURES_H=1
+ else
+ HAVE_FEATURES_H=0
+ fi
+ AC_SUBST([HAVE_FEATURES_H])
+])
+
+# gl_PROG_CC_C99
+# Modifies the value of the shell variable CC in an attempt to make $CC
+# understand ISO C99 source code.
+AC_DEFUN([gl_PROG_CC_C99],
+[
+ dnl Just use AC_PROG_CC_C99.
+ dnl When AC_PROG_CC_C99 and AC_PROG_CC_STDC are used together, the substituted
+ dnl value of CC will contain the C99 enabling options twice. But this is only
+ dnl a cosmetic problem.
+ dnl With Autoconf >= 2.70, use AC_PROG_CC since it implies AC_PROG_CC_C99;
+ dnl this avoids a "warning: The macro `AC_PROG_CC_C99' is obsolete."
+ m4_version_prereq([2.70],
+ [AC_REQUIRE([AC_PROG_CC])],
+ [AC_REQUIRE([AC_PROG_CC_C99])])
+])
+
+# gl_PROG_AR_RANLIB
+# Determines the values for AR, ARFLAGS, RANLIB that fit with the compiler.
+# The user can set the variables AR, ARFLAGS, RANLIB if he wants to override
+# the values.
+AC_DEFUN([gl_PROG_AR_RANLIB],
+[
+ dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler
+ dnl as "cc", and GCC as "gcc". They have different object file formats and
+ dnl library formats. In particular, the GNU binutils programs ar and ranlib
+ dnl produce libraries that work only with gcc, not with cc.
+ AC_REQUIRE([AC_PROG_CC])
+ dnl The '][' hides this use from 'aclocal'.
+ AC_BEFORE([$0], [A][M_PROG_AR])
+ AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler],
+ [
+ AC_EGREP_CPP([Amsterdam],
+ [
+#ifdef __ACK__
+Amsterdam
+#endif
+ ],
+ [gl_cv_c_amsterdam_compiler=yes],
+ [gl_cv_c_amsterdam_compiler=no])
+ ])
+
+ dnl Don't compete with AM_PROG_AR's decision about AR/ARFLAGS if we are not
+ dnl building with __ACK__.
+ if test $gl_cv_c_amsterdam_compiler = yes; then
+ if test -z "$AR"; then
+ AR='cc -c.a'
+ fi
+ if test -z "$ARFLAGS"; then
+ ARFLAGS='-o'
+ fi
+ else
+ dnl AM_PROG_AR was added in automake v1.11.2. AM_PROG_AR does not AC_SUBST
+ dnl ARFLAGS variable (it is filed into Makefile.in directly by automake
+ dnl script on-demand, if not specified by ./configure of course).
+ dnl Don't AC_REQUIRE the AM_PROG_AR otherwise the code for __ACK__ above
+ dnl will be ignored. Also, pay attention to call AM_PROG_AR in else block
+ dnl because AM_PROG_AR is written so it could re-set AR variable even for
+ dnl __ACK__. It may seem like its easier to avoid calling the macro here,
+ dnl but we need to AC_SUBST both AR/ARFLAGS (thus those must have some good
+ dnl default value and automake should usually know them).
+ dnl
+ dnl The '][' hides this use from 'aclocal'.
+ m4_ifdef([A][M_PROG_AR], [A][M_PROG_AR], [:])
+ fi
+
+ dnl In case the code above has not helped with setting AR/ARFLAGS, use
+ dnl Automake-documented default values for AR and ARFLAGS, but prefer
+ dnl ${host}-ar over ar (useful for cross-compiling).
+ AC_CHECK_TOOL([AR], [ar], [ar])
+ if test -z "$ARFLAGS"; then
+ ARFLAGS='cr'
+ fi
+
+ AC_SUBST([AR])
+ AC_SUBST([ARFLAGS])
+ if test -z "$RANLIB"; then
+ if test $gl_cv_c_amsterdam_compiler = yes; then
+ RANLIB=':'
+ else
+ dnl Use the ranlib program if it is available.
+ AC_PROG_RANLIB
+ fi
+ fi
+ AC_SUBST([RANLIB])
+])
+
+# AC_C_RESTRICT
+# This definition is copied from post-2.70 Autoconf and overrides the
+# AC_C_RESTRICT macro from autoconf 2.60..2.70.
+m4_version_prereq([2.70.1], [], [
+AC_DEFUN([AC_C_RESTRICT],
+[AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict],
+ [ac_cv_c_restrict=no
+ # Put '__restrict__' first, to avoid problems with glibc and non-GCC; see:
+ # https://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html
+ # Put 'restrict' last, because C++ lacks it.
+ for ac_kw in __restrict__ __restrict _Restrict restrict; do
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[typedef int *int_ptr;
+ int foo (int_ptr $ac_kw ip) { return ip[0]; }
+ int bar (int [$ac_kw]); /* Catch GCC bug 14050. */
+ int bar (int ip[$ac_kw]) { return ip[0]; }
+ ]],
+ [[int s[1];
+ int *$ac_kw t = s;
+ t[0] = 0;
+ return foo (t) + bar (t);
+ ]])],
+ [ac_cv_c_restrict=$ac_kw])
+ test "$ac_cv_c_restrict" != no && break
+ done
+ ])
+ AH_VERBATIM([restrict],
+[/* Define to the equivalent of the C99 'restrict' keyword, or to
+ nothing if this is not supported. Do not define if restrict is
+ supported only directly. */
+#undef restrict
+/* Work around a bug in older versions of Sun C++, which did not
+ #define __restrict__ or support _Restrict or __restrict__
+ even though the corresponding Sun C compiler ended up with
+ "#define restrict _Restrict" or "#define restrict __restrict__"
+ in the previous line. This workaround can be removed once
+ we assume Oracle Developer Studio 12.5 (2016) or later. */
+#if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__
+# define _Restrict
+# define __restrict__
+#endif])
+ case $ac_cv_c_restrict in
+ restrict) ;;
+ no) AC_DEFINE([restrict], []) ;;
+ *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
+ esac
+])# AC_C_RESTRICT
+])
+
+# gl_BIGENDIAN
+# is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd.
+# Note that AC_REQUIRE([AC_C_BIGENDIAN]) does not work reliably because some
+# macros invoke AC_C_BIGENDIAN with arguments.
+AC_DEFUN([gl_BIGENDIAN],
+[
+ AC_C_BIGENDIAN
+])
+
+# A temporary file descriptor.
+# Must be less than 10, because dash 0.5.8 does not support redirections
+# with multi-digit file descriptors.
+m4_define([GL_TMP_FD], 9)
+
+# gl_SILENT(command)
+# executes command, but without the normal configure output.
+# This is useful when you want to invoke AC_CACHE_CHECK (or AC_CHECK_FUNC etc.)
+# inside another AC_CACHE_CHECK.
+AC_DEFUN([gl_SILENT],
+[
+ exec GL_TMP_FD>&AS_MESSAGE_FD AS_MESSAGE_FD>/dev/null
+ $1
+ exec AS_MESSAGE_FD>&GL_TMP_FD GL_TMP_FD>&-
+])
+
+# gl_CACHE_VAL_SILENT(cache-id, command-to-set-it)
+# is like AC_CACHE_VAL(cache-id, command-to-set-it), except that it does not
+# output a spurious "(cached)" mark in the midst of other configure output.
+# This macro should be used instead of AC_CACHE_VAL when it is not surrounded
+# by an AC_MSG_CHECKING/AC_MSG_RESULT pair.
+AC_DEFUN([gl_CACHE_VAL_SILENT],
+[
+ gl_SILENT([
+ AC_CACHE_VAL([$1], [$2])
+ ])
+])
+
+# gl_CONDITIONAL(conditional, condition)
+# is like AM_CONDITIONAL(conditional, condition), except that it does not
+# produce an error
+# configure: error: conditional "..." was never defined.
+# Usually this means the macro was only invoked conditionally.
+# when only invoked conditionally. Instead, in that case, both the _TRUE
+# and the _FALSE case are disabled.
+AC_DEFUN([gl_CONDITIONAL],
+[
+ pushdef([AC_CONFIG_COMMANDS_PRE], [:])dnl
+ AM_CONDITIONAL([$1], [$2])
+ popdef([AC_CONFIG_COMMANDS_PRE])dnl
+ if test -z "${[$1]_TRUE}" && test -z "${[$1]_FALSE}"; then
+ [$1]_TRUE='#'
+ [$1]_FALSE='#'
+ fi
+])
+
+# gl_CC_ALLOW_WARNINGS
+# sets and substitutes a variable GL_CFLAG_ALLOW_WARNINGS, to a $(CC) option
+# that reverts a preceding '-Werror' option, if available.
+# This is expected to be '-Wno-error' on gcc, clang (except clang/MSVC), xlclang
+# and empty otherwise.
+AC_DEFUN([gl_CC_ALLOW_WARNINGS],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_CACHE_CHECK([for C compiler option to allow warnings],
+ [gl_cv_cc_wallow],
+ [rm -f conftest*
+ echo 'int dummy;' > conftest.c
+ AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c 2>conftest1.err]) >/dev/null
+ AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Wno-error -c conftest.c 2>conftest2.err]) >/dev/null
+ dnl Test the number of error output lines, because AIX xlc accepts the
+ dnl option '-Wno-error', just to produce a warning
+ dnl "Option -Wno-error was incorrectly specified. The option will be ignored."
+ dnl afterwards.
+ if test $? = 0 && test `wc -l < conftest1.err` = `wc -l < conftest2.err`; then
+ gl_cv_cc_wallow='-Wno-error'
+ else
+ gl_cv_cc_wallow=none
+ fi
+ rm -f conftest*
+ ])
+ case "$gl_cv_cc_wallow" in
+ none) GL_CFLAG_ALLOW_WARNINGS='' ;;
+ *) GL_CFLAG_ALLOW_WARNINGS="$gl_cv_cc_wallow" ;;
+ esac
+ AC_SUBST([GL_CFLAG_ALLOW_WARNINGS])
+])
+
+# gl_CXX_ALLOW_WARNINGS
+# sets and substitutes a variable GL_CXXFLAG_ALLOW_WARNINGS, to a $(CC) option
+# that reverts a preceding '-Werror' option, if available.
+AC_DEFUN([gl_CXX_ALLOW_WARNINGS],
+[
+ dnl Requires AC_PROG_CXX or gl_PROG_ANSI_CXX.
+ if test -n "$CXX" && test "$CXX" != no; then
+ AC_CACHE_CHECK([for C++ compiler option to allow warnings],
+ [gl_cv_cxx_wallow],
+ [rm -f conftest*
+ echo 'int dummy;' > conftest.cc
+ AC_TRY_COMMAND([${CXX-c++} $CXXFLAGS $CPPFLAGS -c conftest.cc 2>conftest1.err]) >/dev/null
+ AC_TRY_COMMAND([${CXX-c++} $CXXFLAGS $CPPFLAGS -Wno-error -c conftest.cc 2>conftest2.err]) >/dev/null
+ dnl Test the number of error output lines, because AIX xlC accepts the
+ dnl option '-Wno-error', just to produce a warning
+ dnl "Option -Wno-error was incorrectly specified. The option will be ignored."
+ dnl afterwards.
+ if test $? = 0 && test `wc -l < conftest1.err` = `wc -l < conftest2.err`; then
+ gl_cv_cxx_wallow='-Wno-error'
+ else
+ gl_cv_cxx_wallow=none
+ fi
+ rm -f conftest*
+ ])
+ case "$gl_cv_cxx_wallow" in
+ none) GL_CXXFLAG_ALLOW_WARNINGS='' ;;
+ *) GL_CXXFLAG_ALLOW_WARNINGS="$gl_cv_cxx_wallow" ;;
+ esac
+ else
+ GL_CXXFLAG_ALLOW_WARNINGS=''
+ fi
+ AC_SUBST([GL_CXXFLAG_ALLOW_WARNINGS])
+])
+
+# gl_CC_GNULIB_WARNINGS
+# sets and substitutes a variable GL_CFLAG_GNULIB_WARNINGS, to a $(CC) option
+# set that enables or disables warnings as suitable for the Gnulib coding style.
+AC_DEFUN([gl_CC_GNULIB_WARNINGS],
+[
+ AC_REQUIRE([gl_CC_ALLOW_WARNINGS])
+ dnl Assume that the compiler supports -Wno-* options only if it also supports
+ dnl -Wno-error.
+ GL_CFLAG_GNULIB_WARNINGS=''
+ if test -n "$GL_CFLAG_ALLOW_WARNINGS"; then
+ dnl Enable these warning options:
+ dnl
+ dnl GCC clang
+ dnl -Wno-cast-qual >= 3 >= 3.9
+ dnl -Wno-conversion >= 3 >= 3.9
+ dnl -Wno-float-conversion >= 4.9 >= 3.9
+ dnl -Wno-float-equal >= 3 >= 3.9
+ dnl -Wimplicit-fallthrough >= 7 >= 3.9
+ dnl -Wno-pedantic >= 4.8 >= 3.9
+ dnl -Wno-sign-compare >= 3 >= 3.9
+ dnl -Wno-sign-conversion >= 4.3 >= 3.9
+ dnl -Wno-type-limits >= 4.3 >= 3.9
+ dnl -Wno-undef >= 3 >= 3.9
+ dnl -Wno-unsuffixed-float-constants >= 4.5
+ dnl -Wno-unused-function >= 3 >= 3.9
+ dnl -Wno-unused-parameter >= 3 >= 3.9
+ dnl
+ cat > conftest.c <<\EOF
+ #if __GNUC__ >= 3 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+ -Wno-cast-qual
+ -Wno-conversion
+ -Wno-float-equal
+ -Wno-sign-compare
+ -Wno-undef
+ -Wno-unused-function
+ -Wno-unused-parameter
+ #endif
+ #if __GNUC__ + (__GNUC_MINOR__ >= 9) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+ -Wno-float-conversion
+ #endif
+ #if __GNUC__ >= 7 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+ -Wimplicit-fallthrough
+ #endif
+ #if __GNUC__ + (__GNUC_MINOR__ >= 8) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+ -Wno-pedantic
+ #endif
+ #if __GNUC__ + (__GNUC_MINOR__ >= 3) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+ -Wno-sign-conversion
+ -Wno-type-limits
+ #endif
+ #if __GNUC__ + (__GNUC_MINOR__ >= 5) > 4
+ -Wno-unsuffixed-float-constants
+ #endif
+EOF
+ gl_command="$CC $CFLAGS $CPPFLAGS -E conftest.c > conftest.out"
+ if AC_TRY_EVAL([gl_command]); then
+ gl_options=`grep -v '#' conftest.out`
+ for word in $gl_options; do
+ GL_CFLAG_GNULIB_WARNINGS="$GL_CFLAG_GNULIB_WARNINGS $word"
+ done
+ fi
+ rm -f conftest.c conftest.out
+ fi
+ AC_SUBST([GL_CFLAG_GNULIB_WARNINGS])
+])
+
+dnl gl_CONDITIONAL_HEADER([foo.h])
+dnl takes a shell variable GL_GENERATE_FOO_H (with value true or false) as input
+dnl and produces
+dnl - an AC_SUBSTed variable FOO_H that is either a file name or empty, based
+dnl on whether GL_GENERATE_FOO_H is true or false,
+dnl - an Automake conditional GL_GENERATE_FOO_H that evaluates to the value of
+dnl the shell variable GL_GENERATE_FOO_H.
+AC_DEFUN([gl_CONDITIONAL_HEADER],
+[
+ m4_pushdef([gl_header_name], AS_TR_SH(m4_toupper($1)))
+ m4_pushdef([gl_generate_var], [GL_GENERATE_]AS_TR_SH(m4_toupper($1)))
+ m4_pushdef([gl_generate_cond], [GL_GENERATE_]AS_TR_SH(m4_toupper($1)))
+ case "$gl_generate_var" in
+ false) gl_header_name='' ;;
+ true)
+ dnl It is OK to use a .h file in lib/ from within tests/, but not vice
+ dnl versa.
+ if test -z "$gl_header_name"; then
+ gl_header_name="${gl_source_base_prefix}$1"
+ fi
+ ;;
+ *) echo "*** gl_generate_var is not set correctly" 1>&2; exit 1 ;;
+ esac
+ AC_SUBST(gl_header_name)
+ gl_CONDITIONAL(gl_generate_cond, [$gl_generate_var])
+ m4_popdef([gl_generate_cond])
+ m4_popdef([gl_generate_var])
+ m4_popdef([gl_header_name])
+])
+
+dnl Expands to some code for use in .c programs that, on native Windows, defines
+dnl the Microsoft deprecated alias function names to the underscore-prefixed
+dnl actual function names. With this macro, these function names are available
+dnl without linking with '-loldnames' and without generating warnings.
+dnl Usage: Use it after all system header files are included.
+dnl #include <...>
+dnl #include <...>
+dnl ]GL_MDA_DEFINES[
+dnl ...
+AC_DEFUN([GL_MDA_DEFINES],[
+AC_REQUIRE([_GL_MDA_DEFINES])
+[$gl_mda_defines]
+])
+AC_DEFUN([_GL_MDA_DEFINES],
+[gl_mda_defines='
+#if defined _WIN32 && !defined __CYGWIN__
+#define access _access
+#define chdir _chdir
+#define chmod _chmod
+#define close _close
+#define creat _creat
+#define dup _dup
+#define dup2 _dup2
+#define ecvt _ecvt
+#define execl _execl
+#define execle _execle
+#define execlp _execlp
+#define execv _execv
+#define execve _execve
+#define execvp _execvp
+#define execvpe _execvpe
+#define fcloseall _fcloseall
+#define fcvt _fcvt
+#define fdopen _fdopen
+#define fileno _fileno
+#define gcvt _gcvt
+#define getcwd _getcwd
+#define getpid _getpid
+#define getw _getw
+#define isatty _isatty
+#define j0 _j0
+#define j1 _j1
+#define jn _jn
+#define lfind _lfind
+#define lsearch _lsearch
+#define lseek _lseek
+#define memccpy _memccpy
+#define mkdir _mkdir
+#define mktemp _mktemp
+#define open _open
+#define putenv _putenv
+#define putw _putw
+#define read _read
+#define rmdir _rmdir
+#define strdup _strdup
+#define swab _swab
+#define tempnam _tempnam
+#define tzset _tzset
+#define umask _umask
+#define unlink _unlink
+#define utime _utime
+#define wcsdup _wcsdup
+#define write _write
+#define y0 _y0
+#define y1 _y1
+#define yn _yn
+#endif
+'
+])
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
new file mode 100644
index 0000000..55a0a2c
--- /dev/null
+++ b/gl/m4/gnulib-comp.m4
@@ -0,0 +1,1937 @@
+# DO NOT EDIT! GENERATED AUTOMATICALLY!
+# Copyright (C) 2002-2022 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 file. If not, see <https://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License,
+# this file may be distributed as part of a program that
+# contains a configuration script generated by Autoconf, under
+# the same distribution terms as the rest of that program.
+#
+# Generated by gnulib-tool.
+#
+# This file represents the compiled summary of the specification in
+# gnulib-cache.m4. It lists the computed macro invocations that need
+# to be invoked from configure.ac.
+# In projects that use version control, this file can be treated like
+# other built files.
+
+
+# This macro should be invoked from ./configure.ac, in the section
+# "Checks for programs", right after AC_PROG_CC, and certainly before
+# any checks for libraries, header files, types and library functions.
+AC_DEFUN([gl_EARLY],
+[
+ m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace
+ m4_pattern_allow([^gl_ES$])dnl a valid locale name
+ m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
+ m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
+
+ # Pre-early section.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_REQUIRE([gl_PROG_AR_RANLIB])
+
+ # Code from module absolute-header:
+ # Code from module alloca:
+ # Code from module alloca-opt:
+ # Code from module argp:
+ # Code from module array-list:
+ # Code from module assure:
+ # Code from module at-internal:
+ # Code from module attribute:
+ # Code from module basename-lgpl:
+ # Code from module bitrotate:
+ # Code from module btowc:
+ # Code from module builtin-expect:
+ # Code from module c99:
+ # Code from module calloc-gnu:
+ # Code from module calloc-posix:
+ # Code from module canonicalize:
+ # Code from module canonicalize-lgpl:
+ # Code from module chdir:
+ # Code from module chdir-long:
+ # Code from module chown:
+ # Code from module clock-time:
+ # Code from module cloexec:
+ # Code from module close:
+ # Code from module closedir:
+ # Code from module ctype:
+ # Code from module d-ino:
+ # Code from module d-type:
+ # Code from module dirent:
+ # Code from module dirfd:
+ # Code from module dirname:
+ # Code from module dirname-lgpl:
+ # Code from module double-slash-root:
+ # Code from module dup:
+ # Code from module dup2:
+ # Code from module dynarray:
+ # Code from module eloop-threshold:
+ # Code from module environ:
+ # Code from module errno:
+ # Code from module error:
+ # Code from module exitfail:
+ # Code from module extensions:
+ # Code from module extern-inline:
+ # Code from module fchdir:
+ # Code from module fcntl:
+ # Code from module fcntl-h:
+ # Code from module fd-hook:
+ # Code from module fd-safer-flag:
+ # Code from module fdopendir:
+ # Code from module file-set:
+ # Code from module filename:
+ # Code from module filenamecat-lgpl:
+ # Code from module flexmember:
+ # Code from module float:
+ # Code from module flock:
+ # Code from module fnmatch:
+ # Code from module fnmatch-gnu:
+ # Code from module fnmatch-h:
+ # Code from module free-posix:
+ # Code from module fstat:
+ # Code from module fstatat:
+ # Code from module gen-header:
+ # Code from module getcwd:
+ # Code from module getcwd-lgpl:
+ # Code from module getdelim:
+ # Code from module getdtablesize:
+ # Code from module getline:
+ # Code from module getlogin_r:
+ # Code from module getopt-gnu:
+ # Code from module getopt-posix:
+ # Code from module getprogname:
+ # Code from module getrandom:
+ # Code from module gettext-h:
+ # Code from module gettime:
+ # Code from module gettimeofday:
+ # Code from module gitlog-to-changelog:
+ # Code from module glob:
+ # Code from module glob-h:
+ # Code from module gnupload:
+ # Code from module hard-locale:
+ # Code from module hash:
+ # Code from module hash-map:
+ # Code from module hash-pjw:
+ # Code from module hash-pjw-bare:
+ # Code from module hash-set:
+ # Code from module hash-triple-simple:
+ # Code from module havelib:
+ # Code from module ialloc:
+ # Code from module idpriv-drop:
+ # Code from module idpriv-droptemp:
+ # Code from module idx:
+ # Code from module include_next:
+ # Code from module intprops:
+ # Code from module inttypes-incomplete:
+ # Code from module ioctl:
+ # Code from module isblank:
+ # Code from module langinfo:
+ # Code from module largefile:
+ AC_REQUIRE([AC_SYS_LARGEFILE])
+ AC_REQUIRE([gl_YEAR2038_EARLY])
+ # Code from module lchown:
+ # Code from module lib-ignore:
+ # Code from module libc-config:
+ # Code from module limits-h:
+ # Code from module linkedhash-list:
+ # Code from module list:
+ # Code from module localcharset:
+ # Code from module locale:
+ # Code from module localeconv:
+ # Code from module lock:
+ # Code from module lstat:
+ # Code from module malloc-gnu:
+ # Code from module malloc-posix:
+ # Code from module malloca:
+ # Code from module manywarnings:
+ # Code from module map:
+ # Code from module mbrtowc:
+ # Code from module mbsinit:
+ # Code from module mbsrtowcs:
+ # Code from module mbtowc:
+ # Code from module memchr:
+ # Code from module memmem:
+ # Code from module memmem-simple:
+ # Code from module mempcpy:
+ # Code from module memrchr:
+ # Code from module minmax:
+ # Code from module mkdir:
+ # Code from module mkdtemp:
+ # Code from module mkstemp:
+ # Code from module msvc-inval:
+ # Code from module msvc-nothrow:
+ # Code from module multiarch:
+ # Code from module nanosleep:
+ # Code from module nl_langinfo:
+ # Code from module nocrash:
+ # Code from module nonblocking:
+ # Code from module open:
+ # Code from module openat:
+ # Code from module openat-die:
+ # Code from module openat-h:
+ # Code from module opendir:
+ # Code from module pathmax:
+ # Code from module pipe-posix:
+ # Code from module progname:
+ # Code from module pselect:
+ # Code from module pthread_sigmask:
+ # Code from module raise:
+ # Code from module rawmemchr:
+ # Code from module rbtree-list:
+ # Code from module readdir:
+ # Code from module readlink:
+ # Code from module readlinkat:
+ # Code from module realloc-gnu:
+ # Code from module realloc-posix:
+ # Code from module reallocarray:
+ # Code from module regex:
+ # Code from module rename:
+ # Code from module renameat:
+ # Code from module renameatu:
+ # Code from module rewinddir:
+ # Code from module rmdir:
+ # Code from module same-inode:
+ # Code from module save-cwd:
+ # Code from module scratch_buffer:
+ # Code from module select:
+ # Code from module set:
+ # Code from module setenv:
+ # Code from module setlocale-null:
+ # Code from module sigaction:
+ # Code from module signal-h:
+ # Code from module sigpipe:
+ # Code from module sigprocmask:
+ # Code from module size_max:
+ # Code from module sleep:
+ # Code from module snippet/_Noreturn:
+ # Code from module snippet/arg-nonnull:
+ # Code from module snippet/c++defs:
+ # Code from module snippet/warn-on-use:
+ # Code from module socketlib:
+ # Code from module sockets:
+ # Code from module socklen:
+ # Code from module ssize_t:
+ # Code from module stat:
+ # Code from module stat-time:
+ # Code from module std-gnu11:
+ # Code from module stdalign:
+ # Code from module stdarg:
+ dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode
+ dnl for the builtin va_copy to work. gl_PROG_CC_C99 arranges for this.
+ gl_PROG_CC_C99
+ # Code from module stdbool:
+ # Code from module stddef:
+ # Code from module stdint:
+ # Code from module stdio:
+ # Code from module stdlib:
+ # Code from module stdopen:
+ # Code from module stpcpy:
+ # Code from module strcase:
+ # Code from module strcasestr:
+ # Code from module strcasestr-simple:
+ # Code from module strchrnul:
+ # Code from module strdup-posix:
+ # Code from module streq:
+ # Code from module strerror:
+ # Code from module strerror-override:
+ # Code from module string:
+ # Code from module strings:
+ # Code from module strndup:
+ # Code from module strnlen:
+ # Code from module strnlen1:
+ # Code from module strsep:
+ # Code from module sys_file:
+ # Code from module sys_ioctl:
+ # Code from module sys_random:
+ # Code from module sys_select:
+ # Code from module sys_socket:
+ # Code from module sys_stat:
+ # Code from module sys_time:
+ # Code from module sys_types:
+ # Code from module sys_uio:
+ # Code from module sysexits:
+ # Code from module tempname:
+ # Code from module termios:
+ # Code from module threadlib:
+ gl_THREADLIB_EARLY
+ # Code from module time:
+ # Code from module timespec:
+ # Code from module unistd:
+ # Code from module unistd-safer:
+ # Code from module unlink:
+ # Code from module unlinkat:
+ # Code from module utime:
+ # Code from module utime-h:
+ # Code from module utimens:
+ # Code from module vararrays:
+ # Code from module vasnprintf:
+ # Code from module vasprintf:
+ # Code from module verify:
+ # Code from module verror:
+ # Code from module vsnprintf:
+ # Code from module warnings:
+ # Code from module wchar:
+ # Code from module wcrtomb:
+ # Code from module wctype-h:
+ # Code from module windows-mutex:
+ # Code from module windows-once:
+ # Code from module windows-recmutex:
+ # Code from module windows-rwlock:
+ # Code from module wmemchr:
+ # Code from module wmempcpy:
+ # Code from module xalloc:
+ # Code from module xalloc-die:
+ # Code from module xalloc-oversized:
+ # Code from module xgetcwd:
+ # Code from module xlist:
+ # Code from module xmap:
+ # Code from module xset:
+ # Code from module xsize:
+ # Code from module xstdopen:
+ # Code from module xstrndup:
+ # Code from module xvasprintf:
+])
+
+# This macro should be invoked from ./configure.ac, in the section
+# "Check for header files, types and library functions".
+AC_DEFUN([gl_INIT],
+[
+ AC_CONFIG_LIBOBJ_DIR([gl/lib])
+ AM_CONDITIONAL([GL_COND_LIBTOOL], [true])
+ gl_cond_libtool=true
+ gl_m4_base='gl/m4'
+ m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ]))
+ m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS]))
+ m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES]))
+ m4_pushdef([gl_LIBSOURCES_LIST], [])
+ m4_pushdef([gl_LIBSOURCES_DIR], [])
+ m4_pushdef([GL_MACRO_PREFIX], [gl])
+ m4_pushdef([GL_MODULE_INDICATOR_PREFIX], [GL])
+ gl_COMMON
+ gl_source_base='gl/lib'
+ gl_source_base_prefix=
+changequote(,)dnl
+LTALLOCA=`echo "$ALLOCA" | sed -e 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'`
+changequote([, ])dnl
+AC_SUBST([LTALLOCA])
+ gl_FUNC_ALLOCA
+ gl_CONDITIONAL_HEADER([alloca.h])
+ AC_PROG_MKDIR_P
+ gl_ARGP
+ m4_ifdef([AM_XGETTEXT_OPTION],
+ [AM_][XGETTEXT_OPTION([--flag=argp_error:2:c-format])
+ AM_][XGETTEXT_OPTION([--flag=argp_failure:4:c-format])])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ gl_FUNC_BTOWC
+ gl_CONDITIONAL([GL_COND_OBJ_BTOWC],
+ [test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1])
+ AM_COND_IF([GL_COND_OBJ_BTOWC], [
+ gl_PREREQ_BTOWC
+ ])
+ gl_WCHAR_MODULE_INDICATOR([btowc])
+ gl___BUILTIN_EXPECT
+ gl_FUNC_CALLOC_GNU
+ if test $REPLACE_CALLOC_FOR_CALLOC_GNU = 1; then
+ AC_LIBOBJ([calloc])
+ fi
+ gl_STDLIB_MODULE_INDICATOR([calloc-gnu])
+ gl_FUNC_CALLOC_POSIX
+ if test $REPLACE_CALLOC_FOR_CALLOC_POSIX = 1; then
+ AC_LIBOBJ([calloc])
+ fi
+ gl_STDLIB_MODULE_INDICATOR([calloc-posix])
+ gl_FUNC_CANONICALIZE_FILENAME_MODE
+ gl_MODULE_INDICATOR([canonicalize])
+ gl_MODULE_INDICATOR_FOR_TESTS([canonicalize])
+ gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name])
+ gl_CANONICALIZE_LGPL
+ gl_CONDITIONAL([GL_COND_OBJ_CANONICALIZE_LGPL],
+ [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1])
+ gl_MODULE_INDICATOR([canonicalize-lgpl])
+ gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name])
+ gl_STDLIB_MODULE_INDICATOR([realpath])
+ gl_UNISTD_MODULE_INDICATOR([chdir])
+ gl_FUNC_CHDIR_LONG
+ gl_CONDITIONAL([GL_COND_OBJ_CHDIR_LONG],
+ [test $gl_cv_have_unlimited_file_name_length = no])
+ AM_COND_IF([GL_COND_OBJ_CHDIR_LONG], [
+ gl_PREREQ_CHDIR_LONG
+ ])
+ gl_FUNC_CHOWN
+ gl_CONDITIONAL([GL_COND_OBJ_CHOWN],
+ [test $HAVE_CHOWN = 0 || test $REPLACE_CHOWN = 1])
+ gl_CONDITIONAL([GL_COND_OBJ_FCHOWN_STUB],
+ [test $REPLACE_CHOWN = 1 && test $ac_cv_func_fchown = no])
+ gl_UNISTD_MODULE_INDICATOR([chown])
+ gl_CLOCK_TIME
+ gl_MODULE_INDICATOR_FOR_TESTS([cloexec])
+ gl_FUNC_CLOSE
+ gl_CONDITIONAL([GL_COND_OBJ_CLOSE], [test $REPLACE_CLOSE = 1])
+ gl_UNISTD_MODULE_INDICATOR([close])
+ gl_FUNC_CLOSEDIR
+ gl_CONDITIONAL([GL_COND_OBJ_CLOSEDIR],
+ [test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1])
+ gl_DIRENT_MODULE_INDICATOR([closedir])
+ gl_CTYPE_H
+ gl_CTYPE_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_CHECK_TYPE_STRUCT_DIRENT_D_INO
+ gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE
+ gl_DIRENT_H
+ gl_DIRENT_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_FUNC_DIRFD
+ gl_CONDITIONAL([GL_COND_OBJ_DIRFD],
+ [test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no || test $REPLACE_DIRFD = 1])
+ AM_COND_IF([GL_COND_OBJ_DIRFD], [
+ gl_PREREQ_DIRFD
+ ])
+ gl_DIRENT_MODULE_INDICATOR([dirfd])
+ gl_MODULE_INDICATOR([dirname])
+ gl_DOUBLE_SLASH_ROOT
+ gl_FUNC_DUP
+ gl_CONDITIONAL([GL_COND_OBJ_DUP], [test $REPLACE_DUP = 1])
+ AM_COND_IF([GL_COND_OBJ_DUP], [
+ gl_PREREQ_DUP
+ ])
+ gl_UNISTD_MODULE_INDICATOR([dup])
+ gl_FUNC_DUP2
+ gl_CONDITIONAL([GL_COND_OBJ_DUP2], [test $REPLACE_DUP2 = 1])
+ AM_COND_IF([GL_COND_OBJ_DUP2], [
+ gl_PREREQ_DUP2
+ ])
+ gl_UNISTD_MODULE_INDICATOR([dup2])
+ AC_PROG_MKDIR_P
+ gl_ENVIRON
+ gl_UNISTD_MODULE_INDICATOR([environ])
+ gl_HEADER_ERRNO_H
+ gl_CONDITIONAL_HEADER([errno.h])
+ AC_PROG_MKDIR_P
+ gl_ERROR
+ gl_CONDITIONAL([GL_COND_OBJ_ERROR], [test "$ac_cv_lib_error_at_line" = no])
+ AM_COND_IF([GL_COND_OBJ_ERROR], [
+ gl_PREREQ_ERROR
+ ])
+ m4_ifdef([AM_XGETTEXT_OPTION],
+ [AM_][XGETTEXT_OPTION([--flag=error:3:c-format])
+ AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
+ AC_REQUIRE([gl_EXTERN_INLINE])
+ gl_FUNC_FCHDIR
+ gl_CONDITIONAL([GL_COND_OBJ_FCHDIR], [test $HAVE_FCHDIR = 0])
+ AM_COND_IF([GL_COND_OBJ_FCHDIR], [
+ gl_PREREQ_FCHDIR
+ ])
+ gl_UNISTD_MODULE_INDICATOR([fchdir])
+ gl_FUNC_FCNTL
+ gl_CONDITIONAL([GL_COND_OBJ_FCNTL],
+ [test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1])
+ gl_FCNTL_MODULE_INDICATOR([fcntl])
+ gl_FCNTL_H
+ gl_FCNTL_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_MODULE_INDICATOR([fd-safer-flag])
+ gl_FUNC_FDOPENDIR
+ gl_CONDITIONAL([GL_COND_OBJ_FDOPENDIR],
+ [test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1])
+ gl_DIRENT_MODULE_INDICATOR([fdopendir])
+ gl_MODULE_INDICATOR([fdopendir])
+ gl_FILE_NAME_CONCAT_LGPL
+ AC_C_FLEXIBLE_ARRAY_MEMBER
+ gl_FLOAT_H
+ gl_CONDITIONAL_HEADER([float.h])
+ AC_PROG_MKDIR_P
+ gl_CONDITIONAL([GL_COND_OBJ_FLOAT], [test $REPLACE_FLOAT_LDBL = 1])
+ gl_CONDITIONAL([GL_COND_OBJ_ITOLD], [test $REPLACE_ITOLD = 1])
+ gl_FUNC_FLOCK
+ gl_CONDITIONAL([GL_COND_OBJ_FLOCK], [test $HAVE_FLOCK = 0])
+ AM_COND_IF([GL_COND_OBJ_FLOCK], [
+ gl_PREREQ_FLOCK
+ ])
+ gl_SYS_FILE_MODULE_INDICATOR([flock])
+ gl_FUNC_FNMATCH_POSIX
+ dnl Because of gl_REPLACE_FNMATCH_H:
+ gl_CONDITIONAL_HEADER([fnmatch.h])
+ if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
+ AC_LIBOBJ([fnmatch])
+ gl_PREREQ_FNMATCH
+ fi
+ gl_FNMATCH_MODULE_INDICATOR([fnmatch])
+ gl_FUNC_FNMATCH_GNU
+ if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
+ AC_LIBOBJ([fnmatch])
+ gl_PREREQ_FNMATCH
+ fi
+ gl_MODULE_INDICATOR([fnmatch-gnu])
+ gl_FNMATCH_H
+ gl_FNMATCH_H_REQUIRE_DEFAULTS
+ gl_CONDITIONAL_HEADER([fnmatch.h])
+ AC_PROG_MKDIR_P
+ gl_FUNC_FREE
+ gl_CONDITIONAL([GL_COND_OBJ_FREE], [test $REPLACE_FREE = 1])
+ AM_COND_IF([GL_COND_OBJ_FREE], [
+ gl_PREREQ_FREE
+ ])
+ gl_STDLIB_MODULE_INDICATOR([free-posix])
+ gl_FUNC_FSTAT
+ gl_CONDITIONAL([GL_COND_OBJ_FSTAT], [test $REPLACE_FSTAT = 1])
+ AM_COND_IF([GL_COND_OBJ_FSTAT], [
+ case "$host_os" in
+ mingw*)
+ AC_LIBOBJ([stat-w32])
+ ;;
+ esac
+ gl_PREREQ_FSTAT
+ ])
+ gl_SYS_STAT_MODULE_INDICATOR([fstat])
+ gl_FUNC_FSTATAT
+ gl_CONDITIONAL([GL_COND_OBJ_FSTATAT],
+ [test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1])
+ gl_SYS_STAT_MODULE_INDICATOR([fstatat])
+ gl_FUNC_GETCWD
+ gl_CONDITIONAL([GL_COND_OBJ_GETCWD], [test $REPLACE_GETCWD = 1])
+ AM_COND_IF([GL_COND_OBJ_GETCWD], [
+ gl_PREREQ_GETCWD
+ ])
+ gl_MODULE_INDICATOR([getcwd])
+ gl_UNISTD_MODULE_INDICATOR([getcwd])
+ gl_FUNC_GETCWD_LGPL
+ gl_CONDITIONAL([GL_COND_OBJ_GETCWD_LGPL], [test $REPLACE_GETCWD = 1])
+ gl_UNISTD_MODULE_INDICATOR([getcwd])
+ gl_FUNC_GETDELIM
+ gl_CONDITIONAL([GL_COND_OBJ_GETDELIM],
+ [test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1])
+ AM_COND_IF([GL_COND_OBJ_GETDELIM], [
+ gl_PREREQ_GETDELIM
+ ])
+ gl_STDIO_MODULE_INDICATOR([getdelim])
+ gl_FUNC_GETDTABLESIZE
+ gl_CONDITIONAL([GL_COND_OBJ_GETDTABLESIZE],
+ [test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1])
+ AM_COND_IF([GL_COND_OBJ_GETDTABLESIZE], [
+ gl_PREREQ_GETDTABLESIZE
+ ])
+ gl_UNISTD_MODULE_INDICATOR([getdtablesize])
+ gl_FUNC_GETLINE
+ gl_CONDITIONAL([GL_COND_OBJ_GETLINE], [test $REPLACE_GETLINE = 1])
+ AM_COND_IF([GL_COND_OBJ_GETLINE], [
+ gl_PREREQ_GETLINE
+ ])
+ gl_STDIO_MODULE_INDICATOR([getline])
+ gl_FUNC_GETLOGIN_R
+ gl_CONDITIONAL([GL_COND_OBJ_GETLOGIN_R],
+ [test $HAVE_GETLOGIN_R = 0 || test $REPLACE_GETLOGIN_R = 1])
+ AM_COND_IF([GL_COND_OBJ_GETLOGIN_R], [
+ gl_PREREQ_GETLOGIN_R
+ ])
+ gl_UNISTD_MODULE_INDICATOR([getlogin_r])
+ AC_REQUIRE([gl_LIB_GETLOGIN])
+ gl_FUNC_GETOPT_GNU
+ dnl Because of the way gl_FUNC_GETOPT_GNU is implemented (the gl_getopt_required
+ dnl mechanism), there is no need to do any AC_LIBOBJ or AC_SUBST here; they are
+ dnl done in the getopt-posix module.
+ gl_FUNC_GETOPT_POSIX
+ gl_CONDITIONAL_HEADER([getopt.h])
+ gl_CONDITIONAL_HEADER([getopt-cdefs.h])
+ AC_PROG_MKDIR_P
+ gl_CONDITIONAL([GL_COND_OBJ_GETOPT], [test $REPLACE_GETOPT = 1])
+ AM_COND_IF([GL_COND_OBJ_GETOPT], [
+ dnl Define the substituted variable GNULIB_UNISTD_H_GETOPT to 1.
+ gl_UNISTD_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_GETOPT], [1])
+ ])
+ gl_UNISTD_MODULE_INDICATOR([getopt-posix])
+ gl_FUNC_GETPROGNAME
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ gl_FUNC_GETRANDOM
+ gl_CONDITIONAL([GL_COND_OBJ_GETRANDOM],
+ [test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1])
+ gl_SYS_RANDOM_MODULE_INDICATOR([getrandom])
+ AC_SUBST([LIBINTL])
+ AC_SUBST([LTLIBINTL])
+ gl_GETTIME
+ gl_FUNC_GETTIMEOFDAY
+ gl_CONDITIONAL([GL_COND_OBJ_GETTIMEOFDAY],
+ [test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1])
+ AM_COND_IF([GL_COND_OBJ_GETTIMEOFDAY], [
+ gl_PREREQ_GETTIMEOFDAY
+ ])
+ gl_SYS_TIME_MODULE_INDICATOR([gettimeofday])
+ gl_GLOB
+ dnl Because of gl_REPLACE_GLOB_H:
+ gl_CONDITIONAL_HEADER([glob.h])
+ gl_CONDITIONAL([GL_COND_OBJ_GLOB],
+ [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1])
+ AM_COND_IF([GL_COND_OBJ_GLOB], [
+ gl_PREREQ_GLOB
+ ])
+ gl_CONDITIONAL([GL_COND_OBJ_GLOB_PATTERN_P],
+ [test $HAVE_GLOB_PATTERN_P = 0 || test $REPLACE_GLOB_PATTERN_P = 1])
+ gl_GLOB_MODULE_INDICATOR([glob])
+ gl_GLOB_H
+ gl_GLOB_H_REQUIRE_DEFAULTS
+ gl_CONDITIONAL_HEADER([glob.h])
+ AC_PROG_MKDIR_P
+ AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
+ LIB_HARD_LOCALE="$LIB_SETLOCALE_NULL"
+ AC_SUBST([LIB_HARD_LOCALE])
+ AC_DEFUN([gl_HAVE_MODULE_HAVELIB])
+ gl_IDPRIV
+ gl_IDPRIV
+ gl_INTTYPES_INCOMPLETE
+ gl_INTTYPES_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_FUNC_IOCTL
+ gl_CONDITIONAL([GL_COND_OBJ_IOCTL],
+ [test $HAVE_IOCTL = 0 || test $REPLACE_IOCTL = 1])
+ gl_SYS_IOCTL_MODULE_INDICATOR([ioctl])
+ gl_FUNC_ISBLANK
+ gl_CONDITIONAL([GL_COND_OBJ_ISBLANK], [test $HAVE_ISBLANK = 0])
+ gl_MODULE_INDICATOR([isblank])
+ gl_CTYPE_MODULE_INDICATOR([isblank])
+ gl_LANGINFO_H
+ gl_LANGINFO_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ AC_REQUIRE([gl_LARGEFILE])
+ gl_FUNC_LCHOWN
+ gl_CONDITIONAL([GL_COND_OBJ_LCHOWN],
+ [test $HAVE_LCHOWN = 0 || test $REPLACE_LCHOWN = 1])
+ gl_UNISTD_MODULE_INDICATOR([lchown])
+ gl_IGNORE_UNUSED_LIBRARIES
+ gl___INLINE
+ gl_LIMITS_H
+ gl_CONDITIONAL_HEADER([limits.h])
+ AC_PROG_MKDIR_P
+ gl_LOCALCHARSET
+ dnl For backward compatibility. Some packages still use this.
+ LOCALCHARSET_TESTS_ENVIRONMENT=
+ AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
+ gl_LOCALE_H
+ gl_LOCALE_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_FUNC_LOCALECONV
+ gl_CONDITIONAL([GL_COND_OBJ_LOCALECONV], [test $REPLACE_LOCALECONV = 1])
+ AM_COND_IF([GL_COND_OBJ_LOCALECONV], [
+ gl_PREREQ_LOCALECONV
+ ])
+ gl_LOCALE_MODULE_INDICATOR([localeconv])
+ gl_LOCK
+ gl_MODULE_INDICATOR([lock])
+ gl_FUNC_LSTAT
+ gl_CONDITIONAL([GL_COND_OBJ_LSTAT], [test $REPLACE_LSTAT = 1])
+ AM_COND_IF([GL_COND_OBJ_LSTAT], [
+ gl_PREREQ_LSTAT
+ ])
+ gl_SYS_STAT_MODULE_INDICATOR([lstat])
+ gl_FUNC_MALLOC_GNU
+ if test $REPLACE_MALLOC_FOR_MALLOC_GNU = 1; then
+ AC_LIBOBJ([malloc])
+ fi
+ gl_STDLIB_MODULE_INDICATOR([malloc-gnu])
+ AC_REQUIRE([gl_FUNC_MALLOC_POSIX])
+ if test $REPLACE_MALLOC_FOR_MALLOC_POSIX = 1; then
+ AC_LIBOBJ([malloc])
+ fi
+ gl_STDLIB_MODULE_INDICATOR([malloc-posix])
+ gl_MALLOCA
+ gl_FUNC_MBRTOWC
+ gl_CONDITIONAL([GL_COND_OBJ_MBRTOWC],
+ [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1])
+ AM_COND_IF([GL_COND_OBJ_MBRTOWC], [
+ if test $REPLACE_MBSTATE_T = 1; then
+ AC_LIBOBJ([lc-charset-dispatch])
+ AC_LIBOBJ([mbtowc-lock])
+ gl_PREREQ_MBTOWC_LOCK
+ fi
+ gl_PREREQ_MBRTOWC
+ ])
+ gl_WCHAR_MODULE_INDICATOR([mbrtowc])
+ gl_FUNC_MBSINIT
+ gl_CONDITIONAL([GL_COND_OBJ_MBSINIT],
+ [test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1])
+ AM_COND_IF([GL_COND_OBJ_MBSINIT], [
+ gl_PREREQ_MBSINIT
+ ])
+ gl_WCHAR_MODULE_INDICATOR([mbsinit])
+ gl_FUNC_MBSRTOWCS
+ gl_CONDITIONAL([GL_COND_OBJ_MBSRTOWCS],
+ [test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1])
+ AM_COND_IF([GL_COND_OBJ_MBSRTOWCS], [
+ AC_LIBOBJ([mbsrtowcs-state])
+ gl_PREREQ_MBSRTOWCS
+ ])
+ gl_WCHAR_MODULE_INDICATOR([mbsrtowcs])
+ gl_FUNC_MBTOWC
+ gl_CONDITIONAL([GL_COND_OBJ_MBTOWC],
+ [test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1])
+ AM_COND_IF([GL_COND_OBJ_MBTOWC], [
+ gl_PREREQ_MBTOWC
+ ])
+ gl_STDLIB_MODULE_INDICATOR([mbtowc])
+ gl_FUNC_MEMCHR
+ gl_CONDITIONAL([GL_COND_OBJ_MEMCHR], [test $REPLACE_MEMCHR = 1])
+ AM_COND_IF([GL_COND_OBJ_MEMCHR], [
+ gl_PREREQ_MEMCHR
+ ])
+ gl_STRING_MODULE_INDICATOR([memchr])
+ gl_FUNC_MEMMEM
+ if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
+ AC_LIBOBJ([memmem])
+ fi
+ gl_FUNC_MEMMEM_SIMPLE
+ if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
+ AC_LIBOBJ([memmem])
+ fi
+ gl_STRING_MODULE_INDICATOR([memmem])
+ gl_FUNC_MEMPCPY
+ gl_CONDITIONAL([GL_COND_OBJ_MEMPCPY], [test $HAVE_MEMPCPY = 0])
+ AM_COND_IF([GL_COND_OBJ_MEMPCPY], [
+ gl_PREREQ_MEMPCPY
+ ])
+ gl_STRING_MODULE_INDICATOR([mempcpy])
+ gl_FUNC_MEMRCHR
+ gl_CONDITIONAL([GL_COND_OBJ_MEMRCHR], [test $ac_cv_func_memrchr = no])
+ AM_COND_IF([GL_COND_OBJ_MEMRCHR], [
+ gl_PREREQ_MEMRCHR
+ ])
+ gl_STRING_MODULE_INDICATOR([memrchr])
+ gl_MINMAX
+ gl_FUNC_MKDIR
+ gl_CONDITIONAL([GL_COND_OBJ_MKDIR], [test $REPLACE_MKDIR = 1])
+ gl_SYS_STAT_MODULE_INDICATOR([mkdir])
+ gl_FUNC_MKDTEMP
+ gl_CONDITIONAL([GL_COND_OBJ_MKDTEMP], [test $HAVE_MKDTEMP = 0])
+ AM_COND_IF([GL_COND_OBJ_MKDTEMP], [
+ gl_PREREQ_MKDTEMP
+ ])
+ gl_STDLIB_MODULE_INDICATOR([mkdtemp])
+ gl_FUNC_MKSTEMP
+ gl_CONDITIONAL([GL_COND_OBJ_MKSTEMP],
+ [test $HAVE_MKSTEMP = 0 || test $REPLACE_MKSTEMP = 1])
+ AM_COND_IF([GL_COND_OBJ_MKSTEMP], [
+ gl_PREREQ_MKSTEMP
+ ])
+ gl_STDLIB_MODULE_INDICATOR([mkstemp])
+ AC_REQUIRE([gl_MSVC_INVAL])
+ gl_CONDITIONAL([GL_COND_OBJ_MSVC_INVAL],
+ [test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1])
+ AC_REQUIRE([gl_MSVC_NOTHROW])
+ gl_CONDITIONAL([GL_COND_OBJ_MSVC_NOTHROW],
+ [test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1])
+ gl_MODULE_INDICATOR([msvc-nothrow])
+ gl_MULTIARCH
+ gl_FUNC_NANOSLEEP
+ gl_CONDITIONAL([GL_COND_OBJ_NANOSLEEP],
+ [test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1])
+ gl_TIME_MODULE_INDICATOR([nanosleep])
+ gl_FUNC_NL_LANGINFO
+ gl_CONDITIONAL([GL_COND_OBJ_NL_LANGINFO],
+ [test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1])
+ gl_CONDITIONAL([GL_COND_OBJ_NL_LANGINFO_LOCK],
+ [test $REPLACE_NL_LANGINFO = 1 && test $NL_LANGINFO_MTSAFE = 0])
+ if test $REPLACE_NL_LANGINFO = 1 && test $NL_LANGINFO_MTSAFE = 0; then
+ gl_PREREQ_NL_LANGINFO_LOCK
+ fi
+ gl_LANGINFO_MODULE_INDICATOR([nl_langinfo])
+ gl_NONBLOCKING_IO
+ gl_FCNTL_MODULE_INDICATOR([nonblocking])
+ dnl Define the C macro GNULIB_NONBLOCKING to 1.
+ gl_MODULE_INDICATOR([nonblocking])
+ dnl Define the substituted variable GNULIB_STDIO_H_NONBLOCKING to 1.
+ gl_STDIO_H_REQUIRE_DEFAULTS
+ AC_REQUIRE([gl_ASM_SYMBOL_PREFIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_NONBLOCKING], [1])
+ dnl Define the substituted variable GNULIB_UNISTD_H_NONBLOCKING to 1.
+ gl_UNISTD_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_NONBLOCKING], [1])
+ gl_FUNC_OPEN
+ gl_CONDITIONAL([GL_COND_OBJ_OPEN], [test $REPLACE_OPEN = 1])
+ AM_COND_IF([GL_COND_OBJ_OPEN], [
+ gl_PREREQ_OPEN
+ ])
+ gl_FCNTL_MODULE_INDICATOR([open])
+ gl_FUNC_OPENAT
+ gl_CONDITIONAL([GL_COND_OBJ_OPENAT],
+ [test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1])
+ AM_COND_IF([GL_COND_OBJ_OPENAT], [
+ gl_PREREQ_OPENAT
+ ])
+ gl_MODULE_INDICATOR([openat]) dnl for lib/getcwd.c
+ gl_FCNTL_MODULE_INDICATOR([openat])
+ gl_FUNC_OPENDIR
+ gl_CONDITIONAL([GL_COND_OBJ_OPENDIR],
+ [test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1])
+ gl_DIRENT_MODULE_INDICATOR([opendir])
+ gl_PATHMAX
+ gl_FUNC_PIPE
+ gl_CONDITIONAL([GL_COND_OBJ_PIPE], [test $HAVE_PIPE = 0])
+ gl_UNISTD_MODULE_INDICATOR([pipe])
+ AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>])
+ AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>])
+ gl_FUNC_PSELECT
+ gl_CONDITIONAL([GL_COND_OBJ_PSELECT],
+ [test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1])
+ gl_SYS_SELECT_MODULE_INDICATOR([pselect])
+ gl_FUNC_PTHREAD_SIGMASK
+ gl_CONDITIONAL([GL_COND_OBJ_PTHREAD_SIGMASK],
+ [test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1])
+ AM_COND_IF([GL_COND_OBJ_PTHREAD_SIGMASK], [
+ gl_PREREQ_PTHREAD_SIGMASK
+ ])
+ gl_SIGNAL_MODULE_INDICATOR([pthread_sigmask])
+ gl_FUNC_RAISE
+ gl_CONDITIONAL([GL_COND_OBJ_RAISE],
+ [test $HAVE_RAISE = 0 || test $REPLACE_RAISE = 1])
+ AM_COND_IF([GL_COND_OBJ_RAISE], [
+ gl_PREREQ_RAISE
+ ])
+ gl_SIGNAL_MODULE_INDICATOR([raise])
+ gl_FUNC_RAWMEMCHR
+ gl_CONDITIONAL([GL_COND_OBJ_RAWMEMCHR], [test $HAVE_RAWMEMCHR = 0])
+ AM_COND_IF([GL_COND_OBJ_RAWMEMCHR], [
+ gl_PREREQ_RAWMEMCHR
+ ])
+ gl_STRING_MODULE_INDICATOR([rawmemchr])
+ gl_FUNC_READDIR
+ gl_CONDITIONAL([GL_COND_OBJ_READDIR], [test $HAVE_READDIR = 0])
+ gl_DIRENT_MODULE_INDICATOR([readdir])
+ gl_FUNC_READLINK
+ gl_CONDITIONAL([GL_COND_OBJ_READLINK],
+ [test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1])
+ AM_COND_IF([GL_COND_OBJ_READLINK], [
+ gl_PREREQ_READLINK
+ ])
+ gl_UNISTD_MODULE_INDICATOR([readlink])
+ gl_FUNC_READLINKAT
+ gl_CONDITIONAL([GL_COND_OBJ_READLINKAT],
+ [test $HAVE_READLINKAT = 0 || test $REPLACE_READLINKAT = 1])
+ gl_UNISTD_MODULE_INDICATOR([readlinkat])
+ gl_FUNC_REALLOC_GNU
+ if test $REPLACE_REALLOC_FOR_REALLOC_GNU = 1; then
+ AC_LIBOBJ([realloc])
+ fi
+ gl_STDLIB_MODULE_INDICATOR([realloc-gnu])
+ gl_FUNC_REALLOC_POSIX
+ if test $REPLACE_REALLOC_FOR_REALLOC_POSIX = 1; then
+ AC_LIBOBJ([realloc])
+ fi
+ gl_STDLIB_MODULE_INDICATOR([realloc-posix])
+ gl_FUNC_REALLOCARRAY
+ gl_CONDITIONAL([GL_COND_OBJ_REALLOCARRAY],
+ [test $HAVE_REALLOCARRAY = 0 || test $REPLACE_REALLOCARRAY = 1])
+ AM_COND_IF([GL_COND_OBJ_REALLOCARRAY], [
+ gl_PREREQ_REALLOCARRAY
+ ])
+ gl_MODULE_INDICATOR([reallocarray])
+ gl_STDLIB_MODULE_INDICATOR([reallocarray])
+ gl_REGEX
+ gl_CONDITIONAL([GL_COND_OBJ_REGEX], [test $ac_use_included_regex = yes])
+ AM_COND_IF([GL_COND_OBJ_REGEX], [
+ gl_PREREQ_REGEX
+ ])
+ gl_FUNC_RENAME
+ gl_CONDITIONAL([GL_COND_OBJ_RENAME], [test $REPLACE_RENAME = 1])
+ gl_STDIO_MODULE_INDICATOR([rename])
+ gl_FUNC_RENAMEAT
+ gl_CONDITIONAL([GL_COND_OBJ_RENAMEAT],
+ [test $HAVE_RENAMEAT = 0 || test $REPLACE_RENAMEAT = 1])
+ if test $HAVE_RENAMEAT = 0; then
+ AC_LIBOBJ([at-func2])
+ fi
+ gl_STDIO_MODULE_INDICATOR([renameat])
+ gl_FUNC_RENAMEAT
+ if test $HAVE_RENAMEAT = 0; then
+ AC_LIBOBJ([at-func2])
+ fi
+ gl_FUNC_REWINDDIR
+ gl_CONDITIONAL([GL_COND_OBJ_REWINDDIR], [test $HAVE_REWINDDIR = 0])
+ gl_DIRENT_MODULE_INDICATOR([rewinddir])
+ gl_FUNC_RMDIR
+ gl_CONDITIONAL([GL_COND_OBJ_RMDIR], [test $REPLACE_RMDIR = 1])
+ gl_UNISTD_MODULE_INDICATOR([rmdir])
+ gl_SAVE_CWD
+ AC_PROG_MKDIR_P
+ gl_FUNC_SELECT
+ gl_CONDITIONAL([GL_COND_OBJ_SELECT], [test $REPLACE_SELECT = 1])
+ gl_SYS_SELECT_MODULE_INDICATOR([select])
+ gl_FUNC_SETENV
+ gl_CONDITIONAL([GL_COND_OBJ_SETENV],
+ [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1])
+ gl_STDLIB_MODULE_INDICATOR([setenv])
+ gl_FUNC_SETLOCALE_NULL
+ gl_CONDITIONAL([GL_COND_OBJ_SETLOCALE_LOCK],
+ [test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0])
+ AM_COND_IF([GL_COND_OBJ_SETLOCALE_LOCK], [
+ gl_PREREQ_SETLOCALE_LOCK
+ ])
+ gl_LOCALE_MODULE_INDICATOR([setlocale_null])
+ gl_SIGACTION
+ gl_CONDITIONAL([GL_COND_OBJ_SIGACTION], [test $HAVE_SIGACTION = 0])
+ AM_COND_IF([GL_COND_OBJ_SIGACTION], [
+ gl_PREREQ_SIGACTION
+ ])
+ gl_SIGNAL_MODULE_INDICATOR([sigaction])
+ gl_SIGNAL_H
+ gl_SIGNAL_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_SIGNAL_SIGPIPE
+ dnl Define the C macro GNULIB_SIGPIPE to 1.
+ gl_MODULE_INDICATOR([sigpipe])
+ dnl Define the substituted variable GNULIB_SIGNAL_H_SIGPIPE to 1.
+ gl_SIGNAL_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNAL_H_SIGPIPE], [1])
+ dnl Define the substituted variable GNULIB_STDIO_H_SIGPIPE to 1.
+ gl_STDIO_H_REQUIRE_DEFAULTS
+ AC_REQUIRE([gl_ASM_SYMBOL_PREFIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_SIGPIPE], [1])
+ dnl Define the substituted variable GNULIB_UNISTD_H_SIGPIPE to 1.
+ gl_UNISTD_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_SIGPIPE], [1])
+ gl_SIGNALBLOCKING
+ gl_CONDITIONAL([GL_COND_OBJ_SIGPROCMASK], [test $HAVE_POSIX_SIGNALBLOCKING = 0])
+ AM_COND_IF([GL_COND_OBJ_SIGPROCMASK], [
+ gl_PREREQ_SIGPROCMASK
+ ])
+ gl_SIGNAL_MODULE_INDICATOR([sigprocmask])
+ gl_SIZE_MAX
+ gl_FUNC_SLEEP
+ gl_CONDITIONAL([GL_COND_OBJ_SLEEP],
+ [test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1])
+ gl_UNISTD_MODULE_INDICATOR([sleep])
+ AC_REQUIRE([gl_SOCKETLIB])
+ AC_REQUIRE([gl_SOCKETS])
+ gl_TYPE_SOCKLEN_T
+ gt_TYPE_SSIZE_T
+ gl_FUNC_STAT
+ gl_CONDITIONAL([GL_COND_OBJ_STAT], [test $REPLACE_STAT = 1])
+ AM_COND_IF([GL_COND_OBJ_STAT], [
+ case "$host_os" in
+ mingw*)
+ AC_LIBOBJ([stat-w32])
+ ;;
+ esac
+ gl_PREREQ_STAT
+ ])
+ gl_SYS_STAT_MODULE_INDICATOR([stat])
+ gl_STAT_TIME
+ gl_STAT_BIRTHTIME
+ gl_STDALIGN_H
+ gl_CONDITIONAL_HEADER([stdalign.h])
+ AC_PROG_MKDIR_P
+ gl_STDARG_H
+ gl_CONDITIONAL_HEADER([stdarg.h])
+ AC_PROG_MKDIR_P
+ gl_STDBOOL_H
+ gl_CONDITIONAL_HEADER([stdbool.h])
+ AC_PROG_MKDIR_P
+ gl_STDDEF_H
+ gl_STDDEF_H_REQUIRE_DEFAULTS
+ gl_CONDITIONAL_HEADER([stddef.h])
+ AC_PROG_MKDIR_P
+ gl_STDINT_H
+ gl_CONDITIONAL_HEADER([stdint.h])
+ dnl Because of gl_REPLACE_LIMITS_H:
+ gl_CONDITIONAL_HEADER([limits.h])
+ AC_PROG_MKDIR_P
+ gl_STDIO_H
+ gl_STDIO_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_CONDITIONAL([GL_COND_OBJ_STDIO_READ], [test $REPLACE_STDIO_READ_FUNCS = 1])
+ gl_CONDITIONAL([GL_COND_OBJ_STDIO_WRITE], [test $REPLACE_STDIO_WRITE_FUNCS = 1])
+ dnl No need to create extra modules for these functions. Everyone who uses
+ dnl <stdio.h> likely needs them.
+ gl_STDIO_MODULE_INDICATOR([fscanf])
+ gl_MODULE_INDICATOR([fscanf])
+ gl_STDIO_MODULE_INDICATOR([scanf])
+ gl_MODULE_INDICATOR([scanf])
+ gl_STDIO_MODULE_INDICATOR([fgetc])
+ gl_STDIO_MODULE_INDICATOR([getc])
+ gl_STDIO_MODULE_INDICATOR([getchar])
+ gl_STDIO_MODULE_INDICATOR([fgets])
+ gl_STDIO_MODULE_INDICATOR([fread])
+ dnl No need to create extra modules for these functions. Everyone who uses
+ dnl <stdio.h> likely needs them.
+ gl_STDIO_MODULE_INDICATOR([fprintf])
+ gl_STDIO_MODULE_INDICATOR([printf])
+ gl_STDIO_MODULE_INDICATOR([vfprintf])
+ gl_STDIO_MODULE_INDICATOR([vprintf])
+ gl_STDIO_MODULE_INDICATOR([fputc])
+ gl_STDIO_MODULE_INDICATOR([putc])
+ gl_STDIO_MODULE_INDICATOR([putchar])
+ gl_STDIO_MODULE_INDICATOR([fputs])
+ gl_STDIO_MODULE_INDICATOR([puts])
+ gl_STDIO_MODULE_INDICATOR([fwrite])
+ gl_STDLIB_H
+ gl_STDLIB_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_FUNC_STPCPY
+ gl_CONDITIONAL([GL_COND_OBJ_STPCPY], [test $HAVE_STPCPY = 0])
+ AM_COND_IF([GL_COND_OBJ_STPCPY], [
+ gl_PREREQ_STPCPY
+ ])
+ gl_STRING_MODULE_INDICATOR([stpcpy])
+ gl_STRCASE
+ gl_CONDITIONAL([GL_COND_OBJ_STRCASECMP], [test $HAVE_STRCASECMP = 0])
+ AM_COND_IF([GL_COND_OBJ_STRCASECMP], [
+ gl_PREREQ_STRCASECMP
+ ])
+ gl_CONDITIONAL([GL_COND_OBJ_STRNCASECMP], [test $HAVE_STRNCASECMP = 0])
+ AM_COND_IF([GL_COND_OBJ_STRNCASECMP], [
+ gl_PREREQ_STRNCASECMP
+ ])
+ gl_FUNC_STRCASESTR
+ if test $HAVE_STRCASESTR = 0 || test $REPLACE_STRCASESTR = 1; then
+ AC_LIBOBJ([strcasestr])
+ gl_PREREQ_STRCASESTR
+ fi
+ gl_FUNC_STRCASESTR_SIMPLE
+ if test $HAVE_STRCASESTR = 0 || test $REPLACE_STRCASESTR = 1; then
+ AC_LIBOBJ([strcasestr])
+ gl_PREREQ_STRCASESTR
+ fi
+ gl_STRING_MODULE_INDICATOR([strcasestr])
+ gl_FUNC_STRCHRNUL
+ gl_CONDITIONAL([GL_COND_OBJ_STRCHRNUL],
+ [test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1])
+ AM_COND_IF([GL_COND_OBJ_STRCHRNUL], [
+ gl_PREREQ_STRCHRNUL
+ ])
+ gl_STRING_MODULE_INDICATOR([strchrnul])
+ gl_FUNC_STRDUP_POSIX
+ gl_CONDITIONAL([GL_COND_OBJ_STRDUP], [test $REPLACE_STRDUP = 1])
+ AM_COND_IF([GL_COND_OBJ_STRDUP], [
+ gl_PREREQ_STRDUP
+ ])
+ gl_STRING_MODULE_INDICATOR([strdup])
+ gl_FUNC_STRERROR
+ gl_CONDITIONAL([GL_COND_OBJ_STRERROR], [test $REPLACE_STRERROR = 1])
+ gl_MODULE_INDICATOR([strerror])
+ gl_STRING_MODULE_INDICATOR([strerror])
+ AC_REQUIRE([gl_HEADER_ERRNO_H])
+ AC_REQUIRE([gl_FUNC_STRERROR_0])
+ gl_CONDITIONAL([GL_COND_OBJ_STRERROR_OVERRIDE],
+ [test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1])
+ AM_COND_IF([GL_COND_OBJ_STRERROR_OVERRIDE], [
+ gl_PREREQ_SYS_H_WINSOCK2
+ ])
+ gl_STRING_H
+ gl_STRING_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_STRINGS_H
+ gl_STRINGS_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_FUNC_STRNDUP
+ gl_CONDITIONAL([GL_COND_OBJ_STRNDUP],
+ [test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1])
+ gl_STRING_MODULE_INDICATOR([strndup])
+ gl_FUNC_STRNLEN
+ gl_CONDITIONAL([GL_COND_OBJ_STRNLEN],
+ [test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1])
+ AM_COND_IF([GL_COND_OBJ_STRNLEN], [
+ gl_PREREQ_STRNLEN
+ ])
+ gl_STRING_MODULE_INDICATOR([strnlen])
+ gl_FUNC_STRSEP
+ gl_CONDITIONAL([GL_COND_OBJ_STRSEP], [test $HAVE_STRSEP = 0])
+ AM_COND_IF([GL_COND_OBJ_STRSEP], [
+ gl_PREREQ_STRSEP
+ ])
+ gl_STRING_MODULE_INDICATOR([strsep])
+ gl_SYS_FILE_H
+ gl_SYS_FILE_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_SYS_IOCTL_H
+ gl_SYS_IOCTL_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_SYS_RANDOM_H
+ gl_SYS_RANDOM_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_SYS_SELECT_H
+ gl_SYS_SELECT_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_SYS_SOCKET_H
+ gl_SYS_SOCKET_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_SYS_STAT_H
+ gl_SYS_STAT_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_SYS_TIME_H
+ gl_SYS_TIME_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_SYS_TYPES_H
+ gl_SYS_TYPES_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_SYS_UIO_H
+ gl_SYS_UIO_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_SYSEXITS
+ gl_CONDITIONAL_HEADER([sysexits.h])
+ AC_PROG_MKDIR_P
+ gl_FUNC_GEN_TEMPNAME
+ gl_MODULE_INDICATOR([tempname])
+ gl_TERMIOS_H
+ gl_TERMIOS_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ AC_REQUIRE([gl_THREADLIB])
+ gl_TIME_H
+ gl_TIME_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_TIMESPEC
+ gl_UNISTD_H
+ gl_UNISTD_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_UNISTD_SAFER
+ gl_FUNC_UNLINK
+ gl_CONDITIONAL([GL_COND_OBJ_UNLINK], [test $REPLACE_UNLINK = 1])
+ gl_UNISTD_MODULE_INDICATOR([unlink])
+ gl_FUNC_UNLINKAT
+ gl_CONDITIONAL([GL_COND_OBJ_UNLINKAT],
+ [test $HAVE_UNLINKAT = 0 || test $REPLACE_UNLINKAT = 1])
+ gl_UNISTD_MODULE_INDICATOR([unlinkat])
+ gl_FUNC_UTIME
+ gl_CONDITIONAL([GL_COND_OBJ_UTIME],
+ [test $HAVE_UTIME = 0 || test $REPLACE_UTIME = 1])
+ AM_COND_IF([GL_COND_OBJ_UTIME], [
+ gl_PREREQ_UTIME
+ ])
+ gl_UTIME_MODULE_INDICATOR([utime])
+ gl_UTIME_H
+ gl_UTIME_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_UTIMENS
+ AC_C_VARARRAYS
+ AC_REQUIRE([AC_C_RESTRICT])
+ gl_FUNC_VASNPRINTF
+ gl_FUNC_VASPRINTF
+ gl_STDIO_MODULE_INDICATOR([vasprintf])
+ m4_ifdef([AM_XGETTEXT_OPTION],
+ [AM_][XGETTEXT_OPTION([--flag=asprintf:2:c-format])
+ AM_][XGETTEXT_OPTION([--flag=vasprintf:2:c-format])])
+ m4_ifdef([AM_XGETTEXT_OPTION],
+ [AM_][XGETTEXT_OPTION([--flag=verror:3:c-format])
+ AM_][XGETTEXT_OPTION([--flag=verror_at_line:5:c-format])])
+ gl_FUNC_VSNPRINTF
+ gl_STDIO_MODULE_INDICATOR([vsnprintf])
+ gl_WCHAR_H
+ gl_WCHAR_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_FUNC_WCRTOMB
+ gl_CONDITIONAL([GL_COND_OBJ_WCRTOMB],
+ [test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1])
+ AM_COND_IF([GL_COND_OBJ_WCRTOMB], [
+ gl_PREREQ_WCRTOMB
+ ])
+ gl_WCHAR_MODULE_INDICATOR([wcrtomb])
+ gl_WCTYPE_H
+ gl_WCTYPE_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_MUTEX],
+ [case "$host_os" in mingw*) true;; *) false;; esac])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_ONCE],
+ [case "$host_os" in mingw*) true;; *) false;; esac])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_RECMUTEX],
+ [case "$host_os" in mingw*) true;; *) false;; esac])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_RWLOCK],
+ [case "$host_os" in mingw*) true;; *) false;; esac])
+ gl_FUNC_WMEMCHR
+ gl_CONDITIONAL([GL_COND_OBJ_WMEMCHR], [test $HAVE_WMEMCHR = 0])
+ gl_WCHAR_MODULE_INDICATOR([wmemchr])
+ gl_FUNC_WMEMPCPY
+ gl_CONDITIONAL([GL_COND_OBJ_WMEMPCPY], [test $HAVE_WMEMPCPY = 0])
+ gl_WCHAR_MODULE_INDICATOR([wmempcpy])
+ gl_XALLOC
+ gl_MODULE_INDICATOR([xalloc])
+ gl_MODULE_INDICATOR([xalloc-die])
+ gl_XGETCWD
+ gl_XSIZE
+ gl_XSTRNDUP
+ gl_XVASPRINTF
+ m4_ifdef([AM_XGETTEXT_OPTION],
+ [AM_][XGETTEXT_OPTION([--flag=xasprintf:1:c-format])])
+ # End of code from modules
+ m4_ifval(gl_LIBSOURCES_LIST, [
+ m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ ||
+ for gl_file in ]gl_LIBSOURCES_LIST[ ; do
+ if test ! -r ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file ; then
+ echo "missing file ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file" >&2
+ exit 1
+ fi
+ done])dnl
+ m4_if(m4_sysval, [0], [],
+ [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
+ ])
+ m4_popdef([GL_MODULE_INDICATOR_PREFIX])
+ m4_popdef([GL_MACRO_PREFIX])
+ m4_popdef([gl_LIBSOURCES_DIR])
+ m4_popdef([gl_LIBSOURCES_LIST])
+ m4_popdef([AC_LIBSOURCES])
+ m4_popdef([AC_REPLACE_FUNCS])
+ m4_popdef([AC_LIBOBJ])
+ AC_CONFIG_COMMANDS_PRE([
+ gl_libobjs=
+ gl_ltlibobjs=
+ gl_libobjdeps=
+ if test -n "$gl_LIBOBJS"; then
+ # Remove the extension.
+changequote(,)dnl
+ sed_drop_objext='s/\.o$//;s/\.obj$//'
+ sed_dirname1='s,//*,/,g'
+ sed_dirname2='s,\(.\)/$,\1,'
+ sed_dirname3='s,^[^/]*$,.,'
+ sed_dirname4='s,\(.\)/[^/]*$,\1,'
+ sed_basename1='s,.*/,,'
+changequote([, ])dnl
+ for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
+ gl_libobjs="$gl_libobjs $i.$ac_objext"
+ gl_ltlibobjs="$gl_ltlibobjs $i.lo"
+ i_dir=`echo "$i" | sed -e "$sed_dirname1" -e "$sed_dirname2" -e "$sed_dirname3" -e "$sed_dirname4"`
+ i_base=`echo "$i" | sed -e "$sed_basename1"`
+ gl_libobjdeps="$gl_libobjdeps $i_dir/\$(DEPDIR)/$i_base.Plo"
+ done
+ fi
+ AC_SUBST([gl_LIBOBJS], [$gl_libobjs])
+ AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs])
+ AC_SUBST([gl_LIBOBJDEPS], [$gl_libobjdeps])
+ ])
+ gltests_libdeps=
+ gltests_ltlibdeps=
+ m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ]))
+ m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS]))
+ m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES]))
+ m4_pushdef([gltests_LIBSOURCES_LIST], [])
+ m4_pushdef([gltests_LIBSOURCES_DIR], [])
+ m4_pushdef([GL_MACRO_PREFIX], [gltests])
+ m4_pushdef([GL_MODULE_INDICATOR_PREFIX], [GL])
+ gl_COMMON
+ gl_source_base='tests'
+ gl_source_base_prefix=
+changequote(,)dnl
+ gltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS
+changequote([, ])dnl
+ AC_SUBST([gltests_WITNESS])
+ gl_module_indicator_condition=$gltests_WITNESS
+ m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition])
+ m4_popdef([gl_MODULE_INDICATOR_CONDITION])
+ m4_ifval(gltests_LIBSOURCES_LIST, [
+ m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ ||
+ for gl_file in ]gltests_LIBSOURCES_LIST[ ; do
+ if test ! -r ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file ; then
+ echo "missing file ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file" >&2
+ exit 1
+ fi
+ done])dnl
+ m4_if(m4_sysval, [0], [],
+ [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
+ ])
+ m4_popdef([GL_MODULE_INDICATOR_PREFIX])
+ m4_popdef([GL_MACRO_PREFIX])
+ m4_popdef([gltests_LIBSOURCES_DIR])
+ m4_popdef([gltests_LIBSOURCES_LIST])
+ m4_popdef([AC_LIBSOURCES])
+ m4_popdef([AC_REPLACE_FUNCS])
+ m4_popdef([AC_LIBOBJ])
+ AC_CONFIG_COMMANDS_PRE([
+ gltests_libobjs=
+ gltests_ltlibobjs=
+ gltests_libobjdeps=
+ if test -n "$gltests_LIBOBJS"; then
+ # Remove the extension.
+changequote(,)dnl
+ sed_drop_objext='s/\.o$//;s/\.obj$//'
+ sed_dirname1='s,//*,/,g'
+ sed_dirname2='s,\(.\)/$,\1,'
+ sed_dirname3='s,^[^/]*$,.,'
+ sed_dirname4='s,\(.\)/[^/]*$,\1,'
+ sed_basename1='s,.*/,,'
+changequote([, ])dnl
+ for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
+ gltests_libobjs="$gltests_libobjs $i.$ac_objext"
+ gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
+ i_dir=`echo "$i" | sed -e "$sed_dirname1" -e "$sed_dirname2" -e "$sed_dirname3" -e "$sed_dirname4"`
+ i_base=`echo "$i" | sed -e "$sed_basename1"`
+ gltests_libobjdeps="$gltests_libobjdeps $i_dir/\$(DEPDIR)/$i_base.Plo"
+ done
+ fi
+ AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs])
+ AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs])
+ AC_SUBST([gltests_LIBOBJDEPS], [$gltests_libobjdeps])
+ ])
+ AC_REQUIRE([gl_CC_GNULIB_WARNINGS])
+])
+
+# Like AC_LIBOBJ, except that the module name goes
+# into gl_LIBOBJS instead of into LIBOBJS.
+AC_DEFUN([gl_LIBOBJ], [
+ AS_LITERAL_IF([$1], [gl_LIBSOURCES([$1.c])])dnl
+ gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext"
+])
+
+# Like AC_REPLACE_FUNCS, except that the module name goes
+# into gl_LIBOBJS instead of into LIBOBJS.
+AC_DEFUN([gl_REPLACE_FUNCS], [
+ m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
+ AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)])
+])
+
+# Like AC_LIBSOURCES, except the directory where the source file is
+# expected is derived from the gnulib-tool parameterization,
+# and alloca is special cased (for the alloca-opt module).
+# We could also entirely rely on EXTRA_lib..._SOURCES.
+AC_DEFUN([gl_LIBSOURCES], [
+ m4_foreach([_gl_NAME], [$1], [
+ m4_if(_gl_NAME, [alloca.c], [], [
+ m4_define([gl_LIBSOURCES_DIR], [gl/lib])
+ m4_append([gl_LIBSOURCES_LIST], _gl_NAME, [ ])
+ ])
+ ])
+])
+
+# Like AC_LIBOBJ, except that the module name goes
+# into gltests_LIBOBJS instead of into LIBOBJS.
+AC_DEFUN([gltests_LIBOBJ], [
+ AS_LITERAL_IF([$1], [gltests_LIBSOURCES([$1.c])])dnl
+ gltests_LIBOBJS="$gltests_LIBOBJS $1.$ac_objext"
+])
+
+# Like AC_REPLACE_FUNCS, except that the module name goes
+# into gltests_LIBOBJS instead of into LIBOBJS.
+AC_DEFUN([gltests_REPLACE_FUNCS], [
+ m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
+ AC_CHECK_FUNCS([$1], , [gltests_LIBOBJ($ac_func)])
+])
+
+# Like AC_LIBSOURCES, except the directory where the source file is
+# expected is derived from the gnulib-tool parameterization,
+# and alloca is special cased (for the alloca-opt module).
+# We could also entirely rely on EXTRA_lib..._SOURCES.
+AC_DEFUN([gltests_LIBSOURCES], [
+ m4_foreach([_gl_NAME], [$1], [
+ m4_if(_gl_NAME, [alloca.c], [], [
+ m4_define([gltests_LIBSOURCES_DIR], [tests])
+ m4_append([gltests_LIBSOURCES_LIST], _gl_NAME, [ ])
+ ])
+ ])
+])
+
+# This macro records the list of files which have been installed by
+# gnulib-tool and may be removed by future gnulib-tool invocations.
+AC_DEFUN([gl_FILE_LIST], [
+ build-aux/config.rpath
+ build-aux/gitlog-to-changelog
+ build-aux/gnupload
+ lib/_Noreturn.h
+ lib/alloca.c
+ lib/alloca.in.h
+ lib/arg-nonnull.h
+ lib/argp-ba.c
+ lib/argp-eexst.c
+ lib/argp-fmtstream.c
+ lib/argp-fmtstream.h
+ lib/argp-fs-xinl.c
+ lib/argp-help.c
+ lib/argp-namefrob.h
+ lib/argp-parse.c
+ lib/argp-pin.c
+ lib/argp-pv.c
+ lib/argp-pvh.c
+ lib/argp-xinl.c
+ lib/argp.h
+ lib/asnprintf.c
+ lib/asprintf.c
+ lib/assure.h
+ lib/at-func.c
+ lib/at-func2.c
+ lib/attribute.h
+ lib/basename-lgpl.c
+ lib/basename-lgpl.h
+ lib/basename.c
+ lib/bitrotate.c
+ lib/bitrotate.h
+ lib/btowc.c
+ lib/c++defs.h
+ lib/calloc.c
+ lib/canonicalize-lgpl.c
+ lib/canonicalize.c
+ lib/canonicalize.h
+ lib/cdefs.h
+ lib/chdir-long.c
+ lib/chdir-long.h
+ lib/chown.c
+ lib/cloexec.c
+ lib/cloexec.h
+ lib/close.c
+ lib/closedir.c
+ lib/ctype.in.h
+ lib/dirent-private.h
+ lib/dirent.in.h
+ lib/dirfd.c
+ lib/dirname-lgpl.c
+ lib/dirname.c
+ lib/dirname.h
+ lib/dup-safer-flag.c
+ lib/dup-safer.c
+ lib/dup.c
+ lib/dup2.c
+ lib/dynarray.h
+ lib/eloop-threshold.h
+ lib/errno.in.h
+ lib/error.c
+ lib/error.h
+ lib/exitfail.c
+ lib/exitfail.h
+ lib/fchdir.c
+ lib/fchown-stub.c
+ lib/fcntl.c
+ lib/fcntl.in.h
+ lib/fd-hook.c
+ lib/fd-hook.h
+ lib/fd-safer-flag.c
+ lib/fd-safer.c
+ lib/fdopendir.c
+ lib/file-set.c
+ lib/file-set.h
+ lib/filename.h
+ lib/filenamecat-lgpl.c
+ lib/filenamecat.h
+ lib/flexmember.h
+ lib/float+.h
+ lib/float.c
+ lib/float.in.h
+ lib/flock.c
+ lib/fnmatch.c
+ lib/fnmatch.in.h
+ lib/fnmatch_loop.c
+ lib/free.c
+ lib/fstat.c
+ lib/fstatat.c
+ lib/getcwd-lgpl.c
+ lib/getcwd.c
+ lib/getdelim.c
+ lib/getdtablesize.c
+ lib/getline.c
+ lib/getlogin_r.c
+ 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.c
+ lib/getopt.in.h
+ lib/getopt1.c
+ lib/getopt_int.h
+ lib/getprogname.c
+ lib/getprogname.h
+ lib/getrandom.c
+ lib/gettext.h
+ lib/gettime.c
+ lib/gettimeofday.c
+ lib/gl_anyhash1.h
+ lib/gl_anyhash2.h
+ lib/gl_anyhash_primes.h
+ lib/gl_anylinked_list1.h
+ lib/gl_anylinked_list2.h
+ lib/gl_anyrbtree_list1.h
+ lib/gl_anyrbtree_list2.h
+ lib/gl_anytree_list1.h
+ lib/gl_anytree_list2.h
+ lib/gl_array_list.c
+ lib/gl_array_list.h
+ lib/gl_hash_map.c
+ lib/gl_hash_map.h
+ lib/gl_hash_set.c
+ lib/gl_hash_set.h
+ lib/gl_linkedhash_list.c
+ lib/gl_linkedhash_list.h
+ lib/gl_list.c
+ lib/gl_list.h
+ lib/gl_map.c
+ lib/gl_map.h
+ lib/gl_rbtree_list.c
+ lib/gl_rbtree_list.h
+ lib/gl_set.c
+ lib/gl_set.h
+ lib/gl_xlist.c
+ lib/gl_xlist.h
+ lib/gl_xmap.c
+ lib/gl_xmap.h
+ lib/gl_xset.c
+ lib/gl_xset.h
+ lib/glob-libc.h
+ lib/glob.c
+ lib/glob.in.h
+ lib/glob_internal.h
+ lib/glob_pattern_p.c
+ lib/globfree.c
+ lib/glthread/lock.c
+ lib/glthread/lock.h
+ lib/glthread/threadlib.c
+ lib/hard-locale.c
+ lib/hard-locale.h
+ lib/hash-pjw-bare.c
+ lib/hash-pjw-bare.h
+ lib/hash-pjw.c
+ lib/hash-pjw.h
+ lib/hash-triple-simple.c
+ lib/hash-triple.h
+ lib/hash.c
+ lib/hash.h
+ lib/ialloc.c
+ lib/ialloc.h
+ lib/idpriv-drop.c
+ lib/idpriv-droptemp.c
+ lib/idpriv.h
+ lib/idx.h
+ lib/intprops.h
+ lib/inttypes.in.h
+ lib/ioctl.c
+ lib/isblank.c
+ lib/itold.c
+ lib/langinfo.in.h
+ lib/lc-charset-dispatch.c
+ lib/lc-charset-dispatch.h
+ lib/lchown.c
+ lib/libc-config.h
+ lib/limits.in.h
+ lib/localcharset.c
+ lib/localcharset.h
+ lib/locale.in.h
+ lib/localeconv.c
+ lib/lstat.c
+ lib/malloc.c
+ lib/malloc/dynarray-skeleton.c
+ lib/malloc/dynarray.h
+ 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/malloc/scratch_buffer.h
+ lib/malloc/scratch_buffer_dupfree.c
+ lib/malloc/scratch_buffer_grow.c
+ lib/malloc/scratch_buffer_grow_preserve.c
+ lib/malloc/scratch_buffer_set_array_size.c
+ lib/malloca.c
+ lib/malloca.h
+ lib/mbrtowc-impl-utf8.h
+ lib/mbrtowc-impl.h
+ lib/mbrtowc.c
+ lib/mbsinit.c
+ lib/mbsrtowcs-impl.h
+ lib/mbsrtowcs-state.c
+ lib/mbsrtowcs.c
+ lib/mbtowc-impl.h
+ lib/mbtowc-lock.c
+ lib/mbtowc-lock.h
+ lib/mbtowc.c
+ lib/memchr.c
+ lib/memchr.valgrind
+ lib/memmem.c
+ lib/mempcpy.c
+ lib/memrchr.c
+ lib/minmax.h
+ lib/mkdir.c
+ lib/mkdtemp.c
+ lib/mkstemp.c
+ lib/msvc-inval.c
+ lib/msvc-inval.h
+ lib/msvc-nothrow.c
+ lib/msvc-nothrow.h
+ lib/nanosleep.c
+ lib/nl_langinfo-lock.c
+ lib/nl_langinfo.c
+ lib/nonblocking.c
+ lib/nonblocking.h
+ lib/open.c
+ lib/openat-die.c
+ lib/openat-priv.h
+ lib/openat-proc.c
+ lib/openat.c
+ lib/openat.h
+ lib/opendir.c
+ lib/pathmax.h
+ lib/pipe-safer.c
+ lib/pipe.c
+ lib/printf-args.c
+ lib/printf-args.h
+ lib/printf-parse.c
+ lib/printf-parse.h
+ lib/progname.c
+ lib/progname.h
+ lib/pselect.c
+ lib/pthread_sigmask.c
+ lib/raise.c
+ lib/rawmemchr.c
+ lib/rawmemchr.valgrind
+ lib/readdir.c
+ lib/readlink.c
+ lib/readlinkat.c
+ lib/realloc.c
+ lib/reallocarray.c
+ lib/regcomp.c
+ lib/regex.c
+ lib/regex.h
+ lib/regex_internal.c
+ lib/regex_internal.h
+ lib/regexec.c
+ lib/rename.c
+ lib/renameat.c
+ lib/renameatu.c
+ lib/renameatu.h
+ lib/rewinddir.c
+ lib/rmdir.c
+ lib/same-inode.h
+ lib/save-cwd.c
+ lib/save-cwd.h
+ lib/scratch_buffer.h
+ lib/select.c
+ lib/setenv.c
+ lib/setlocale-lock.c
+ lib/setlocale_null.c
+ lib/setlocale_null.h
+ lib/sig-handler.c
+ lib/sig-handler.h
+ lib/sigaction.c
+ lib/signal.in.h
+ lib/sigprocmask.c
+ lib/size_max.h
+ lib/sleep.c
+ lib/sockets.c
+ lib/sockets.h
+ lib/stat-time.c
+ lib/stat-time.h
+ lib/stat-w32.c
+ lib/stat-w32.h
+ lib/stat.c
+ lib/stdalign.in.h
+ lib/stdarg.in.h
+ lib/stdbool.in.h
+ lib/stddef.in.h
+ lib/stdint.in.h
+ lib/stdio-read.c
+ lib/stdio-write.c
+ lib/stdio.in.h
+ lib/stdlib.in.h
+ lib/stdopen.c
+ lib/stdopen.h
+ lib/stpcpy.c
+ lib/str-two-way.h
+ lib/strcasecmp.c
+ lib/strcasestr.c
+ lib/strchrnul.c
+ lib/strchrnul.valgrind
+ lib/strdup.c
+ lib/streq.h
+ lib/strerror-override.c
+ lib/strerror-override.h
+ lib/strerror.c
+ lib/string.in.h
+ lib/strings.in.h
+ lib/stripslash.c
+ lib/strncasecmp.c
+ lib/strndup.c
+ lib/strnlen.c
+ lib/strnlen1.c
+ lib/strnlen1.h
+ lib/strsep.c
+ lib/sys_file.in.h
+ lib/sys_ioctl.in.h
+ lib/sys_random.in.h
+ lib/sys_select.in.h
+ lib/sys_socket.c
+ lib/sys_socket.in.h
+ lib/sys_stat.in.h
+ lib/sys_time.in.h
+ lib/sys_types.in.h
+ lib/sys_uio.in.h
+ lib/sysexits.in.h
+ lib/tempname.c
+ lib/tempname.h
+ lib/termios.in.h
+ lib/time.in.h
+ lib/timespec.c
+ lib/timespec.h
+ lib/unistd--.h
+ lib/unistd-safer.h
+ lib/unistd.c
+ lib/unistd.in.h
+ lib/unlink.c
+ lib/unlinkat.c
+ lib/utime.c
+ lib/utime.in.h
+ lib/utimens.c
+ lib/utimens.h
+ lib/vasnprintf.c
+ lib/vasnprintf.h
+ lib/vasprintf.c
+ lib/verify.h
+ lib/verror.c
+ lib/verror.h
+ lib/vsnprintf.c
+ lib/w32sock.h
+ lib/warn-on-use.h
+ lib/wchar.in.h
+ lib/wcrtomb.c
+ lib/wctype-h.c
+ lib/wctype.in.h
+ lib/windows-initguard.h
+ lib/windows-mutex.c
+ lib/windows-mutex.h
+ lib/windows-once.c
+ lib/windows-once.h
+ lib/windows-recmutex.c
+ lib/windows-recmutex.h
+ lib/windows-rwlock.c
+ lib/windows-rwlock.h
+ lib/wmemchr-impl.h
+ lib/wmemchr.c
+ lib/wmempcpy.c
+ lib/xalloc-die.c
+ lib/xalloc-oversized.h
+ lib/xalloc.h
+ lib/xasprintf.c
+ lib/xgetcwd.c
+ lib/xgetcwd.h
+ lib/xmalloc.c
+ lib/xsize.c
+ lib/xsize.h
+ lib/xstdopen.c
+ lib/xstdopen.h
+ lib/xstrndup.c
+ lib/xstrndup.h
+ lib/xvasprintf.c
+ lib/xvasprintf.h
+ m4/00gnulib.m4
+ m4/__inline.m4
+ m4/absolute-header.m4
+ m4/alloca.m4
+ m4/argp.m4
+ m4/asm-underscore.m4
+ m4/btowc.m4
+ m4/builtin-expect.m4
+ m4/calloc.m4
+ m4/canonicalize.m4
+ m4/chdir-long.m4
+ m4/chown.m4
+ m4/clock_time.m4
+ m4/close.m4
+ m4/closedir.m4
+ m4/codeset.m4
+ m4/ctype_h.m4
+ m4/d-ino.m4
+ m4/d-type.m4
+ m4/dirent_h.m4
+ m4/dirfd.m4
+ m4/double-slash-root.m4
+ m4/dup.m4
+ m4/dup2.m4
+ m4/eealloc.m4
+ m4/environ.m4
+ m4/errno_h.m4
+ m4/error.m4
+ m4/exponentd.m4
+ m4/extensions.m4
+ m4/extern-inline.m4
+ m4/fchdir.m4
+ m4/fcntl-o.m4
+ m4/fcntl.m4
+ m4/fcntl_h.m4
+ m4/fdopendir.m4
+ m4/filenamecat.m4
+ m4/flexmember.m4
+ m4/float_h.m4
+ m4/flock.m4
+ m4/fnmatch.m4
+ m4/fnmatch_h.m4
+ m4/free.m4
+ m4/fstat.m4
+ m4/fstatat.m4
+ m4/getcwd-abort-bug.m4
+ m4/getcwd-path-max.m4
+ m4/getcwd.m4
+ m4/getdelim.m4
+ m4/getdtablesize.m4
+ m4/getline.m4
+ m4/getlogin.m4
+ m4/getlogin_r.m4
+ m4/getopt.m4
+ m4/getpagesize.m4
+ m4/getprogname.m4
+ m4/getrandom.m4
+ m4/gettime.m4
+ m4/gettimeofday.m4
+ m4/glob.m4
+ m4/glob_h.m4
+ m4/gnulib-common.m4
+ m4/host-cpu-c-abi.m4
+ m4/idpriv.m4
+ m4/include_next.m4
+ m4/intmax_t.m4
+ m4/inttypes.m4
+ m4/inttypes_h.m4
+ m4/ioctl.m4
+ m4/isblank.m4
+ m4/langinfo_h.m4
+ m4/largefile.m4
+ m4/lchown.m4
+ m4/lib-ignore.m4
+ m4/lib-ld.m4
+ m4/lib-link.m4
+ m4/lib-prefix.m4
+ m4/limits-h.m4
+ m4/localcharset.m4
+ m4/locale-fr.m4
+ m4/locale-ja.m4
+ m4/locale-zh.m4
+ m4/locale_h.m4
+ m4/localeconv.m4
+ m4/lock.m4
+ m4/lstat.m4
+ m4/malloc.m4
+ m4/malloca.m4
+ m4/manywarnings-c++.m4
+ m4/manywarnings.m4
+ m4/math_h.m4
+ m4/mbrtowc.m4
+ m4/mbsinit.m4
+ m4/mbsrtowcs.m4
+ m4/mbstate_t.m4
+ m4/mbtowc.m4
+ m4/memchr.m4
+ m4/memmem.m4
+ m4/mempcpy.m4
+ m4/memrchr.m4
+ m4/minmax.m4
+ m4/mkdir.m4
+ m4/mkdtemp.m4
+ m4/mkstemp.m4
+ m4/mmap-anon.m4
+ m4/mode_t.m4
+ m4/msvc-inval.m4
+ m4/msvc-nothrow.m4
+ m4/multiarch.m4
+ m4/nanosleep.m4
+ m4/nl_langinfo.m4
+ m4/nocrash.m4
+ m4/nonblocking.m4
+ m4/off_t.m4
+ m4/open-cloexec.m4
+ m4/open-slash.m4
+ m4/open.m4
+ m4/openat.m4
+ m4/opendir.m4
+ m4/pathmax.m4
+ m4/pid_t.m4
+ m4/pipe.m4
+ m4/printf.m4
+ m4/pselect.m4
+ m4/pthread_rwlock_rdlock.m4
+ m4/pthread_sigmask.m4
+ m4/raise.m4
+ m4/rawmemchr.m4
+ m4/readdir.m4
+ m4/readlink.m4
+ m4/readlinkat.m4
+ m4/realloc.m4
+ m4/reallocarray.m4
+ m4/regex.m4
+ m4/rename.m4
+ m4/renameat.m4
+ m4/rewinddir.m4
+ m4/rmdir.m4
+ m4/save-cwd.m4
+ m4/select.m4
+ m4/setenv.m4
+ m4/setlocale_null.m4
+ m4/sigaction.m4
+ m4/signal_h.m4
+ m4/signalblocking.m4
+ m4/sigpipe.m4
+ m4/size_max.m4
+ m4/sleep.m4
+ m4/socketlib.m4
+ m4/sockets.m4
+ m4/socklen.m4
+ m4/sockpfaf.m4
+ m4/ssize_t.m4
+ m4/stat-time.m4
+ m4/stat.m4
+ m4/std-gnu11.m4
+ m4/stdalign.m4
+ m4/stdarg.m4
+ m4/stdbool.m4
+ m4/stddef_h.m4
+ m4/stdint.m4
+ m4/stdint_h.m4
+ m4/stdio_h.m4
+ m4/stdlib_h.m4
+ m4/stpcpy.m4
+ m4/strcase.m4
+ m4/strcasestr.m4
+ m4/strchrnul.m4
+ m4/strdup.m4
+ m4/strerror.m4
+ m4/string_h.m4
+ m4/strings_h.m4
+ m4/strndup.m4
+ m4/strnlen.m4
+ m4/strsep.m4
+ m4/sys_file_h.m4
+ m4/sys_ioctl_h.m4
+ m4/sys_random_h.m4
+ m4/sys_select_h.m4
+ m4/sys_socket_h.m4
+ m4/sys_stat_h.m4
+ m4/sys_time_h.m4
+ m4/sys_types_h.m4
+ m4/sys_uio_h.m4
+ m4/sysexits.m4
+ m4/tempname.m4
+ m4/termios_h.m4
+ m4/threadlib.m4
+ m4/time_h.m4
+ m4/timespec.m4
+ m4/unistd-safer.m4
+ m4/unistd_h.m4
+ m4/unlink.m4
+ m4/unlinkat.m4
+ m4/utime.m4
+ m4/utime_h.m4
+ m4/utimens.m4
+ m4/utimes.m4
+ m4/vararrays.m4
+ m4/vasnprintf.m4
+ m4/vasprintf.m4
+ m4/visibility.m4
+ m4/vsnprintf.m4
+ m4/warn-on-use.m4
+ m4/warnings.m4
+ m4/wchar_h.m4
+ m4/wchar_t.m4
+ m4/wcrtomb.m4
+ m4/wctype_h.m4
+ m4/wint_t.m4
+ m4/wmemchr.m4
+ m4/wmempcpy.m4
+ m4/xalloc.m4
+ m4/xgetcwd.m4
+ m4/xsize.m4
+ m4/xstrndup.m4
+ m4/xvasprintf.m4
+ m4/year2038.m4
+ m4/zzgnulib.m4
+])
diff --git a/gl/m4/host-cpu-c-abi.m4 b/gl/m4/host-cpu-c-abi.m4
new file mode 100644
index 0000000..b922324
--- /dev/null
+++ b/gl/m4/host-cpu-c-abi.m4
@@ -0,0 +1,678 @@
+# host-cpu-c-abi.m4 serial 15
+dnl Copyright (C) 2002-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible and Sam Steingold.
+
+dnl Sets the HOST_CPU variable to the canonical name of the CPU.
+dnl Sets the HOST_CPU_C_ABI variable to the canonical name of the CPU with its
+dnl C language ABI (application binary interface).
+dnl Also defines __${HOST_CPU}__ and __${HOST_CPU_C_ABI}__ as C macros in
+dnl config.h.
+dnl
+dnl This canonical name can be used to select a particular assembly language
+dnl source file that will interoperate with C code on the given host.
+dnl
+dnl For example:
+dnl * 'i386' and 'sparc' are different canonical names, because code for i386
+dnl will not run on SPARC CPUs and vice versa. They have different
+dnl instruction sets.
+dnl * 'sparc' and 'sparc64' are different canonical names, because code for
+dnl 'sparc' and code for 'sparc64' cannot be linked together: 'sparc' code
+dnl contains 32-bit instructions, whereas 'sparc64' code contains 64-bit
+dnl instructions. A process on a SPARC CPU can be in 32-bit mode or in 64-bit
+dnl mode, but not both.
+dnl * 'mips' and 'mipsn32' are different canonical names, because they use
+dnl different argument passing and return conventions for C functions, and
+dnl although the instruction set of 'mips' is a large subset of the
+dnl instruction set of 'mipsn32'.
+dnl * 'mipsn32' and 'mips64' are different canonical names, because they use
+dnl different sizes for the C types like 'int' and 'void *', and although
+dnl the instruction sets of 'mipsn32' and 'mips64' are the same.
+dnl * The same canonical name is used for different endiannesses. You can
+dnl determine the endianness through preprocessor symbols:
+dnl - 'arm': test __ARMEL__.
+dnl - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL.
+dnl - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN.
+dnl * The same name 'i386' is used for CPUs of type i386, i486, i586
+dnl (Pentium), AMD K7, Pentium II, Pentium IV, etc., because
+dnl - Instructions that do not exist on all of these CPUs (cmpxchg,
+dnl MMX, SSE, SSE2, 3DNow! etc.) are not frequently used. If your
+dnl assembly language source files use such instructions, you will
+dnl need to make the distinction.
+dnl - Speed of execution of the common instruction set is reasonable across
+dnl the entire family of CPUs. If you have assembly language source files
+dnl that are optimized for particular CPU types (like GNU gmp has), you
+dnl will need to make the distinction.
+dnl See <https://en.wikipedia.org/wiki/X86_instruction_listings>.
+AC_DEFUN([gl_HOST_CPU_C_ABI],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_C_ASM])
+ AC_CACHE_CHECK([host CPU and C ABI], [gl_cv_host_cpu_c_abi],
+ [case "$host_cpu" in
+
+changequote(,)dnl
+ i[34567]86 )
+changequote([,])dnl
+ gl_cv_host_cpu_c_abi=i386
+ ;;
+
+ x86_64 )
+ # On x86_64 systems, the C compiler may be generating code in one of
+ # these ABIs:
+ # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+ # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+ # with native Windows (mingw, MSVC).
+ # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+ # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if (defined __x86_64__ || defined __amd64__ \
+ || defined _M_X64 || defined _M_AMD64)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __ILP32__ || defined _ILP32
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=x86_64-x32],
+ [gl_cv_host_cpu_c_abi=x86_64])],
+ [gl_cv_host_cpu_c_abi=i386])
+ ;;
+
+changequote(,)dnl
+ alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] )
+changequote([,])dnl
+ gl_cv_host_cpu_c_abi=alpha
+ ;;
+
+ arm* | aarch64 )
+ # Assume arm with EABI.
+ # On arm64 systems, the C compiler may be generating code in one of
+ # these ABIs:
+ # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+ # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+ # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef __aarch64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __ILP32__ || defined _ILP32
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=arm64-ilp32],
+ [gl_cv_host_cpu_c_abi=arm64])],
+ [# Don't distinguish little-endian and big-endian arm, since they
+ # don't require different machine code for simple operations and
+ # since the user can distinguish them through the preprocessor
+ # defines __ARMEL__ vs. __ARMEB__.
+ # But distinguish arm which passes floating-point arguments and
+ # return values in integer registers (r0, r1, ...) - this is
+ # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which
+ # passes them in float registers (s0, s1, ...) and double registers
+ # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer
+ # sets the preprocessor defines __ARM_PCS (for the first case) and
+ # __ARM_PCS_VFP (for the second case), but older GCC does not.
+ echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c
+ # Look for a reference to the register d0 in the .s file.
+ AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1
+ if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then
+ gl_cv_host_cpu_c_abi=armhf
+ else
+ gl_cv_host_cpu_c_abi=arm
+ fi
+ rm -f conftest*
+ ])
+ ;;
+
+ hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+ # On hppa, the C compiler may be generating 32-bit code or 64-bit
+ # code. In the latter case, it defines _LP64 and __LP64__.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=hppa64],
+ [gl_cv_host_cpu_c_abi=hppa])
+ ;;
+
+ ia64* )
+ # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+ # 32-bit code. In the latter case, it defines _ILP32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef _ILP32
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=ia64-ilp32],
+ [gl_cv_host_cpu_c_abi=ia64])
+ ;;
+
+ mips* )
+ # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+ # at 32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=mips64],
+ [# In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but
+ # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIN32.
+ # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but
+ # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIO32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if (_MIPS_SIM == _ABIN32)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=mipsn32],
+ [gl_cv_host_cpu_c_abi=mips])])
+ ;;
+
+ powerpc* )
+ # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+ # No need to distinguish them here; the caller may distinguish
+ # them based on the OS.
+ # On powerpc64 systems, the C compiler may still be generating
+ # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+ # be generating 64-bit code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __powerpc64__ || defined __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [# On powerpc64, there are two ABIs on Linux: The AIX compatible
+ # one and the ELFv2 one. The latter defines _CALL_ELF=2.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined _CALL_ELF && _CALL_ELF == 2
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=powerpc64-elfv2],
+ [gl_cv_host_cpu_c_abi=powerpc64])
+ ],
+ [gl_cv_host_cpu_c_abi=powerpc])
+ ;;
+
+ rs6000 )
+ gl_cv_host_cpu_c_abi=powerpc
+ ;;
+
+ riscv32 | riscv64 )
+ # There are 2 architectures (with variants): rv32* and rv64*.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if __riscv_xlen == 64
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [cpu=riscv64],
+ [cpu=riscv32])
+ # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+ # Size of 'long' and 'void *':
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [main_abi=lp64],
+ [main_abi=ilp32])
+ # Float ABIs:
+ # __riscv_float_abi_double:
+ # 'float' and 'double' are passed in floating-point registers.
+ # __riscv_float_abi_single:
+ # 'float' are passed in floating-point registers.
+ # __riscv_float_abi_soft:
+ # No values are passed in floating-point registers.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __riscv_float_abi_double
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [float_abi=d],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __riscv_float_abi_single
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [float_abi=f],
+ [float_abi=''])
+ ])
+ gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}"
+ ;;
+
+ s390* )
+ # On s390x, the C compiler may be generating 64-bit (= s390x) code
+ # or 31-bit (= s390) code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__ || defined __s390x__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=s390x],
+ [gl_cv_host_cpu_c_abi=s390])
+ ;;
+
+ sparc | sparc64 )
+ # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+ # C compiler still generates 32-bit code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __sparcv9 || defined __arch64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=sparc64],
+ [gl_cv_host_cpu_c_abi=sparc])
+ ;;
+
+ *)
+ gl_cv_host_cpu_c_abi="$host_cpu"
+ ;;
+ esac
+ ])
+
+ dnl In most cases, $HOST_CPU and $HOST_CPU_C_ABI are the same.
+ HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'`
+ HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi"
+ AC_SUBST([HOST_CPU])
+ AC_SUBST([HOST_CPU_C_ABI])
+
+ # This was
+ # AC_DEFINE_UNQUOTED([__${HOST_CPU}__])
+ # AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__])
+ # earlier, but KAI C++ 3.2d doesn't like this.
+ sed -e 's/-/_/g' >> confdefs.h <<EOF
+#ifndef __${HOST_CPU}__
+#define __${HOST_CPU}__ 1
+#endif
+#ifndef __${HOST_CPU_C_ABI}__
+#define __${HOST_CPU_C_ABI}__ 1
+#endif
+EOF
+ AH_TOP([/* CPU and C ABI indicator */
+#ifndef __i386__
+#undef __i386__
+#endif
+#ifndef __x86_64_x32__
+#undef __x86_64_x32__
+#endif
+#ifndef __x86_64__
+#undef __x86_64__
+#endif
+#ifndef __alpha__
+#undef __alpha__
+#endif
+#ifndef __arm__
+#undef __arm__
+#endif
+#ifndef __armhf__
+#undef __armhf__
+#endif
+#ifndef __arm64_ilp32__
+#undef __arm64_ilp32__
+#endif
+#ifndef __arm64__
+#undef __arm64__
+#endif
+#ifndef __hppa__
+#undef __hppa__
+#endif
+#ifndef __hppa64__
+#undef __hppa64__
+#endif
+#ifndef __ia64_ilp32__
+#undef __ia64_ilp32__
+#endif
+#ifndef __ia64__
+#undef __ia64__
+#endif
+#ifndef __loongarch64__
+#undef __loongarch64__
+#endif
+#ifndef __m68k__
+#undef __m68k__
+#endif
+#ifndef __mips__
+#undef __mips__
+#endif
+#ifndef __mipsn32__
+#undef __mipsn32__
+#endif
+#ifndef __mips64__
+#undef __mips64__
+#endif
+#ifndef __powerpc__
+#undef __powerpc__
+#endif
+#ifndef __powerpc64__
+#undef __powerpc64__
+#endif
+#ifndef __powerpc64_elfv2__
+#undef __powerpc64_elfv2__
+#endif
+#ifndef __riscv32__
+#undef __riscv32__
+#endif
+#ifndef __riscv64__
+#undef __riscv64__
+#endif
+#ifndef __riscv32_ilp32__
+#undef __riscv32_ilp32__
+#endif
+#ifndef __riscv32_ilp32f__
+#undef __riscv32_ilp32f__
+#endif
+#ifndef __riscv32_ilp32d__
+#undef __riscv32_ilp32d__
+#endif
+#ifndef __riscv64_ilp32__
+#undef __riscv64_ilp32__
+#endif
+#ifndef __riscv64_ilp32f__
+#undef __riscv64_ilp32f__
+#endif
+#ifndef __riscv64_ilp32d__
+#undef __riscv64_ilp32d__
+#endif
+#ifndef __riscv64_lp64__
+#undef __riscv64_lp64__
+#endif
+#ifndef __riscv64_lp64f__
+#undef __riscv64_lp64f__
+#endif
+#ifndef __riscv64_lp64d__
+#undef __riscv64_lp64d__
+#endif
+#ifndef __s390__
+#undef __s390__
+#endif
+#ifndef __s390x__
+#undef __s390x__
+#endif
+#ifndef __sh__
+#undef __sh__
+#endif
+#ifndef __sparc__
+#undef __sparc__
+#endif
+#ifndef __sparc64__
+#undef __sparc64__
+#endif
+])
+
+])
+
+
+dnl Sets the HOST_CPU_C_ABI_32BIT variable to 'yes' if the C language ABI
+dnl (application binary interface) is a 32-bit one, to 'no' if it is a 64-bit
+dnl one, or to 'unknown' if unknown.
+dnl This is a simplified variant of gl_HOST_CPU_C_ABI.
+AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([32-bit host C ABI], [gl_cv_host_cpu_c_abi_32bit],
+ [if test -n "$gl_cv_host_cpu_c_abi"; then
+ case "$gl_cv_host_cpu_c_abi" in
+ i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
+ gl_cv_host_cpu_c_abi_32bit=yes ;;
+ x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
+ gl_cv_host_cpu_c_abi_32bit=no ;;
+ *)
+ gl_cv_host_cpu_c_abi_32bit=unknown ;;
+ esac
+ else
+ case "$host_cpu" in
+
+ # CPUs that only support a 32-bit ABI.
+ arc \
+ | bfin \
+ | cris* \
+ | csky \
+ | epiphany \
+ | ft32 \
+ | h8300 \
+ | m68k \
+ | microblaze | microblazeel \
+ | nds32 | nds32le | nds32be \
+ | nios2 | nios2eb | nios2el \
+ | or1k* \
+ | or32 \
+ | sh | sh[1234] | sh[1234]e[lb] \
+ | tic6x \
+ | xtensa* )
+ gl_cv_host_cpu_c_abi_32bit=yes
+ ;;
+
+ # CPUs that only support a 64-bit ABI.
+changequote(,)dnl
+ alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
+ | mmix )
+changequote([,])dnl
+ gl_cv_host_cpu_c_abi_32bit=no
+ ;;
+
+changequote(,)dnl
+ i[34567]86 )
+changequote([,])dnl
+ gl_cv_host_cpu_c_abi_32bit=yes
+ ;;
+
+ x86_64 )
+ # On x86_64 systems, the C compiler may be generating code in one of
+ # these ABIs:
+ # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+ # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+ # with native Windows (mingw, MSVC).
+ # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+ # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if (defined __x86_64__ || defined __amd64__ \
+ || defined _M_X64 || defined _M_AMD64) \
+ && !(defined __ILP32__ || defined _ILP32)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ arm* | aarch64 )
+ # Assume arm with EABI.
+ # On arm64 systems, the C compiler may be generating code in one of
+ # these ABIs:
+ # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+ # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+ # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+ # On hppa, the C compiler may be generating 32-bit code or 64-bit
+ # code. In the latter case, it defines _LP64 and __LP64__.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ ia64* )
+ # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+ # 32-bit code. In the latter case, it defines _ILP32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef _ILP32
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=yes],
+ [gl_cv_host_cpu_c_abi_32bit=no])
+ ;;
+
+ mips* )
+ # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+ # at 32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ powerpc* )
+ # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+ # No need to distinguish them here; the caller may distinguish
+ # them based on the OS.
+ # On powerpc64 systems, the C compiler may still be generating
+ # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+ # be generating 64-bit code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __powerpc64__ || defined __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ rs6000 )
+ gl_cv_host_cpu_c_abi_32bit=yes
+ ;;
+
+ riscv32 | riscv64 )
+ # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+ # Size of 'long' and 'void *':
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ s390* )
+ # On s390x, the C compiler may be generating 64-bit (= s390x) code
+ # or 31-bit (= s390) code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__ || defined __s390x__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ sparc | sparc64 )
+ # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+ # C compiler still generates 32-bit code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __sparcv9 || defined __arch64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ *)
+ gl_cv_host_cpu_c_abi_32bit=unknown
+ ;;
+ esac
+ fi
+ ])
+
+ HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
+])
diff --git a/gl/m4/iconv.m4 b/gl/m4/iconv.m4
new file mode 100644
index 0000000..a503646
--- /dev/null
+++ b/gl/m4/iconv.m4
@@ -0,0 +1,268 @@
+# iconv.m4 serial 18 (gettext-0.18.2)
+dnl Copyright (C) 2000-2002, 2007-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
+[
+ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+
+ dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+ dnl accordingly.
+ AC_LIB_LINKFLAGS_BODY([iconv])
+])
+
+AC_DEFUN([AM_ICONV_LINK],
+[
+ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
+ dnl those with the standalone portable GNU libiconv installed).
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+ dnl accordingly.
+ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+
+ dnl Add $INCICONV to CPPFLAGS before performing the following checks,
+ dnl because if the user has installed libiconv and not disabled its use
+ dnl via --without-libiconv-prefix, he wants to use it. The first
+ dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
+ am_save_CPPFLAGS="$CPPFLAGS"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
+
+ AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
+ am_cv_func_iconv="no, consider installing GNU libiconv"
+ am_cv_lib_iconv=no
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <stdlib.h>
+#include <iconv.h>
+ ]],
+ [[iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);]])],
+ [am_cv_func_iconv=yes])
+ if test "$am_cv_func_iconv" != yes; then
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBICONV"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <stdlib.h>
+#include <iconv.h>
+ ]],
+ [[iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);]])],
+ [am_cv_lib_iconv=yes]
+ [am_cv_func_iconv=yes])
+ LIBS="$am_save_LIBS"
+ fi
+ ])
+ if test "$am_cv_func_iconv" = yes; then
+ AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
+ dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
+ dnl Solaris 10.
+ am_save_LIBS="$LIBS"
+ if test $am_cv_lib_iconv = yes; then
+ LIBS="$LIBS $LIBICONV"
+ fi
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <iconv.h>
+#include <string.h>
+int main ()
+{
+ int result = 0;
+ /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
+ returns. */
+ {
+ iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
+ if (cd_utf8_to_88591 != (iconv_t)(-1))
+ {
+ static const char input[] = "\342\202\254"; /* EURO SIGN */
+ char buf[10];
+ const char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_utf8_to_88591,
+ (char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (res == 0)
+ result |= 1;
+ iconv_close (cd_utf8_to_88591);
+ }
+ }
+ /* Test against Solaris 10 bug: Failures are not distinguishable from
+ successful returns. */
+ {
+ iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
+ if (cd_ascii_to_88591 != (iconv_t)(-1))
+ {
+ static const char input[] = "\263";
+ char buf[10];
+ const char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_ascii_to_88591,
+ (char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (res == 0)
+ result |= 2;
+ iconv_close (cd_ascii_to_88591);
+ }
+ }
+ /* Test against AIX 6.1..7.1 bug: Buffer overrun. */
+ {
+ iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
+ if (cd_88591_to_utf8 != (iconv_t)(-1))
+ {
+ static const char input[] = "\304";
+ static char buf[2] = { (char)0xDE, (char)0xAD };
+ const char *inptr = input;
+ size_t inbytesleft = 1;
+ char *outptr = buf;
+ size_t outbytesleft = 1;
+ size_t res = iconv (cd_88591_to_utf8,
+ (char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
+ result |= 4;
+ iconv_close (cd_88591_to_utf8);
+ }
+ }
+#if 0 /* This bug could be worked around by the caller. */
+ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
+ {
+ iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
+ if (cd_88591_to_utf8 != (iconv_t)(-1))
+ {
+ static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+ char buf[50];
+ const char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_88591_to_utf8,
+ (char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if ((int)res > 0)
+ result |= 8;
+ iconv_close (cd_88591_to_utf8);
+ }
+ }
+#endif
+ /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+ provided. */
+ if (/* Try standardized names. */
+ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
+ /* Try IRIX, OSF/1 names. */
+ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
+ /* Try AIX names. */
+ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
+ /* Try HP-UX names. */
+ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
+ result |= 16;
+ return result;
+}]])],
+ [am_cv_func_iconv_works=yes],
+ [am_cv_func_iconv_works=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+ *) am_cv_func_iconv_works="guessing yes" ;;
+ esac
+changequote([,])dnl
+ ])
+ LIBS="$am_save_LIBS"
+ ])
+ case "$am_cv_func_iconv_works" in
+ *no) am_func_iconv=no am_cv_lib_iconv=no ;;
+ *) am_func_iconv=yes ;;
+ esac
+ else
+ am_func_iconv=no am_cv_lib_iconv=no
+ fi
+ if test "$am_func_iconv" = yes; then
+ AC_DEFINE([HAVE_ICONV], [1],
+ [Define if you have the iconv() function and it works.])
+ fi
+ if test "$am_cv_lib_iconv" = yes; then
+ AC_MSG_CHECKING([how to link with libiconv])
+ AC_MSG_RESULT([$LIBICONV])
+ else
+ dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
+ dnl either.
+ CPPFLAGS="$am_save_CPPFLAGS"
+ LIBICONV=
+ LTLIBICONV=
+ fi
+ AC_SUBST([LIBICONV])
+ AC_SUBST([LTLIBICONV])
+])
+
+dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
+dnl avoid warnings like
+dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
+dnl This is tricky because of the way 'aclocal' is implemented:
+dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
+dnl Otherwise aclocal's initial scan pass would miss the macro definition.
+dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
+dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
+dnl warnings.
+m4_define([gl_iconv_AC_DEFUN],
+ m4_version_prereq([2.64],
+ [[AC_DEFUN_ONCE(
+ [$1], [$2])]],
+ [m4_ifdef([gl_00GNULIB],
+ [[AC_DEFUN_ONCE(
+ [$1], [$2])]],
+ [[AC_DEFUN(
+ [$1], [$2])]])]))
+gl_iconv_AC_DEFUN([AM_ICONV],
+[
+ AM_ICONV_LINK
+ if test "$am_cv_func_iconv" = yes; then
+ AC_MSG_CHECKING([for iconv declaration])
+ AC_CACHE_VAL([am_cv_proto_iconv], [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
+#else
+size_t iconv();
+#endif
+ ]],
+ [[]])],
+ [am_cv_proto_iconv_arg1=""],
+ [am_cv_proto_iconv_arg1="const"])
+ am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
+ am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
+ AC_MSG_RESULT([
+ $am_cv_proto_iconv])
+ AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
+ [Define as const if the declaration of iconv() needs const.])
+ dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
+ m4_ifdef([gl_ICONV_H_DEFAULTS],
+ [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+ if test -n "$am_cv_proto_iconv_arg1"; then
+ ICONV_CONST="const"
+ fi
+ ])
+ fi
+])
diff --git a/gl/m4/idpriv.m4 b/gl/m4/idpriv.m4
new file mode 100644
index 0000000..b3b1c7b
--- /dev/null
+++ b/gl/m4/idpriv.m4
@@ -0,0 +1,14 @@
+# idpriv.m4 serial 1
+dnl Copyright (C) 2009-2022 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_IDPRIV],
+[
+ dnl Persuade glibc <unistd.h> to declare {get,set}res{uid,gid}.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_FUNCS_ONCE([getuid geteuid getresuid getgid getegid getresgid])
+ AC_CHECK_FUNCS_ONCE([setresuid setreuid seteuid setresgid setregid setegid])
+])
diff --git a/gl/m4/include_next.m4 b/gl/m4/include_next.m4
new file mode 100644
index 0000000..a9247f6
--- /dev/null
+++ b/gl/m4/include_next.m4
@@ -0,0 +1,224 @@
+# include_next.m4 serial 26
+dnl Copyright (C) 2006-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert and Derek Price.
+
+dnl Sets INCLUDE_NEXT, INCLUDE_NEXT_AS_FIRST_DIRECTIVE, PRAGMA_SYSTEM_HEADER,
+dnl and PRAGMA_COLUMNS.
+dnl
+dnl INCLUDE_NEXT expands to 'include_next' if the compiler supports it, or to
+dnl 'include' otherwise.
+dnl
+dnl INCLUDE_NEXT_AS_FIRST_DIRECTIVE expands to 'include_next' if the compiler
+dnl supports it in the special case that it is the first include directive in
+dnl the given file, or to 'include' otherwise.
+dnl
+dnl PRAGMA_SYSTEM_HEADER can be used in files that contain #include_next,
+dnl so as to avoid GCC warnings when the gcc option -pedantic is used.
+dnl '#pragma GCC system_header' has the same effect as if the file was found
+dnl through the include search path specified with '-isystem' options (as
+dnl opposed to the search path specified with '-I' options). Namely, gcc
+dnl does not warn about some things, and on some systems (Solaris and Interix)
+dnl __STDC__ evaluates to 0 instead of to 1. The latter is an undesired side
+dnl effect; we are therefore careful to use 'defined __STDC__' or '1' instead
+dnl of plain '__STDC__'.
+dnl
+dnl PRAGMA_COLUMNS can be used in files that override system header files, so
+dnl as to avoid compilation errors on HP NonStop systems when the gnulib file
+dnl is included by a system header file that does a "#pragma COLUMNS 80" (which
+dnl has the effect of truncating the lines of that file and all files that it
+dnl includes to 80 columns) and the gnulib file has lines longer than 80
+dnl columns.
+
+AC_DEFUN([gl_INCLUDE_NEXT],
+[
+ AC_LANG_PREPROC_REQUIRE()
+ AC_CACHE_CHECK([whether the preprocessor supports include_next],
+ [gl_cv_have_include_next],
+ [rm -rf conftestd1a conftestd1b conftestd2
+ mkdir conftestd1a conftestd1b conftestd2
+ dnl IBM C 9.0, 10.1 (original versions, prior to the 2009-01 updates) on
+ dnl AIX 6.1 support include_next when used as first preprocessor directive
+ dnl in a file, but not when preceded by another include directive. Check
+ dnl for this bug by including <stdio.h>.
+ dnl Additionally, with this same compiler, include_next is a no-op when
+ dnl used in a header file that was included by specifying its absolute
+ dnl file name. Despite these two bugs, include_next is used in the
+ dnl compiler's <math.h>. By virtue of the second bug, we need to use
+ dnl include_next as well in this case.
+ cat <<EOF > conftestd1a/conftest.h
+#define DEFINED_IN_CONFTESTD1
+#include_next <conftest.h>
+#ifdef DEFINED_IN_CONFTESTD2
+int foo;
+#else
+#error "include_next doesn't work"
+#endif
+EOF
+ cat <<EOF > conftestd1b/conftest.h
+#define DEFINED_IN_CONFTESTD1
+#include <stdio.h>
+#include_next <conftest.h>
+#ifdef DEFINED_IN_CONFTESTD2
+int foo;
+#else
+#error "include_next doesn't work"
+#endif
+EOF
+ cat <<EOF > conftestd2/conftest.h
+#ifndef DEFINED_IN_CONFTESTD1
+#error "include_next test doesn't work"
+#endif
+#define DEFINED_IN_CONFTESTD2
+EOF
+ gl_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
+dnl We intentionally avoid using AC_LANG_SOURCE here.
+ AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
+ [gl_cv_have_include_next=yes],
+ [CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
+ AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
+ [gl_cv_have_include_next=buggy],
+ [gl_cv_have_include_next=no])
+ ])
+ CPPFLAGS="$gl_save_CPPFLAGS"
+ rm -rf conftestd1a conftestd1b conftestd2
+ ])
+ PRAGMA_SYSTEM_HEADER=
+ if test $gl_cv_have_include_next = yes; then
+ INCLUDE_NEXT=include_next
+ INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
+ if test -n "$GCC"; then
+ PRAGMA_SYSTEM_HEADER='#pragma GCC system_header'
+ fi
+ else
+ if test $gl_cv_have_include_next = buggy; then
+ INCLUDE_NEXT=include
+ INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
+ else
+ INCLUDE_NEXT=include
+ INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include
+ fi
+ fi
+ AC_SUBST([INCLUDE_NEXT])
+ AC_SUBST([INCLUDE_NEXT_AS_FIRST_DIRECTIVE])
+ AC_SUBST([PRAGMA_SYSTEM_HEADER])
+
+ dnl HP NonStop systems, which define __TANDEM, limit the line length
+ dnl after including some system header files.
+ AC_CACHE_CHECK([whether source code line length is unlimited],
+ [gl_cv_source_line_length_unlimited],
+ [AC_EGREP_CPP([choke me],
+ [
+#ifdef __TANDEM
+choke me
+#endif
+ ],
+ [gl_cv_source_line_length_unlimited=no],
+ [gl_cv_source_line_length_unlimited=yes])
+ ])
+ if test $gl_cv_source_line_length_unlimited = no; then
+ PRAGMA_COLUMNS="#pragma COLUMNS 10000"
+ else
+ PRAGMA_COLUMNS=
+ fi
+ AC_SUBST([PRAGMA_COLUMNS])
+])
+
+# gl_CHECK_NEXT_HEADERS(HEADER1 HEADER2 ...)
+# ------------------------------------------
+# For each arg foo.h, if #include_next works, define NEXT_FOO_H to be
+# '<foo.h>'; otherwise define it to be
+# '"///usr/include/foo.h"', or whatever other absolute file name is suitable.
+# Also, if #include_next works as first preprocessing directive in a file,
+# define NEXT_AS_FIRST_DIRECTIVE_FOO_H to be '<foo.h>'; otherwise define it to
+# be
+# '"///usr/include/foo.h"', or whatever other absolute file name is suitable.
+# That way, a header file with the following line:
+# #@INCLUDE_NEXT@ @NEXT_FOO_H@
+# or
+# #@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_FOO_H@
+# behaves (after sed substitution) as if it contained
+# #include_next <foo.h>
+# even if the compiler does not support include_next.
+# The three "///" are to pacify Sun C 5.8, which otherwise would say
+# "warning: #include of /usr/include/... may be non-portable".
+# Use '""', not '<>', so that the /// cannot be confused with a C99 comment.
+# Note: This macro assumes that the header file is not empty after
+# preprocessing, i.e. it does not only define preprocessor macros but also
+# provides some type/enum definitions or function/variable declarations.
+#
+# This macro also checks whether each header exists, by invoking
+# AC_CHECK_HEADERS_ONCE or AC_CHECK_HEADERS on each argument.
+AC_DEFUN([gl_CHECK_NEXT_HEADERS],
+[
+ gl_NEXT_HEADERS_INTERNAL([$1], [check])
+])
+
+# gl_NEXT_HEADERS(HEADER1 HEADER2 ...)
+# ------------------------------------
+# Like gl_CHECK_NEXT_HEADERS, except do not check whether the headers exist.
+# This is suitable for headers like <stddef.h> that are standardized by C89
+# and therefore can be assumed to exist.
+AC_DEFUN([gl_NEXT_HEADERS],
+[
+ gl_NEXT_HEADERS_INTERNAL([$1], [assume])
+])
+
+# The guts of gl_CHECK_NEXT_HEADERS and gl_NEXT_HEADERS.
+AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
+[
+ AC_REQUIRE([gl_INCLUDE_NEXT])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ m4_if([$2], [check],
+ [AC_CHECK_HEADERS_ONCE([$1])
+ ])
+
+ m4_foreach_w([gl_HEADER_NAME], [$1],
+ [AS_VAR_PUSHDEF([gl_next_header],
+ [gl_cv_next_]m4_defn([gl_HEADER_NAME]))
+ if test $gl_cv_have_include_next = yes; then
+ AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+ else
+ AC_CACHE_CHECK(
+ [absolute name of <]m4_defn([gl_HEADER_NAME])[>],
+ [gl_next_header],
+ [m4_if([$2], [check],
+ [AS_VAR_PUSHDEF([gl_header_exists],
+ [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
+ if test AS_VAR_GET([gl_header_exists]) = yes; then
+ AS_VAR_POPDEF([gl_header_exists])
+ ])
+ gl_ABSOLUTE_HEADER_ONE(gl_HEADER_NAME)
+ AS_VAR_COPY([gl_header], [gl_cv_absolute_]AS_TR_SH(gl_HEADER_NAME))
+ AS_VAR_SET([gl_next_header], ['"'$gl_header'"'])
+ m4_if([$2], [check],
+ [else
+ AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+ fi
+ ])
+ ])
+ fi
+ AC_SUBST(
+ AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
+ [AS_VAR_GET([gl_next_header])])
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'gl_HEADER_NAME'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=AS_VAR_GET([gl_next_header])
+ fi
+ AC_SUBST(
+ AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])),
+ [$gl_next_as_first_directive])
+ AS_VAR_POPDEF([gl_next_header])])
+])
+
+# Autoconf 2.68 added warnings for our use of AC_COMPILE_IFELSE;
+# this fallback is safe for all earlier autoconf versions.
+m4_define_default([AC_LANG_DEFINES_PROVIDED])
diff --git a/gl/m4/intdiv0.m4 b/gl/m4/intdiv0.m4
new file mode 100644
index 0000000..74d0e80
--- /dev/null
+++ b/gl/m4/intdiv0.m4
@@ -0,0 +1,87 @@
+# intdiv0.m4 serial 6 (gettext-0.18.2)
+dnl Copyright (C) 2002, 2007-2008, 2010-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gt_INTDIV0],
+[
+ AC_REQUIRE([AC_PROG_CC])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl
+
+ AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
+ gt_cv_int_divbyzero_sigfpe,
+ [
+ gt_cv_int_divbyzero_sigfpe=
+changequote(,)dnl
+ case "$host_os" in
+ macos* | darwin[6-9]* | darwin[1-9][0-9]*)
+ # On Mac OS X 10.2 or newer, just assume the same as when cross-
+ # compiling. If we were to perform the real test, 1 Crash Report
+ # dialog window would pop up.
+ case "$host_cpu" in
+ i[34567]86 | x86_64)
+ gt_cv_int_divbyzero_sigfpe="guessing yes" ;;
+ esac
+ ;;
+ esac
+changequote([,])dnl
+ if test -z "$gt_cv_int_divbyzero_sigfpe"; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdlib.h>
+#include <signal.h>
+
+static void
+sigfpe_handler (int sig)
+{
+ /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
+ exit (sig != SIGFPE);
+}
+
+int x = 1;
+int y = 0;
+int z;
+int nan;
+
+int main ()
+{
+ signal (SIGFPE, sigfpe_handler);
+/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
+#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
+ signal (SIGTRAP, sigfpe_handler);
+#endif
+/* Linux/SPARC yields signal SIGILL. */
+#if defined (__sparc__) && defined (__linux__)
+ signal (SIGILL, sigfpe_handler);
+#endif
+
+ z = x / y;
+ nan = y / y;
+ exit (2);
+}
+]])],
+ [gt_cv_int_divbyzero_sigfpe=yes],
+ [gt_cv_int_divbyzero_sigfpe=no],
+ [
+ # Guess based on the CPU.
+changequote(,)dnl
+ case "$host_cpu" in
+ alpha* | i[34567]86 | x86_64 | m68k | s390*)
+ gt_cv_int_divbyzero_sigfpe="guessing yes";;
+ *)
+ gt_cv_int_divbyzero_sigfpe="guessing no";;
+ esac
+changequote([,])dnl
+ ])
+ fi
+ ])
+ case "$gt_cv_int_divbyzero_sigfpe" in
+ *yes) value=1;;
+ *) value=0;;
+ esac
+ AC_DEFINE_UNQUOTED([INTDIV0_RAISES_SIGFPE], [$value],
+ [Define if integer division by zero raises signal SIGFPE.])
+])
diff --git a/gl/m4/intl.m4 b/gl/m4/intl.m4
new file mode 100644
index 0000000..67feb58
--- /dev/null
+++ b/gl/m4/intl.m4
@@ -0,0 +1,272 @@
+# intl.m4 serial 25 (gettext-0.18.3)
+dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2009.
+
+AC_PREREQ([2.60])
+
+dnl Checks for all prerequisites of the intl subdirectory,
+dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
+dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
+AC_DEFUN([AM_INTL_SUBDIR],
+[
+ AC_REQUIRE([AC_PROG_INSTALL])dnl
+ AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+ AC_REQUIRE([AC_PROG_CC])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl
+ AC_REQUIRE([gt_GLIBC2])dnl
+ AC_REQUIRE([AC_PROG_RANLIB])dnl
+ AC_REQUIRE([gl_VISIBILITY])dnl
+ AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
+ AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl
+ AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
+ AC_REQUIRE([gt_TYPE_WINT_T])dnl
+ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
+ AC_REQUIRE([gt_TYPE_INTMAX_T])
+ AC_REQUIRE([gt_PRINTF_POSIX])
+ AC_REQUIRE([gl_GLIBC21])dnl
+ AC_REQUIRE([gl_XSIZE])dnl
+ AC_REQUIRE([gl_FCNTL_O_FLAGS])dnl
+ AC_REQUIRE([gt_INTL_MACOSX])dnl
+ AC_REQUIRE([gl_EXTERN_INLINE])dnl
+
+ dnl Support for automake's --enable-silent-rules.
+ case "$enable_silent_rules" in
+ yes) INTL_DEFAULT_VERBOSITY=0;;
+ no) INTL_DEFAULT_VERBOSITY=1;;
+ *) INTL_DEFAULT_VERBOSITY=1;;
+ esac
+ AC_SUBST([INTL_DEFAULT_VERBOSITY])
+
+ AC_CHECK_TYPE([ptrdiff_t], ,
+ [AC_DEFINE([ptrdiff_t], [long],
+ [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
+ ])
+ AC_CHECK_HEADERS([features.h stddef.h stdlib.h string.h])
+ AC_CHECK_FUNCS([asprintf fwprintf newlocale putenv setenv setlocale \
+ snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
+
+ dnl Use the _snprintf function only if it is declared (because on NetBSD it
+ dnl is defined as a weak alias of snprintf; we prefer to use the latter).
+ AC_CHECK_DECLS([_snprintf, _snwprintf], , , [#include <stdio.h>])
+
+ dnl Use the *_unlocked functions only if they are declared.
+ dnl (because some of them were defined without being declared in Solaris
+ dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
+ dnl on Solaris 2.5.1 to run on Solaris 2.6).
+ AC_CHECK_DECLS([getc_unlocked], , , [#include <stdio.h>])
+
+ case $gt_cv_func_printf_posix in
+ *yes) HAVE_POSIX_PRINTF=1 ;;
+ *) HAVE_POSIX_PRINTF=0 ;;
+ esac
+ AC_SUBST([HAVE_POSIX_PRINTF])
+ if test "$ac_cv_func_asprintf" = yes; then
+ HAVE_ASPRINTF=1
+ else
+ HAVE_ASPRINTF=0
+ fi
+ AC_SUBST([HAVE_ASPRINTF])
+ if test "$ac_cv_func_snprintf" = yes; then
+ HAVE_SNPRINTF=1
+ else
+ HAVE_SNPRINTF=0
+ fi
+ AC_SUBST([HAVE_SNPRINTF])
+ if test "$ac_cv_func_newlocale" = yes; then
+ HAVE_NEWLOCALE=1
+ else
+ HAVE_NEWLOCALE=0
+ fi
+ AC_SUBST([HAVE_NEWLOCALE])
+ if test "$ac_cv_func_wprintf" = yes; then
+ HAVE_WPRINTF=1
+ else
+ HAVE_WPRINTF=0
+ fi
+ AC_SUBST([HAVE_WPRINTF])
+
+ AM_LANGINFO_CODESET
+ gt_LC_MESSAGES
+
+ dnl Compilation on mingw and Cygwin needs special Makefile rules, because
+ dnl 1. when we install a shared library, we must arrange to export
+ dnl auxiliary pointer variables for every exported variable,
+ dnl 2. when we install a shared library and a static library simultaneously,
+ dnl the include file specifies __declspec(dllimport) and therefore we
+ dnl must arrange to define the auxiliary pointer variables for the
+ dnl exported variables _also_ in the static library.
+ if test "$enable_shared" = yes; then
+ case "$host_os" in
+ mingw* | cygwin*) is_woe32dll=yes ;;
+ *) is_woe32dll=no ;;
+ esac
+ else
+ is_woe32dll=no
+ fi
+ WOE32DLL=$is_woe32dll
+ AC_SUBST([WOE32DLL])
+
+ dnl On mingw and Cygwin, we can activate special Makefile rules which add
+ dnl version information to the shared libraries and executables.
+ case "$host_os" in
+ mingw* | cygwin*) is_woe32=yes ;;
+ *) is_woe32=no ;;
+ esac
+ WOE32=$is_woe32
+ AC_SUBST([WOE32])
+ if test $WOE32 = yes; then
+ dnl Check for a program that compiles Windows resource files.
+ AC_CHECK_TOOL([WINDRES], [windres])
+ fi
+
+ dnl Determine whether when creating a library, "-lc" should be passed to
+ dnl libtool or not. On many platforms, it is required for the libtool option
+ dnl -no-undefined to work. On HP-UX, however, the -lc - stored by libtool
+ dnl in the *.la files - makes it impossible to create multithreaded programs,
+ dnl because libtool also reorders the -lc to come before the -pthread, and
+ dnl this disables pthread_create() <http://docs.hp.com/en/1896/pthreads.html>.
+ case "$host_os" in
+ hpux*) LTLIBC="" ;;
+ *) LTLIBC="-lc" ;;
+ esac
+ AC_SUBST([LTLIBC])
+
+ dnl Rename some macros and functions used for locking.
+ AH_BOTTOM([
+#define __libc_lock_t gl_lock_t
+#define __libc_lock_define gl_lock_define
+#define __libc_lock_define_initialized gl_lock_define_initialized
+#define __libc_lock_init gl_lock_init
+#define __libc_lock_lock gl_lock_lock
+#define __libc_lock_unlock gl_lock_unlock
+#define __libc_lock_recursive_t gl_recursive_lock_t
+#define __libc_lock_define_recursive gl_recursive_lock_define
+#define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized
+#define __libc_lock_init_recursive gl_recursive_lock_init
+#define __libc_lock_lock_recursive gl_recursive_lock_lock
+#define __libc_lock_unlock_recursive gl_recursive_lock_unlock
+#define glthread_in_use libintl_thread_in_use
+#define glthread_lock_init_func libintl_lock_init_func
+#define glthread_lock_lock_func libintl_lock_lock_func
+#define glthread_lock_unlock_func libintl_lock_unlock_func
+#define glthread_lock_destroy_func libintl_lock_destroy_func
+#define glthread_rwlock_init_multithreaded libintl_rwlock_init_multithreaded
+#define glthread_rwlock_init_func libintl_rwlock_init_func
+#define glthread_rwlock_rdlock_multithreaded libintl_rwlock_rdlock_multithreaded
+#define glthread_rwlock_rdlock_func libintl_rwlock_rdlock_func
+#define glthread_rwlock_wrlock_multithreaded libintl_rwlock_wrlock_multithreaded
+#define glthread_rwlock_wrlock_func libintl_rwlock_wrlock_func
+#define glthread_rwlock_unlock_multithreaded libintl_rwlock_unlock_multithreaded
+#define glthread_rwlock_unlock_func libintl_rwlock_unlock_func
+#define glthread_rwlock_destroy_multithreaded libintl_rwlock_destroy_multithreaded
+#define glthread_rwlock_destroy_func libintl_rwlock_destroy_func
+#define glthread_recursive_lock_init_multithreaded libintl_recursive_lock_init_multithreaded
+#define glthread_recursive_lock_init_func libintl_recursive_lock_init_func
+#define glthread_recursive_lock_lock_multithreaded libintl_recursive_lock_lock_multithreaded
+#define glthread_recursive_lock_lock_func libintl_recursive_lock_lock_func
+#define glthread_recursive_lock_unlock_multithreaded libintl_recursive_lock_unlock_multithreaded
+#define glthread_recursive_lock_unlock_func libintl_recursive_lock_unlock_func
+#define glthread_recursive_lock_destroy_multithreaded libintl_recursive_lock_destroy_multithreaded
+#define glthread_recursive_lock_destroy_func libintl_recursive_lock_destroy_func
+#define glthread_once_func libintl_once_func
+#define glthread_once_singlethreaded libintl_once_singlethreaded
+#define glthread_once_multithreaded libintl_once_multithreaded
+])
+])
+
+
+dnl Checks for the core files of the intl subdirectory:
+dnl dcigettext.c
+dnl eval-plural.h
+dnl explodename.c
+dnl finddomain.c
+dnl gettextP.h
+dnl gmo.h
+dnl hash-string.h hash-string.c
+dnl l10nflist.c
+dnl libgnuintl.h.in (except the *printf stuff)
+dnl loadinfo.h
+dnl loadmsgcat.c
+dnl localealias.c
+dnl log.c
+dnl plural-exp.h plural-exp.c
+dnl plural.y
+dnl Used by libglocale.
+AC_DEFUN([gt_INTL_SUBDIR_CORE],
+[
+ AC_REQUIRE([AC_C_INLINE])dnl
+ AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+ AC_REQUIRE([gl_AC_HEADER_STDINT_H])
+ AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+ AC_REQUIRE([AC_FUNC_MMAP])dnl
+ AC_REQUIRE([gt_INTDIV0])dnl
+ AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
+ AC_REQUIRE([gt_INTTYPES_PRI])dnl
+ AC_REQUIRE([gl_LOCK])dnl
+
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }]],
+ [[]])],
+ [AC_DEFINE([HAVE_BUILTIN_EXPECT], [1],
+ [Define to 1 if the compiler understands __builtin_expect.])])
+
+ AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h])
+ AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
+ stpcpy strcasecmp strdup strtoul tsearch uselocale argz_count \
+ argz_stringify argz_next __fsetlocking])
+
+ dnl Use the *_unlocked functions only if they are declared.
+ dnl (because some of them were defined without being declared in Solaris
+ dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
+ dnl on Solaris 2.5.1 to run on Solaris 2.6).
+ AC_CHECK_DECLS([feof_unlocked, fgets_unlocked], , , [#include <stdio.h>])
+
+ AM_ICONV
+
+ dnl intl/plural.c is generated from intl/plural.y. It requires bison,
+ dnl because plural.y uses bison specific features. It requires at least
+ dnl bison-1.26 because earlier versions generate a plural.c that doesn't
+ dnl compile.
+ dnl bison is only needed for the maintainer (who touches plural.y). But in
+ dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
+ dnl the rule in general Makefile. Now, some people carelessly touch the
+ dnl files or have a broken "make" program, hence the plural.c rule will
+ dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
+ dnl present or too old.
+ AC_CHECK_PROGS([INTLBISON], [bison])
+ if test -z "$INTLBISON"; then
+ ac_verc_fail=yes
+ else
+ dnl Found it, now check the version.
+ AC_MSG_CHECKING([version of bison])
+changequote(<<,>>)dnl
+ ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
+ case $ac_prog_version in
+ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+ 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
+changequote([,])dnl
+ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+ *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+ esac
+ AC_MSG_RESULT([$ac_prog_version])
+ fi
+ if test $ac_verc_fail = yes; then
+ INTLBISON=:
+ fi
+])
diff --git a/gl/m4/intldir.m4 b/gl/m4/intldir.m4
new file mode 100644
index 0000000..388ecd6
--- /dev/null
+++ b/gl/m4/intldir.m4
@@ -0,0 +1,19 @@
+# intldir.m4 serial 2 (gettext-0.18)
+dnl Copyright (C) 2006, 2009-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+AC_PREREQ([2.52])
+
+dnl Tells the AM_GNU_GETTEXT macro to consider an intl/ directory.
+AC_DEFUN([AM_GNU_GETTEXT_INTL_SUBDIR], [])
diff --git a/gl/m4/intlmacosx.m4 b/gl/m4/intlmacosx.m4
new file mode 100644
index 0000000..ab97d39
--- /dev/null
+++ b/gl/m4/intlmacosx.m4
@@ -0,0 +1,56 @@
+# intlmacosx.m4 serial 5 (gettext-0.18.2)
+dnl Copyright (C) 2004-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Checks for special options needed on Mac OS X.
+dnl Defines INTL_MACOSX_LIBS.
+AC_DEFUN([gt_INTL_MACOSX],
+[
+ dnl Check for API introduced in Mac OS X 10.2.
+ AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
+ [gt_cv_func_CFPreferencesCopyAppValue],
+ [gt_save_LIBS="$LIBS"
+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <CoreFoundation/CFPreferences.h>]],
+ [[CFPreferencesCopyAppValue(NULL, NULL)]])],
+ [gt_cv_func_CFPreferencesCopyAppValue=yes],
+ [gt_cv_func_CFPreferencesCopyAppValue=no])
+ LIBS="$gt_save_LIBS"])
+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
+ AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
+ [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
+ fi
+ dnl Check for API introduced in Mac OS X 10.3.
+ AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
+ [gt_save_LIBS="$LIBS"
+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <CoreFoundation/CFLocale.h>]],
+ [[CFLocaleCopyCurrent();]])],
+ [gt_cv_func_CFLocaleCopyCurrent=yes],
+ [gt_cv_func_CFLocaleCopyCurrent=no])
+ LIBS="$gt_save_LIBS"])
+ if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+ AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
+ [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
+ fi
+ INTL_MACOSX_LIBS=
+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+ INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
+ fi
+ AC_SUBST([INTL_MACOSX_LIBS])
+])
diff --git a/gl/m4/intmax.m4 b/gl/m4/intmax.m4
new file mode 100644
index 0000000..18733a5
--- /dev/null
+++ b/gl/m4/intmax.m4
@@ -0,0 +1,36 @@
+# intmax.m4 serial 6 (gettext-0.18.2)
+dnl Copyright (C) 2002-2005, 2008-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Test whether the system has the 'intmax_t' type, but don't attempt to
+dnl find a replacement if it is lacking.
+
+AC_DEFUN([gt_TYPE_INTMAX_T],
+[
+ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
+ AC_REQUIRE([gl_AC_HEADER_STDINT_H])
+ AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <stddef.h>
+#include <stdlib.h>
+#if HAVE_STDINT_H_WITH_UINTMAX
+#include <stdint.h>
+#endif
+#if HAVE_INTTYPES_H_WITH_UINTMAX
+#include <inttypes.h>
+#endif
+ ]],
+ [[intmax_t x = -1;
+ return !x;]])],
+ [gt_cv_c_intmax_t=yes],
+ [gt_cv_c_intmax_t=no])])
+ if test $gt_cv_c_intmax_t = yes; then
+ AC_DEFINE([HAVE_INTMAX_T], [1],
+ [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
+ fi
+])
diff --git a/gl/m4/intmax_t.m4 b/gl/m4/intmax_t.m4
new file mode 100644
index 0000000..8a15dab
--- /dev/null
+++ b/gl/m4/intmax_t.m4
@@ -0,0 +1,59 @@
+# intmax_t.m4 serial 9
+dnl Copyright (C) 1997-2004, 2006-2007, 2009-2022 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+AC_PREREQ([2.53])
+
+# Define intmax_t to 'long' or 'long long'
+# if it is not already defined in <stdint.h> or <inttypes.h>.
+
+AC_DEFUN([gl_AC_TYPE_INTMAX_T],
+[
+ dnl For simplicity, we assume that a header file defines 'intmax_t' if and
+ dnl only if it defines 'uintmax_t'.
+ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
+ AC_REQUIRE([gl_AC_HEADER_STDINT_H])
+ if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
+ AC_DEFINE_UNQUOTED([intmax_t], [long long],
+ [Define to long or long long if <inttypes.h> and <stdint.h> don't define.])
+ else
+ AC_DEFINE([HAVE_INTMAX_T], [1],
+ [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
+ fi
+])
+
+dnl An alternative would be to explicitly test for 'intmax_t'.
+
+AC_DEFUN([gt_AC_TYPE_INTMAX_T],
+[
+ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
+ AC_REQUIRE([gl_AC_HEADER_STDINT_H])
+ AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <stddef.h>
+#include <stdlib.h>
+#if HAVE_STDINT_H_WITH_UINTMAX
+#include <stdint.h>
+#endif
+#if HAVE_INTTYPES_H_WITH_UINTMAX
+#include <inttypes.h>
+#endif
+ ]],
+ [[intmax_t x = -1; return !x;]])],
+ [gt_cv_c_intmax_t=yes],
+ [gt_cv_c_intmax_t=no])])
+ if test $gt_cv_c_intmax_t = yes; then
+ AC_DEFINE([HAVE_INTMAX_T], [1],
+ [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
+ else
+ AC_DEFINE_UNQUOTED([intmax_t], [long long],
+ [Define to long or long long if <stdint.h> and <inttypes.h> don't define.])
+ fi
+])
diff --git a/gl/m4/inttypes-pri.m4 b/gl/m4/inttypes-pri.m4
new file mode 100644
index 0000000..e5a1e05
--- /dev/null
+++ b/gl/m4/inttypes-pri.m4
@@ -0,0 +1,42 @@
+# inttypes-pri.m4 serial 7 (gettext-0.18.2)
+dnl Copyright (C) 1997-2002, 2006, 2008-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_PREREQ([2.53])
+
+# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
+# macros to non-string values. This is the case on AIX 4.3.3.
+
+AC_DEFUN([gt_INTTYPES_PRI],
+[
+ AC_CHECK_HEADERS([inttypes.h])
+ if test $ac_cv_header_inttypes_h = yes; then
+ AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
+ [gt_cv_inttypes_pri_broken],
+ [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <inttypes.h>
+#ifdef PRId32
+char *p = PRId32;
+#endif
+ ]],
+ [[]])],
+ [gt_cv_inttypes_pri_broken=no],
+ [gt_cv_inttypes_pri_broken=yes])
+ ])
+ fi
+ if test "$gt_cv_inttypes_pri_broken" = yes; then
+ AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], [1],
+ [Define if <inttypes.h> exists and defines unusable PRI* macros.])
+ PRI_MACROS_BROKEN=1
+ else
+ PRI_MACROS_BROKEN=0
+ fi
+ AC_SUBST([PRI_MACROS_BROKEN])
+])
diff --git a/gl/m4/inttypes.m4 b/gl/m4/inttypes.m4
new file mode 100644
index 0000000..df25a21
--- /dev/null
+++ b/gl/m4/inttypes.m4
@@ -0,0 +1,180 @@
+# inttypes.m4 serial 36
+dnl Copyright (C) 2006-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Derek Price, Bruno Haible.
+dnl Test whether <inttypes.h> is supported or must be substituted.
+
+AC_DEFUN_ONCE([gl_INTTYPES_H],
+[
+ AC_REQUIRE([gl_INTTYPES_INCOMPLETE])
+ gl_INTTYPES_PRI_SCN
+])
+
+AC_DEFUN_ONCE([gl_INTTYPES_INCOMPLETE],
+[
+ AC_REQUIRE([gl_STDINT_H])
+ AC_CHECK_HEADERS_ONCE([inttypes.h])
+
+ dnl Override <inttypes.h> always, so that the portability warnings work.
+ AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
+ gl_CHECK_NEXT_HEADERS([inttypes.h])
+
+ AC_REQUIRE([gl_MULTIARCH])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <inttypes.h>
+ ]], [imaxabs imaxdiv strtoimax strtoumax])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+])
+
+# Ensure that the PRI* and SCN* macros are defined appropriately.
+AC_DEFUN([gl_INTTYPES_PRI_SCN],
+[
+ PRIPTR_PREFIX=
+ if $GL_GENERATE_STDINT_H; then
+ dnl Using the gnulib <stdint.h>. It defines intptr_t to 'long' or
+ dnl 'long long', depending on _WIN64.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #ifdef _WIN64
+ LLP64
+ #endif
+ ]])
+ ],
+ [PRIPTR_PREFIX='"l"'],
+ [PRIPTR_PREFIX='"ll"'])
+ else
+ dnl Using the system's <stdint.h>.
+ for glpfx in '' l ll I64; do
+ case $glpfx in
+ '') gltype1='int';;
+ l) gltype1='long int';;
+ ll) gltype1='long long int';;
+ I64) gltype1='__int64';;
+ esac
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <stdint.h>
+ extern intptr_t foo;
+ extern $gltype1 foo;]])],
+ [PRIPTR_PREFIX='"'$glpfx'"'])
+ test -n "$PRIPTR_PREFIX" && break
+ done
+ fi
+ AC_SUBST([PRIPTR_PREFIX])
+
+ gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+ [INT32_MAX_LT_INTMAX_MAX],
+ [defined INT32_MAX && defined INTMAX_MAX],
+ [INT32_MAX < INTMAX_MAX],
+ [sizeof (int) < sizeof (long long int)])
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+ [INT64_MAX_EQ_LONG_MAX],
+ [defined INT64_MAX],
+ [INT64_MAX == LONG_MAX],
+ [sizeof (long long int) == sizeof (long int)])
+ else
+ INT64_MAX_EQ_LONG_MAX=-1
+ fi
+ gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+ [UINT32_MAX_LT_UINTMAX_MAX],
+ [defined UINT32_MAX && defined UINTMAX_MAX],
+ [UINT32_MAX < UINTMAX_MAX],
+ [sizeof (unsigned int) < sizeof (unsigned long long int)])
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+ [UINT64_MAX_EQ_ULONG_MAX],
+ [defined UINT64_MAX],
+ [UINT64_MAX == ULONG_MAX],
+ [sizeof (unsigned long long int) == sizeof (unsigned long int)])
+ else
+ UINT64_MAX_EQ_ULONG_MAX=-1
+ fi
+])
+
+# Define the symbol $1 to be 1 if the condition is true, 0 otherwise.
+# If $2 is true, the condition is $3; otherwise if long long int is supported
+# approximate the condition with $4; otherwise, assume the condition is false.
+# The condition should work on all C99 platforms; the approximations should be
+# good enough to work on all practical pre-C99 platforms.
+# $2 is evaluated by the C preprocessor, $3 and $4 as compile-time constants.
+AC_DEFUN([gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION],
+[
+ AC_CACHE_CHECK([whether $3],
+ [gl_cv_test_$1],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[/* Work also in C++ mode. */
+ #define __STDC_LIMIT_MACROS 1
+
+ /* Work if build is not clean. */
+ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
+
+ #include <limits.h>
+ #if HAVE_STDINT_H
+ #include <stdint.h>
+ #endif
+
+ #if $2
+ #define CONDITION ($3)
+ #else
+ #define CONDITION ($4)
+ #endif
+ int test[CONDITION ? 1 : -1];]])],
+ [gl_cv_test_$1=yes],
+ [gl_cv_test_$1=no])])
+ if test $gl_cv_test_$1 = yes; then
+ $1=1;
+ else
+ $1=0;
+ fi
+ AC_SUBST([$1])
+])
+
+# gl_INTTYPES_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_INTTYPES_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_INTTYPES_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_INTTYPES_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_INTTYPES_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_IMAXABS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_IMAXDIV])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOIMAX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOUMAX])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_INTTYPES_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_INTTYPES_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_DECL_IMAXABS=1; AC_SUBST([HAVE_DECL_IMAXABS])
+ HAVE_DECL_IMAXDIV=1; AC_SUBST([HAVE_DECL_IMAXDIV])
+ HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX])
+ HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX])
+ HAVE_IMAXDIV_T=1; AC_SUBST([HAVE_IMAXDIV_T])
+ REPLACE_STRTOIMAX=0; AC_SUBST([REPLACE_STRTOIMAX])
+ REPLACE_STRTOUMAX=0; AC_SUBST([REPLACE_STRTOUMAX])
+ INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX])
+ INT64_MAX_EQ_LONG_MAX='defined _LP64'; AC_SUBST([INT64_MAX_EQ_LONG_MAX])
+ PRIPTR_PREFIX=__PRIPTR_PREFIX; AC_SUBST([PRIPTR_PREFIX])
+ UINT32_MAX_LT_UINTMAX_MAX=1; AC_SUBST([UINT32_MAX_LT_UINTMAX_MAX])
+ UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; AC_SUBST([UINT64_MAX_EQ_ULONG_MAX])
+])
diff --git a/gl/m4/inttypes_h.m4 b/gl/m4/inttypes_h.m4
new file mode 100644
index 0000000..6e9eebf
--- /dev/null
+++ b/gl/m4/inttypes_h.m4
@@ -0,0 +1,29 @@
+# inttypes_h.m4 serial 10
+dnl Copyright (C) 1997-2004, 2006, 2008-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
+[
+ AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <sys/types.h>
+#include <inttypes.h>
+ ]],
+ [[uintmax_t i = (uintmax_t) -1; return !i;]])],
+ [gl_cv_header_inttypes_h=yes],
+ [gl_cv_header_inttypes_h=no])])
+ if test $gl_cv_header_inttypes_h = yes; then
+ AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1],
+ [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
+ and declares uintmax_t. ])
+ fi
+])
diff --git a/gl/m4/ioctl.m4 b/gl/m4/ioctl.m4
new file mode 100644
index 0000000..7c72134
--- /dev/null
+++ b/gl/m4/ioctl.m4
@@ -0,0 +1,44 @@
+# ioctl.m4 serial 6
+dnl Copyright (C) 2008-2022 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_IOCTL],
+[
+ AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])
+ AC_REQUIRE([gl_SYS_SOCKET_H])
+ HAVE_IOCTL=1
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ dnl Even if the 'socket' module is not used here, another part of the
+ dnl application may use it and pass file descriptors that refer to
+ dnl sockets to the ioctl() function. So enable the support for sockets.
+ HAVE_IOCTL=0
+ else
+ AC_CHECK_FUNCS([ioctl])
+ dnl On glibc systems, the second parameter is 'unsigned long int request',
+ dnl not 'int request'. We cannot simply cast the function pointer, but
+ dnl instead need a wrapper.
+ AC_CACHE_CHECK([for ioctl with POSIX signature],
+ [gl_cv_func_ioctl_posix_signature],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/ioctl.h>
+ /* On some platforms, ioctl() is declared in <unistd.h>. */
+ #include <unistd.h>
+ ]],
+ [[extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ int ioctl (int, int, ...);
+ ]])
+ ],
+ [gl_cv_func_ioctl_posix_signature=yes],
+ [gl_cv_func_ioctl_posix_signature=no])
+ ])
+ if test $gl_cv_func_ioctl_posix_signature != yes; then
+ REPLACE_IOCTL=1
+ fi
+ fi
+])
diff --git a/gl/m4/isblank.m4 b/gl/m4/isblank.m4
new file mode 100644
index 0000000..1d0ed6c
--- /dev/null
+++ b/gl/m4/isblank.m4
@@ -0,0 +1,17 @@
+# isblank.m4 serial 3
+dnl Copyright (C) 2009-2022 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_ISBLANK],
+[
+ dnl Persuade glibc <ctype.h> to declare isblank().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([gl_CTYPE_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([isblank])
+ if test $ac_cv_func_isblank = no; then
+ HAVE_ISBLANK=0
+ fi
+])
diff --git a/gl/m4/langinfo_h.m4 b/gl/m4/langinfo_h.m4
new file mode 100644
index 0000000..563c8c4
--- /dev/null
+++ b/gl/m4/langinfo_h.m4
@@ -0,0 +1,137 @@
+# langinfo_h.m4 serial 12
+dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_LANGINFO_H],
+[
+ AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
+
+ dnl Persuade glibc-2.0.6 <langinfo.h> to define CODESET.
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ dnl <langinfo.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([langinfo.h])
+
+ dnl Determine whether <langinfo.h> exists. It is missing on mingw and BeOS.
+ HAVE_LANGINFO_CODESET=0
+ HAVE_LANGINFO_T_FMT_AMPM=0
+ HAVE_LANGINFO_ALTMON=0
+ HAVE_LANGINFO_ERA=0
+ HAVE_LANGINFO_YESEXPR=0
+ AC_CHECK_HEADERS_ONCE([langinfo.h])
+ if test $ac_cv_header_langinfo_h = yes; then
+ HAVE_LANGINFO_H=1
+ dnl Determine what <langinfo.h> defines.
+ dnl CODESET is missing on OpenBSD 3.8.
+ dnl ERA etc. are missing on OpenBSD 6.7.
+ dnl T_FMT_AMPM and YESEXPR, NOEXPR are missing on IRIX 5.3.
+ dnl ALTMON_* are missing on glibc 2.26 and many other systems.
+ AC_CACHE_CHECK([whether langinfo.h defines CODESET],
+ [gl_cv_header_langinfo_codeset],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <langinfo.h>
+int a = CODESET;
+]])],
+ [gl_cv_header_langinfo_codeset=yes],
+ [gl_cv_header_langinfo_codeset=no])
+ ])
+ if test $gl_cv_header_langinfo_codeset = yes; then
+ HAVE_LANGINFO_CODESET=1
+ fi
+ AC_CACHE_CHECK([whether langinfo.h defines T_FMT_AMPM],
+ [gl_cv_header_langinfo_t_fmt_ampm],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <langinfo.h>
+int a = T_FMT_AMPM;
+]])],
+ [gl_cv_header_langinfo_t_fmt_ampm=yes],
+ [gl_cv_header_langinfo_t_fmt_ampm=no])
+ ])
+ if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then
+ HAVE_LANGINFO_T_FMT_AMPM=1
+ fi
+ AC_CACHE_CHECK([whether langinfo.h defines ALTMON_1],
+ [gl_cv_header_langinfo_altmon],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <langinfo.h>
+int a = ALTMON_1;
+]])],
+ [gl_cv_header_langinfo_altmon=yes],
+ [gl_cv_header_langinfo_altmon=no])
+ ])
+ if test $gl_cv_header_langinfo_altmon = yes; then
+ HAVE_LANGINFO_ALTMON=1
+ fi
+ AC_CACHE_CHECK([whether langinfo.h defines ERA],
+ [gl_cv_header_langinfo_era],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <langinfo.h>
+int a = ERA;
+]])],
+ [gl_cv_header_langinfo_era=yes],
+ [gl_cv_header_langinfo_era=no])
+ ])
+ if test $gl_cv_header_langinfo_era = yes; then
+ HAVE_LANGINFO_ERA=1
+ fi
+ AC_CACHE_CHECK([whether langinfo.h defines YESEXPR],
+ [gl_cv_header_langinfo_yesexpr],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <langinfo.h>
+int a = YESEXPR;
+]])],
+ [gl_cv_header_langinfo_yesexpr=yes],
+ [gl_cv_header_langinfo_yesexpr=no])
+ ])
+ if test $gl_cv_header_langinfo_yesexpr = yes; then
+ HAVE_LANGINFO_YESEXPR=1
+ fi
+ else
+ HAVE_LANGINFO_H=0
+ fi
+ AC_SUBST([HAVE_LANGINFO_H])
+ AC_SUBST([HAVE_LANGINFO_CODESET])
+ AC_SUBST([HAVE_LANGINFO_T_FMT_AMPM])
+ AC_SUBST([HAVE_LANGINFO_ALTMON])
+ AC_SUBST([HAVE_LANGINFO_ERA])
+ AC_SUBST([HAVE_LANGINFO_YESEXPR])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <langinfo.h>
+ ]], [nl_langinfo])
+])
+
+# gl_LANGINFO_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_LANGINFO_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_LANGINFO_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_LANGINFO_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_LANGINFO_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NL_LANGINFO])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_LANGINFO_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_LANGINFO_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_NL_LANGINFO=1; AC_SUBST([HAVE_NL_LANGINFO])
+ REPLACE_NL_LANGINFO=0; AC_SUBST([REPLACE_NL_LANGINFO])
+])
diff --git a/gl/m4/largefile.m4 b/gl/m4/largefile.m4
new file mode 100644
index 0000000..3e8b5e3
--- /dev/null
+++ b/gl/m4/largefile.m4
@@ -0,0 +1,180 @@
+# Enable large files on systems where this is not the default.
+# Enable support for files on Linux file systems with 64-bit inode numbers.
+
+# Copyright 1992-1996, 1998-2022 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.
+
+# The following macro works around a problem in Autoconf's AC_FUNC_FSEEKO:
+# It does not set _LARGEFILE_SOURCE=1 on HP-UX/ia64 32-bit, although this
+# setting of _LARGEFILE_SOURCE is needed so that <stdio.h> declares fseeko
+# and ftello in C++ mode as well.
+AC_DEFUN([gl_SET_LARGEFILE_SOURCE],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_FUNC_FSEEKO
+ case "$host_os" in
+ hpux*)
+ AC_DEFINE([_LARGEFILE_SOURCE], [1],
+ [Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2).])
+ ;;
+ esac
+])
+
+# Work around a problem in Autoconf through at least 2.71 on glibc 2.34+
+# with _TIME_BITS. Also, work around a problem in autoconf <= 2.69:
+# AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5,
+# or configures them incorrectly in some cases.
+m4_version_prereq([2.70], [], [
+
+# _AC_SYS_LARGEFILE_TEST_INCLUDES
+# -------------------------------
+m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES],
+[#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
+ int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1]];[]dnl
+])
+])# m4_version_prereq 2.70
+
+
+# _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE,
+# CACHE-VAR,
+# DESCRIPTION,
+# PROLOGUE, [FUNCTION-BODY])
+# --------------------------------------------------------
+m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE],
+[AC_CACHE_CHECK([for $1 value needed for large files], [$3],
+[while :; do
+ m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
+ [AC_LANG_PROGRAM([$5], [$6])],
+ [$3=no; break])
+ m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
+ [AC_LANG_PROGRAM([#undef $1
+#define $1 $2
+$5], [$6])],
+ [$3=$2; break])
+ $3=unknown
+ break
+done])
+case $$3 in #(
+ no | unknown) ;;
+ *) AC_DEFINE_UNQUOTED([$1], [$$3], [$4]);;
+esac
+rm -rf conftest*[]dnl
+])# _AC_SYS_LARGEFILE_MACRO_VALUE
+
+
+# AC_SYS_LARGEFILE
+# ----------------
+# By default, many hosts won't let programs access large files;
+# one must use special compiler options to get large-file access to work.
+# For more details about this brain damage please see:
+# http://www.unix.org/version2/whatsnew/lfs20mar.html
+# Additionally, on Linux file systems with 64-bit inodes a file that happens
+# to have a 64-bit inode number cannot be accessed by 32-bit applications on
+# Linux x86/x86_64. This can occur with file systems such as XFS and NFS.
+AC_DEFUN([AC_SYS_LARGEFILE],
+[AC_ARG_ENABLE(largefile,
+ [ --disable-largefile omit support for large files])
+AS_IF([test "$enable_largefile" != no],
+ [AC_CACHE_CHECK([for special C compiler options needed for large files],
+ ac_cv_sys_largefile_CC,
+ [ac_cv_sys_largefile_CC=no
+ if test "$GCC" != yes; then
+ ac_save_CC=$CC
+ while :; do
+ # IRIX 6.2 and later do not support large files by default,
+ # so use the C compiler's -n32 option if that helps.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_INCLUDES])])
+ AC_COMPILE_IFELSE([], [break])
+ CC="$CC -n32"
+ AC_COMPILE_IFELSE([], [ac_cv_sys_largefile_CC=' -n32'; break])
+ break
+ done
+ CC=$ac_save_CC
+ rm -f conftest.$ac_ext
+ fi])
+ if test "$ac_cv_sys_largefile_CC" != no; then
+ CC=$CC$ac_cv_sys_largefile_CC
+ fi
+
+ _AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
+ ac_cv_sys_file_offset_bits,
+ [Number of bits in a file offset, on hosts where this is settable.],
+ [_AC_SYS_LARGEFILE_TEST_INCLUDES])
+ AS_CASE([$ac_cv_sys_file_offset_bits],
+ [unknown],
+ [_AC_SYS_LARGEFILE_MACRO_VALUE([_LARGE_FILES], [1],
+ [ac_cv_sys_large_files],
+ [Define for large files, on AIX-style hosts.],
+ [_AC_SYS_LARGEFILE_TEST_INCLUDES])],
+ [64],
+ [gl_YEAR2038_BODY([])])])
+])# AC_SYS_LARGEFILE
+
+# Enable large files on systems where this is implemented by Gnulib, not by the
+# system headers.
+# Set the variables WINDOWS_64_BIT_OFF_T, WINDOWS_64_BIT_ST_SIZE if Gnulib
+# overrides ensure that off_t or 'struct size.st_size' are 64-bit, respectively.
+AC_DEFUN([gl_LARGEFILE],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ mingw*)
+ dnl Native Windows.
+ dnl mingw64 defines off_t to a 64-bit type already, if
+ dnl _FILE_OFFSET_BITS=64, which is ensured by AC_SYS_LARGEFILE.
+ AC_CACHE_CHECK([for 64-bit off_t], [gl_cv_type_off_t_64],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
+ ]],
+ [[]])],
+ [gl_cv_type_off_t_64=yes], [gl_cv_type_off_t_64=no])
+ ])
+ if test $gl_cv_type_off_t_64 = no; then
+ WINDOWS_64_BIT_OFF_T=1
+ else
+ WINDOWS_64_BIT_OFF_T=0
+ fi
+ dnl Some mingw versions define, if _FILE_OFFSET_BITS=64, 'struct stat'
+ dnl to 'struct _stat32i64' or 'struct _stat64' (depending on
+ dnl _USE_32BIT_TIME_T), which has a 32-bit st_size member.
+ AC_CACHE_CHECK([for 64-bit st_size], [gl_cv_member_st_size_64],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ struct stat buf;
+ int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1];
+ ]],
+ [[]])],
+ [gl_cv_member_st_size_64=yes], [gl_cv_member_st_size_64=no])
+ ])
+ if test $gl_cv_member_st_size_64 = no; then
+ WINDOWS_64_BIT_ST_SIZE=1
+ else
+ WINDOWS_64_BIT_ST_SIZE=0
+ fi
+ ;;
+ *)
+ dnl Nothing to do on gnulib's side.
+ dnl A 64-bit off_t is
+ dnl - already the default on Mac OS X, FreeBSD, NetBSD, OpenBSD, IRIX,
+ dnl OSF/1, Cygwin,
+ dnl - enabled by _FILE_OFFSET_BITS=64 (ensured by AC_SYS_LARGEFILE) on
+ dnl glibc, HP-UX, Solaris,
+ dnl - enabled by _LARGE_FILES=1 (ensured by AC_SYS_LARGEFILE) on AIX,
+ dnl - impossible to achieve on Minix 3.1.8.
+ WINDOWS_64_BIT_OFF_T=0
+ WINDOWS_64_BIT_ST_SIZE=0
+ ;;
+ esac
+])
diff --git a/gl/m4/lchown.m4 b/gl/m4/lchown.m4
new file mode 100644
index 0000000..9f9cd42
--- /dev/null
+++ b/gl/m4/lchown.m4
@@ -0,0 +1,38 @@
+# serial 17
+# Determine whether we need the lchown wrapper.
+
+dnl Copyright (C) 1998, 2001, 2003-2007, 2009-2022 Free Software Foundation,
+dnl Inc.
+
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Jim Meyering.
+dnl Provide lchown on systems that lack it, and work around bugs
+dnl on systems that have it.
+
+AC_DEFUN([gl_FUNC_LCHOWN],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_CHOWN])
+ AC_CHECK_FUNCS_ONCE([lchmod])
+ AC_CHECK_FUNCS([lchown])
+ if test $ac_cv_func_lchown = no; then
+ HAVE_LCHOWN=0
+ else
+ dnl Trailing slash and ctime bugs in chown also occur in lchown.
+ case "$gl_cv_func_chown_slash_works" in
+ *yes) ;;
+ *)
+ REPLACE_LCHOWN=1
+ ;;
+ esac
+ case "$gl_cv_func_chown_ctime_works" in
+ *yes) ;;
+ *)
+ REPLACE_LCHOWN=1
+ ;;
+ esac
+ fi
+])
diff --git a/gl/m4/lcmessage.m4 b/gl/m4/lcmessage.m4
new file mode 100644
index 0000000..d62a175
--- /dev/null
+++ b/gl/m4/lcmessage.m4
@@ -0,0 +1,35 @@
+# lcmessage.m4 serial 7 (gettext-0.18.2)
+dnl Copyright (C) 1995-2002, 2004-2005, 2008-2013 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
+
+# Check whether LC_MESSAGES is available in <locale.h>.
+
+AC_DEFUN([gt_LC_MESSAGES],
+[
+ AC_CACHE_CHECK([for LC_MESSAGES], [gt_cv_val_LC_MESSAGES],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <locale.h>]],
+ [[return LC_MESSAGES]])],
+ [gt_cv_val_LC_MESSAGES=yes],
+ [gt_cv_val_LC_MESSAGES=no])])
+ if test $gt_cv_val_LC_MESSAGES = yes; then
+ AC_DEFINE([HAVE_LC_MESSAGES], [1],
+ [Define if your <locale.h> file defines LC_MESSAGES.])
+ fi
+])
diff --git a/gl/m4/lib-ignore.m4 b/gl/m4/lib-ignore.m4
new file mode 100644
index 0000000..4928e67
--- /dev/null
+++ b/gl/m4/lib-ignore.m4
@@ -0,0 +1,115 @@
+# If possible, ignore libraries that are not depended on.
+
+dnl Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Paul Eggert.
+
+# gl_IGNORE_UNUSED_LIBRARIES
+# --------------------------
+# Determines the option to be passed to the C/C++/Fortran compiler, so that it
+# omits unused libraries.
+# Example (on Solaris):
+# $ cc foo.c -lnsl; ldd ./a.out
+# libnsl.so.1 => /lib/libnsl.so.1
+# libc.so.1 => /lib/libc.so.1
+# libmp.so.2 => /lib/libmp.so.2
+# libmd.so.1 => /lib/libmd.so.1
+# libscf.so.1 => /lib/libscf.so.1
+# libdoor.so.1 => /lib/libdoor.so.1
+# libuutil.so.1 => /lib/libuutil.so.1
+# libgen.so.1 => /lib/libgen.so.1
+# libm.so.2 => /lib/libm.so.2
+# $ cc foo.c -lnsl -Wl,-z,ignore; ldd ./a.out
+# libc.so.1 => /lib/libc.so.1
+# libm.so.2 => /lib/libm.so.2
+#
+# Note that the option works only for the C compiler, not for the C++
+# compiler:
+# - Sun C likes '-Wl,-z,ignore'.
+# '-Qoption ld -z,ignore' is not accepted.
+# '-z ignore' is accepted but has no effect.
+# - Sun C++ and Sun Fortran like '-Qoption ld -z,ignore'.
+# '-Wl,-z,ignore' is not accepted.
+# '-z ignore' is accepted but has no effect.
+#
+# Sets and substitutes a variable that depends on the current language:
+# - IGNORE_UNUSED_LIBRARIES_CFLAGS for C
+# - IGNORE_UNUSED_LIBRARIES_CXXFLAGS for C++
+# - IGNORE_UNUSED_LIBRARIES_FFLAGS for Fortran
+#
+# Note that the option works only for direct invocation of the compiler, not
+# through libtool: When libtool is used to create a shared library, it will
+# honor and translate '-Wl,-z,ignore' to '-Qoption ld -z -Qoption ld ignore'
+# if needed, but it will drop a '-Qoption ld -z,ignore' on the command line.
+#
+AC_DEFUN([gl_IGNORE_UNUSED_LIBRARIES],
+[
+ AC_CACHE_CHECK([for []_AC_LANG[] compiler flag to ignore unused libraries],
+ [gl_cv_prog_[]_AC_LANG_ABBREV[]_ignore_unused_libraries],
+ [gl_cv_prog_[]_AC_LANG_ABBREV[]_ignore_unused_libraries=none
+ gl_saved_ldflags=$LDFLAGS
+ gl_saved_libs=$LIBS
+ # Link with -lm to detect binutils 2.16 bug with --as-needed; see
+ # <https://lists.gnu.org/r/bug-gnulib/2006-06/msg00131.html>.
+ LIBS="$LIBS -lm"
+ # Use long option sequences like '-z ignore' to test for the feature,
+ # to forestall problems with linkers that have -z, -i, -g, -n, etc. flags.
+ # GCC + binutils likes '-Wl,--as-needed'.
+ # GCC + Solaris ld likes '-Wl,-z,ignore'.
+ # Sun C likes '-Wl,-z,ignore'. '-z ignore' is accepted but has no effect.
+ # Don't try bare '--as-needed'; nothing likes it and the HP-UX 11.11
+ # native cc issues annoying warnings and then ignores it,
+ # which would cause us to incorrectly conclude that it worked.
+ for gl_flags in _gl_IGNORE_UNUSED_LIBRARIES_OPTIONS
+ do
+ LDFLAGS="$gl_flags $LDFLAGS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM()],
+ [gl_cv_prog_[]_AC_LANG_ABBREV[]_ignore_unused_libraries=$gl_flags])
+ LDFLAGS=$gl_saved_ldflags
+ test "$gl_cv_prog_[]_AC_LANG_ABBREV[]_ignore_unused_libraries" != none &&
+ break
+ done
+ LIBS=$gl_saved_libs
+ ])
+ IGNORE_UNUSED_LIBRARIES_[]_AC_LANG_PREFIX[]FLAGS=
+ if test "$gl_cv_prog_[]_AC_LANG_ABBREV[]_ignore_unused_libraries" != none; then
+ IGNORE_UNUSED_LIBRARIES_[]_AC_LANG_PREFIX[]FLAGS="$gl_cv_prog_[]_AC_LANG_ABBREV[]_ignore_unused_libraries"
+ fi
+ AC_SUBST([IGNORE_UNUSED_LIBRARIES_]_AC_LANG_PREFIX[FLAGS])
+])
+
+# _gl_IGNORE_UNUSED_LIBRARIES_OPTIONS
+# -----------------------------------
+# Expands to the language dependent options to be tried.
+AC_DEFUN([_gl_IGNORE_UNUSED_LIBRARIES_OPTIONS],
+[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+
+# _gl_IGNORE_UNUSED_LIBRARIES_OPTIONS(C)
+# --------------------------------------
+m4_define([_gl_IGNORE_UNUSED_LIBRARIES_OPTIONS(C)],
+[ '-Wl,--as-needed' \
+ '-Wl,-z,ignore' \
+ '-z ignore'
+])
+
+# _gl_IGNORE_UNUSED_LIBRARIES_OPTIONS(C++)
+# ----------------------------------------
+m4_define([_gl_IGNORE_UNUSED_LIBRARIES_OPTIONS(C++)],
+[ '-Wl,--as-needed' \
+ '-Qoption ld -z,ignore' \
+ '-Wl,-z,ignore' \
+ '-z ignore'
+])
+
+# _gl_IGNORE_UNUSED_LIBRARIES_OPTIONS(Fortran 77)
+# -----------------------------------------------
+m4_copy([_gl_IGNORE_UNUSED_LIBRARIES_OPTIONS(C++)],
+ [_gl_IGNORE_UNUSED_LIBRARIES_OPTIONS(Fortran 77)])
+
+# _gl_IGNORE_UNUSED_LIBRARIES_OPTIONS(Fortran)
+# --------------------------------------------
+m4_copy([_gl_IGNORE_UNUSED_LIBRARIES_OPTIONS(Fortran 77)],
+ [_gl_IGNORE_UNUSED_LIBRARIES_OPTIONS(Fortran)])
diff --git a/gl/m4/lib-ld.m4 b/gl/m4/lib-ld.m4
new file mode 100644
index 0000000..934207a
--- /dev/null
+++ b/gl/m4/lib-ld.m4
@@ -0,0 +1,168 @@
+# lib-ld.m4 serial 10
+dnl Copyright (C) 1996-2003, 2009-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Subroutines of libtool.m4,
+dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
+dnl collision with libtool.m4.
+
+dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
+AC_DEFUN([AC_LIB_PROG_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ acl_cv_prog_gnu_ld=yes
+ ;;
+*)
+ acl_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$acl_cv_prog_gnu_ld
+])
+
+dnl From libtool-2.4. Sets the variable LD.
+AC_DEFUN([AC_LIB_PROG_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld [default=no]])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])dnl
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+ # contains only /bin. Note that ksh looks also at the FPATH variable,
+ # so we have to set that as well for the test.
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ || PATH_SEPARATOR=';'
+ }
+fi
+
+if test -n "$LD"; then
+ AC_MSG_CHECKING([for ld])
+elif test "$GCC" = yes; then
+ AC_MSG_CHECKING([for ld used by $CC])
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+if test -n "$LD"; then
+ # Let the user override the test with a path.
+ :
+else
+ AC_CACHE_VAL([acl_cv_path_LD],
+ [
+ acl_cv_path_LD= # Final result of this test
+ ac_prog=ld # Program to search in $PATH
+ if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ acl_output=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $acl_output in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'`
+ while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do
+ acl_output=`echo $acl_output | sed "s%$re_direlt%/%"`
+ done
+ # Got the pathname. No search in PATH is needed.
+ acl_cv_path_LD="$acl_output"
+ ac_prog=
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+ fi
+ if test -n "$ac_prog"; then
+ # Search for $ac_prog in $PATH.
+ acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$acl_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ acl_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_ifs"
+ fi
+ case $host in
+ *-*-aix*)
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __powerpc64__ || defined __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [# The compiler produces 64-bit code. Add option '-b64' so that the
+ # linker groks 64-bit object files.
+ case "$acl_cv_path_LD " in
+ *" -b64 "*) ;;
+ *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;;
+ esac
+ ], [])
+ ;;
+ sparc64-*-netbsd*)
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __sparcv9 || defined __arch64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [],
+ [# The compiler produces 32-bit code. Add option '-m elf32_sparc'
+ # so that the linker groks 32-bit object files.
+ case "$acl_cv_path_LD " in
+ *" -m elf32_sparc "*) ;;
+ *) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;;
+ esac
+ ])
+ ;;
+ esac
+ ])
+ LD="$acl_cv_path_LD"
+fi
+if test -n "$LD"; then
+ AC_MSG_RESULT([$LD])
+else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([no acceptable ld found in \$PATH])
+fi
+AC_LIB_PROG_LD_GNU
+])
diff --git a/gl/m4/lib-link.m4 b/gl/m4/lib-link.m4
new file mode 100644
index 0000000..3b75bcd
--- /dev/null
+++ b/gl/m4/lib-link.m4
@@ -0,0 +1,813 @@
+# lib-link.m4 serial 33
+dnl Copyright (C) 2001-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_PREREQ([2.61])
+
+dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
+dnl augments the CPPFLAGS variable.
+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+AC_DEFUN([AC_LIB_LINKFLAGS],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+ pushdef([Name],[m4_translit([$1],[./+-], [____])])
+ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+ AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
+ AC_LIB_LINKFLAGS_BODY([$1], [$2])
+ ac_cv_lib[]Name[]_libs="$LIB[]NAME"
+ ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
+ ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
+ ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
+ ])
+ LIB[]NAME="$ac_cv_lib[]Name[]_libs"
+ LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
+ INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
+ LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+ AC_SUBST([LIB]NAME)
+ AC_SUBST([LTLIB]NAME)
+ AC_SUBST([LIB]NAME[_PREFIX])
+ dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
+ dnl results of this search when this library appears as a dependency.
+ HAVE_LIB[]NAME=yes
+ popdef([NAME])
+ popdef([Name])
+])
+
+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
+dnl searches for libname and the libraries corresponding to explicit and
+dnl implicit dependencies, together with the specified include files and
+dnl the ability to compile and link the specified testcode. The missing-message
+dnl defaults to 'no' and may contain additional hints for the user.
+dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
+dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
+dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
+dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+ pushdef([Name],[m4_translit([$1],[./+-], [____])])
+ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+
+ dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
+ dnl accordingly.
+ AC_LIB_LINKFLAGS_BODY([$1], [$2])
+
+ dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
+ dnl because if the user has installed lib[]Name and not disabled its use
+ dnl via --without-lib[]Name-prefix, he wants to use it.
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+
+ AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
+ ac_save_LIBS="$LIBS"
+ dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
+ dnl because these -l options might require -L options that are present in
+ dnl LIBS. -l options benefit only from the -L options listed before it.
+ dnl Otherwise, add it to the front of LIBS, because it may be a static
+ dnl library that depends on another static library that is present in LIBS.
+ dnl Static libraries benefit only from the static libraries listed after
+ dnl it.
+ case " $LIB[]NAME" in
+ *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
+ *) LIBS="$LIB[]NAME $LIBS" ;;
+ esac
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[$3]], [[$4]])],
+ [ac_cv_lib[]Name=yes],
+ [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
+ LIBS="$ac_save_LIBS"
+ ])
+ if test "$ac_cv_lib[]Name" = yes; then
+ HAVE_LIB[]NAME=yes
+ AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
+ AC_MSG_CHECKING([how to link with lib[]$1])
+ AC_MSG_RESULT([$LIB[]NAME])
+ else
+ HAVE_LIB[]NAME=no
+ dnl If $LIB[]NAME didn't lead to a usable library, we don't need
+ dnl $INC[]NAME either.
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LIB[]NAME=
+ LTLIB[]NAME=
+ LIB[]NAME[]_PREFIX=
+ fi
+ AC_SUBST([HAVE_LIB]NAME)
+ AC_SUBST([LIB]NAME)
+ AC_SUBST([LTLIB]NAME)
+ AC_SUBST([LIB]NAME[_PREFIX])
+ popdef([NAME])
+ popdef([Name])
+])
+
+dnl Determine the platform dependent parameters needed to use rpath:
+dnl acl_libext,
+dnl acl_shlibext,
+dnl acl_libname_spec,
+dnl acl_library_names_spec,
+dnl acl_hardcode_libdir_flag_spec,
+dnl acl_hardcode_libdir_separator,
+dnl acl_hardcode_direct,
+dnl acl_hardcode_minus_L.
+AC_DEFUN([AC_LIB_RPATH],
+[
+ dnl Complain if config.rpath is missing.
+ AC_REQUIRE_AUX_FILE([config.rpath])
+ AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
+ AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
+ AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
+ AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
+ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+ . ./conftest.sh
+ rm -f ./conftest.sh
+ acl_cv_rpath=done
+ ])
+ wl="$acl_cv_wl"
+ acl_libext="$acl_cv_libext"
+ acl_shlibext="$acl_cv_shlibext"
+ acl_libname_spec="$acl_cv_libname_spec"
+ acl_library_names_spec="$acl_cv_library_names_spec"
+ acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+ acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+ acl_hardcode_direct="$acl_cv_hardcode_direct"
+ acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
+ dnl Determine whether the user wants rpath handling at all.
+ AC_ARG_ENABLE([rpath],
+ [ --disable-rpath do not hardcode runtime library paths],
+ :, enable_rpath=yes)
+])
+
+dnl AC_LIB_FROMPACKAGE(name, package)
+dnl declares that libname comes from the given package. The configure file
+dnl will then not have a --with-libname-prefix option but a
+dnl --with-package-prefix option. Several libraries can come from the same
+dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
+dnl macro call that searches for libname.
+AC_DEFUN([AC_LIB_FROMPACKAGE],
+[
+ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+ define([acl_frompackage_]NAME, [$2])
+ popdef([NAME])
+ pushdef([PACK],[$2])
+ pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+ define([acl_libsinpackage_]PACKUP,
+ m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
+ popdef([PACKUP])
+ popdef([PACK])
+])
+
+dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
+dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
+dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+ pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
+ pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+ pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
+ dnl By default, look in $includedir and $libdir.
+ use_additional=yes
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+ eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
+ ])
+ AC_ARG_WITH(PACK[-prefix],
+[[ --with-]]PACK[[-prefix[=DIR] search for ]]PACKLIBS[[ in DIR/include and DIR/lib
+ --without-]]PACK[[-prefix don't search for ]]PACKLIBS[[ in includedir and libdir]],
+[
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+ eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
+ ])
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/$acl_libdirstem"
+ additional_libdir2="$withval/$acl_libdirstem2"
+ additional_libdir3="$withval/$acl_libdirstem3"
+ fi
+ fi
+])
+ if test "X$additional_libdir2" = "X$additional_libdir"; then
+ additional_libdir2=
+ fi
+ if test "X$additional_libdir3" = "X$additional_libdir"; then
+ additional_libdir3=
+ fi
+ dnl Search the library and its dependencies in $additional_libdir and
+ dnl $LDFLAGS. Using breadth-first-seach.
+ LIB[]NAME=
+ LTLIB[]NAME=
+ INC[]NAME=
+ LIB[]NAME[]_PREFIX=
+ dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
+ dnl computed. So it has to be reset here.
+ HAVE_LIB[]NAME=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='$1 $2'
+ while test -n "$names_next_round"; do
+ names_this_round="$names_next_round"
+ names_next_round=
+ for name in $names_this_round; do
+ already_handled=
+ for n in $names_already_handled; do
+ if test "$n" = "$name"; then
+ already_handled=yes
+ break
+ fi
+ done
+ if test -z "$already_handled"; then
+ names_already_handled="$names_already_handled $name"
+ dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
+ dnl or AC_LIB_HAVE_LINKFLAGS call.
+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
+ eval value=\"\$HAVE_LIB$uppername\"
+ if test -n "$value"; then
+ if test "$value" = yes; then
+ eval value=\"\$LIB$uppername\"
+ test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
+ eval value=\"\$LTLIB$uppername\"
+ test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
+ else
+ dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
+ dnl that this library doesn't exist. So just drop it.
+ :
+ fi
+ else
+ dnl Search the library lib$name in $additional_libdir and $LDFLAGS
+ dnl and the already constructed $LIBNAME/$LTLIBNAME.
+ found_dir=
+ found_la=
+ found_so=
+ found_a=
+ eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
+ if test -n "$acl_shlibext"; then
+ shrext=".$acl_shlibext" # typically: shrext=.so
+ else
+ shrext=
+ fi
+ if test $use_additional = yes; then
+ for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do
+ if test "X$found_dir" = "X"; then
+ eval dir=\$$additional_libdir_variable
+ if test -n "$dir"; then
+ dnl The same code as in the loop below:
+ dnl First look for a shared library.
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ dnl Then look for a static library.
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ fi
+ fi
+ done
+ fi
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+ dnl First look for a shared library.
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ dnl Then look for a static library.
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ ;;
+ esac
+ if test "X$found_dir" != "X"; then
+ break
+ fi
+ done
+ fi
+ if test "X$found_dir" != "X"; then
+ dnl Found the library.
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
+ if test "X$found_so" != "X"; then
+ dnl Linking with a shared library. We attempt to hardcode its
+ dnl directory into the executable's runpath, unless it's the
+ dnl standard /usr/lib.
+ if test "$enable_rpath" = no \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem" \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem2" \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then
+ dnl No hardcoding is needed.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ else
+ dnl Use an explicit option to hardcode DIR into the resulting
+ dnl binary.
+ dnl Potentially add DIR to ltrpathdirs.
+ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $found_dir"
+ fi
+ dnl The hardcoding into $LIBNAME is system dependent.
+ if test "$acl_hardcode_direct" = yes; then
+ dnl Using DIR/libNAME.so during linking hardcodes DIR into the
+ dnl resulting binary.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ else
+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+ dnl Use an explicit option to hardcode DIR into the resulting
+ dnl binary.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ dnl Potentially add DIR to rpathdirs.
+ dnl The rpathdirs will be appended to $LIBNAME at the end.
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $found_dir"
+ fi
+ else
+ dnl Rely on "-L$found_dir".
+ dnl But don't add it if it's already contained in the LDFLAGS
+ dnl or the already constructed $LIBNAME
+ haveit=
+ for x in $LDFLAGS $LIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
+ fi
+ if test "$acl_hardcode_minus_L" != no; then
+ dnl FIXME: Not sure whether we should use
+ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+ dnl here.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ else
+ dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
+ dnl here, because this doesn't fit in flags passed to the
+ dnl compiler. So give up. No hardcoding. This affects only
+ dnl very old systems.
+ dnl FIXME: Not sure whether we should use
+ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+ dnl here.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+ fi
+ fi
+ fi
+ fi
+ else
+ if test "X$found_a" != "X"; then
+ dnl Linking with a static library.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
+ else
+ dnl We shouldn't come here, but anyway it's good to have a
+ dnl fallback.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
+ fi
+ fi
+ dnl Assume the include files are nearby.
+ additional_includedir=
+ case "$found_dir" in
+ */$acl_libdirstem | */$acl_libdirstem/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+ if test "$name" = '$1'; then
+ LIB[]NAME[]_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ */$acl_libdirstem2 | */$acl_libdirstem2/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
+ if test "$name" = '$1'; then
+ LIB[]NAME[]_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ */$acl_libdirstem3 | */$acl_libdirstem3/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'`
+ if test "$name" = '$1'; then
+ LIB[]NAME[]_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ esac
+ if test "X$additional_includedir" != "X"; then
+ dnl Potentially add $additional_includedir to $INCNAME.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/include,
+ dnl 2. if it's /usr/local/include and we are using GCC on Linux,
+ dnl 3. if it's already present in $CPPFLAGS or the already
+ dnl constructed $INCNAME,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_includedir" != "X/usr/include"; then
+ haveit=
+ if test "X$additional_includedir" = "X/usr/local/include"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ for x in $CPPFLAGS $INC[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-I$additional_includedir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_includedir"; then
+ dnl Really add $additional_includedir to $INCNAME.
+ INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ fi
+ dnl Look for dependencies.
+ if test -n "$found_la"; then
+ dnl Read the .la file. It defines the variables
+ dnl dlname, library_names, old_library, dependency_libs, current,
+ dnl age, revision, installed, dlopen, dlpreopen, libdir.
+ save_libdir="$libdir"
+ case "$found_la" in
+ */* | *\\*) . "$found_la" ;;
+ *) . "./$found_la" ;;
+ esac
+ libdir="$save_libdir"
+ dnl We use only dependency_libs.
+ for dep in $dependency_libs; do
+ case "$dep" in
+ -L*)
+ dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+ dnl Potentially add $dependency_libdir to $LIBNAME and $LTLIBNAME.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/lib,
+ dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
+ dnl 3. if it's already present in $LDFLAGS or the already
+ dnl constructed $LIBNAME,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \
+ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \
+ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then
+ haveit=
+ if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \
+ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \
+ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ haveit=
+ for x in $LDFLAGS $LIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$dependency_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$dependency_libdir"; then
+ dnl Really add $dependency_libdir to $LIBNAME.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$dependency_libdir"
+ fi
+ fi
+ haveit=
+ for x in $LDFLAGS $LTLIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$dependency_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$dependency_libdir"; then
+ dnl Really add $dependency_libdir to $LTLIBNAME.
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$dependency_libdir"
+ fi
+ fi
+ fi
+ fi
+ ;;
+ -R*)
+ dir=`echo "X$dep" | sed -e 's/^X-R//'`
+ if test "$enable_rpath" != no; then
+ dnl Potentially add DIR to rpathdirs.
+ dnl The rpathdirs will be appended to $LIBNAME at the end.
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ dnl Potentially add DIR to ltrpathdirs.
+ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $dir"
+ fi
+ fi
+ ;;
+ -l*)
+ dnl Handle this in the next round.
+ dnl But on GNU systems, ignore -lc options, because
+ dnl - linking with libc is the default anyway,
+ dnl - linking with libc.a may produce an error
+ dnl "/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie"
+ dnl or may produce an executable that always crashes, see
+ dnl <https://lists.gnu.org/archive/html/grep-devel/2020-09/msg00052.html>.
+ dep=`echo "X$dep" | sed -e 's/^X-l//'`
+ if test "X$dep" != Xc \
+ || case $host_os in
+ linux* | gnu* | k*bsd*-gnu) false ;;
+ *) true ;;
+ esac; then
+ names_next_round="$names_next_round $dep"
+ fi
+ ;;
+ *.la)
+ dnl Handle this in the next round. Throw away the .la's
+ dnl directory; it is already contained in a preceding -L
+ dnl option.
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+ ;;
+ *)
+ dnl Most likely an immediate library name.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
+ ;;
+ esac
+ done
+ fi
+ else
+ dnl Didn't find the library; assume it is in the system directories
+ dnl known to the linker and runtime loader. (All the system
+ dnl directories known to the linker should also be known to the
+ dnl runtime loader, otherwise the system is severely misconfigured.)
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
+ fi
+ fi
+ fi
+ done
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n "$acl_hardcode_libdir_separator"; then
+ dnl Weird platform: only the last -rpath option counts, the user must
+ dnl pass all path elements in one option. We can arrange that for a
+ dnl single library, but not when more than one $LIBNAMEs are used.
+ alldirs=
+ for found_dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+ done
+ dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+ else
+ dnl The -rpath options are cumulative.
+ for found_dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$found_dir"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+ done
+ fi
+ fi
+ if test "X$ltrpathdirs" != "X"; then
+ dnl When using libtool, the option that works for both libraries and
+ dnl executables is -R. The -R options are cumulative.
+ for found_dir in $ltrpathdirs; do
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
+ done
+ fi
+ popdef([PACKLIBS])
+ popdef([PACKUP])
+ popdef([PACK])
+ popdef([NAME])
+])
+
+dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
+dnl unless already present in VAR.
+dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
+dnl contains two or three consecutive elements that belong together.
+AC_DEFUN([AC_LIB_APPENDTOVAR],
+[
+ for element in [$2]; do
+ haveit=
+ for x in $[$1]; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X$element"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ [$1]="${[$1]}${[$1]:+ }$element"
+ fi
+ done
+])
+
+dnl For those cases where a variable contains several -L and -l options
+dnl referring to unknown libraries and directories, this macro determines the
+dnl necessary additional linker options for the runtime path.
+dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
+dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
+dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
+dnl otherwise linking without libtool is assumed.
+AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
+[
+ AC_REQUIRE([AC_LIB_RPATH])
+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+ $1=
+ if test "$enable_rpath" != no; then
+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+ dnl Use an explicit option to hardcode directories into the resulting
+ dnl binary.
+ rpathdirs=
+ next=
+ for opt in $2; do
+ if test -n "$next"; then
+ dir="$next"
+ dnl No need to hardcode the standard /usr/lib.
+ if test "X$dir" != "X/usr/$acl_libdirstem" \
+ && test "X$dir" != "X/usr/$acl_libdirstem2" \
+ && test "X$dir" != "X/usr/$acl_libdirstem3"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ next=
+ else
+ case $opt in
+ -L) next=yes ;;
+ -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
+ dnl No need to hardcode the standard /usr/lib.
+ if test "X$dir" != "X/usr/$acl_libdirstem" \
+ && test "X$dir" != "X/usr/$acl_libdirstem2" \
+ && test "X$dir" != "X/usr/$acl_libdirstem3"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ next= ;;
+ *) next= ;;
+ esac
+ fi
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n ""$3""; then
+ dnl libtool is used for linking. Use -R options.
+ for dir in $rpathdirs; do
+ $1="${$1}${$1:+ }-R$dir"
+ done
+ else
+ dnl The linker is used for linking directly.
+ if test -n "$acl_hardcode_libdir_separator"; then
+ dnl Weird platform: only the last -rpath option counts, the user
+ dnl must pass all path elements in one option.
+ alldirs=
+ for dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
+ done
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ $1="$flag"
+ else
+ dnl The -rpath options are cumulative.
+ for dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$dir"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ $1="${$1}${$1:+ }$flag"
+ done
+ fi
+ fi
+ fi
+ fi
+ fi
+ AC_SUBST([$1])
+])
diff --git a/gl/m4/lib-prefix.m4 b/gl/m4/lib-prefix.m4
new file mode 100644
index 0000000..999f712
--- /dev/null
+++ b/gl/m4/lib-prefix.m4
@@ -0,0 +1,323 @@
+# lib-prefix.m4 serial 20
+dnl Copyright (C) 2001-2005, 2008-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
+dnl to access previously installed libraries. The basic assumption is that
+dnl a user will want packages to use other packages he previously installed
+dnl with the same --prefix option.
+dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
+dnl libraries, but is otherwise very convenient.
+AC_DEFUN([AC_LIB_PREFIX],
+[
+ AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ dnl By default, look in $includedir and $libdir.
+ use_additional=yes
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ AC_ARG_WITH([lib-prefix],
+[[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
+ --without-lib-prefix don't search for libraries in includedir and libdir]],
+[
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/$acl_libdirstem"
+ fi
+ fi
+])
+ if test $use_additional = yes; then
+ dnl Potentially add $additional_includedir to $CPPFLAGS.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/include,
+ dnl 2. if it's already present in $CPPFLAGS,
+ dnl 3. if it's /usr/local/include and we are using GCC on Linux,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_includedir" != "X/usr/include"; then
+ haveit=
+ for x in $CPPFLAGS; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-I$additional_includedir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test "X$additional_includedir" = "X/usr/local/include"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ if test -d "$additional_includedir"; then
+ dnl Really add $additional_includedir to $CPPFLAGS.
+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ dnl Potentially add $additional_libdir to $LDFLAGS.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/lib,
+ dnl 2. if it's already present in $LDFLAGS,
+ dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
+ haveit=
+ for x in $LDFLAGS; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux*) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ dnl Really add $additional_libdir to $LDFLAGS.
+ LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
+ fi
+ fi
+ fi
+ fi
+ fi
+])
+
+dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
+dnl acl_final_exec_prefix, containing the values to which $prefix and
+dnl $exec_prefix will expand at the end of the configure script.
+AC_DEFUN([AC_LIB_PREPARE_PREFIX],
+[
+ dnl Unfortunately, prefix and exec_prefix get only finally determined
+ dnl at the end of configure.
+ if test "X$prefix" = "XNONE"; then
+ acl_final_prefix="$ac_default_prefix"
+ else
+ acl_final_prefix="$prefix"
+ fi
+ if test "X$exec_prefix" = "XNONE"; then
+ acl_final_exec_prefix='${prefix}'
+ else
+ acl_final_exec_prefix="$exec_prefix"
+ fi
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+ prefix="$acl_save_prefix"
+])
+
+dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
+dnl variables prefix and exec_prefix bound to the values they will have
+dnl at the end of the configure script.
+AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
+[
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ $1
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+])
+
+dnl AC_LIB_PREPARE_MULTILIB creates
+dnl - a function acl_is_expected_elfclass, that tests whether standard input
+dn; has a 32-bit or 64-bit ELF header, depending on the host CPU ABI,
+dnl - 3 variables acl_libdirstem, acl_libdirstem2, acl_libdirstem3, containing
+dnl the basename of the libdir to try in turn, either "lib" or "lib64" or
+dnl "lib/64" or "lib32" or "lib/sparcv9" or "lib/amd64" or similar.
+AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
+[
+ dnl There is no formal standard regarding lib, lib32, and lib64.
+ dnl On most glibc systems, the current practice is that on a system supporting
+ dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
+ dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. However, on
+ dnl Arch Linux based distributions, it's the opposite: 32-bit libraries go
+ dnl under $prefix/lib32 and 64-bit libraries go under $prefix/lib.
+ dnl We determine the compiler's default mode by looking at the compiler's
+ dnl library search path. If at least one of its elements ends in /lib64 or
+ dnl points to a directory whose absolute pathname ends in /lib64, we use that
+ dnl for 64-bit ABIs. Similarly for 32-bit ABIs. Otherwise we use the default,
+ dnl namely "lib".
+ dnl On Solaris systems, the current practice is that on a system supporting
+ dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
+ dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
+ dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT])
+
+ AC_CACHE_CHECK([for ELF binary format], [gl_cv_elf],
+ [AC_EGREP_CPP([Extensible Linking Format],
+ [#if defined __ELF__ || (defined __linux__ && defined __EDG__)
+ Extensible Linking Format
+ #endif
+ ],
+ [gl_cv_elf=yes],
+ [gl_cv_elf=no])
+ ])
+ if test $gl_cv_elf = yes; then
+ # Extract the ELF class of a file (5th byte) in decimal.
+ # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
+ if od -A x < /dev/null >/dev/null 2>/dev/null; then
+ # Use POSIX od.
+ func_elfclass ()
+ {
+ od -A n -t d1 -j 4 -N 1
+ }
+ else
+ # Use BSD hexdump.
+ func_elfclass ()
+ {
+ dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "'
+ echo
+ }
+ fi
+ # Use 'expr', not 'test', to compare the values of func_elfclass, because on
+ # Solaris 11 OpenIndiana and Solaris 11 OmniOS, the result is 001 or 002,
+ # not 1 or 2.
+changequote(,)dnl
+ case $HOST_CPU_C_ABI_32BIT in
+ yes)
+ # 32-bit ABI.
+ acl_is_expected_elfclass ()
+ {
+ expr "`func_elfclass | sed -e 's/[ ]//g'`" = 1 > /dev/null
+ }
+ ;;
+ no)
+ # 64-bit ABI.
+ acl_is_expected_elfclass ()
+ {
+ expr "`func_elfclass | sed -e 's/[ ]//g'`" = 2 > /dev/null
+ }
+ ;;
+ *)
+ # Unknown.
+ acl_is_expected_elfclass ()
+ {
+ :
+ }
+ ;;
+ esac
+changequote([,])dnl
+ else
+ acl_is_expected_elfclass ()
+ {
+ :
+ }
+ fi
+
+ dnl Allow the user to override the result by setting acl_cv_libdirstems.
+ AC_CACHE_CHECK([for the common suffixes of directories in the library search path],
+ [acl_cv_libdirstems],
+ [dnl Try 'lib' first, because that's the default for libdir in GNU, see
+ dnl <https://www.gnu.org/prep/standards/html_node/Directory-Variables.html>.
+ acl_libdirstem=lib
+ acl_libdirstem2=
+ acl_libdirstem3=
+ case "$host_os" in
+ solaris*)
+ dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
+ dnl <https://docs.oracle.com/cd/E19253-01/816-5138/dev-env/index.html>.
+ dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
+ dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
+ dnl symlink is missing, so we set acl_libdirstem2 too.
+ if test $HOST_CPU_C_ABI_32BIT = no; then
+ acl_libdirstem2=lib/64
+ case "$host_cpu" in
+ sparc*) acl_libdirstem3=lib/sparcv9 ;;
+ i*86 | x86_64) acl_libdirstem3=lib/amd64 ;;
+ esac
+ fi
+ ;;
+ *)
+ dnl If $CC generates code for a 32-bit ABI, the libraries are
+ dnl surely under $prefix/lib or $prefix/lib32, not $prefix/lib64.
+ dnl Similarly, if $CC generates code for a 64-bit ABI, the libraries
+ dnl are surely under $prefix/lib or $prefix/lib64, not $prefix/lib32.
+ dnl Find the compiler's search path. However, non-system compilers
+ dnl sometimes have odd library search paths. But we can't simply invoke
+ dnl '/usr/bin/gcc -print-search-dirs' because that would not take into
+ dnl account the -m32/-m31 or -m64 options from the $CC or $CFLAGS.
+ searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \
+ | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+ if test $HOST_CPU_C_ABI_32BIT != no; then
+ # 32-bit or unknown ABI.
+ if test -d /usr/lib32; then
+ acl_libdirstem2=lib32
+ fi
+ fi
+ if test $HOST_CPU_C_ABI_32BIT != yes; then
+ # 64-bit or unknown ABI.
+ if test -d /usr/lib64; then
+ acl_libdirstem3=lib64
+ fi
+ fi
+ if test -n "$searchpath"; then
+ acl_save_IFS="${IFS= }"; IFS=":"
+ for searchdir in $searchpath; do
+ if test -d "$searchdir"; then
+ case "$searchdir" in
+ */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;;
+ */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;;
+ */../ | */.. )
+ # Better ignore directories of this form. They are misleading.
+ ;;
+ *) searchdir=`cd "$searchdir" && pwd`
+ case "$searchdir" in
+ */lib32 ) acl_libdirstem2=lib32 ;;
+ */lib64 ) acl_libdirstem3=lib64 ;;
+ esac ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_IFS"
+ if test $HOST_CPU_C_ABI_32BIT = yes; then
+ # 32-bit ABI.
+ acl_libdirstem3=
+ fi
+ if test $HOST_CPU_C_ABI_32BIT = no; then
+ # 64-bit ABI.
+ acl_libdirstem2=
+ fi
+ fi
+ ;;
+ esac
+ test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+ test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem"
+ acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3"
+ ])
+ dnl Decompose acl_cv_libdirstems into acl_libdirstem, acl_libdirstem2, and
+ dnl acl_libdirstem3.
+changequote(,)dnl
+ acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'`
+ acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'`
+ acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'`
+changequote([,])dnl
+])
diff --git a/gl/m4/libtool.m4 b/gl/m4/libtool.m4
new file mode 100644
index 0000000..e7b6833
--- /dev/null
+++ b/gl/m4/libtool.m4
@@ -0,0 +1,8427 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software
+# Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# 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.
+
+m4_define([_LT_COPYING], [dnl
+# Copyright (C) 2014 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool 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 2 of of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program or library that is built
+# using GNU Libtool, you may include this file under the same
+# distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+])
+
+# serial 59 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+ [m4_default([$3],
+ [m4_fatal([Libtool version $1 or higher is required],
+ 63)])],
+ [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+ *\ * | *\ *)
+ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS=$ltmain
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_PREPARE_CC_BASENAME
+# -----------------------
+m4_defun([_LT_PREPARE_CC_BASENAME], [
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+ for cc_temp in @S|@*""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+ done
+ func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+])# _LT_PREPARE_CC_BASENAME
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
+# but that macro is also expanded into generated libtool script, which
+# arranges for $SED and $ECHO to be set by different means.
+m4_defun([_LT_CC_BASENAME],
+[m4_require([_LT_PREPARE_CC_BASENAME])dnl
+AC_REQUIRE([_LT_DECL_SED])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+func_cc_basename $1
+cc_basename=$func_cc_basename_result
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
+dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_DECL_FILECMD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
+m4_require([_LT_CMD_TRUNCATE])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options that allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}"; then
+ setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}"; then
+ setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test set != "${COLLECT_NAMES+set}"; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a '.a' archive for static linking (except MSVC and
+# ICC, which need '.lib').
+libext=a
+
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+old_CC=$CC
+old_CFLAGS=$CFLAGS
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ _LT_PATH_MAGIC
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from 'configure', and 'config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
+# 'config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain=$ac_aux_dir/ltmain.sh
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the 'libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME. Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+ [m4_ifval([$1], [$1], [$2])])
+ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+ m4_ifval([$4],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+ lt_dict_add_subkey([lt_decl_dict], [$2],
+ [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+ [0], [m4_fatal([$0: too few arguments: $#])],
+ [1], [m4_fatal([$0: too few arguments: $#: $1])],
+ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+ [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+ m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_if([$2], [],
+ m4_quote(lt_decl_varnames),
+ m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to 'config.status' so that its
+# declaration there will have the same value as in 'configure'. VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly. In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags='_LT_TAGS'dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+# # Some comment about what VAR is for.
+# visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+ [description])))[]dnl
+m4_pushdef([_libtool_name],
+ m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+ [0], [_libtool_name=[$]$1],
+ [1], [_libtool_name=$lt_[]$1],
+ [2], [_libtool_name=$lt_[]$1],
+ [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
+# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into 'config.status', and then the shell code to quote escape them in
+# for loops in 'config.status'. Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+ dnl If the libtool generation code has been placed in $CONFIG_LT,
+ dnl instead of duplicating it all over again into config.status,
+ dnl then we will have config.status run $CONFIG_LT later, so it
+ dnl needs to know what name is stored there:
+ [AC_CONFIG_COMMANDS([libtool],
+ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+ dnl If the libtool generation code is destined for config.status,
+ dnl expand the accumulated commands and init code now:
+ [AC_CONFIG_COMMANDS([libtool],
+ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable. If COMMENT is supplied, it is inserted after the
+# '#!' sequence but before initialization text begins. After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script. The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test 0 = "$lt_write_fail" && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+ echo
+ AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+'$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+
+Report bugs to <bug-libtool@gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2011 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test 0 != $[#]
+do
+ case $[1] in
+ --version | --v* | -V )
+ echo "$lt_cl_version"; exit 0 ;;
+ --help | --h* | -h )
+ echo "$lt_cl_help"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --quiet | --q* | --silent | --s* | -q )
+ lt_cl_silent=: ;;
+
+ -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try '$[0] --help' for more information.]) ;;
+
+ *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try '$[0] --help' for more information.]) ;;
+ esac
+ shift
+done
+
+if $lt_cl_silent; then
+ exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure. Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test yes = "$silent" &&
+ lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars. Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+ m4_if(_LT_TAG, [C], [
+ # See if we are running on zsh, and set the options that allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}"; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile=${ofile}T
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+# Generated automatically by $as_me ($PACKAGE) $VERSION
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit, 1996
+
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ cat <<'_LT_EOF' >> "$cfgfile"
+
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_PREPARE_MUNGE_PATH_LIST
+_LT_PREPARE_CC_BASENAME
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test set != "${COLLECT_NAMES+set}"; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+ _LT_PROG_LTMAIN
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ $SED '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ RM='$RM'
+ ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+# autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+ [C], [_LT_LANG(C)],
+ [C++], [_LT_LANG(CXX)],
+ [Go], [_LT_LANG(GO)],
+ [Java], [_LT_LANG(GCJ)],
+ [Fortran 77], [_LT_LANG(F77)],
+ [Fortran], [_LT_LANG(FC)],
+ [Windows Resource], [_LT_LANG(RC)],
+ [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+ [_LT_LANG($1)],
+ [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+ [LT_SUPPORTED_TAG([$1])dnl
+ m4_append([_LT_TAGS], [$1 ])dnl
+ m4_define([_LT_LANG_]$1[_enabled], [])dnl
+ _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+m4_ifndef([AC_PROG_GO], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_GO. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+m4_defun([AC_PROG_GO],
+[AC_LANG_PUSH(Go)dnl
+AC_ARG_VAR([GOC], [Go compiler command])dnl
+AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+AC_CHECK_TOOL(GOC, gccgo)
+if test -z "$GOC"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
+ fi
+fi
+if test -z "$GOC"; then
+ AC_CHECK_PROG(GOC, gccgo, gccgo, false)
+fi
+])#m4_defun
+])#m4_ifndef
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [LT_LANG(CXX)],
+ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [LT_LANG(F77)],
+ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+ [LT_LANG(FC)],
+ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [m4_ifdef([AC_PROG_GCJ],
+ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([A][M_PROG_GCJ],
+ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([LT_PROG_GCJ],
+ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([AC_PROG_GO],
+ [LT_LANG(GO)],
+ [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+ [LT_LANG(RC)],
+ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+ AC_CHECK_TOOL([LIPO], [lipo], [:])
+ AC_CHECK_TOOL([OTOOL], [otool], [:])
+ AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+ _LT_DECL([], [DSYMUTIL], [1],
+ [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+ _LT_DECL([], [NMEDIT], [1],
+ [Tool to change global to local symbols on Mac OS X])
+ _LT_DECL([], [LIPO], [1],
+ [Tool to manipulate fat objects and archives on Mac OS X])
+ _LT_DECL([], [OTOOL], [1],
+ [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+ _LT_DECL([], [OTOOL64], [1],
+ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "$LT_MULTI_MODULE"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ # If there is a non-empty error log, and "single_module"
+ # appears in it, assume the flag caused a linker warning
+ if test -s conftest.err && $GREP single_module conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ # Otherwise, if the output was created with a 0 exit code from
+ # the compiler, it worked.
+ elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi])
+
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS=$save_LDFLAGS
+ ])
+
+ AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+ [lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+ echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+ $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+ echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+ $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -s conftest.err && $GREP force_load conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+ darwin*)
+ case $MACOSX_DEPLOYMENT_TARGET,$host in
+ 10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+ *)
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test yes = "$lt_cv_apple_cc_single_mod"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test yes = "$lt_cv_ld_exported_symbols_list"; then
+ _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
+ fi
+ if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+ m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ if test yes = "$lt_cv_ld_force_load"; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
+ [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
+ case $cc_basename in
+ ifort*|nagfor*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test yes = "$_lt_dar_can_shared"; then
+ output_verbose_link_cmd=func_echo_all
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+ _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+ m4_if([$1], [CXX],
+[ if test yes != "$lt_cv_apple_cc_single_mod"; then
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
+ fi
+],[])
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+if test set = "${lt_cv_aix_libpath+set}"; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+ lt_aix_libpath_sed='[
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }]'
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi],[])
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
+ fi
+ ])
+ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script that will find a shell with a builtin
+# printf (that we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+case $ECHO in
+ printf*) AC_MSG_RESULT([printf]) ;;
+ print*) AC_MSG_RESULT([print -r]) ;;
+ *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test "X`printf %s $ECHO`" = "X$ECHO" \
+ || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[m4_require([_LT_DECL_SED])dnl
+AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
+ [Search for dependent libraries within DIR (or the compiler's sysroot
+ if not specified).])],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted. We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case $with_sysroot in #(
+ yes)
+ if test yes = "$GCC"; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ AC_MSG_RESULT([$with_sysroot])
+ AC_MSG_ERROR([The sysroot must be an absolute path.])
+ ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and where our libraries should be installed.])])
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AS_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test no = "$enable_libtool_lock" || enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out what ABI is being produced by ac_compile, and set mode
+ # options accordingly.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `$FILECMD conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE=32
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE=64
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test yes = "$lt_cv_prog_gnu_ld"; then
+ case `$FILECMD conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `$FILECMD conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+mips64*-*linux*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ emul=elf
+ case `$FILECMD conftest.$ac_objext` in
+ *32-bit*)
+ emul="${emul}32"
+ ;;
+ *64-bit*)
+ emul="${emul}64"
+ ;;
+ esac
+ case `$FILECMD conftest.$ac_objext` in
+ *MSB*)
+ emul="${emul}btsmip"
+ ;;
+ *LSB*)
+ emul="${emul}ltsmip"
+ ;;
+ esac
+ case `$FILECMD conftest.$ac_objext` in
+ *N32*)
+ emul="${emul}n32"
+ ;;
+ esac
+ LD="${LD-ld} -m $emul"
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly. Note that the listed cases only cover the
+ # situations where additional linker options are needed (such as when
+ # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+ # vice versa); the common cases where no linker options are needed do
+ # not appear in the list.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `$FILECMD conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ case `$FILECMD conftest.o` in
+ *x86-64*)
+ LD="${LD-ld} -m elf32_x86_64"
+ ;;
+ *)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ esac
+ ;;
+ powerpc64le-*linux*)
+ LD="${LD-ld} -m elf32lppclinux"
+ ;;
+ powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ powerpcle-*linux*)
+ LD="${LD-ld} -m elf64lppc"
+ ;;
+ powerpc-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test yes != "$lt_cv_cc_needs_belf"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS=$SAVE_CFLAGS
+ fi
+ ;;
+*-*solaris*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `$FILECMD conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*)
+ case $host in
+ i?86-*-solaris*|x86_64-*-solaris*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ sparc*-*-solaris*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
+ if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+ LD=${LD-ld}_sol2
+ fi
+ ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks=$enable_libtool_lock
+])# _LT_ENABLE_LOCK
+
+
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+_LT_DECL([], [AR], [1], [The archiver])
+
+# Use ARFLAGS variable as AR's operation code to sync the variable naming with
+# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
+# higher priority because thats what people were doing historically (setting
+# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
+# variable obsoleted/removed.
+
+test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
+lt_ar_flags=$AR_FLAGS
+_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
+
+# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override
+# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
+_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
+ [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+ [lt_cv_ar_at_file=no
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+ [echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([lt_ar_try])
+ if test 0 -eq "$ac_status"; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ AC_TRY_EVAL([lt_ar_try])
+ if test 0 -ne "$ac_status"; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+ ])
+ ])
+
+if test no = "$lt_cv_ar_at_file"; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+ [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[_LT_PROG_AR
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+ [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ bitrig* | openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+ [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+ [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ fi
+ $RM conftest*
+])
+
+if test yes = "[$]$2"; then
+ m4_if([$5], , :, [$5])
+else
+ m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS $3"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ else
+ $2=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS=$save_LDFLAGS
+])
+
+if test yes = "[$]$2"; then
+ m4_if([$4], , :, [$4])
+else
+ m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ teststring=ABCD
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ os2*)
+ # The test takes a long time on OS/2.
+ lt_cv_sys_max_cmd_len=8192
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len" && \
+ test undefined != "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test X`env echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test 17 != "$i" # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+])
+if test -n "$lt_cv_sys_max_cmd_len"; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+ [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test yes = "$cross_compiling"; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisibility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}]
+_LT_EOF
+ if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
+ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_dlunknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test yes != "$enable_dlopen"; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen=load_add_on
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen=LoadLibrary
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen=dlopen
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
+ lt_cv_dlopen=dyld
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ tpf*)
+ # Don't try to run any link tests for TPF. We know it's impossible
+ # because TPF is a cross-compiler, and we know how we open DSOs.
+ lt_cv_dlopen=dlopen
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=no
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen=shl_load],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen=dlopen],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test no = "$lt_cv_dlopen"; then
+ enable_dlopen=no
+ else
+ enable_dlopen=yes
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS=$CPPFLAGS
+ test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS=$LDFLAGS
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS=$LIBS
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test yes = "$lt_cv_dlopen_self"; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS=$save_CPPFLAGS
+ LDFLAGS=$save_LDFLAGS
+ LIBS=$save_LIBS
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+ [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+ [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+ [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w . 2>&AS_MESSAGE_LOG_FD
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+ [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links=nottested
+if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test no = "$hard_links"; then
+ AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+ [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
+ [Define to the sub-directory where libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+ test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+ test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
+
+ # We can hardcode non-existent directories.
+ if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
+ test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
+ test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test yes = "$shlibpath_overrides_runpath" ||
+ test no = "$enable_shared"; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+ [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -z "$STRIP"; then
+ AC_MSG_RESULT([no])
+else
+ if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ old_striplib="$STRIP --strip-debug"
+ striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+ else
+ case $host_os in
+ darwin*)
+ # FIXME - insert some real tests, host_os isn't really good enough
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ AC_MSG_RESULT([yes])
+ ;;
+ freebsd*)
+ if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
+ old_striplib="$STRIP --strip-debug"
+ striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+ fi
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_PREPARE_MUNGE_PATH_LIST
+# ---------------------------
+# Make sure func_munge_path_list() is defined correctly.
+m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
+[[# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+# string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+# string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+# string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+# "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+# VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+ case x@S|@2 in
+ x)
+ ;;
+ *:)
+ eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
+ ;;
+ x:*)
+ eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
+ ;;
+ *::*)
+ eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+ eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
+ ;;
+ *)
+ eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
+ ;;
+ esac
+}
+]])# _LT_PREPARE_PATH_LIST
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+ [], [
+if test yes = "$GCC"; then
+ case $host_os in
+ darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+ *) lt_awk_arg='/^libraries:/' ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
+ *) lt_sed_strip_eq='s|=/|/|g' ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary...
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ # ...but if some path component already ends with the multilib dir we assume
+ # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+ case "$lt_multi_os_dir; $lt_search_path_spec " in
+ "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+ lt_multi_os_dir=
+ ;;
+ esac
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
+ elif test -n "$lt_multi_os_dir"; then
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS = " "; FS = "/|\n";} {
+ lt_foo = "";
+ lt_count = 0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo = "/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=.so
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
+[User-defined run-time library search path.])
+
+case $host_os in
+aix3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='$libname$release$shared_ext$major'
+ ;;
+
+aix[[4-9]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 supports IA64
+ library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line '#! .'. This would cause the generated library to
+ # depend on '.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # Using Import Files as archive members, it is possible to support
+ # filename-based versioning of shared library archives on AIX. While
+ # this would work for both with and without runtime linking, it will
+ # prevent static linking of such archives. So we do filename-based
+ # shared library versioning with .so extension only, which is used
+ # when both runtime linking and shared linking is enabled.
+ # Unfortunately, runtime linking may impact performance, so we do
+ # not want this to be the default eventually. Also, we use the
+ # versioned .so libs for executables only if there is the -brtl
+ # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+ # To allow for filename-based versioning support, we need to create
+ # libNAME.so.V as an archive file, containing:
+ # *) an Import File, referring to the versioned filename of the
+ # archive as well as the shared archive member, telling the
+ # bitwidth (32 or 64) of that shared object, and providing the
+ # list of exported symbols of that shared object, eventually
+ # decorated with the 'weak' keyword
+ # *) the shared object with the F_LOADONLY flag set, to really avoid
+ # it being seen by the linker.
+ # At run time we better use the real file rather than another symlink,
+ # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+ case $with_aix_soname,$aix_use_runtimelinking in
+ # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ aix,yes) # traditional libtool
+ dynamic_linker='AIX unversionable lib.so'
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ ;;
+ aix,no) # traditional AIX only
+ dynamic_linker='AIX lib.a[(]lib.so.V[)]'
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='$libname$release.a $libname.a'
+ soname_spec='$libname$release$shared_ext$major'
+ ;;
+ svr4,*) # full svr4 only
+ dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
+ library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+ # We do not specify a path in Import Files, so LIBPATH fires.
+ shlibpath_overrides_runpath=yes
+ ;;
+ *,yes) # both, prefer svr4
+ dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
+ library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+ # unpreferred sharedlib libNAME.a needs extra handling
+ postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
+ postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
+ # We do not specify a path in Import Files, so LIBPATH fires.
+ shlibpath_overrides_runpath=yes
+ ;;
+ *,no) # both, prefer aix
+ dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
+ library_names_spec='$libname$release.a $libname.a'
+ soname_spec='$libname$release$shared_ext$major'
+ # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
+ postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
+ postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
+ ;;
+ esac
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='$libname$shared_ext'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[[45]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=.dll
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl* | *,icl*)
+ # Native MSVC or ICC
+ libname_spec='$name'
+ soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+ library_names_spec='$libname.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec=$LIB
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC and ICC wrapper
+ library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+ soname_spec='$libname$release$major$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd* | dragonfly* | midnightbsd*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[[23]].*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2.*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+haiku*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ if test 32 = "$HPUX_IA64_MODE"; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ sys_lib_dlsearch_path_spec=/usr/lib/hpux32
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ sys_lib_dlsearch_path_spec=/usr/lib/hpux64
+ fi
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[[3-9]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test yes = "$lt_cv_prog_gnu_ld"; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='$libname$release$shared_ext$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+ sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+linux*android*)
+ version_type=none # Android doesn't support versioned libraries.
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext'
+ soname_spec='$libname$release$shared_ext'
+ finish_cmds=
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ dynamic_linker='Android linker'
+ # Don't embed -rpath directories since the linker doesn't support them.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+ [lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+ [lt_cv_shlibpath_overrides_runpath=yes])])
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+ ])
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Ideally, we could use ldconfig to report *all* directores which are
+ # searched for libraries, however this is still not possible. Aside from not
+ # being certain /sbin/ldconfig is available, command
+ # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+ # even though it is searched at run-time. Try to do the best guess by
+ # appending ld.so.conf contents (and includes) to the search path.
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsdelf*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='NetBSD ld.elf_so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd* | bitrig*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec=/usr/lib
+ need_lib_prefix=no
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ need_version=no
+ else
+ need_version=yes
+ fi
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+os2*)
+ libname_spec='$name'
+ version_type=windows
+ shrext_cmds=.dll
+ need_version=no
+ need_lib_prefix=no
+ # OS/2 can only load a DLL with a base name of 8 characters or less.
+ soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+ v=$($ECHO $release$versuffix | tr -d .-);
+ n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+ $ECHO $n$v`$shared_ext'
+ library_names_spec='${libname}_dll.$libext'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=BEGINLIBPATH
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='$libname$release$shared_ext$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test yes = "$with_gnu_ld"; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+ soname_spec='$libname$shared_ext.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=sco
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test yes = "$with_gnu_ld"; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test no = "$dynamic_linker" && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test yes = "$GCC"; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+ sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
+fi
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+ sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
+fi
+
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+ [Variables whose values should be saved in libtool wrapper scripts and
+ restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+ [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+ [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+ [[List of archive names. First name is the real one, the rest are links.
+ The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+ [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+ [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+ [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+ [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+ [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+ [[As "finish_cmds", except a single script fragment to be evaled but
+ not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+ [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+ [Compile-time system search path for libraries])
+_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
+ [Detected run-time system search path for libraries])
+_LT_DECL([], [configure_time_lt_sys_library_path], [2],
+ [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program that can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD=$MAGIC_CMD
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="m4_if([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS=$lt_save_ifs
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$1"; then
+ lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS=$lt_save_ifs
+ MAGIC_CMD=$lt_save_MAGIC_CMD
+ ;;
+esac])
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+ [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program that can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test no = "$withval" || with_gnu_ld=yes],
+ [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test yes = "$GCC"; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return, which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD=$ac_prog
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test yes = "$with_gnu_ld"; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS=$lt_save_ifs
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD=$ac_dir/$ac_prog
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test no != "$with_gnu_ld" && break
+ ;;
+ *)
+ test yes != "$with_gnu_ld" && break
+ ;;
+ esac
+ fi
+ done
+ IFS=$lt_save_ifs
+else
+ lt_cv_path_LD=$LD # Let the user override the test with a path.
+fi])
+LD=$lt_cv_path_LD
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test yes != "$GCC"; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test yes = "$GCC"; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_PATH_DD
+# -----------
+# find a working dd
+m4_defun([_LT_PATH_DD],
+[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
+[printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+: ${lt_DD:=$DD}
+AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
+[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+ cmp -s conftest.i conftest.out \
+ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
+fi])
+rm -f conftest.i conftest2.i conftest.out])
+])# _LT_PATH_DD
+
+
+# _LT_CMD_TRUNCATE
+# ----------------
+# find command to truncate a binary pipe
+m4_defun([_LT_CMD_TRUNCATE],
+[m4_require([_LT_PATH_DD])
+AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
+[printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+lt_cv_truncate_bin=
+if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+ cmp -s conftest.i conftest.out \
+ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
+fi
+rm -f conftest.i conftest2.i conftest.out
+test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
+_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
+ [Command to truncate a binary pipe])
+])# _LT_CMD_TRUNCATE
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# 'unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# that responds to the $file_magic_cmd with a given extended regex.
+# If you have 'file' or equivalent on your system and you're not sure
+# whether 'pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[[45]]*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='$FILECMD -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly* | midnightbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=$FILECMD
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=$FILECMD
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[[3-9]]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd* | netbsdelf*-gnu)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=$FILECMD
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd* | bitrig*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+os2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+ [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+ [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+ [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+ [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM=$NM
+else
+ lt_nm_to_check=${ac_tool_prefix}nm
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS=$lt_save_ifs
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm=$ac_dir/$lt_tmp_nm
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
+ case $build_os in
+ mingw*) lt_bad_file=conftest.nm/nofile ;;
+ *) lt_bad_file=/dev/null ;;
+ esac
+ case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
+ *$lt_bad_file* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break 2
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break 2
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS=$lt_save_ifs
+ done
+ : ${lt_cv_path_NM=no}
+fi])
+if test no != "$lt_cv_path_NM"; then
+ NM=$lt_cv_path_NM
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+ case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols -headers"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+ AC_SUBST([DUMPBIN])
+ if test : != "$DUMPBIN"; then
+ NM=$DUMPBIN
+ fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+ [lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+ cat conftest.out >&AS_MESSAGE_LOG_FD
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh;
+ # decide which one to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd=$ECHO
+ ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+ [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+ [lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*])
+if test yes != "$lt_cv_path_mainfest_tool"; then
+ MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# _LT_DLL_DEF_P([FILE])
+# ---------------------
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with func_dll_def_p in the libtool script
+AC_DEFUN([_LT_DLL_DEF_P],
+[dnl
+ test DEF = "`$SED -n dnl
+ -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace
+ -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments
+ -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl
+ -e q dnl Only consider the first "real" line
+ $1`" dnl
+])# _LT_DLL_DEF_P
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM=-lm)
+ ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test yes = "$GCC"; then
+ case $cc_basename in
+ nvcc*)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+ esac
+
+ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+ [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*)
+ if test ia64 = "$host_cpu"; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris*)
+ symcode='[[BDRT]]'
+ ;;
+sco3.2v5*)
+ symcode='[[DT]]'
+ ;;
+sysv4.2uw2*)
+ symcode='[[DT]]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[[ABDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Gets list of data symbols to import.
+ lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'"
+ # Adjust the below global symbol transforms to fixup imported variables.
+ lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+ lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
+ lt_c_name_lib_hook="\
+ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
+ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
+else
+ # Disable hooks by default.
+ lt_cv_sys_global_symbol_to_import=
+ lt_cdecl_hook=
+ lt_c_name_hook=
+ lt_c_name_lib_hook=
+fi
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="$SED -n"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
+
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function,
+ # D for any global variable and I for any imported variable.
+ # Also find C++ and __fastcall symbols from MSVC++ or ICC,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK ['"\
+" {last_section=section; section=\$ 3};"\
+" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx]"
+ else
+ lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD
+ if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT@&t@_DLSYM_CONST
+#elif defined __osf__
+/* This system does not cope well with relocations in const data. */
+# define LT@&t@_DLSYM_CONST
+#else
+# define LT@&t@_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT@&t@_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS=conftstm.$ac_objext
+ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test yes = "$pipe_works"; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+ [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+ [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
+ [Transform the output of nm into a list of symbols to manually relocate])
+_LT_DECL([global_symbol_to_c_name_address],
+ [lt_cv_sys_global_symbol_to_c_name_address], [1],
+ [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+ [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
+ [The name lister interface])
+_LT_DECL([], [nm_file_list_spec], [1],
+ [Specify filename containing input files for $NM])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+m4_if([$1], [CXX], [
+ # C++ specific cases for pic, static, wl, etc.
+ if test yes = "$GXX"; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the '-m68020' flag to GCC prevents building anything better,
+ # like '-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ case $host_os in
+ os2*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[[4-9]]*)
+ # All AIX code is PIC.
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly* | midnightbsd*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+ if test ia64 != "$host_cpu"; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64, which still supported -KPIC.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | $SED 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd* | netbsdelf*-gnu)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the '-m68020' flag to GCC prevents building anything better,
+ # like '-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ case $host_os in
+ os2*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+ if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
+ fi
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ case $cc_basename in
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ case $host_os in
+ os2*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+ ;;
+ esac
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ # old Intel for x86_64, which still supported -KPIC.
+ ecc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # flang / f18. f95 an alias for gfortran or flang on Debian
+ flang* | f18* | f95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ tcc*)
+ # Fabrice Bellard et al's Tiny C Compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ ccc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | $SED 5q` in
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ *Sun\ F* | *Sun*Fortran*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ *Intel*\ [[CF]]*Compiler*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ *Portland\ Group*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ rdos*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ unicos*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+case $host_os in
+ # For platforms that do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+ [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ [Additional compiler flags for building library objects])
+
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+ $lt_tmp_static_flag,
+ [],
+ [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ case $host_os in
+ aix[[4-9]]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+ # Without the "-l" option, or with the "-B" option, AIX nm treats
+ # weak defined symbols like other global defined symbols, whereas
+ # GNU nm marks them as "W".
+ # While the 'weak' keyword is ignored in the Export File, we need
+ # it in the Import File for the 'aix-soname' feature, so we have
+ # to replace the "-B" option with "-P" for AIX nm.
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
+ ;;
+ cygwin* | mingw* | cegcc*)
+ case $cc_basename in
+ cl* | icl*)
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | gnu*)
+ _LT_TAGVAR(link_all_deplibs, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+], [
+ runpath_var=
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)=
+ _LT_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_TAGVAR(compiler_needs_object, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(hardcode_automatic, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(inherit_rpath, $1)=no
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(module_cmds, $1)=
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ' (' and ')$', so one must not match beginning or
+ # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+ # as well as any symbol that contains 'd'.
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++ or Intel C++ Compiler.
+ if test yes != "$GCC"; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
+ with_gnu_ld=yes
+ ;;
+ openbsd* | bitrig*)
+ with_gnu_ld=no
+ ;;
+ linux* | k*bsd*-gnu | gnu*)
+ _LT_TAGVAR(link_all_deplibs, $1)=no
+ ;;
+ esac
+
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test yes = "$with_gnu_ld"; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+ *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test yes = "$lt_use_gnu_ld_interface"; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='$wl'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[[3-9]]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test ia64 != "$host_cpu"; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file, use it as
+ # is; otherwise, prepend EXPORTS...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ shrext_cmds=.dll
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ prefix_cmds="$SED"~
+ if test EXPORTS = "`$SED 1q $export_symbols`"; then
+ prefix_cmds="$prefix_cmds -e 1d";
+ fi~
+ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test linux-dietlibc = "$host_os"; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test no = "$tmp_diet"
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ tmp_sharedflag='--shared' ;;
+ nagfor*) # NAGFOR 5.3
+ tmp_sharedflag='-Wl,-shared' ;;
+ xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | $SED 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+
+ if test yes = "$supports_anon_versioning"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ tcc*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
+ ;;
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test yes = "$supports_anon_versioning"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
+ runpath_var=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test ia64 = "$host_cpu"; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+ # Without the "-l" option, or with the "-B" option, AIX nm treats
+ # weak defined symbols like other global defined symbols, whereas
+ # GNU nm marks them as "W".
+ # While the 'weak' keyword is ignored in the Export File, we need
+ # it in the Import File for the 'aix-soname' feature, so we have
+ # to replace the "-B" option with "-P" for AIX nm.
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # have runtime linking enabled, and use it for executables.
+ # For shared libraries, we enable/disable runtime linking
+ # depending on the kind of the shared library created -
+ # when "with_aix_soname,aix_use_runtimelinking" is:
+ # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
+ # "aix,yes" lib.so shared, rtl:yes, for executables
+ # lib.a static archive
+ # "both,no" lib.so.V(shr.o) shared, rtl:yes
+ # lib.a(lib.so.V) shared, rtl:no, for executables
+ # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a(lib.so.V) shared, rtl:no
+ # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a static archive
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+ # With aix-soname=svr4, we create the lib.so.V shared archives only,
+ # so we don't have lib.a shared libs to link our executables.
+ # We have to force runtime linking in this case.
+ aix_use_runtimelinking=yes
+ LDFLAGS="$LDFLAGS -Wl,-brtl"
+ fi
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
+ case $with_aix_soname,$aix_use_runtimelinking in
+ aix,*) ;; # traditional, no import file
+ svr4,* | *,yes) # use import file
+ # The Import File defines what to hardcode.
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ ;;
+ esac
+
+ if test yes = "$GCC"; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`$CC -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag="$shared_flag "'$wl-G'
+ fi
+ # Need to ensure runtime linking is disabled for the traditional
+ # shared library, or the linker may eventually find shared libraries
+ # /with/ Import File - we do not want to mix them.
+ shared_flag_aix='-shared'
+ shared_flag_svr4='-shared $wl-G'
+ else
+ # not using gcc
+ if test ia64 = "$host_cpu"; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag='$wl-G'
+ else
+ shared_flag='$wl-bM:SRE'
+ fi
+ shared_flag_aix='$wl-bM:SRE'
+ shared_flag_svr4='$wl-G'
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+ else
+ if test ia64 = "$host_cpu"; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+ if test yes = "$with_gnu_ld"; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+ # -brtl affects multiple linker settings, -berok does not and is overridden later
+ compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
+ if test svr4 != "$with_aix_soname"; then
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+ fi
+ if test aix != "$with_aix_soname"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
+ else
+ # used by -dlpreopen to get the symbols
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
+ fi
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[[45]]*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++ or Intel C++ Compiler.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl* | icl*)
+ # Native MSVC or ICC
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=.dll
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+ cp "$export_symbols" "$output_objdir/$soname.def";
+ echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+ else
+ $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile=$lt_outputfile.exe
+ lt_tool_outputfile=$lt_tool_outputfile.exe
+ ;;
+ esac~
+ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC and ICC wrapper
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=.dll
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2.*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly* | midnightbsd*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ ;;
+
+ hpux10*)
+ if test yes,no = "$GCC,$with_gnu_ld"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test no = "$with_gnu_ld"; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test yes,no = "$GCC,$with_gnu_ld"; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ m4_if($1, [], [
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ _LT_LINKER_OPTION([if $CC understands -b],
+ _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+ [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+ ;;
+ esac
+ fi
+ if test no = "$with_gnu_ld"; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+ [lt_cv_irix_exported_symbol],
+ [save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(
+ [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+ [C++], [[int foo (void) { return 0; }]],
+ [Fortran 77], [[
+ subroutine foo
+ end]],
+ [Fortran], [[
+ subroutine foo
+ end]])])],
+ [lt_cv_irix_exported_symbol=yes],
+ [lt_cv_irix_exported_symbol=no])
+ LDFLAGS=$save_LDFLAGS])
+ if test yes = "$lt_cv_irix_exported_symbol"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=no
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ linux*)
+ case $cc_basename in
+ tcc*)
+ # Fabrice Bellard et al's Tiny C Compiler
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ ;;
+ esac
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd* | bitrig*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ fi
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ shrext_cmds=.dll
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ prefix_cmds="$SED"~
+ if test EXPORTS = "`$SED 1q $export_symbols`"; then
+ prefix_cmds="$prefix_cmds -e 1d";
+ fi~
+ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ ;;
+
+ osf3*)
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+ if test yes = "$GCC"; then
+ wlarc='$wl'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='$wl'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands '-z linker_flag'. GCC discards it without '$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test sequent = "$host_vendor"; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We CANNOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ if test sni = "$host_vendor"; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+ [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test yes,yes = "$GCC,$enable_shared"; then
+ case $_LT_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+ [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+ [$RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+ then
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ ])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+ [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+ [enable_shared_with_static_runtimes], [0],
+ [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+ [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+ [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+ [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+ [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+ [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+ [Commands used to build a loadable module if different from building
+ a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+ [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+ [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+ [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+ [Flag to hardcode $libdir into a binary during linking.
+ This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+ [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+ [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
+ DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+ [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
+ DIR into the resulting binary and the resulting library dependency is
+ "absolute", i.e impossible to change by setting $shlibpath_var if the
+ library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+ [Set to "yes" if building a shared library automatically hardcodes DIR
+ into the library and all subsequent libraries and executables linked
+ against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+ [Set to yes if linker adds runtime paths of dependent libraries
+ to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+ [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [always_export_symbols], [0],
+ [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+ [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+ [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+ [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+ [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+ [Commands necessary for finishing linking programs])
+_LT_TAGDECL([], [file_list_spec], [1],
+ [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC=$CC
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+ LT_SYS_DLOPEN_SELF
+ _LT_CMD_STRIPLIB
+
+ # Report what library types will actually be built
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test no = "$can_build_shared" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test yes = "$enable_shared" && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test ia64 != "$host_cpu"; then
+ case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+ yes,aix,yes) ;; # shared object as lib.so file only
+ yes,svr4,*) ;; # shared object as lib.so archive member only
+ yes,*) enable_static=no ;; # shared object in lib.a archive as well
+ esac
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test yes = "$enable_shared" || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC=$lt_save_CC
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test no != "$CXX" &&
+ ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
+ (test g++ != "$CXX"))); then
+ AC_PROG_CXXCPP
+else
+ _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test yes != "$_lt_caught_CXX_error"; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test yes = "$GXX"; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+ else
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+ fi
+
+ if test yes = "$GXX"; then
+ # Set up default GNU C++ configuration
+
+ LT_PATH_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test yes = "$with_gnu_ld"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='$wl'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix[[4-9]]*)
+ if test ia64 = "$host_cpu"; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # have runtime linking enabled, and use it for executables.
+ # For shared libraries, we enable/disable runtime linking
+ # depending on the kind of the shared library created -
+ # when "with_aix_soname,aix_use_runtimelinking" is:
+ # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
+ # "aix,yes" lib.so shared, rtl:yes, for executables
+ # lib.a static archive
+ # "both,no" lib.so.V(shr.o) shared, rtl:yes
+ # lib.a(lib.so.V) shared, rtl:no, for executables
+ # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a(lib.so.V) shared, rtl:no
+ # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a static archive
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+ # With aix-soname=svr4, we create the lib.so.V shared archives only,
+ # so we don't have lib.a shared libs to link our executables.
+ # We have to force runtime linking in this case.
+ aix_use_runtimelinking=yes
+ LDFLAGS="$LDFLAGS -Wl,-brtl"
+ fi
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
+ case $with_aix_soname,$aix_use_runtimelinking in
+ aix,*) ;; # no import file
+ svr4,* | *,yes) # use import file
+ # The Import File defines what to hardcode.
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ ;;
+ esac
+
+ if test yes = "$GXX"; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`$CC -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag=$shared_flag' $wl-G'
+ fi
+ # Need to ensure runtime linking is disabled for the traditional
+ # shared library, or the linker may eventually find shared libraries
+ # /with/ Import File - we do not want to mix them.
+ shared_flag_aix='-shared'
+ shared_flag_svr4='-shared $wl-G'
+ else
+ # not using gcc
+ if test ia64 = "$host_cpu"; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag='$wl-G'
+ else
+ shared_flag='$wl-bM:SRE'
+ fi
+ shared_flag_aix='$wl-bM:SRE'
+ shared_flag_svr4='$wl-G'
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ # The "-G" linker flag allows undefined symbols.
+ _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+ else
+ if test ia64 = "$host_cpu"; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+ if test yes = "$with_gnu_ld"; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+ # -brtl affects multiple linker settings, -berok does not and is overridden later
+ compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
+ if test svr4 != "$with_aix_soname"; then
+ # This is similar to how AIX traditionally builds its shared
+ # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+ fi
+ if test aix != "$with_aix_soname"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
+ else
+ # used by -dlpreopen to get the symbols
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
+ fi
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $GXX,$cc_basename in
+ ,cl* | no,cl* | ,icl* | no,icl*)
+ # Native MSVC or ICC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=.dll
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+ cp "$export_symbols" "$output_objdir/$soname.def";
+ echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+ else
+ $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile=$lt_outputfile.exe
+ lt_tool_outputfile=$lt_tool_outputfile.exe
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file, use it as
+ # is; otherwise, prepend EXPORTS...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ shrext_cmds=.dll
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ prefix_cmds="$SED"~
+ if test EXPORTS = "`$SED 1q $export_symbols`"; then
+ prefix_cmds="$prefix_cmds -e 1d";
+ fi~
+ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ freebsd2.*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ freebsd-elf*)
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+
+ freebsd* | dragonfly* | midnightbsd*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ hpux9*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test yes = "$GXX"; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test no = "$with_gnu_ld"; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test yes = "$GXX"; then
+ if test no = "$with_gnu_ld"; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test yes = "$GXX"; then
+ if test no = "$with_gnu_ld"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
+ fi
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ ;;
+ xl* | mpixl* | bgxl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ if test yes = "$supports_anon_versioning"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | $SED 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ openbsd* | bitrig*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=func_echo_all
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
+ $RM $lib.exp'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test yes,no = "$GXX,$with_gnu_ld"; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+ case $host in
+ osf3*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands '-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test yes,no = "$GXX,$with_gnu_ld"; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
+ else
+ # g++ 2.7 appears to require '-G' NOT '-shared' on this
+ # platform.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
+ fi
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We CANNOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+ '"$_LT_TAGVAR(old_archive_cmds, $1)"
+ _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+ '"$_LT_TAGVAR(reload_cmds, $1)"
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+ test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
+
+ _LT_TAGVAR(GCC, $1)=$GXX
+ _LT_TAGVAR(LD, $1)=$LD
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test yes != "$_lt_caught_CXX_error"
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+ case @S|@2 in
+ .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
+ *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
+ esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+_LT_EOF
+], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
+package foo
+func foo() {
+}
+_LT_EOF
+])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case $prev$p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test x-L = "$p" ||
+ test x-R = "$p"; then
+ prev=$p
+ continue
+ fi
+
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test no = "$pre_test_object_deps_done"; then
+ case $prev in
+ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
+ else
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+ _LT_TAGVAR(postdeps, $1)=$prev$p
+ else
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
+ fi
+ fi
+ prev=
+ ;;
+
+ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test no = "$pre_test_object_deps_done"; then
+ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+ _LT_TAGVAR(predep_objects, $1)=$p
+ else
+ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+ _LT_TAGVAR(postdep_objects, $1)=$p
+ else
+ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_TAGVAR(predep_objects,$1)=
+ _LT_TAGVAR(postdep_objects,$1)=
+ _LT_TAGVAR(postdeps,$1)=
+ ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+ [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+ [Dependencies to place before and after the objects being linked to
+ create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+ [The library search path used internally by the compiler when linking
+ a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test no = "$F77"; then
+ _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test yes != "$_lt_disable_F77"; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${F77-"f77"}
+ CFLAGS=$FFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+ GCC=$G77
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test no = "$can_build_shared" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test yes = "$enable_shared" && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test ia64 != "$host_cpu"; then
+ case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+ yes,aix,yes) ;; # shared object as lib.so file only
+ yes,svr4,*) ;; # shared object as lib.so archive member only
+ yes,*) enable_static=no ;; # shared object in lib.a archive as well
+ esac
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test yes = "$enable_shared" || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)=$G77
+ _LT_TAGVAR(LD, $1)=$LD
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+fi # test yes != "$_lt_disable_F77"
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test no = "$FC"; then
+ _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test yes != "$_lt_disable_FC"; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${FC-"f95"}
+ CFLAGS=$FCFLAGS
+ compiler=$CC
+ GCC=$ac_cv_fc_compiler_gnu
+
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test no = "$can_build_shared" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test yes = "$enable_shared" && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test ia64 != "$host_cpu"; then
+ case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+ yes,aix,yes) ;; # shared object as lib.so file only
+ yes,svr4,*) ;; # shared object as lib.so archive member only
+ yes,*) enable_static=no ;; # shared object in lib.a archive as well
+ esac
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test yes = "$enable_shared" || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
+ _LT_TAGVAR(LD, $1)=$LD
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+fi # test yes != "$_lt_disable_FC"
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)=$LD
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_GO_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Go compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_GO_CONFIG],
+[AC_REQUIRE([LT_PROG_GO])dnl
+AC_LANG_SAVE
+
+# Source file extension for Go test sources.
+ac_ext=go
+
+# Object file extension for compiled Go test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="package main; func main() { }"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='package main; func main() { }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GOC-"gccgo"}
+CFLAGS=$GOFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)=$LD
+_LT_CC_BASENAME([$compiler])
+
+# Go did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GO_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code=$lt_simple_compile_test_code
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+CFLAGS=
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+ :
+ _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+ [AC_CHECK_TOOL(GCJ, gcj,)
+ test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_GO
+# ----------
+AC_DEFUN([LT_PROG_GO],
+[AC_CHECK_TOOL(GOC, gccgo,)
+])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
+
+# _LT_DECL_FILECMD
+# ----------------
+# Check for a file(cmd) program that can be used to detect file type and magic
+m4_defun([_LT_DECL_FILECMD],
+[AC_CHECK_TOOL([FILECMD], [file], [:])
+_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types])
+])# _LD_DECL_FILECMD
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+ [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f "$lt_ac_sed" && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test 10 -lt "$lt_ac_count" && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test "$lt_ac_count" -gt "$lt_ac_max"; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine what file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+ [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+ [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/gl/m4/limits-h.m4 b/gl/m4/limits-h.m4
new file mode 100644
index 0000000..5d5a5bf
--- /dev/null
+++ b/gl/m4/limits-h.m4
@@ -0,0 +1,41 @@
+dnl Check whether limits.h has needed features.
+
+dnl Copyright 2016-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+AC_DEFUN_ONCE([gl_LIMITS_H],
+[
+ gl_CHECK_NEXT_HEADERS([limits.h])
+
+ AC_CACHE_CHECK([whether limits.h has WORD_BIT, BOOL_WIDTH etc.],
+ [gl_cv_header_limits_width],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+ #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+ #endif
+ #include <limits.h>
+ long long llm = LLONG_MAX;
+ int wb = WORD_BIT;
+ int ullw = ULLONG_WIDTH;
+ int bw = BOOL_WIDTH;
+ ]])],
+ [gl_cv_header_limits_width=yes],
+ [gl_cv_header_limits_width=no])])
+ if test "$gl_cv_header_limits_width" = yes; then
+ GL_GENERATE_LIMITS_H=false
+ else
+ GL_GENERATE_LIMITS_H=true
+ fi
+])
+
+dnl Unconditionally enables the replacement of <limits.h>.
+AC_DEFUN([gl_REPLACE_LIMITS_H],
+[
+ AC_REQUIRE([gl_LIMITS_H])
+ GL_GENERATE_LIMITS_H=true
+])
diff --git a/gl/m4/localcharset.m4 b/gl/m4/localcharset.m4
new file mode 100644
index 0000000..f5dbbd4
--- /dev/null
+++ b/gl/m4/localcharset.m4
@@ -0,0 +1,11 @@
+# localcharset.m4 serial 8
+dnl Copyright (C) 2002, 2004, 2006, 2009-2022 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_LOCALCHARSET],
+[
+ dnl Prerequisites of lib/localcharset.c.
+ AC_REQUIRE([AM_LANGINFO_CODESET])
+])
diff --git a/gl/m4/locale-fr.m4 b/gl/m4/locale-fr.m4
new file mode 100644
index 0000000..3753891
--- /dev/null
+++ b/gl/m4/locale-fr.m4
@@ -0,0 +1,253 @@
+# locale-fr.m4 serial 20
+dnl Copyright (C) 2003, 2005-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl Determine the name of a french locale with traditional encoding.
+AC_DEFUN([gt_LOCALE_FR],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([AM_LANGINFO_CODESET])
+ AC_CACHE_CHECK([for a traditional french locale], [gt_cv_locale_fr], [
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+ /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
+ imitates locale dependent behaviour by looking at the environment
+ variables, and all locales use the UTF-8 encoding. */
+#if defined __BEOS__ || defined __HAIKU__
+ return 1;
+#else
+ /* Check whether the given locale name is recognized by the system. */
+# if defined _WIN32 && !defined __CYGWIN__
+ /* On native Windows, setlocale(category, "") looks at the system settings,
+ not at the environment variables. Also, when an encoding suffix such
+ as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
+ category of the locale to "C". */
+ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+ || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ return 1;
+# else
+ if (setlocale (LC_ALL, "") == NULL) return 1;
+# endif
+ /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
+ On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+ is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
+ On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+ succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+ some unit tests fail.
+ On MirBSD 10, when an unsupported locale is specified, setlocale()
+ succeeds but then nl_langinfo(CODESET) is "UTF-8". */
+# if HAVE_LANGINFO_CODESET
+ {
+ const char *cs = nl_langinfo (CODESET);
+ if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+ || strcmp (cs, "UTF-8") == 0)
+ return 1;
+ }
+# endif
+# ifdef __CYGWIN__
+ /* On Cygwin, avoid locale names without encoding suffix, because the
+ locale_charset() function relies on the encoding suffix. Note that
+ LC_ALL is set on the command line. */
+ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+ /* Check whether in the abbreviation of the second month, the second
+ character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
+ one byte long. This excludes the UTF-8 encoding. */
+ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+ if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
+# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
+ /* Check whether the decimal separator is a comma.
+ On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+ are nl_langinfo(RADIXCHAR) are both ".". */
+ if (localeconv () ->decimal_point[0] != ',') return 1;
+# endif
+ return 0;
+#endif
+}
+ ]])])
+ if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
+ case "$host_os" in
+ # Handle native Windows specially, because there setlocale() interprets
+ # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+ # "fr" or "fra" as "French" or "French_France.1252",
+ # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+ # "ja" as "Japanese" or "Japanese_Japan.932",
+ # and similar.
+ mingw*)
+ # Test for the native Windows locale name.
+ if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr=French_France.1252
+ else
+ # None found.
+ gt_cv_locale_fr=none
+ fi
+ ;;
+ *)
+ # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+ # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
+ # configure script would override the LC_ALL setting. Likewise for
+ # LC_CTYPE, which is also set at the beginning of the configure script.
+ # Test for the usual locale name.
+ if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr=fr_FR
+ else
+ # Test for the locale name with explicit encoding suffix.
+ if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr=fr_FR.ISO-8859-1
+ else
+ # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
+ if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr=fr_FR.ISO8859-1
+ else
+ # Test for the HP-UX locale name.
+ if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr=fr_FR.iso88591
+ else
+ # Test for the Solaris 7 locale name.
+ if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr=fr
+ else
+ # None found.
+ gt_cv_locale_fr=none
+ fi
+ fi
+ fi
+ fi
+ fi
+ ;;
+ esac
+ fi
+ rm -fr conftest*
+ ])
+ LOCALE_FR=$gt_cv_locale_fr
+ AC_SUBST([LOCALE_FR])
+])
+
+dnl Determine the name of a french locale with UTF-8 encoding.
+AC_DEFUN([gt_LOCALE_FR_UTF8],
+[
+ AC_REQUIRE([AM_LANGINFO_CODESET])
+ AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+ /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
+ imitates locale dependent behaviour by looking at the environment
+ variables, and all locales use the UTF-8 encoding. */
+#if !(defined __BEOS__ || defined __HAIKU__)
+ /* Check whether the given locale name is recognized by the system. */
+# if defined _WIN32 && !defined __CYGWIN__
+ /* On native Windows, setlocale(category, "") looks at the system settings,
+ not at the environment variables. Also, when an encoding suffix such
+ as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
+ category of the locale to "C". */
+ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+ || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ return 1;
+# else
+ if (setlocale (LC_ALL, "") == NULL) return 1;
+# endif
+ /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
+ On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+ is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
+ On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+ succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+ some unit tests fail. */
+# if HAVE_LANGINFO_CODESET
+ {
+ const char *cs = nl_langinfo (CODESET);
+ if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
+ return 1;
+ }
+# endif
+# ifdef __CYGWIN__
+ /* On Cygwin, avoid locale names without encoding suffix, because the
+ locale_charset() function relies on the encoding suffix. Note that
+ LC_ALL is set on the command line. */
+ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+ /* Check whether in the abbreviation of the second month, the second
+ character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
+ two bytes long, with UTF-8 encoding. */
+ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+ if (strftime (buf, sizeof (buf), "%b", &t) < 4
+ || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
+ return 1;
+#endif
+#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
+ /* Check whether the decimal separator is a comma.
+ On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+ are nl_langinfo(RADIXCHAR) are both ".". */
+ if (localeconv () ->decimal_point[0] != ',') return 1;
+#endif
+ return 0;
+}
+ ]])])
+ if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
+ case "$host_os" in
+ # Handle native Windows specially, because there setlocale() interprets
+ # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+ # "fr" or "fra" as "French" or "French_France.1252",
+ # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+ # "ja" as "Japanese" or "Japanese_Japan.932",
+ # and similar.
+ mingw*)
+ # Test for the hypothetical native Windows locale name.
+ if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr_utf8=French_France.65001
+ else
+ # None found.
+ gt_cv_locale_fr_utf8=none
+ fi
+ ;;
+ *)
+ # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+ # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
+ # configure script would override the LC_ALL setting. Likewise for
+ # LC_CTYPE, which is also set at the beginning of the configure script.
+ # Test for the usual locale name.
+ if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr_utf8=fr_FR
+ else
+ # Test for the locale name with explicit encoding suffix.
+ if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr_utf8=fr_FR.UTF-8
+ else
+ # Test for the Solaris 7 locale name.
+ if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr_utf8=fr.UTF-8
+ else
+ # None found.
+ gt_cv_locale_fr_utf8=none
+ fi
+ fi
+ fi
+ ;;
+ esac
+ fi
+ rm -fr conftest*
+ ])
+ LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+ AC_SUBST([LOCALE_FR_UTF8])
+])
diff --git a/gl/m4/locale-ja.m4 b/gl/m4/locale-ja.m4
new file mode 100644
index 0000000..73a5d1a
--- /dev/null
+++ b/gl/m4/locale-ja.m4
@@ -0,0 +1,143 @@
+# locale-ja.m4 serial 15
+dnl Copyright (C) 2003, 2005-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl Determine the name of a japanese locale with EUC-JP encoding.
+AC_DEFUN([gt_LOCALE_JA],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([AM_LANGINFO_CODESET])
+ AC_CACHE_CHECK([for a traditional japanese locale], [gt_cv_locale_ja], [
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main ()
+{
+ /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
+ imitates locale dependent behaviour by looking at the environment
+ variables, and all locales use the UTF-8 encoding. */
+#if defined __BEOS__ || defined __HAIKU__
+ return 1;
+#else
+ /* Check whether the given locale name is recognized by the system. */
+# if defined _WIN32 && !defined __CYGWIN__
+ /* On native Windows, setlocale(category, "") looks at the system settings,
+ not at the environment variables. Also, when an encoding suffix such
+ as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
+ category of the locale to "C". */
+ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+ || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ return 1;
+# else
+ if (setlocale (LC_ALL, "") == NULL) return 1;
+# endif
+ /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
+ On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+ is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
+ On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+ succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+ some unit tests fail.
+ On MirBSD 10, when an unsupported locale is specified, setlocale()
+ succeeds but then nl_langinfo(CODESET) is "UTF-8". */
+# if HAVE_LANGINFO_CODESET
+ {
+ const char *cs = nl_langinfo (CODESET);
+ if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+ || strcmp (cs, "UTF-8") == 0)
+ return 1;
+ }
+# endif
+# ifdef __CYGWIN__
+ /* On Cygwin, avoid locale names without encoding suffix, because the
+ locale_charset() function relies on the encoding suffix. Note that
+ LC_ALL is set on the command line. */
+ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+ /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales
+ on Cygwin 1.5.x. */
+ if (MB_CUR_MAX == 1)
+ return 1;
+ /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
+ This excludes the UTF-8 encoding (except on MirBSD). */
+ {
+ const char *p;
+ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+ if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+ for (p = buf; *p != '\0'; p++)
+ if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+ return 1;
+ }
+ return 0;
+#endif
+}
+ ]])])
+ if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
+ case "$host_os" in
+ # Handle native Windows specially, because there setlocale() interprets
+ # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+ # "fr" or "fra" as "French" or "French_France.1252",
+ # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+ # "ja" as "Japanese" or "Japanese_Japan.932",
+ # and similar.
+ mingw*)
+ # Note that on native Windows, the Japanese locale is
+ # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we
+ # cannot use it here.
+ gt_cv_locale_ja=none
+ ;;
+ *)
+ # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+ # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
+ # configure script would override the LC_ALL setting. Likewise for
+ # LC_CTYPE, which is also set at the beginning of the configure script.
+ # Test for the AIX locale name.
+ if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_ja=ja_JP
+ else
+ # Test for the locale name with explicit encoding suffix.
+ if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_ja=ja_JP.EUC-JP
+ else
+ # Test for the HP-UX, OSF/1, NetBSD locale name.
+ if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_ja=ja_JP.eucJP
+ else
+ # Test for the IRIX, FreeBSD locale name.
+ if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_ja=ja_JP.EUC
+ else
+ # Test for the Solaris 7 locale name.
+ if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_ja=ja
+ else
+ # Special test for NetBSD 1.6.
+ if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
+ gt_cv_locale_ja=ja_JP.eucJP
+ else
+ # None found.
+ gt_cv_locale_ja=none
+ fi
+ fi
+ fi
+ fi
+ fi
+ fi
+ ;;
+ esac
+ fi
+ rm -fr conftest*
+ ])
+ LOCALE_JA=$gt_cv_locale_ja
+ AC_SUBST([LOCALE_JA])
+])
diff --git a/gl/m4/locale-zh.m4 b/gl/m4/locale-zh.m4
new file mode 100644
index 0000000..c997971
--- /dev/null
+++ b/gl/m4/locale-zh.m4
@@ -0,0 +1,137 @@
+# locale-zh.m4 serial 15
+dnl Copyright (C) 2003, 2005-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl Determine the name of a chinese locale with GB18030 encoding.
+AC_DEFUN([gt_LOCALE_ZH_CN],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([AM_LANGINFO_CODESET])
+ AC_CACHE_CHECK([for a transitional chinese locale], [gt_cv_locale_zh_CN], [
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[
+#include <locale.h>
+#include <stdlib.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main ()
+{
+ /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
+ imitates locale dependent behaviour by looking at the environment
+ variables, and all locales use the UTF-8 encoding. */
+#if defined __BEOS__ || defined __HAIKU__
+ return 1;
+#else
+ /* Check whether the given locale name is recognized by the system. */
+# if defined _WIN32 && !defined __CYGWIN__
+ /* On native Windows, setlocale(category, "") looks at the system settings,
+ not at the environment variables. Also, when an encoding suffix such
+ as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
+ category of the locale to "C". */
+ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+ || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ return 1;
+# else
+ if (setlocale (LC_ALL, "") == NULL) return 1;
+# endif
+ /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
+ On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+ is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
+ On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+ succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+ some unit tests fail.
+ On MirBSD 10, when an unsupported locale is specified, setlocale()
+ succeeds but then nl_langinfo(CODESET) is "UTF-8". */
+# if HAVE_LANGINFO_CODESET
+ {
+ const char *cs = nl_langinfo (CODESET);
+ if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+ || strcmp (cs, "UTF-8") == 0)
+ return 1;
+ }
+# endif
+# ifdef __CYGWIN__
+ /* On Cygwin, avoid locale names without encoding suffix, because the
+ locale_charset() function relies on the encoding suffix. Note that
+ LC_ALL is set on the command line. */
+ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+ /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
+ This excludes the UTF-8 encoding (except on MirBSD). */
+ {
+ const char *p;
+ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+ if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+ for (p = buf; *p != '\0'; p++)
+ if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+ return 1;
+ }
+ /* Check whether a typical GB18030 multibyte sequence is recognized as a
+ single wide character. This excludes the GB2312 and GBK encodings. */
+ if (mblen ("\203\062\332\066", 5) != 4)
+ return 1;
+ return 0;
+#endif
+}
+ ]])])
+ if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
+ case "$host_os" in
+ # Handle native Windows specially, because there setlocale() interprets
+ # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+ # "fr" or "fra" as "French" or "French_France.1252",
+ # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+ # "ja" as "Japanese" or "Japanese_Japan.932",
+ # and similar.
+ mingw*)
+ # Test for the hypothetical native Windows locale name.
+ if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_zh_CN=Chinese_China.54936
+ else
+ # None found.
+ gt_cv_locale_zh_CN=none
+ fi
+ ;;
+ solaris2.8)
+ # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
+ # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
+ # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
+ gt_cv_locale_zh_CN=none
+ ;;
+ *)
+ # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+ # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
+ # configure script would override the LC_ALL setting. Likewise for
+ # LC_CTYPE, which is also set at the beginning of the configure script.
+ # Test for the locale name without encoding suffix.
+ if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_zh_CN=zh_CN
+ else
+ # Test for the locale name with explicit encoding suffix.
+ if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_zh_CN=zh_CN.GB18030
+ else
+ # None found.
+ gt_cv_locale_zh_CN=none
+ fi
+ fi
+ ;;
+ esac
+ else
+ # If there was a link error, due to mblen(), the system is so old that
+ # it certainly doesn't have a chinese locale.
+ gt_cv_locale_zh_CN=none
+ fi
+ rm -fr conftest*
+ ])
+ LOCALE_ZH_CN=$gt_cv_locale_zh_CN
+ AC_SUBST([LOCALE_ZH_CN])
+])
diff --git a/gl/m4/locale_h.m4 b/gl/m4/locale_h.m4
new file mode 100644
index 0000000..ca5d0d0
--- /dev/null
+++ b/gl/m4/locale_h.m4
@@ -0,0 +1,174 @@
+# locale_h.m4 serial 28
+dnl Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_LOCALE_H],
+[
+ dnl Ensure to expand the default settings once only, before all statements
+ dnl that occur in other macros.
+ AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
+
+ dnl Persuade glibc <locale.h> to define locale_t and the int_p_*, int_n_*
+ dnl members of 'struct lconv'.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ dnl If <stddef.h> is replaced, then <locale.h> must also be replaced.
+ AC_REQUIRE([gl_STDDEF_H])
+
+ AC_REQUIRE([gl_LOCALE_T])
+
+ dnl Solaris 11.0 defines the int_p_*, int_n_* members of 'struct lconv'
+ dnl only if _LCONV_C99 is defined.
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ solaris*)
+ AC_DEFINE([_LCONV_C99], [1], [Define to 1 on Solaris.])
+ ;;
+ esac
+
+ AC_CACHE_CHECK([whether locale.h conforms to POSIX:2001],
+ [gl_cv_header_locale_h_posix2001],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <locale.h>
+ int x = LC_MESSAGES;
+ int y = sizeof (((struct lconv *) 0)->decimal_point);]],
+ [[]])],
+ [gl_cv_header_locale_h_posix2001=yes],
+ [gl_cv_header_locale_h_posix2001=no])])
+
+ dnl Check whether 'struct lconv' is complete.
+ dnl Bionic libc's 'struct lconv' is just a dummy.
+ dnl On OpenBSD 4.9, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, Cygwin 1.5.x,
+ dnl mingw, MSVC 9, it lacks the int_p_* and int_n_* members.
+ AC_CACHE_CHECK([whether struct lconv is properly defined],
+ [gl_cv_sys_struct_lconv_ok],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <locale.h>
+ struct lconv l;
+ int x = sizeof (l.decimal_point);
+ int y = sizeof (l.int_p_cs_precedes);]],
+ [[]])],
+ [gl_cv_sys_struct_lconv_ok=yes],
+ [gl_cv_sys_struct_lconv_ok=no])
+ ])
+ if test $gl_cv_sys_struct_lconv_ok = no; then
+ dnl On native Windows with MSVC, merely define these member names as macros.
+ dnl This avoids trouble in C++ mode.
+ case "$host_os" in
+ mingw*)
+ AC_EGREP_CPP([Special], [
+#ifdef _MSC_VER
+ Special
+#endif
+ ],
+ [],
+ [REPLACE_STRUCT_LCONV=1])
+ ;;
+ *) REPLACE_STRUCT_LCONV=1 ;;
+ esac
+ fi
+
+ dnl <locale.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_NEXT_HEADERS([locale.h])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <locale.h>
+/* Some systems provide declarations in a non-standard header. */
+#if HAVE_XLOCALE_H
+# include <xlocale.h>
+#endif
+ ]],
+ [setlocale newlocale duplocale freelocale])
+])
+
+dnl Checks to determine whether the system has the locale_t type,
+dnl and how to obtain it.
+AC_DEFUN([gl_LOCALE_T],
+[
+ dnl Persuade glibc and Solaris <locale.h> to define locale_t.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ dnl Check whether use of locale_t requires inclusion of <xlocale.h>,
+ dnl e.g. on Mac OS X 10.5. If <locale.h> does not define locale_t by
+ dnl itself, we assume that <xlocale.h> will do so.
+ AC_CACHE_CHECK([whether locale.h defines locale_t],
+ [gl_cv_header_locale_has_locale_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <locale.h>
+ locale_t x;]],
+ [[]])],
+ [gl_cv_header_locale_has_locale_t=yes],
+ [gl_cv_header_locale_has_locale_t=no])
+ ])
+
+ dnl Check for <xlocale.h>.
+ AC_CHECK_HEADERS_ONCE([xlocale.h])
+ if test $ac_cv_header_xlocale_h = yes; then
+ HAVE_XLOCALE_H=1
+ if test $gl_cv_header_locale_has_locale_t = yes; then
+ gl_cv_header_locale_h_needs_xlocale_h=no
+ else
+ gl_cv_header_locale_h_needs_xlocale_h=yes
+ fi
+ HAVE_LOCALE_T=1
+ else
+ HAVE_XLOCALE_H=0
+ gl_cv_header_locale_h_needs_xlocale_h=no
+ if test $gl_cv_header_locale_has_locale_t = yes; then
+ HAVE_LOCALE_T=1
+ else
+ HAVE_LOCALE_T=0
+ fi
+ fi
+ AC_SUBST([HAVE_XLOCALE_H])
+])
+
+# gl_LOCALE_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_LOCALE_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_LOCALE_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_LOCALE_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_LOCALE_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALECONV])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE_NULL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUPLOCALE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALENAME])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_LOCALE_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_LOCALE_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_NEWLOCALE=1; AC_SUBST([HAVE_NEWLOCALE])
+ HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE])
+ HAVE_FREELOCALE=1; AC_SUBST([HAVE_FREELOCALE])
+ REPLACE_LOCALECONV=0; AC_SUBST([REPLACE_LOCALECONV])
+ REPLACE_SETLOCALE=0; AC_SUBST([REPLACE_SETLOCALE])
+ REPLACE_NEWLOCALE=0; AC_SUBST([REPLACE_NEWLOCALE])
+ REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE])
+ REPLACE_FREELOCALE=0; AC_SUBST([REPLACE_FREELOCALE])
+ REPLACE_STRUCT_LCONV=0; AC_SUBST([REPLACE_STRUCT_LCONV])
+ LOCALENAME_ENHANCE_LOCALE_FUNCS=0; AC_SUBST([LOCALENAME_ENHANCE_LOCALE_FUNCS])
+])
diff --git a/gl/m4/localeconv.m4 b/gl/m4/localeconv.m4
new file mode 100644
index 0000000..09c1a1a
--- /dev/null
+++ b/gl/m4/localeconv.m4
@@ -0,0 +1,22 @@
+# localeconv.m4 serial 1
+dnl Copyright (C) 2012-2022 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_LOCALECONV],
+[
+ AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
+ AC_REQUIRE([gl_LOCALE_H])
+
+ if test $REPLACE_STRUCT_LCONV = 1; then
+ REPLACE_LOCALECONV=1
+ fi
+])
+
+# Prerequisites of lib/localeconv.c.
+AC_DEFUN([gl_PREREQ_LOCALECONV],
+[
+ AC_CHECK_MEMBERS([struct lconv.decimal_point], [], [],
+ [[#include <locale.h>]])
+])
diff --git a/gl/m4/lock.m4 b/gl/m4/lock.m4
new file mode 100644
index 0000000..c4cbf07
--- /dev/null
+++ b/gl/m4/lock.m4
@@ -0,0 +1,47 @@
+# lock.m4 serial 14
+dnl Copyright (C) 2005-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_LOCK],
+[
+ AC_REQUIRE([gl_THREADLIB])
+ if test "$gl_threads_api" = posix; then
+ # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
+ # pthread_rwlock_* functions.
+ has_rwlock=false
+ AC_CHECK_TYPE([pthread_rwlock_t],
+ [has_rwlock=true
+ AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
+ [Define if the POSIX multithreading library has read/write locks.])],
+ [],
+ [#include <pthread.h>])
+ if $has_rwlock; then
+ gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
+ fi
+ # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(
+ [[#include <pthread.h>]],
+ [[
+#if __FreeBSD__ == 4
+error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
+#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
+ && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
+error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
+#else
+int x = (int)PTHREAD_MUTEX_RECURSIVE;
+return !x;
+#endif
+ ]])],
+ [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1],
+ [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
+ fi
+ gl_PREREQ_LOCK
+])
+
+# Prerequisites of lib/glthread/lock.c.
+AC_DEFUN([gl_PREREQ_LOCK], [:])
diff --git a/gl/m4/lstat.m4 b/gl/m4/lstat.m4
new file mode 100644
index 0000000..d987060
--- /dev/null
+++ b/gl/m4/lstat.m4
@@ -0,0 +1,79 @@
+# serial 33
+
+# Copyright (C) 1997-2001, 2003-2022 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+dnl From Jim Meyering.
+
+AC_DEFUN([gl_FUNC_LSTAT],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+ dnl If lstat does not exist, the replacement <sys/stat.h> does
+ dnl "#define lstat stat", and lstat.c is a no-op.
+ AC_CHECK_FUNCS_ONCE([lstat])
+ if test $ac_cv_func_lstat = yes; then
+ AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+ case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in
+ solaris* | *no)
+ REPLACE_LSTAT=1
+ ;;
+ esac
+ else
+ HAVE_LSTAT=0
+ fi
+])
+
+# Prerequisites of lib/lstat.c.
+AC_DEFUN([gl_PREREQ_LSTAT], [:])
+
+AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
+[
+ dnl We don't use AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK any more, because it
+ dnl is no longer maintained in Autoconf and because it invokes AC_LIBOBJ.
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether lstat correctly handles trailing slash],
+ [gl_cv_func_lstat_dereferences_slashed_symlink],
+ [rm -f conftest.sym conftest.file
+ echo >conftest.file
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [AC_INCLUDES_DEFAULT],
+ [[struct stat sbuf;
+ if (symlink ("conftest.file", "conftest.sym") != 0)
+ return 1;
+ /* Linux will dereference the symlink and fail, as required by
+ POSIX. That is better in the sense that it means we will not
+ have to compile and use the lstat wrapper. */
+ return lstat ("conftest.sym/", &sbuf) == 0;
+ ]])],
+ [gl_cv_func_lstat_dereferences_slashed_symlink=yes],
+ [gl_cv_func_lstat_dereferences_slashed_symlink=no],
+ [case "$host_os" in
+ linux-* | linux)
+ # Guess yes on Linux systems.
+ gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
+ *-gnu* | gnu*)
+ # Guess yes on glibc systems.
+ gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
+ mingw*)
+ # Guess no on native Windows.
+ gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
+ *)
+ # If we don't know, obey --enable-cross-guesses.
+ gl_cv_func_lstat_dereferences_slashed_symlink="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -f conftest.sym conftest.file
+ ])
+ case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
+ *yes)
+ AC_DEFINE_UNQUOTED([LSTAT_FOLLOWS_SLASHED_SYMLINK], [1],
+ [Define to 1 if 'lstat' dereferences a symlink specified
+ with a trailing slash.])
+ ;;
+ esac
+])
diff --git a/gl/m4/ltoptions.m4 b/gl/m4/ltoptions.m4
new file mode 100644
index 0000000..b0b5e9c
--- /dev/null
+++ b/gl/m4/ltoptions.m4
@@ -0,0 +1,437 @@
+# Helper functions for option handling. -*- Autoconf -*-
+#
+# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free
+# Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# 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.
+
+# serial 8 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it. Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+ _LT_MANGLE_DEFUN([$1], [$2]),
+ [m4_warning([Unknown $1 option '$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+ [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME. If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+ dnl
+ dnl Simply set some default values (i.e off) if boolean options were not
+ dnl specified:
+ _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+ ])
+ _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+ ])
+ dnl
+ dnl If no reference was made to various pairs of opposing options, then
+ dnl we run the default mode handler for the pair. For example, if neither
+ dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
+ dnl archives by default:
+ _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+ _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+ [_LT_ENABLE_FAST_INSTALL])
+ _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
+ [_LT_WITH_AIX_SONAME([aix])])
+ ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the 'dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS], [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the 'win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the 'shared' and
+# 'disable-shared' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+ [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac],
+ [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+ _LT_DECL([build_libtool_libs], [enable_shared], [0],
+ [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the 'static' and
+# 'disable-static' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+ [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac],
+ [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+ _LT_DECL([build_old_libs], [enable_static], [0],
+ [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the 'fast-install'
+# and 'disable-fast-install' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac],
+ [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+ [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the 'fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the 'disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_AIX_SONAME([DEFAULT])
+# ----------------------------------
+# implement the --with-aix-soname flag, and support the `aix-soname=aix'
+# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
+# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'.
+m4_define([_LT_WITH_AIX_SONAME],
+[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
+shared_archive_member_spec=
+case $host,$enable_shared in
+power*-*-aix[[5-9]]*,yes)
+ AC_MSG_CHECKING([which variant of shared library versioning to provide])
+ AC_ARG_WITH([aix-soname],
+ [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
+ [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
+ [case $withval in
+ aix|svr4|both)
+ ;;
+ *)
+ AC_MSG_ERROR([Unknown argument to --with-aix-soname])
+ ;;
+ esac
+ lt_cv_with_aix_soname=$with_aix_soname],
+ [AC_CACHE_VAL([lt_cv_with_aix_soname],
+ [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
+ with_aix_soname=$lt_cv_with_aix_soname])
+ AC_MSG_RESULT([$with_aix_soname])
+ if test aix != "$with_aix_soname"; then
+ # For the AIX way of multilib, we name the shared archive member
+ # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
+ # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
+ # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
+ # the AIX toolchain works better with OBJECT_MODE set (default 32).
+ if test 64 = "${OBJECT_MODE-32}"; then
+ shared_archive_member_spec=shr_64
+ else
+ shared_archive_member_spec=shr
+ fi
+ fi
+ ;;
+*)
+ with_aix_soname=aix
+ ;;
+esac
+
+_LT_DECL([], [shared_archive_member_spec], [0],
+ [Shared archive member basename, for filename based shared library versioning on AIX])dnl
+])# _LT_WITH_AIX_SONAME
+
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
+# LT_INIT options.
+# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+ [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for lt_pkg in $withval; do
+ IFS=$lt_save_ifs
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac],
+ [pic_mode=m4_default([$1], [default])])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the 'pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+ [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+ [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+ [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+ [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+ [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/gl/m4/ltsugar.m4 b/gl/m4/ltsugar.m4
new file mode 100644
index 0000000..902508b
--- /dev/null
+++ b/gl/m4/ltsugar.m4
@@ -0,0 +1,124 @@
+# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
+#
+# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software
+# Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# 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.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+ [$#], [2], [[$2]],
+ [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+ [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59, which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+ [$#], 1, [],
+ [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+ m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+ [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+ [m4_foreach([_Lt_suffix],
+ ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+ [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+ [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+ [lt_append([$1], [$2], [$3])$4],
+ [$5])],
+ [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+ m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+ m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+ [$5],
+ [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+ [lt_join(m4_quote(m4_default([$4], [[, ]])),
+ lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+ [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/gl/m4/ltversion.m4 b/gl/m4/ltversion.m4
new file mode 100644
index 0000000..b155d0a
--- /dev/null
+++ b/gl/m4/ltversion.m4
@@ -0,0 +1,24 @@
+# ltversion.m4 -- version numbers -*- Autoconf -*-
+#
+# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation,
+# Inc.
+# Written by Scott James Remnant, 2004
+#
+# 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.
+
+# @configure_input@
+
+# serial 4245 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.4.7])
+m4_define([LT_PACKAGE_REVISION], [2.4.7])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.4.7'
+macro_revision='2.4.7'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/gl/m4/lt~obsolete.m4 b/gl/m4/lt~obsolete.m4
new file mode 100644
index 0000000..0f7a875
--- /dev/null
+++ b/gl/m4/lt~obsolete.m4
@@ -0,0 +1,99 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
+#
+# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free
+# Software Foundation, Inc.
+# Written by Scott James Remnant, 2004.
+#
+# 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.
+
+# serial 5 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else. This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/gl/m4/malloc.m4 b/gl/m4/malloc.m4
new file mode 100644
index 0000000..6b76c1e
--- /dev/null
+++ b/gl/m4/malloc.m4
@@ -0,0 +1,175 @@
+# malloc.m4 serial 28
+dnl Copyright (C) 2007, 2009-2022 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.
+
+# This is adapted with modifications from upstream Autoconf here:
+# https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/functions.m4?id=v2.70#n949
+AC_DEFUN([_AC_FUNC_MALLOC_IF],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
+ AC_CACHE_CHECK([whether malloc (0) returns nonnull],
+ [ac_cv_func_malloc_0_nonnull],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdlib.h>
+ ]],
+ [[void *p = malloc (0);
+ int result = !p;
+ free (p);
+ return result;]])
+ ],
+ [ac_cv_func_malloc_0_nonnull=yes],
+ [ac_cv_func_malloc_0_nonnull=no],
+ [case "$host_os" in
+ # Guess yes on platforms where we know the result.
+ *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \
+ | gnu* | *-musl* | midnightbsd* \
+ | hpux* | solaris* | cygwin* | mingw* | msys* )
+ ac_cv_func_malloc_0_nonnull="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ AS_CASE([$ac_cv_func_malloc_0_nonnull], [*yes], [$1], [$2])
+])# _AC_FUNC_MALLOC_IF
+
+# gl_FUNC_MALLOC_GNU
+# ------------------
+# Replace malloc if it is not compatible with GNU libc.
+AC_DEFUN([gl_FUNC_MALLOC_GNU],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_MALLOC_POSIX])
+ REPLACE_MALLOC_FOR_MALLOC_GNU="$REPLACE_MALLOC_FOR_MALLOC_POSIX"
+ if test $REPLACE_MALLOC_FOR_MALLOC_GNU = 0; then
+ _AC_FUNC_MALLOC_IF([], [REPLACE_MALLOC_FOR_MALLOC_GNU=1])
+ fi
+])
+
+# gl_FUNC_MALLOC_PTRDIFF
+# ----------------------
+# Test whether malloc (N) reliably fails when N exceeds PTRDIFF_MAX,
+# and replace malloc otherwise.
+AC_DEFUN([gl_FUNC_MALLOC_PTRDIFF],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([gl_CHECK_MALLOC_PTRDIFF])
+ test "$gl_cv_malloc_ptrdiff" = yes || REPLACE_MALLOC_FOR_MALLOC_POSIX=1
+])
+
+# Test whether malloc, realloc, calloc refuse to create objects
+# larger than what can be expressed in ptrdiff_t.
+# Set gl_cv_func_malloc_gnu to yes or no accordingly.
+AC_DEFUN([gl_CHECK_MALLOC_PTRDIFF],
+[
+ AC_CACHE_CHECK([whether malloc is ptrdiff_t safe],
+ [gl_cv_malloc_ptrdiff],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdint.h>
+ ]],
+ [[/* 64-bit ptrdiff_t is so wide that no practical platform
+ can exceed it. */
+ #define WIDE_PTRDIFF (PTRDIFF_MAX >> 31 >> 31 != 0)
+
+ /* On rare machines where size_t fits in ptrdiff_t there
+ is no problem. */
+ #define NARROW_SIZE (SIZE_MAX <= PTRDIFF_MAX)
+
+ /* glibc 2.30 and later malloc refuses to exceed ptrdiff_t
+ bounds even on 32-bit platforms. We don't know which
+ non-glibc systems are safe. */
+ #define KNOWN_SAFE (2 < __GLIBC__ + (30 <= __GLIBC_MINOR__))
+
+ #if WIDE_PTRDIFF || NARROW_SIZE || KNOWN_SAFE
+ return 0;
+ #else
+ #error "malloc might not be ptrdiff_t safe"
+ syntax error
+ #endif
+ ]])],
+ [gl_cv_malloc_ptrdiff=yes],
+ [gl_cv_malloc_ptrdiff=no])
+ ])
+])
+
+# gl_FUNC_MALLOC_POSIX
+# --------------------
+# Test whether 'malloc' is POSIX compliant (sets errno to ENOMEM when it
+# fails, and doesn't mess up with ptrdiff_t overflow), and replace
+# malloc if it is not.
+AC_DEFUN([gl_FUNC_MALLOC_POSIX],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_MALLOC_PTRDIFF])
+ AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
+ if test "$gl_cv_func_malloc_posix" = yes; then
+ AC_DEFINE([HAVE_MALLOC_POSIX], [1],
+ [Define if malloc, realloc, and calloc set errno on allocation failure.])
+ else
+ REPLACE_MALLOC_FOR_MALLOC_POSIX=1
+ fi
+])
+
+# Test whether malloc, realloc, calloc set errno to ENOMEM on failure.
+# Set gl_cv_func_malloc_posix to yes or no accordingly.
+AC_DEFUN([gl_CHECK_MALLOC_POSIX],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([whether malloc, realloc, calloc set errno on failure],
+ [gl_cv_func_malloc_posix],
+ [
+ dnl It is too dangerous to try to allocate a large amount of memory:
+ dnl some systems go to their knees when you do that. So assume that
+ dnl all Unix implementations of the function set errno on failure,
+ dnl except on those platforms where we have seen 'test-malloc-gnu',
+ dnl 'test-realloc-gnu', 'test-calloc-gnu' fail.
+ case "$host_os" in
+ mingw*)
+ gl_cv_func_malloc_posix=no ;;
+ irix* | solaris*)
+ dnl On IRIX 6.5, the three functions return NULL with errno unset
+ dnl when the argument is larger than PTRDIFF_MAX.
+ dnl On Solaris 11.3, the three functions return NULL with errno set
+ dnl to EAGAIN, not ENOMEM, when the argument is larger than
+ dnl PTRDIFF_MAX.
+ dnl Here is a test program:
+m4_divert_push([KILL])
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#define ptrdiff_t long
+#ifndef PTRDIFF_MAX
+# define PTRDIFF_MAX ((ptrdiff_t) ((1UL << (8 * sizeof (ptrdiff_t) - 1)) - 1))
+#endif
+
+int main ()
+{
+ void *p;
+
+ fprintf (stderr, "PTRDIFF_MAX = %lu\n", (unsigned long) PTRDIFF_MAX);
+
+ errno = 0;
+ p = malloc ((unsigned long) PTRDIFF_MAX + 1);
+ fprintf (stderr, "p=%p errno=%d\n", p, errno);
+
+ errno = 0;
+ p = calloc (PTRDIFF_MAX / 2 + 1, 2);
+ fprintf (stderr, "p=%p errno=%d\n", p, errno);
+
+ errno = 0;
+ p = realloc (NULL, (unsigned long) PTRDIFF_MAX + 1);
+ fprintf (stderr, "p=%p errno=%d\n", p, errno);
+
+ return 0;
+}
+m4_divert_pop([KILL])
+ gl_cv_func_malloc_posix=no ;;
+ *)
+ gl_cv_func_malloc_posix=yes ;;
+ esac
+ ])
+])
diff --git a/gl/m4/malloca.m4 b/gl/m4/malloca.m4
new file mode 100644
index 0000000..77eb96a
--- /dev/null
+++ b/gl/m4/malloca.m4
@@ -0,0 +1,14 @@
+# malloca.m4 serial 2
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2022 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_MALLOCA],
+[
+ dnl Use the autoconf tests for alloca(), but not the AC_SUBSTed variables
+ dnl @ALLOCA@ and @LTALLOCA@.
+ dnl gl_FUNC_ALLOCA dnl Already brought in by the module dependencies.
+ AC_REQUIRE([gl_EEMALLOC])
+])
diff --git a/gl/m4/manywarnings.m4 b/gl/m4/manywarnings.m4
new file mode 100644
index 0000000..f4b5853
--- /dev/null
+++ b/gl/m4/manywarnings.m4
@@ -0,0 +1,211 @@
+# manywarnings.m4 serial 23
+dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Simon Josefsson
+
+# gl_MANYWARN_COMPLEMENT(OUTVAR, LISTVAR, REMOVEVAR)
+# --------------------------------------------------
+# Copy LISTVAR to OUTVAR except for the entries in REMOVEVAR.
+# Elements separated by whitespace. In set logic terms, the function
+# does OUTVAR = LISTVAR \ REMOVEVAR.
+AC_DEFUN([gl_MANYWARN_COMPLEMENT],
+[
+ gl_warn_set=
+ set x $2; shift
+ for gl_warn_item
+ do
+ case " $3 " in
+ *" $gl_warn_item "*)
+ ;;
+ *)
+ gl_AS_VAR_APPEND([gl_warn_set], [" $gl_warn_item"])
+ ;;
+ esac
+ done
+ $1=$gl_warn_set
+])
+
+# gl_MANYWARN_ALL_GCC(VARIABLE)
+# -----------------------------
+# Add all documented GCC warning parameters to variable VARIABLE.
+# Note that you need to test them using gl_WARN_ADD if you want to
+# make sure your gcc understands it.
+#
+# The effects of this macro depend on the current language (_AC_LANG).
+AC_DEFUN([gl_MANYWARN_ALL_GCC],
+[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+
+# Specialization for _AC_LANG = C.
+AC_DEFUN([gl_MANYWARN_ALL_GCC(C)],
+[
+ AC_LANG_PUSH([C])
+
+ dnl First, check for some issues that only occur when combining multiple
+ dnl gcc warning categories.
+ AC_REQUIRE([AC_PROG_CC])
+ if test -n "$GCC"; then
+
+ dnl Check if -Wextra -Werror -Wno-missing-field-initializers is supported
+ dnl with the current $CC $CFLAGS $CPPFLAGS.
+ AC_CACHE_CHECK([whether -Wno-missing-field-initializers is supported],
+ [gl_cv_cc_nomfi_supported],
+ [gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Wextra -Werror -Wno-missing-field-initializers"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]], [[]])],
+ [gl_cv_cc_nomfi_supported=yes],
+ [gl_cv_cc_nomfi_supported=no])
+ CFLAGS="$gl_save_CFLAGS"
+ ])
+
+ if test "$gl_cv_cc_nomfi_supported" = yes; then
+ dnl Now check whether -Wno-missing-field-initializers is needed
+ dnl for the { 0, } construct.
+ AC_CACHE_CHECK([whether -Wno-missing-field-initializers is needed],
+ [gl_cv_cc_nomfi_needed],
+ [gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Wextra -Werror"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[int f (void)
+ {
+ typedef struct { int a; int b; } s_t;
+ s_t s1 = { 0, };
+ return s1.b;
+ }
+ ]],
+ [[]])],
+ [gl_cv_cc_nomfi_needed=no],
+ [gl_cv_cc_nomfi_needed=yes])
+ CFLAGS="$gl_save_CFLAGS"
+ ])
+ fi
+
+ dnl Next, check if -Werror -Wuninitialized is useful with the
+ dnl user's choice of $CFLAGS; some versions of gcc warn that it
+ dnl has no effect if -O is not also used
+ AC_CACHE_CHECK([whether -Wuninitialized is supported],
+ [gl_cv_cc_uninitialized_supported],
+ [gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror -Wuninitialized"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]], [[]])],
+ [gl_cv_cc_uninitialized_supported=yes],
+ [gl_cv_cc_uninitialized_supported=no])
+ CFLAGS="$gl_save_CFLAGS"
+ ])
+
+ fi
+
+ # List all gcc warning categories.
+ # To compare this list to your installed GCC's, run this Bash command:
+ #
+ # comm -3 \
+ # <((sed -n 's/^ *\(-[^ 0-9][^ ]*\).*/\1/p' manywarnings.m4; \
+ # awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec) | sort) \
+ # <(LC_ALL=C gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort)
+
+ $1=
+ for gl_manywarn_item in -fanalyzer -fno-common \
+ -Wall \
+ -Warith-conversion \
+ -Wbad-function-cast \
+ -Wcast-align=strict \
+ -Wdate-time \
+ -Wdisabled-optimization \
+ -Wdouble-promotion \
+ -Wduplicated-branches \
+ -Wduplicated-cond \
+ -Wextra \
+ -Wformat-signedness \
+ -Winit-self \
+ -Winline \
+ -Winvalid-pch \
+ -Wlogical-op \
+ -Wmissing-declarations \
+ -Wmissing-include-dirs \
+ -Wmissing-prototypes \
+ -Wnested-externs \
+ -Wnull-dereference \
+ -Wold-style-definition \
+ -Wopenmp-simd \
+ -Woverlength-strings \
+ -Wpacked \
+ -Wpointer-arith \
+ -Wshadow \
+ -Wstack-protector \
+ -Wstrict-overflow \
+ -Wstrict-prototypes \
+ -Wsuggest-attribute=cold \
+ -Wsuggest-attribute=const \
+ -Wsuggest-attribute=format \
+ -Wsuggest-attribute=malloc \
+ -Wsuggest-attribute=noreturn \
+ -Wsuggest-attribute=pure \
+ -Wsuggest-final-methods \
+ -Wsuggest-final-types \
+ -Wsync-nand \
+ -Wsystem-headers \
+ -Wtrampolines \
+ -Wuninitialized \
+ -Wunknown-pragmas \
+ -Wunsafe-loop-optimizations \
+ -Wunused-macros \
+ -Wvariadic-macros \
+ -Wvector-operation-performance \
+ -Wvla \
+ -Wwrite-strings \
+ \
+ ; do
+ gl_AS_VAR_APPEND([$1], [" $gl_manywarn_item"])
+ done
+
+ # gcc --help=warnings outputs an unusual form for these options; list
+ # them here so that the above 'comm' command doesn't report a false match.
+ gl_AS_VAR_APPEND([$1], [' -Warray-bounds=2'])
+ gl_AS_VAR_APPEND([$1], [' -Wattribute-alias=2'])
+ gl_AS_VAR_APPEND([$1], [' -Wbidi-chars=any,ucn'])
+ gl_AS_VAR_APPEND([$1], [' -Wformat-overflow=2'])
+ gl_AS_VAR_APPEND([$1], [' -Wformat=2'])
+ gl_AS_VAR_APPEND([$1], [' -Wformat-truncation=2'])
+ gl_AS_VAR_APPEND([$1], [' -Wimplicit-fallthrough=5'])
+ gl_AS_VAR_APPEND([$1], [' -Wshift-overflow=2'])
+ gl_AS_VAR_APPEND([$1], [' -Wuse-after-free=3'])
+ gl_AS_VAR_APPEND([$1], [' -Wunused-const-variable=2'])
+ gl_AS_VAR_APPEND([$1], [' -Wvla-larger-than=4031'])
+
+ # These are needed for older GCC versions.
+ if test -n "$GCC"; then
+ case `($CC --version) 2>/dev/null` in
+ 'gcc (GCC) '[[0-3]].* | \
+ 'gcc (GCC) '4.[[0-7]].*)
+ gl_AS_VAR_APPEND([$1], [' -fdiagnostics-show-option'])
+ gl_AS_VAR_APPEND([$1], [' -funit-at-a-time'])
+ ;;
+ esac
+ fi
+
+ # Disable specific options as needed.
+ if test "$gl_cv_cc_nomfi_needed" = yes; then
+ gl_AS_VAR_APPEND([$1], [' -Wno-missing-field-initializers'])
+ fi
+
+ if test "$gl_cv_cc_uninitialized_supported" = no; then
+ gl_AS_VAR_APPEND([$1], [' -Wno-uninitialized'])
+ fi
+
+ # This warning have too many false alarms in GCC 11.2.1.
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101713
+ gl_AS_VAR_APPEND([$1], [' -Wno-analyzer-malloc-leak'])
+
+ AC_LANG_POP([C])
+])
+
+# Specialization for _AC_LANG = C++.
+AC_DEFUN([gl_MANYWARN_ALL_GCC(C++)],
+[
+ gl_MANYWARN_ALL_GCC_CXX_IMPL([$1])
+])
diff --git a/gl/m4/math_h.m4 b/gl/m4/math_h.m4
new file mode 100644
index 0000000..a08526a
--- /dev/null
+++ b/gl/m4/math_h.m4
@@ -0,0 +1,391 @@
+# math_h.m4 serial 125
+dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_MATH_H],
+[
+ AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ gl_CHECK_NEXT_HEADERS([math.h])
+
+ AC_CACHE_CHECK([whether NAN macro works], [gl_cv_header_math_nan_works],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]],
+ [[/* Solaris 10 has a broken definition of NAN. Other platforms
+ fail to provide NAN, or provide it only in C99 mode; this
+ test only needs to fail when NAN is provided but wrong. */
+ float f = 1.0f;
+#ifdef NAN
+ f = NAN;
+#endif
+ return f == 0;]])],
+ [gl_cv_header_math_nan_works=yes],
+ [gl_cv_header_math_nan_works=no])])
+ if test $gl_cv_header_math_nan_works = no; then
+ REPLACE_NAN=1
+ fi
+ AC_CACHE_CHECK([whether HUGE_VAL works], [gl_cv_header_math_huge_val_works],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]],
+ [[/* Solaris 10 has a broken definition of HUGE_VAL. */
+ double d = HUGE_VAL;
+ return d == 0;]])],
+ [gl_cv_header_math_huge_val_works=yes],
+ [gl_cv_header_math_huge_val_works=no])])
+ if test $gl_cv_header_math_huge_val_works = no; then
+ REPLACE_HUGE_VAL=1
+ fi
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <math.h>]],
+ [acosf acosl asinf asinl atanf atanl
+ cbrt cbrtf cbrtl ceilf ceill copysign copysignf copysignl cosf cosl coshf
+ expf expl exp2 exp2f exp2l expm1 expm1f expm1l
+ fabsf fabsl floorf floorl fma fmaf fmal
+ fmod fmodf fmodl frexpf frexpl hypotf hypotl
+ ilogb ilogbf ilogbl
+ ldexpf ldexpl
+ log logf logl log10 log10f log10l log1p log1pf log1pl log2 log2f log2l
+ logb logbf logbl
+ modf modff modfl powf
+ remainder remainderf remainderl
+ rint rintf rintl round roundf roundl sinf sinl sinhf sqrtf sqrtl
+ tanf tanl tanhf trunc truncf truncl])
+])
+
+# gl_MATH_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_MATH_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_MATH_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_MATH_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACOSF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACOSL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ASINF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ASINL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATANF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATANL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATAN2F])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRTL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEIL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEILF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEILL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGNF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGNL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSHF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2F])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2L])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1F])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1L])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FABSF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FABSL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOOR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOORF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOORL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMA])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMAF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMAL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMOD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMODF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMODL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGB])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGBF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGBL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISFINITE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISINF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAND])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXPF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXPL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10F])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10L])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1P])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1PF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1PL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2F])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2L])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGB])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGBF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGBL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODFF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODFL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POWF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDER])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDERF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDERL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINTL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUND])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNBIT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINHF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SQRTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SQRTL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANHF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCL])
+ dnl Support Microsoft deprecated alias function names by default.
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_J0], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_J1], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_JN], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_Y0], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_Y1], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_YN], [1])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_MATH_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_MATH_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_MATH_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_ACOSF=1; AC_SUBST([HAVE_ACOSF])
+ HAVE_ACOSL=1; AC_SUBST([HAVE_ACOSL])
+ HAVE_ASINF=1; AC_SUBST([HAVE_ASINF])
+ HAVE_ASINL=1; AC_SUBST([HAVE_ASINL])
+ HAVE_ATANF=1; AC_SUBST([HAVE_ATANF])
+ HAVE_ATANL=1; AC_SUBST([HAVE_ATANL])
+ HAVE_ATAN2F=1; AC_SUBST([HAVE_ATAN2F])
+ HAVE_CBRT=1; AC_SUBST([HAVE_CBRT])
+ HAVE_CBRTF=1; AC_SUBST([HAVE_CBRTF])
+ HAVE_CBRTL=1; AC_SUBST([HAVE_CBRTL])
+ HAVE_COPYSIGN=1; AC_SUBST([HAVE_COPYSIGN])
+ HAVE_COPYSIGNL=1; AC_SUBST([HAVE_COPYSIGNL])
+ HAVE_COSF=1; AC_SUBST([HAVE_COSF])
+ HAVE_COSL=1; AC_SUBST([HAVE_COSL])
+ HAVE_COSHF=1; AC_SUBST([HAVE_COSHF])
+ HAVE_EXPF=1; AC_SUBST([HAVE_EXPF])
+ HAVE_EXPL=1; AC_SUBST([HAVE_EXPL])
+ HAVE_EXPM1=1; AC_SUBST([HAVE_EXPM1])
+ HAVE_EXPM1F=1; AC_SUBST([HAVE_EXPM1F])
+ HAVE_FABSF=1; AC_SUBST([HAVE_FABSF])
+ HAVE_FABSL=1; AC_SUBST([HAVE_FABSL])
+ HAVE_FMA=1; AC_SUBST([HAVE_FMA])
+ HAVE_FMAF=1; AC_SUBST([HAVE_FMAF])
+ HAVE_FMAL=1; AC_SUBST([HAVE_FMAL])
+ HAVE_FMODF=1; AC_SUBST([HAVE_FMODF])
+ HAVE_FMODL=1; AC_SUBST([HAVE_FMODL])
+ HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF])
+ HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF])
+ HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL])
+ HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB])
+ HAVE_ILOGBF=1; AC_SUBST([HAVE_ILOGBF])
+ HAVE_ILOGBL=1; AC_SUBST([HAVE_ILOGBL])
+ HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF])
+ HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND])
+ HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL])
+ HAVE_LDEXPF=1; AC_SUBST([HAVE_LDEXPF])
+ HAVE_LOGF=1; AC_SUBST([HAVE_LOGF])
+ HAVE_LOGL=1; AC_SUBST([HAVE_LOGL])
+ HAVE_LOG10F=1; AC_SUBST([HAVE_LOG10F])
+ HAVE_LOG10L=1; AC_SUBST([HAVE_LOG10L])
+ HAVE_LOG1P=1; AC_SUBST([HAVE_LOG1P])
+ HAVE_LOG1PF=1; AC_SUBST([HAVE_LOG1PF])
+ HAVE_LOG1PL=1; AC_SUBST([HAVE_LOG1PL])
+ HAVE_LOGBF=1; AC_SUBST([HAVE_LOGBF])
+ HAVE_LOGBL=1; AC_SUBST([HAVE_LOGBL])
+ HAVE_MODFF=1; AC_SUBST([HAVE_MODFF])
+ HAVE_MODFL=1; AC_SUBST([HAVE_MODFL])
+ HAVE_POWF=1; AC_SUBST([HAVE_POWF])
+ HAVE_REMAINDER=1; AC_SUBST([HAVE_REMAINDER])
+ HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF])
+ HAVE_RINT=1; AC_SUBST([HAVE_RINT])
+ HAVE_RINTL=1; AC_SUBST([HAVE_RINTL])
+ HAVE_SINF=1; AC_SUBST([HAVE_SINF])
+ HAVE_SINL=1; AC_SUBST([HAVE_SINL])
+ HAVE_SINHF=1; AC_SUBST([HAVE_SINHF])
+ HAVE_SQRTF=1; AC_SUBST([HAVE_SQRTF])
+ HAVE_SQRTL=1; AC_SUBST([HAVE_SQRTL])
+ HAVE_TANF=1; AC_SUBST([HAVE_TANF])
+ HAVE_TANL=1; AC_SUBST([HAVE_TANL])
+ HAVE_TANHF=1; AC_SUBST([HAVE_TANHF])
+ HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL])
+ HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL])
+ HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL])
+ HAVE_DECL_CBRTF=1; AC_SUBST([HAVE_DECL_CBRTF])
+ HAVE_DECL_CBRTL=1; AC_SUBST([HAVE_DECL_CBRTL])
+ HAVE_DECL_CEILF=1; AC_SUBST([HAVE_DECL_CEILF])
+ HAVE_DECL_CEILL=1; AC_SUBST([HAVE_DECL_CEILL])
+ HAVE_DECL_COPYSIGNF=1; AC_SUBST([HAVE_DECL_COPYSIGNF])
+ HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL])
+ HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL])
+ HAVE_DECL_EXP2=1; AC_SUBST([HAVE_DECL_EXP2])
+ HAVE_DECL_EXP2F=1; AC_SUBST([HAVE_DECL_EXP2F])
+ HAVE_DECL_EXP2L=1; AC_SUBST([HAVE_DECL_EXP2L])
+ HAVE_DECL_EXPM1L=1; AC_SUBST([HAVE_DECL_EXPM1L])
+ HAVE_DECL_FLOORF=1; AC_SUBST([HAVE_DECL_FLOORF])
+ HAVE_DECL_FLOORL=1; AC_SUBST([HAVE_DECL_FLOORL])
+ HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL])
+ HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL])
+ HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL])
+ HAVE_DECL_LOG10L=1; AC_SUBST([HAVE_DECL_LOG10L])
+ HAVE_DECL_LOG2=1; AC_SUBST([HAVE_DECL_LOG2])
+ HAVE_DECL_LOG2F=1; AC_SUBST([HAVE_DECL_LOG2F])
+ HAVE_DECL_LOG2L=1; AC_SUBST([HAVE_DECL_LOG2L])
+ HAVE_DECL_LOGB=1; AC_SUBST([HAVE_DECL_LOGB])
+ HAVE_DECL_REMAINDER=1; AC_SUBST([HAVE_DECL_REMAINDER])
+ HAVE_DECL_REMAINDERL=1; AC_SUBST([HAVE_DECL_REMAINDERL])
+ HAVE_DECL_RINTF=1; AC_SUBST([HAVE_DECL_RINTF])
+ HAVE_DECL_ROUND=1; AC_SUBST([HAVE_DECL_ROUND])
+ HAVE_DECL_ROUNDF=1; AC_SUBST([HAVE_DECL_ROUNDF])
+ HAVE_DECL_ROUNDL=1; AC_SUBST([HAVE_DECL_ROUNDL])
+ HAVE_DECL_SINL=1; AC_SUBST([HAVE_DECL_SINL])
+ HAVE_DECL_SQRTL=1; AC_SUBST([HAVE_DECL_SQRTL])
+ HAVE_DECL_TANL=1; AC_SUBST([HAVE_DECL_TANL])
+ HAVE_DECL_TRUNC=1; AC_SUBST([HAVE_DECL_TRUNC])
+ HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF])
+ HAVE_DECL_TRUNCL=1; AC_SUBST([HAVE_DECL_TRUNCL])
+ REPLACE_ACOSF=0; AC_SUBST([REPLACE_ACOSF])
+ REPLACE_ASINF=0; AC_SUBST([REPLACE_ASINF])
+ REPLACE_ATANF=0; AC_SUBST([REPLACE_ATANF])
+ REPLACE_ATAN2F=0; AC_SUBST([REPLACE_ATAN2F])
+ REPLACE_CBRTF=0; AC_SUBST([REPLACE_CBRTF])
+ REPLACE_CBRTL=0; AC_SUBST([REPLACE_CBRTL])
+ REPLACE_CEIL=0; AC_SUBST([REPLACE_CEIL])
+ REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF])
+ REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL])
+ REPLACE_COSF=0; AC_SUBST([REPLACE_COSF])
+ REPLACE_COSHF=0; AC_SUBST([REPLACE_COSHF])
+ REPLACE_EXPF=0; AC_SUBST([REPLACE_EXPF])
+ REPLACE_EXPL=0; AC_SUBST([REPLACE_EXPL])
+ REPLACE_EXPM1=0; AC_SUBST([REPLACE_EXPM1])
+ REPLACE_EXPM1F=0; AC_SUBST([REPLACE_EXPM1F])
+ REPLACE_EXPM1L=0; AC_SUBST([REPLACE_EXPM1L])
+ REPLACE_EXP2=0; AC_SUBST([REPLACE_EXP2])
+ REPLACE_EXP2L=0; AC_SUBST([REPLACE_EXP2L])
+ REPLACE_FABSL=0; AC_SUBST([REPLACE_FABSL])
+ REPLACE_FLOOR=0; AC_SUBST([REPLACE_FLOOR])
+ REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF])
+ REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL])
+ REPLACE_FMA=0; AC_SUBST([REPLACE_FMA])
+ REPLACE_FMAF=0; AC_SUBST([REPLACE_FMAF])
+ REPLACE_FMAL=0; AC_SUBST([REPLACE_FMAL])
+ REPLACE_FMOD=0; AC_SUBST([REPLACE_FMOD])
+ REPLACE_FMODF=0; AC_SUBST([REPLACE_FMODF])
+ REPLACE_FMODL=0; AC_SUBST([REPLACE_FMODL])
+ REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF])
+ REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP])
+ REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL])
+ REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL])
+ REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT])
+ REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF])
+ REPLACE_HYPOTL=0; AC_SUBST([REPLACE_HYPOTL])
+ REPLACE_ILOGB=0; AC_SUBST([REPLACE_ILOGB])
+ REPLACE_ILOGBF=0; AC_SUBST([REPLACE_ILOGBF])
+ REPLACE_ILOGBL=0; AC_SUBST([REPLACE_ILOGBL])
+ REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE])
+ REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF])
+ REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN])
+ REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL])
+ REPLACE_LOG=0; AC_SUBST([REPLACE_LOG])
+ REPLACE_LOGF=0; AC_SUBST([REPLACE_LOGF])
+ REPLACE_LOGL=0; AC_SUBST([REPLACE_LOGL])
+ REPLACE_LOG10=0; AC_SUBST([REPLACE_LOG10])
+ REPLACE_LOG10F=0; AC_SUBST([REPLACE_LOG10F])
+ REPLACE_LOG10L=0; AC_SUBST([REPLACE_LOG10L])
+ REPLACE_LOG1P=0; AC_SUBST([REPLACE_LOG1P])
+ REPLACE_LOG1PF=0; AC_SUBST([REPLACE_LOG1PF])
+ REPLACE_LOG1PL=0; AC_SUBST([REPLACE_LOG1PL])
+ REPLACE_LOG2=0; AC_SUBST([REPLACE_LOG2])
+ REPLACE_LOG2F=0; AC_SUBST([REPLACE_LOG2F])
+ REPLACE_LOG2L=0; AC_SUBST([REPLACE_LOG2L])
+ REPLACE_LOGB=0; AC_SUBST([REPLACE_LOGB])
+ REPLACE_LOGBF=0; AC_SUBST([REPLACE_LOGBF])
+ REPLACE_LOGBL=0; AC_SUBST([REPLACE_LOGBL])
+ REPLACE_MODF=0; AC_SUBST([REPLACE_MODF])
+ REPLACE_MODFF=0; AC_SUBST([REPLACE_MODFF])
+ REPLACE_MODFL=0; AC_SUBST([REPLACE_MODFL])
+ REPLACE_NAN=0; AC_SUBST([REPLACE_NAN])
+ REPLACE_REMAINDER=0; AC_SUBST([REPLACE_REMAINDER])
+ REPLACE_REMAINDERF=0; AC_SUBST([REPLACE_REMAINDERF])
+ REPLACE_REMAINDERL=0; AC_SUBST([REPLACE_REMAINDERL])
+ REPLACE_RINTL=0; AC_SUBST([REPLACE_RINTL])
+ REPLACE_ROUND=0; AC_SUBST([REPLACE_ROUND])
+ REPLACE_ROUNDF=0; AC_SUBST([REPLACE_ROUNDF])
+ REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL])
+ REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT])
+ REPLACE_SIGNBIT_USING_BUILTINS=0; AC_SUBST([REPLACE_SIGNBIT_USING_BUILTINS])
+ REPLACE_SINF=0; AC_SUBST([REPLACE_SINF])
+ REPLACE_SINHF=0; AC_SUBST([REPLACE_SINHF])
+ REPLACE_SQRTF=0; AC_SUBST([REPLACE_SQRTF])
+ REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL])
+ REPLACE_TANF=0; AC_SUBST([REPLACE_TANF])
+ REPLACE_TANHF=0; AC_SUBST([REPLACE_TANHF])
+ REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC])
+ REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF])
+ REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL])
+])
+
+# gl_LONG_DOUBLE_VS_DOUBLE
+# determines whether 'long double' and 'double' have the same representation.
+# Sets variable HAVE_SAME_LONG_DOUBLE_AS_DOUBLE to 0 or 1, and defines
+# HAVE_SAME_LONG_DOUBLE_AS_DOUBLE accordingly.
+# The currently known platforms where this is the case are:
+# Linux/HPPA, Minix 3.1.8, AIX 5, AIX 6 and 7 with xlc, MSVC 9.
+AC_DEFUN([gl_LONG_DOUBLE_VS_DOUBLE],
+[
+ AC_CACHE_CHECK([whether long double and double are the same],
+ [gl_cv_long_double_equals_double],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <float.h>]],
+ [[typedef int check[sizeof (long double) == sizeof (double)
+ && LDBL_MANT_DIG == DBL_MANT_DIG
+ && LDBL_MAX_EXP == DBL_MAX_EXP
+ && LDBL_MIN_EXP == DBL_MIN_EXP
+ ? 1 : -1];
+ ]])],
+ [gl_cv_long_double_equals_double=yes],
+ [gl_cv_long_double_equals_double=no])
+ ])
+ if test $gl_cv_long_double_equals_double = yes; then
+ AC_DEFINE([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE], [1],
+ [Define to 1 if 'long double' and 'double' have the same representation.])
+ HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1
+ else
+ HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0
+ fi
+ AC_SUBST([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE])
+])
diff --git a/gl/m4/mbrtowc.m4 b/gl/m4/mbrtowc.m4
new file mode 100644
index 0000000..ec8716b
--- /dev/null
+++ b/gl/m4/mbrtowc.m4
@@ -0,0 +1,790 @@
+# mbrtowc.m4 serial 38 -*- coding: utf-8 -*-
+dnl Copyright (C) 2001-2002, 2004-2005, 2008-2022 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_MBRTOWC],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_REQUIRE([gl_PTHREADLIB])
+ AC_CHECK_HEADERS_ONCE([threads.h])
+
+ AC_REQUIRE([AC_TYPE_MBSTATE_T])
+ gl_MBSTATE_T_BROKEN
+
+ AC_CHECK_FUNCS_ONCE([mbrtowc])
+ if test $ac_cv_func_mbrtowc = no; then
+ HAVE_MBRTOWC=0
+ AC_CHECK_DECLS([mbrtowc],,, [[
+ #include <wchar.h>
+ ]])
+ if test $ac_cv_have_decl_mbrtowc = yes; then
+ dnl On Minix 3.1.8, the system's <wchar.h> declares mbrtowc() although
+ dnl it does not have the function. Avoid a collision with gnulib's
+ dnl replacement.
+ REPLACE_MBRTOWC=1
+ fi
+ else
+ if test $REPLACE_MBSTATE_T = 1; then
+ REPLACE_MBRTOWC=1
+ else
+ gl_MBRTOWC_NULL_ARG1
+ gl_MBRTOWC_NULL_ARG2
+ gl_MBRTOWC_RETVAL
+ gl_MBRTOWC_NUL_RETVAL
+ gl_MBRTOWC_STORES_INCOMPLETE
+ gl_MBRTOWC_EMPTY_INPUT
+ gl_MBRTOWC_C_LOCALE
+ case "$gl_cv_func_mbrtowc_null_arg1" in
+ *yes) ;;
+ *) AC_DEFINE([MBRTOWC_NULL_ARG1_BUG], [1],
+ [Define if the mbrtowc function has the NULL pwc argument bug.])
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_null_arg2" in
+ *yes) ;;
+ *) AC_DEFINE([MBRTOWC_NULL_ARG2_BUG], [1],
+ [Define if the mbrtowc function has the NULL string argument bug.])
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_retval" in
+ *yes) ;;
+ *) AC_DEFINE([MBRTOWC_RETVAL_BUG], [1],
+ [Define if the mbrtowc function returns a wrong return value.])
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_nul_retval" in
+ *yes) ;;
+ *) AC_DEFINE([MBRTOWC_NUL_RETVAL_BUG], [1],
+ [Define if the mbrtowc function does not return 0 for a NUL character.])
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_stores_incomplete" in
+ *no) ;;
+ *) AC_DEFINE([MBRTOWC_STORES_INCOMPLETE_BUG], [1],
+ [Define if the mbrtowc function stores a wide character when reporting incomplete input.])
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_empty_input" in
+ *yes) ;;
+ *) AC_DEFINE([MBRTOWC_EMPTY_INPUT_BUG], [1],
+ [Define if the mbrtowc function does not return (size_t) -2
+ for empty input.])
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
+ *yes) ;;
+ *) AC_DEFINE([MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ], [1],
+ [Define if the mbrtowc function may signal encoding errors in the C locale.])
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ fi
+ fi
+ if test $REPLACE_MBSTATE_T = 1; then
+ case "$host_os" in
+ mingw*) LIB_MBRTOWC= ;;
+ *)
+ gl_WEAK_SYMBOLS
+ case "$gl_cv_have_weak" in
+ *yes) LIB_MBRTOWC= ;;
+ *) LIB_MBRTOWC="$LIBPTHREAD" ;;
+ esac
+ ;;
+ esac
+ else
+ LIB_MBRTOWC=
+ fi
+ dnl LIB_MBRTOWC is expected to be '-pthread' or '-lpthread' on AIX
+ dnl with gcc or xlc, and empty otherwise.
+ AC_SUBST([LIB_MBRTOWC])
+])
+
+dnl Test whether mbsinit() and mbrtowc() need to be overridden in a way that
+dnl redefines the semantics of the given mbstate_t type.
+dnl Result is REPLACE_MBSTATE_T.
+dnl When this is set to 1, we replace both mbsinit() and mbrtowc(), in order to
+dnl avoid inconsistencies.
+
+AC_DEFUN([gl_MBSTATE_T_BROKEN],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ AC_REQUIRE([AC_TYPE_MBSTATE_T])
+ AC_CHECK_FUNCS_ONCE([mbsinit])
+ AC_CHECK_FUNCS_ONCE([mbrtowc])
+ dnl On native Windows, we know exactly how mbsinit() behaves and don't need
+ dnl to override it, even if - like on MSVC - mbsinit() is only defined as
+ dnl an inline function, not as a global function.
+ if case "$host_os" in
+ mingw*) true ;;
+ *) test $ac_cv_func_mbsinit = yes ;;
+ esac \
+ && test $ac_cv_func_mbrtowc = yes; then
+ gl_MBRTOWC_INCOMPLETE_STATE
+ gl_MBRTOWC_SANITYCHECK
+ REPLACE_MBSTATE_T=0
+ case "$gl_cv_func_mbrtowc_incomplete_state" in
+ *yes) ;;
+ *) REPLACE_MBSTATE_T=1 ;;
+ esac
+ case "$gl_cv_func_mbrtowc_sanitycheck" in
+ *yes) ;;
+ *) REPLACE_MBSTATE_T=1 ;;
+ esac
+ else
+ REPLACE_MBSTATE_T=1
+ fi
+])
+
+dnl Test whether mbrtowc puts the state into non-initial state when parsing an
+dnl incomplete multibyte character.
+dnl Result is gl_cv_func_mbrtowc_incomplete_state.
+
+AC_DEFUN([gl_MBRTOWC_INCOMPLETE_STATE],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gt_LOCALE_JA])
+ AC_REQUIRE([gt_LOCALE_FR_UTF8])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether mbrtowc handles incomplete characters],
+ [gl_cv_func_mbrtowc_incomplete_state],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on AIX and OSF/1.
+ aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
+ esac
+changequote([,])dnl
+ if test $LOCALE_JA != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+ {
+ const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+ if (mbsinit (&state))
+ return 2;
+ }
+ return 0;
+}]])],
+ [gl_cv_func_mbrtowc_incomplete_state=yes],
+ [gl_cv_func_mbrtowc_incomplete_state=no],
+ [:])
+ else
+ if test $LOCALE_FR_UTF8 != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ const char input[] = "B\303\274\303\237er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+ if (mbsinit (&state))
+ return 2;
+ }
+ return 0;
+}]])],
+ [gl_cv_func_mbrtowc_incomplete_state=yes],
+ [gl_cv_func_mbrtowc_incomplete_state=no],
+ [:])
+ fi
+ fi
+ ])
+])
+
+dnl Test whether mbrtowc works not worse than mbtowc.
+dnl Result is gl_cv_func_mbrtowc_sanitycheck.
+
+AC_DEFUN([gl_MBRTOWC_SANITYCHECK],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gt_LOCALE_ZH_CN])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether mbrtowc works as well as mbtowc],
+ [gl_cv_func_mbrtowc_sanitycheck],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on Solaris 8.
+ solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
+ esac
+changequote([,])dnl
+ if test $LOCALE_ZH_CN != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ /* This fails on Solaris 8:
+ mbrtowc returns 2, and sets wc to 0x00F0.
+ mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
+ if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+ {
+ char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 3, 6, &state) != 4
+ && mbtowc (&wc, input + 3, 6) == 4)
+ return 2;
+ }
+ return 0;
+}]])],
+ [gl_cv_func_mbrtowc_sanitycheck=yes],
+ [gl_cv_func_mbrtowc_sanitycheck=no],
+ [:])
+ fi
+ ])
+])
+
+dnl Test whether mbrtowc supports a NULL pwc argument correctly.
+dnl Result is gl_cv_func_mbrtowc_null_arg1.
+
+AC_DEFUN([gl_MBRTOWC_NULL_ARG1],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gt_LOCALE_FR_UTF8])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether mbrtowc handles a NULL pwc argument],
+ [gl_cv_func_mbrtowc_null_arg1],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on Solaris.
+ solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;;
+ esac
+changequote([,])dnl
+ if test $LOCALE_FR_UTF8 != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ int result = 0;
+
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ char input[] = "\303\237er";
+ mbstate_t state;
+ wchar_t wc;
+ size_t ret;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input, 5, &state);
+ if (ret != 2)
+ result |= 1;
+ if (!mbsinit (&state))
+ result |= 2;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ ret = mbrtowc (NULL, input, 5, &state);
+ if (ret != 2) /* Solaris 7 fails here: ret is -1. */
+ result |= 4;
+ if (!mbsinit (&state))
+ result |= 8;
+ }
+ return result;
+}]])],
+ [gl_cv_func_mbrtowc_null_arg1=yes],
+ [gl_cv_func_mbrtowc_null_arg1=no],
+ [:])
+ fi
+ ])
+])
+
+dnl Test whether mbrtowc supports a NULL string argument correctly.
+dnl Result is gl_cv_func_mbrtowc_null_arg2.
+
+AC_DEFUN([gl_MBRTOWC_NULL_ARG2],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gt_LOCALE_FR_UTF8])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether mbrtowc handles a NULL string argument],
+ [gl_cv_func_mbrtowc_null_arg2],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on OSF/1.
+ osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;;
+ esac
+changequote([,])dnl
+ if test $LOCALE_FR_UTF8 != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ mbstate_t state;
+ wchar_t wc;
+ int ret;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ mbrtowc (&wc, NULL, 5, &state);
+ /* Check that wc was not modified. */
+ if (wc != (wchar_t) 0xBADFACE)
+ return 2;
+ }
+ return 0;
+}]])],
+ [gl_cv_func_mbrtowc_null_arg2=yes],
+ [gl_cv_func_mbrtowc_null_arg2=no],
+ [:])
+ fi
+ ])
+])
+
+dnl Test whether mbrtowc, when parsing the end of a multibyte character,
+dnl correctly returns the number of bytes that were needed to complete the
+dnl character (not the total number of bytes of the multibyte character).
+dnl Result is gl_cv_func_mbrtowc_retval.
+
+AC_DEFUN([gl_MBRTOWC_RETVAL],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gt_LOCALE_FR_UTF8])
+ AC_REQUIRE([gt_LOCALE_JA])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([whether mbrtowc has a correct return value],
+ [gl_cv_func_mbrtowc_retval],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on HP-UX, Solaris, native Windows.
+ hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_retval="guessing yes" ;;
+ esac
+changequote([,])dnl
+ if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \
+ || { case "$host_os" in mingw*) true;; *) false;; esac; }; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ int result = 0;
+ int found_some_locale = 0;
+ /* This fails on Solaris. */
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ char input[] = "B\303\274\303\237er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+ {
+ input[1] = '\0';
+ if (mbrtowc (&wc, input + 2, 5, &state) != 1)
+ result |= 1;
+ }
+ found_some_locale = 1;
+ }
+ /* This fails on HP-UX 11.11. */
+ if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+ {
+ char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+ {
+ input[1] = '\0';
+ if (mbrtowc (&wc, input + 2, 5, &state) != 2)
+ result |= 2;
+ }
+ found_some_locale = 1;
+ }
+ /* This fails on native Windows. */
+ if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
+ {
+ char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
+ {
+ input[3] = '\0';
+ if (mbrtowc (&wc, input + 4, 4, &state) != 1)
+ result |= 4;
+ }
+ found_some_locale = 1;
+ }
+ if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
+ {
+ char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
+ {
+ input[3] = '\0';
+ if (mbrtowc (&wc, input + 4, 4, &state) != 1)
+ result |= 8;
+ }
+ found_some_locale = 1;
+ }
+ if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
+ {
+ char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
+ {
+ input[3] = '\0';
+ if (mbrtowc (&wc, input + 4, 4, &state) != 1)
+ result |= 16;
+ }
+ found_some_locale = 1;
+ }
+ return (found_some_locale ? result : 77);
+}]])],
+ [gl_cv_func_mbrtowc_retval=yes],
+ [if test $? != 77; then
+ gl_cv_func_mbrtowc_retval=no
+ fi
+ ],
+ [:])
+ fi
+ ])
+])
+
+dnl Test whether mbrtowc, when parsing a NUL character, correctly returns 0.
+dnl Result is gl_cv_func_mbrtowc_nul_retval.
+
+AC_DEFUN([gl_MBRTOWC_NUL_RETVAL],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gt_LOCALE_ZH_CN])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether mbrtowc returns 0 when parsing a NUL character],
+ [gl_cv_func_mbrtowc_nul_retval],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on Solaris 8 and 9.
+ solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;;
+ esac
+changequote([,])dnl
+ if test $LOCALE_ZH_CN != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ /* This fails on Solaris 8 and 9. */
+ if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+ {
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "", 1, &state) != 0)
+ return 2;
+ }
+ return 0;
+}]])],
+ [gl_cv_func_mbrtowc_nul_retval=yes],
+ [gl_cv_func_mbrtowc_nul_retval=no],
+ [:])
+ fi
+ ])
+])
+
+dnl Test whether mbrtowc stores a wide character when reporting incomplete
+dnl input.
+
+AC_DEFUN([gl_MBRTOWC_STORES_INCOMPLETE],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether mbrtowc stores incomplete characters],
+ [gl_cv_func_mbrtowc_stores_incomplete],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_mbrtowc_stores_incomplete="guessing yes" ;;
+ *) gl_cv_func_mbrtowc_stores_incomplete="guessing no" ;;
+ esac
+changequote([,])dnl
+ case "$host_os" in
+ mingw*)
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ int result = 0;
+ if (setlocale (LC_ALL, "French_France.65001") != NULL)
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
+ && wc != (wchar_t) 0xBADFACE)
+ result |= 1;
+ }
+ if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "\226", 1, &state) == (size_t)(-2)
+ && wc != (wchar_t) 0xBADFACE)
+ result |= 2;
+ }
+ if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "\245", 1, &state) == (size_t)(-2)
+ && wc != (wchar_t) 0xBADFACE)
+ result |= 4;
+ }
+ if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "\261", 1, &state) == (size_t)(-2)
+ && wc != (wchar_t) 0xBADFACE)
+ result |= 8;
+ }
+ return result;
+}]])],
+ [gl_cv_func_mbrtowc_stores_incomplete=no],
+ [gl_cv_func_mbrtowc_stores_incomplete=yes],
+ [:])
+ ;;
+ *)
+ AC_REQUIRE([gt_LOCALE_FR_UTF8])
+ if test $LOCALE_FR_UTF8 != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
+ && wc != (wchar_t) 0xBADFACE)
+ return 1;
+ }
+ return 0;
+}]])],
+ [gl_cv_func_mbrtowc_stores_incomplete=no],
+ [gl_cv_func_mbrtowc_stores_incomplete=yes],
+ [:])
+ fi
+ ;;
+ esac
+ ])
+])
+
+dnl Test whether mbrtowc returns the correct value on empty input.
+
+AC_DEFUN([gl_MBRTOWC_EMPTY_INPUT],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether mbrtowc works on empty input],
+ [gl_cv_func_mbrtowc_empty_input],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on AIX and glibc systems.
+ aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
+ *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
+ esac
+changequote([,])dnl
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+ #include <wchar.h>
+ static wchar_t wc;
+ static mbstate_t mbs;
+ int
+ main (void)
+ {
+ return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2;
+ }]])],
+ [gl_cv_func_mbrtowc_empty_input=yes],
+ [gl_cv_func_mbrtowc_empty_input=no],
+ [:])
+ ])
+])
+
+dnl Test whether mbrtowc reports encoding errors in the C locale.
+dnl Although POSIX was never intended to allow this, the GNU C Library
+dnl and other implementations do it. See:
+dnl https://sourceware.org/bugzilla/show_bug.cgi?id=19932
+
+AC_DEFUN([gl_MBRTOWC_C_LOCALE],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether the C locale is free of encoding errors],
+ [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+ gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal"
+
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <limits.h>
+ #include <locale.h>
+ #include <wchar.h>
+ ]], [[
+ int i;
+ char *locale = setlocale (LC_ALL, "C");
+ if (! locale)
+ return 2;
+ for (i = CHAR_MIN; i <= CHAR_MAX; i++)
+ {
+ char c = i;
+ wchar_t wc;
+ mbstate_t mbs = { 0, };
+ size_t ss = mbrtowc (&wc, &c, 1, &mbs);
+ if (1 < ss)
+ return 3;
+ }
+ return 0;
+ ]])],
+ [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes],
+ [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no],
+ [case "$host_os" in
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;;
+ esac
+ ])
+ ])
+])
+
+# Prerequisites of lib/mbrtowc.c and lib/lc-charset-dispatch.c.
+AC_DEFUN([gl_PREREQ_MBRTOWC], [
+ AC_REQUIRE([AC_C_INLINE])
+ :
+])
+
+# Prerequisites of lib/mbtowc-lock.c.
+AC_DEFUN([gl_PREREQ_MBTOWC_LOCK],
+[
+ gl_VISIBILITY
+])
+
+
+dnl From Paul Eggert
+
+dnl This is an override of an autoconf macro.
+
+AC_DEFUN([AC_FUNC_MBRTOWC],
+[
+ dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60.
+ AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
+ [gl_cv_func_mbrtowc],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <wchar.h>]],
+ [[wchar_t wc;
+ char const s[] = "";
+ size_t n = 1;
+ mbstate_t state;
+ return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])],
+ [gl_cv_func_mbrtowc=yes],
+ [gl_cv_func_mbrtowc=no])])
+ if test $gl_cv_func_mbrtowc = yes; then
+ AC_DEFINE([HAVE_MBRTOWC], [1],
+ [Define to 1 if mbrtowc and mbstate_t are properly declared.])
+ fi
+])
diff --git a/gl/m4/mbsinit.m4 b/gl/m4/mbsinit.m4
new file mode 100644
index 0000000..ebd2d4f
--- /dev/null
+++ b/gl/m4/mbsinit.m4
@@ -0,0 +1,44 @@
+# mbsinit.m4 serial 9
+dnl Copyright (C) 2008, 2010-2022 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_MBSINIT],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ AC_REQUIRE([AC_TYPE_MBSTATE_T])
+ gl_MBSTATE_T_BROKEN
+
+ AC_CHECK_FUNCS_ONCE([mbsinit])
+ if test $ac_cv_func_mbsinit = no; then
+ HAVE_MBSINIT=0
+ AC_CHECK_DECLS([mbsinit],,, [[
+ #include <wchar.h>
+ ]])
+ if test $ac_cv_have_decl_mbsinit = yes; then
+ dnl On Minix 3.1.8, the system's <wchar.h> declares mbsinit() although
+ dnl it does not have the function. Avoid a collision with gnulib's
+ dnl replacement.
+ REPLACE_MBSINIT=1
+ fi
+ else
+ if test $REPLACE_MBSTATE_T = 1; then
+ REPLACE_MBSINIT=1
+ else
+ dnl On mingw, mbsinit() always returns 1, which is inappropriate for
+ dnl states produced by mbrtowc() for an incomplete multibyte character
+ dnl in multibyte locales.
+ case "$host_os" in
+ mingw*) REPLACE_MBSINIT=1 ;;
+ esac
+ fi
+ fi
+])
+
+# Prerequisites of lib/mbsinit.c.
+AC_DEFUN([gl_PREREQ_MBSINIT], [
+ :
+])
diff --git a/gl/m4/mbsrtowcs.m4 b/gl/m4/mbsrtowcs.m4
new file mode 100644
index 0000000..f672fa5
--- /dev/null
+++ b/gl/m4/mbsrtowcs.m4
@@ -0,0 +1,141 @@
+# mbsrtowcs.m4 serial 14
+dnl Copyright (C) 2008-2022 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_MBSRTOWCS],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+
+ AC_REQUIRE([AC_TYPE_MBSTATE_T])
+ gl_MBSTATE_T_BROKEN
+
+ AC_CHECK_FUNCS_ONCE([mbsrtowcs])
+ if test $ac_cv_func_mbsrtowcs = no; then
+ HAVE_MBSRTOWCS=0
+ AC_CHECK_DECLS([mbsrtowcs],,, [[
+ #include <wchar.h>
+ ]])
+ if test $ac_cv_have_decl_mbsrtowcs = yes; then
+ dnl On Minix 3.1.8, the system's <wchar.h> declares mbsrtowcs() although
+ dnl it does not have the function. Avoid a collision with gnulib's
+ dnl replacement.
+ REPLACE_MBSRTOWCS=1
+ fi
+ else
+ if test $REPLACE_MBSTATE_T = 1; then
+ REPLACE_MBSRTOWCS=1
+ else
+ gl_MBSRTOWCS_WORKS
+ case "$gl_cv_func_mbsrtowcs_works" in
+ *yes) ;;
+ *) REPLACE_MBSRTOWCS=1 ;;
+ esac
+ fi
+ fi
+])
+
+dnl Test whether mbsrtowcs works.
+dnl Result is gl_cv_func_mbsrtowcs_works.
+
+AC_DEFUN([gl_MBSRTOWCS_WORKS],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gt_LOCALE_FR])
+ AC_REQUIRE([gt_LOCALE_FR_UTF8])
+ AC_REQUIRE([gt_LOCALE_JA])
+ AC_REQUIRE([gt_LOCALE_ZH_CN])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether mbsrtowcs works],
+ [gl_cv_func_mbsrtowcs_works],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on HP-UX, Solaris, mingw.
+ hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbsrtowcs_works="guessing yes" ;;
+ esac
+changequote([,])dnl
+ if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ int result = 0;
+ /* Test whether the function supports a NULL destination argument.
+ This fails on native Windows. */
+ if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+ {
+ const char input[] = "\337er";
+ const char *src = input;
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbsrtowcs (NULL, &src, 1, &state) != 3
+ || src != input)
+ result |= 1;
+ }
+ /* Test whether the function works when started with a conversion state
+ in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ const char input[] = "B\303\274\303\237er";
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2))
+ if (!mbsinit (&state))
+ {
+ const char *src = input + 2;
+ if (mbsrtowcs (NULL, &src, 10, &state) != 4)
+ result |= 2;
+ }
+ }
+ if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+ {
+ const char input[] = "<\306\374\313\334\270\354>";
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2))
+ if (!mbsinit (&state))
+ {
+ const char *src = input + 4;
+ if (mbsrtowcs (NULL, &src, 10, &state) != 3)
+ result |= 4;
+ }
+ }
+ if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+ {
+ const char input[] = "B\250\271\201\060\211\070er";
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2))
+ if (!mbsinit (&state))
+ {
+ const char *src = input + 2;
+ if (mbsrtowcs (NULL, &src, 10, &state) != 4)
+ result |= 8;
+ }
+ }
+ return result;
+}]])],
+ [gl_cv_func_mbsrtowcs_works=yes],
+ [gl_cv_func_mbsrtowcs_works=no],
+ [:])
+ fi
+ ])
+])
+
+# Prerequisites of lib/mbsrtowcs.c.
+AC_DEFUN([gl_PREREQ_MBSRTOWCS], [
+ :
+])
diff --git a/gl/m4/mbstate_t.m4 b/gl/m4/mbstate_t.m4
new file mode 100644
index 0000000..a6eba1b
--- /dev/null
+++ b/gl/m4/mbstate_t.m4
@@ -0,0 +1,34 @@
+# mbstate_t.m4 serial 14
+dnl Copyright (C) 2000-2002, 2008-2022 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.
+
+# From Paul Eggert.
+
+# BeOS 5 has <wchar.h> but does not define mbstate_t,
+# so you can't declare an object of that type.
+# Check for this incompatibility with Standard C.
+
+# AC_TYPE_MBSTATE_T
+# -----------------
+AC_DEFUN([AC_TYPE_MBSTATE_T],
+[
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) dnl for HP-UX 11.11
+
+ AC_CACHE_CHECK([for mbstate_t], [ac_cv_type_mbstate_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [AC_INCLUDES_DEFAULT[
+ #include <wchar.h>]],
+ [[mbstate_t x; return sizeof x;]])],
+ [ac_cv_type_mbstate_t=yes],
+ [ac_cv_type_mbstate_t=no])])
+ if test $ac_cv_type_mbstate_t = yes; then
+ AC_DEFINE([HAVE_MBSTATE_T], [1],
+ [Define to 1 if <wchar.h> declares mbstate_t.])
+ else
+ AC_DEFINE([mbstate_t], [int],
+ [Define to a type if <wchar.h> does not define.])
+ fi
+])
diff --git a/gl/m4/mbtowc.m4 b/gl/m4/mbtowc.m4
new file mode 100644
index 0000000..2827e83
--- /dev/null
+++ b/gl/m4/mbtowc.m4
@@ -0,0 +1,24 @@
+# mbtowc.m4 serial 3
+dnl Copyright (C) 2011-2022 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_MBTOWC],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+
+ AC_CHECK_FUNCS([mbtowc])
+ if test $ac_cv_func_mbtowc = no; then
+ HAVE_MBTOWC=0
+ else
+ if false; then
+ REPLACE_MBTOWC=1
+ fi
+ fi
+])
+
+# Prerequisites of lib/mbtowc.c.
+AC_DEFUN([gl_PREREQ_MBTOWC], [
+ :
+])
diff --git a/gl/m4/memchr.m4 b/gl/m4/memchr.m4
new file mode 100644
index 0000000..c7489d8
--- /dev/null
+++ b/gl/m4/memchr.m4
@@ -0,0 +1,106 @@
+# memchr.m4 serial 18
+dnl Copyright (C) 2002-2004, 2009-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ dnl Check for prerequisites for memory fence checks.
+ gl_FUNC_MMAP_ANON
+ AC_CHECK_HEADERS_ONCE([sys/mman.h])
+ AC_CHECK_FUNCS_ONCE([mprotect])
+
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+ # Detect platform-specific bugs in some versions of glibc:
+ # memchr should not dereference anything with length 0
+ # https://bugzilla.redhat.com/show_bug.cgi?id=499689
+ # memchr should not dereference overestimated length after a match
+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
+ # https://sourceware.org/bugzilla/show_bug.cgi?id=10162
+ # memchr should cast the second argument to 'unsigned char'.
+ # This bug exists in Android 4.3.
+ # Assume that memchr works on platforms that lack mprotect.
+ AC_CACHE_CHECK([whether memchr works], [gl_cv_func_memchr_works],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <string.h>
+#if HAVE_SYS_MMAN_H
+# include <fcntl.h>
+# include <unistd.h>
+# include <sys/types.h>
+# include <sys/mman.h>
+# ifndef MAP_FILE
+# define MAP_FILE 0
+# endif
+#endif
+]], [[
+ int result = 0;
+ char *fence = NULL;
+#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
+# if HAVE_MAP_ANONYMOUS
+ const int flags = MAP_ANONYMOUS | MAP_PRIVATE;
+ const int fd = -1;
+# else /* !HAVE_MAP_ANONYMOUS */
+ const int flags = MAP_FILE | MAP_PRIVATE;
+ int fd = open ("/dev/zero", O_RDONLY, 0666);
+ if (fd >= 0)
+# endif
+ {
+ int pagesize = getpagesize ();
+ char *two_pages =
+ (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE,
+ flags, fd, 0);
+ if (two_pages != (char *)(-1)
+ && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0)
+ fence = two_pages + pagesize;
+ }
+#endif
+ if (fence)
+ {
+ /* Test against bugs on glibc systems. */
+ if (memchr (fence, 0, 0))
+ result |= 1;
+ strcpy (fence - 9, "12345678");
+ if (memchr (fence - 9, 0, 79) != fence - 1)
+ result |= 2;
+ if (memchr (fence - 1, 0, 3) != fence - 1)
+ result |= 4;
+ /* Test against bug on AIX 7.2. */
+ if (memchr (fence - 4, '6', 16) != fence - 4)
+ result |= 8;
+ }
+ /* Test against bug on Android 4.3. */
+ {
+ char input[3];
+ input[0] = 'a';
+ input[1] = 'b';
+ input[2] = 'c';
+ if (memchr (input, 0x789abc00 | 'b', 3) != input + 1)
+ result |= 16;
+ }
+ return result;
+]])],
+ [gl_cv_func_memchr_works=yes],
+ [gl_cv_func_memchr_works=no],
+ [case "$host_os" in
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_memchr_works="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_memchr_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_memchr_works" in
+ *yes) ;;
+ *) REPLACE_MEMCHR=1 ;;
+ esac
+])
+
+# Prerequisites of lib/memchr.c.
+AC_DEFUN([gl_PREREQ_MEMCHR], [
+ AC_CHECK_HEADERS([bp-sym.h])
+])
diff --git a/gl/m4/memmem.m4 b/gl/m4/memmem.m4
new file mode 100644
index 0000000..e01aa5c
--- /dev/null
+++ b/gl/m4/memmem.m4
@@ -0,0 +1,155 @@
+# memmem.m4 serial 29
+dnl Copyright (C) 2002-2004, 2007-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Check that memmem is present and functional.
+AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE],
+[
+ dnl Persuade glibc <string.h> to declare memmem().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+ AC_CHECK_FUNCS([memmem])
+ if test $ac_cv_func_memmem = yes; then
+ HAVE_MEMMEM=1
+ else
+ HAVE_MEMMEM=0
+ fi
+ AC_CHECK_DECLS_ONCE([memmem])
+ if test $ac_cv_have_decl_memmem = no; then
+ HAVE_DECL_MEMMEM=0
+ else
+ dnl Detect https://sourceware.org/bugzilla/show_bug.cgi?id=12092.
+ dnl Also check that we handle empty needles correctly.
+ AC_CACHE_CHECK([whether memmem works],
+ [gl_cv_func_memmem_works_always],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <string.h> /* for memmem */
+#define P "_EF_BF_BD"
+#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
+#define NEEDLE P P P P P
+]], [[
+ int result = 0;
+ if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE)))
+ result |= 1;
+ /* Check for empty needle behavior. */
+ {
+ const char *haystack = "AAA";
+ if (memmem (haystack, 3, (const char *) 1, 0) != haystack)
+ result |= 2;
+ }
+ return result;
+ ]])],
+ [gl_cv_func_memmem_works_always=yes],
+ [gl_cv_func_memmem_works_always=no],
+ [dnl glibc 2.9..2.12 and cygwin 1.7.7 have issue #12092 above.
+ dnl Also empty needles work on glibc >= 2.1 and cygwin >= 1.7.0.
+ dnl uClibc is not affected, since it uses different source code.
+ dnl Assume that it works on all other platforms (even if not linear).
+ AC_EGREP_CPP([Lucky user],
+ [
+#include <string.h> /* for __GNU_LIBRARY__ */
+#ifdef __GNU_LIBRARY__
+ #include <features.h>
+ #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \
+ || __GLIBC_MINOR__ > 12)) \
+ || (__GLIBC__ > 2)) \
+ || defined __UCLIBC__
+ Lucky user
+ #endif
+#elif defined __CYGWIN__
+ #include <cygwin/version.h>
+ #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
+ Lucky user
+ #endif
+#else
+ Lucky user
+#endif
+ ],
+ [gl_cv_func_memmem_works_always="guessing yes"],
+ [gl_cv_func_memmem_works_always="$gl_cross_guess_normal"])
+ ])
+ ])
+ case "$gl_cv_func_memmem_works_always" in
+ *yes) ;;
+ *)
+ REPLACE_MEMMEM=1
+ ;;
+ esac
+ fi
+ gl_PREREQ_MEMMEM
+]) # gl_FUNC_MEMMEM_SIMPLE
+
+dnl Additionally, check that memmem has linear performance characteristics
+AC_DEFUN([gl_FUNC_MEMMEM],
+[
+ AC_REQUIRE([gl_FUNC_MEMMEM_SIMPLE])
+ if test $HAVE_DECL_MEMMEM = 1 && test $REPLACE_MEMMEM = 0; then
+ AC_CACHE_CHECK([whether memmem works in linear time],
+ [gl_cv_func_memmem_works_fast],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <signal.h> /* for signal */
+#include <string.h> /* for memmem */
+#include <stdlib.h> /* for malloc */
+#include <unistd.h> /* for alarm */
+static void quit (int sig) { _exit (sig + 128); }
+]], [[
+ int result = 0;
+ size_t m = 1000000;
+ char *haystack = (char *) malloc (2 * m + 1);
+ char *needle = (char *) malloc (m + 1);
+ /* Failure to compile this test due to missing alarm is okay,
+ since all such platforms (mingw) also lack memmem. */
+ signal (SIGALRM, quit);
+ alarm (5);
+ /* Check for quadratic performance. */
+ if (haystack && needle)
+ {
+ memset (haystack, 'A', 2 * m);
+ haystack[2 * m] = 'B';
+ memset (needle, 'A', m);
+ needle[m] = 'B';
+ if (!memmem (haystack, 2 * m + 1, needle, m + 1))
+ result |= 1;
+ }
+ /* Free allocated memory, in case some sanitizer is watching. */
+ free (haystack);
+ free (needle);
+ return result;
+ ]])],
+ [gl_cv_func_memmem_works_fast=yes], [gl_cv_func_memmem_works_fast=no],
+ [dnl Only glibc >= 2.9 and cygwin > 1.7.0 are known to have a
+ dnl memmem that works in linear time.
+ AC_EGREP_CPP([Lucky user],
+ [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9) || (__GLIBC__ > 2)) \
+ && !defined __UCLIBC__
+ Lucky user
+ #endif
+#endif
+#ifdef __CYGWIN__
+ #include <cygwin/version.h>
+ #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 0)
+ Lucky user
+ #endif
+#endif
+ ],
+ [gl_cv_func_memmem_works_fast="guessing yes"],
+ [gl_cv_func_memmem_works_fast="$gl_cross_guess_normal"])
+ ])
+ ])
+ case "$gl_cv_func_memmem_works_fast" in
+ *yes) ;;
+ *)
+ REPLACE_MEMMEM=1
+ ;;
+ esac
+ fi
+]) # gl_FUNC_MEMMEM
+
+# Prerequisites of lib/memmem.c.
+AC_DEFUN([gl_PREREQ_MEMMEM], [:])
diff --git a/gl/m4/mempcpy.m4 b/gl/m4/mempcpy.m4
new file mode 100644
index 0000000..1107eb4
--- /dev/null
+++ b/gl/m4/mempcpy.m4
@@ -0,0 +1,26 @@
+# mempcpy.m4 serial 12
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2022 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_MEMPCPY],
+[
+ dnl Persuade glibc <string.h> to declare mempcpy().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ dnl The mempcpy() declaration in lib/string.in.h uses 'restrict'.
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+ AC_CHECK_FUNCS([mempcpy])
+ if test $ac_cv_func_mempcpy = no; then
+ HAVE_MEMPCPY=0
+ fi
+])
+
+# Prerequisites of lib/mempcpy.c.
+AC_DEFUN([gl_PREREQ_MEMPCPY], [
+ :
+])
diff --git a/gl/m4/memrchr.m4 b/gl/m4/memrchr.m4
new file mode 100644
index 0000000..ec5e208
--- /dev/null
+++ b/gl/m4/memrchr.m4
@@ -0,0 +1,23 @@
+# memrchr.m4 serial 11
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2022 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_MEMRCHR],
+[
+ dnl Persuade glibc <string.h> to declare memrchr().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+ AC_CHECK_DECLS_ONCE([memrchr])
+ if test $ac_cv_have_decl_memrchr = no; then
+ HAVE_DECL_MEMRCHR=0
+ fi
+
+ AC_CHECK_FUNCS([memrchr])
+])
+
+# Prerequisites of lib/memrchr.c.
+AC_DEFUN([gl_PREREQ_MEMRCHR], [:])
diff --git a/gl/m4/minmax.m4 b/gl/m4/minmax.m4
new file mode 100644
index 0000000..b976739
--- /dev/null
+++ b/gl/m4/minmax.m4
@@ -0,0 +1,44 @@
+# minmax.m4 serial 4
+dnl Copyright (C) 2005, 2009-2022 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_PREREQ([2.53])
+
+AC_DEFUN([gl_MINMAX],
+[
+ AC_REQUIRE([gl_PREREQ_MINMAX])
+])
+
+# Prerequisites of lib/minmax.h.
+AC_DEFUN([gl_PREREQ_MINMAX],
+[
+ gl_MINMAX_IN_HEADER([limits.h])
+ gl_MINMAX_IN_HEADER([sys/param.h])
+])
+
+dnl gl_MINMAX_IN_HEADER(HEADER)
+dnl The parameter has to be a literal header name; it cannot be macro,
+dnl nor a shell variable. (Because autoheader collects only AC_DEFINE
+dnl invocations with a literal macro name.)
+AC_DEFUN([gl_MINMAX_IN_HEADER],
+[
+ m4_pushdef([header], AS_TR_SH([$1]))
+ m4_pushdef([HEADER], AS_TR_CPP([$1]))
+ AC_CACHE_CHECK([whether <$1> defines MIN and MAX],
+ [gl_cv_minmax_in_]header,
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <$1>
+ int x = MIN (42, 17);]],
+ [[]])],
+ [gl_cv_minmax_in_]header[=yes],
+ [gl_cv_minmax_in_]header[=no])])
+ if test $gl_cv_minmax_in_[]header = yes; then
+ AC_DEFINE([HAVE_MINMAX_IN_]HEADER, 1,
+ [Define to 1 if <$1> defines the MIN and MAX macros.])
+ fi
+ m4_popdef([HEADER])
+ m4_popdef([header])
+])
diff --git a/gl/m4/mkdir.m4 b/gl/m4/mkdir.m4
new file mode 100644
index 0000000..8b78ce9
--- /dev/null
+++ b/gl/m4/mkdir.m4
@@ -0,0 +1,87 @@
+# serial 17
+
+# Copyright (C) 2001, 2003-2004, 2006, 2008-2022 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.
+
+# On some systems, mkdir ("foo/", 0700) fails because of the trailing slash.
+# On others, mkdir ("foo/./", 0700) mistakenly succeeds.
+# On such systems, arrange to use a wrapper function.
+AC_DEFUN([gl_FUNC_MKDIR],
+[dnl
+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ AC_CACHE_CHECK([whether mkdir handles trailing slash],
+ [gl_cv_func_mkdir_trailing_slash_works],
+ [rm -rf conftest.dir
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ ]GL_MDA_DEFINES],
+ [[return mkdir ("conftest.dir/", 0700);]])],
+ [gl_cv_func_mkdir_trailing_slash_works=yes],
+ [gl_cv_func_mkdir_trailing_slash_works=no],
+ [case "$host_os" in
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_mkdir_trailing_slash_works="guessing yes"],
+ [gl_cv_func_mkdir_trailing_slash_works="guessing no"])
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_mkdir_trailing_slash_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -rf conftest.dir
+ ])
+ case "$gl_cv_func_mkdir_trailing_slash_works" in
+ *yes) ;;
+ *)
+ REPLACE_MKDIR=1
+ ;;
+ esac
+
+ AC_CACHE_CHECK([whether mkdir handles trailing dot],
+ [gl_cv_func_mkdir_trailing_dot_works],
+ [rm -rf conftest.dir
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ ]GL_MDA_DEFINES],
+ [[return !mkdir ("conftest.dir/./", 0700);]])],
+ [gl_cv_func_mkdir_trailing_dot_works=yes],
+ [gl_cv_func_mkdir_trailing_dot_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_mkdir_trailing_dot_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -rf conftest.dir
+ ]
+ )
+ case "$gl_cv_func_mkdir_trailing_dot_works" in
+ *yes) ;;
+ *)
+ REPLACE_MKDIR=1
+ AC_DEFINE([FUNC_MKDIR_DOT_BUG], [1], [Define to 1 if mkdir mistakenly
+ creates a directory given with a trailing dot component.])
+ ;;
+ esac
+])
diff --git a/gl/m4/mkdtemp.m4 b/gl/m4/mkdtemp.m4
new file mode 100644
index 0000000..b616a9a
--- /dev/null
+++ b/gl/m4/mkdtemp.m4
@@ -0,0 +1,20 @@
+# mkdtemp.m4 serial 8
+dnl Copyright (C) 2001-2003, 2006-2007, 2009-2022 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_MKDTEMP],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_CHECK_FUNCS([mkdtemp])
+ if test $ac_cv_func_mkdtemp = no; then
+ HAVE_MKDTEMP=0
+ fi
+])
+
+# Prerequisites of lib/mkdtemp.c
+AC_DEFUN([gl_PREREQ_MKDTEMP],
+[:
+])
diff --git a/gl/m4/mkstemp.m4 b/gl/m4/mkstemp.m4
new file mode 100644
index 0000000..322f4bc
--- /dev/null
+++ b/gl/m4/mkstemp.m4
@@ -0,0 +1,87 @@
+#serial 28
+
+# Copyright (C) 2001, 2003-2007, 2009-2022 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.
+
+# On some hosts (e.g., HP-UX 10.20, SunOS 4.1.4, Solaris 2.5.1), mkstemp has a
+# silly limit that it can create no more than 26 files from a given template.
+# Other systems lack mkstemp altogether.
+# On OSF1/Tru64 V4.0F, the system-provided mkstemp function can create
+# only 32 files per process.
+# On some hosts, mkstemp creates files with mode 0666, which is a security
+# problem and a violation of POSIX 2008.
+# On systems like the above, arrange to use the replacement function.
+AC_DEFUN([gl_FUNC_MKSTEMP],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ AC_CHECK_FUNCS_ONCE([mkstemp])
+ if test $ac_cv_func_mkstemp = yes; then
+ AC_CACHE_CHECK([for working mkstemp],
+ [gl_cv_func_working_mkstemp],
+ [
+ mkdir conftest.mkstemp
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [AC_INCLUDES_DEFAULT
+ GL_MDA_DEFINES],
+ [[int result = 0;
+ int i;
+ off_t large = (off_t) 4294967295u;
+ if (large < 0)
+ large = 2147483647;
+ umask (0);
+ for (i = 0; i < 70; i++)
+ {
+ char templ[] = "conftest.mkstemp/coXXXXXX";
+ int (*mkstemp_function) (char *) = mkstemp;
+ int fd = mkstemp_function (templ);
+ if (fd < 0)
+ result |= 1;
+ else
+ {
+ struct stat st;
+ if (lseek (fd, large, SEEK_SET) != large)
+ result |= 2;
+ if (fstat (fd, &st) < 0)
+ result |= 4;
+ else if (st.st_mode & 0077)
+ result |= 8;
+ if (close (fd))
+ result |= 16;
+ }
+ }
+ return result;]])],
+ [gl_cv_func_working_mkstemp=yes],
+ [gl_cv_func_working_mkstemp=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_working_mkstemp="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_working_mkstemp="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_working_mkstemp="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_working_mkstemp="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -rf conftest.mkstemp
+ ])
+ case "$gl_cv_func_working_mkstemp" in
+ *yes) ;;
+ *)
+ REPLACE_MKSTEMP=1
+ ;;
+ esac
+ else
+ HAVE_MKSTEMP=0
+ fi
+])
+
+# Prerequisites of lib/mkstemp.c.
+AC_DEFUN([gl_PREREQ_MKSTEMP],
+[
+])
diff --git a/gl/m4/mmap-anon.m4 b/gl/m4/mmap-anon.m4
new file mode 100644
index 0000000..a4580ff
--- /dev/null
+++ b/gl/m4/mmap-anon.m4
@@ -0,0 +1,55 @@
+# mmap-anon.m4 serial 12
+dnl Copyright (C) 2005, 2007, 2009-2022 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.
+
+# Detect how mmap can be used to create anonymous (not file-backed) memory
+# mappings.
+# - On Linux, AIX, OSF/1, Solaris, Cygwin, Interix, Haiku, both MAP_ANONYMOUS
+# and MAP_ANON exist and have the same value.
+# - On HP-UX, only MAP_ANONYMOUS exists.
+# - On Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, only MAP_ANON exists.
+# - On IRIX, neither exists, and a file descriptor opened to /dev/zero must be
+# used.
+
+AC_DEFUN_ONCE([gl_FUNC_MMAP_ANON],
+[
+ dnl Persuade glibc <sys/mman.h> to define MAP_ANONYMOUS.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
+ # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
+ # irrelevant for anonymous mappings.
+ AC_CHECK_FUNC([mmap], [gl_have_mmap=yes], [gl_have_mmap=no])
+
+ # Try to allow MAP_ANONYMOUS.
+ gl_have_mmap_anonymous=no
+ if test $gl_have_mmap = yes; then
+ AC_MSG_CHECKING([for MAP_ANONYMOUS])
+ AC_EGREP_CPP([I cannot identify this map], [
+#include <sys/mman.h>
+#ifdef MAP_ANONYMOUS
+ I cannot identify this map
+#endif
+],
+ [gl_have_mmap_anonymous=yes])
+ if test $gl_have_mmap_anonymous != yes; then
+ AC_EGREP_CPP([I cannot identify this map], [
+#include <sys/mman.h>
+#ifdef MAP_ANON
+ I cannot identify this map
+#endif
+],
+ [AC_DEFINE([MAP_ANONYMOUS], [MAP_ANON],
+ [Define to a substitute value for mmap()'s MAP_ANONYMOUS flag.])
+ gl_have_mmap_anonymous=yes])
+ fi
+ AC_MSG_RESULT([$gl_have_mmap_anonymous])
+ if test $gl_have_mmap_anonymous = yes; then
+ AC_DEFINE([HAVE_MAP_ANONYMOUS], [1],
+ [Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including
+ config.h and <sys/mman.h>.])
+ fi
+ fi
+])
diff --git a/gl/m4/mode_t.m4 b/gl/m4/mode_t.m4
new file mode 100644
index 0000000..e08d27a
--- /dev/null
+++ b/gl/m4/mode_t.m4
@@ -0,0 +1,26 @@
+# mode_t.m4 serial 2
+dnl Copyright (C) 2009-2022 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.
+
+# For using mode_t, it's sufficient to use AC_TYPE_MODE_T and
+# include <sys/types.h>.
+
+# Define PROMOTED_MODE_T to the type that is the result of "default argument
+# promotion" (ISO C 6.5.2.2.(6)) of the type mode_t.
+AC_DEFUN([gl_PROMOTED_TYPE_MODE_T],
+[
+ AC_REQUIRE([AC_TYPE_MODE_T])
+ AC_CACHE_CHECK([for promoted mode_t type], [gl_cv_promoted_mode_t], [
+ dnl Assume mode_t promotes to 'int' if and only if it is smaller than 'int',
+ dnl and to itself otherwise. This assumption is not guaranteed by the ISO C
+ dnl standard, but we don't know of any real-world counterexamples.
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]],
+ [[typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];]])],
+ [gl_cv_promoted_mode_t='int'],
+ [gl_cv_promoted_mode_t='mode_t'])
+ ])
+ AC_DEFINE_UNQUOTED([PROMOTED_MODE_T], [$gl_cv_promoted_mode_t],
+ [Define to the type that is the result of default argument promotions of type mode_t.])
+])
diff --git a/gl/m4/msvc-inval.m4 b/gl/m4/msvc-inval.m4
new file mode 100644
index 0000000..b32cf6e
--- /dev/null
+++ b/gl/m4/msvc-inval.m4
@@ -0,0 +1,19 @@
+# msvc-inval.m4 serial 1
+dnl Copyright (C) 2011-2022 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_MSVC_INVAL],
+[
+ AC_CHECK_FUNCS_ONCE([_set_invalid_parameter_handler])
+ if test $ac_cv_func__set_invalid_parameter_handler = yes; then
+ HAVE_MSVC_INVALID_PARAMETER_HANDLER=1
+ AC_DEFINE([HAVE_MSVC_INVALID_PARAMETER_HANDLER], [1],
+ [Define to 1 on MSVC platforms that have the "invalid parameter handler"
+ concept.])
+ else
+ HAVE_MSVC_INVALID_PARAMETER_HANDLER=0
+ fi
+ AC_SUBST([HAVE_MSVC_INVALID_PARAMETER_HANDLER])
+])
diff --git a/gl/m4/msvc-nothrow.m4 b/gl/m4/msvc-nothrow.m4
new file mode 100644
index 0000000..16ceb1f
--- /dev/null
+++ b/gl/m4/msvc-nothrow.m4
@@ -0,0 +1,10 @@
+# msvc-nothrow.m4 serial 1
+dnl Copyright (C) 2011-2022 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_MSVC_NOTHROW],
+[
+ AC_REQUIRE([gl_MSVC_INVAL])
+])
diff --git a/gl/m4/multiarch.m4 b/gl/m4/multiarch.m4
new file mode 100644
index 0000000..5d94276
--- /dev/null
+++ b/gl/m4/multiarch.m4
@@ -0,0 +1,65 @@
+# multiarch.m4 serial 9
+dnl Copyright (C) 2008-2022 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.
+
+# Determine whether the compiler is or may be producing universal binaries.
+#
+# On Mac OS X 10.5 and later systems, the user can create libraries and
+# executables that work on multiple system types--known as "fat" or
+# "universal" binaries--by specifying multiple '-arch' options to the
+# compiler but only a single '-arch' option to the preprocessor. Like
+# this:
+#
+# ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+# CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+# CPP="gcc -E" CXXCPP="g++ -E"
+#
+# Detect this situation and set APPLE_UNIVERSAL_BUILD accordingly.
+
+AC_DEFUN_ONCE([gl_MULTIARCH],
+[
+ dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN.
+ AC_CACHE_CHECK([whether the compiler produces multi-arch binaries],
+ [gl_cv_c_multiarch],
+ [gl_cv_c_multiarch=no
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+ ]])],
+ [
+ dnl Check for potential -arch flags. It is not universal unless
+ dnl there are at least two -arch flags with different values.
+ arch=
+ prev=
+ for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
+ if test -n "$prev"; then
+ case $word in
+ i?86 | x86_64 | ppc | ppc64 | arm | arm64)
+ if test -z "$arch" || test "$arch" = "$word"; then
+ arch="$word"
+ else
+ gl_cv_c_multiarch=yes
+ fi
+ ;;
+ esac
+ prev=
+ else
+ if test "x$word" = "x-arch"; then
+ prev=arch
+ fi
+ fi
+ done
+ ])
+ ])
+ if test $gl_cv_c_multiarch = yes; then
+ APPLE_UNIVERSAL_BUILD=1
+ else
+ APPLE_UNIVERSAL_BUILD=0
+ fi
+ AC_SUBST([APPLE_UNIVERSAL_BUILD])
+])
diff --git a/gl/m4/nanosleep.m4 b/gl/m4/nanosleep.m4
new file mode 100644
index 0000000..1964b1e
--- /dev/null
+++ b/gl/m4/nanosleep.m4
@@ -0,0 +1,139 @@
+# serial 41
+
+dnl From Jim Meyering.
+dnl Check for the nanosleep function.
+dnl If not found, use the supplied replacement.
+dnl
+
+# Copyright (C) 1999-2001, 2003-2022 Free Software Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_NANOSLEEP],
+[
+ AC_REQUIRE([gl_TIME_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ dnl Persuade glibc and Solaris <time.h> to declare nanosleep.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_DECLS_ONCE([alarm])
+
+ nanosleep_save_libs=$LIBS
+
+ # Solaris 2.5.1 needs -lposix4 to get the nanosleep function.
+ # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
+ LIB_NANOSLEEP=
+ AC_SUBST([LIB_NANOSLEEP])
+ AC_SEARCH_LIBS([nanosleep], [rt posix4],
+ [test "$ac_cv_search_nanosleep" = "none required" ||
+ LIB_NANOSLEEP=$ac_cv_search_nanosleep])
+ if test "x$ac_cv_search_nanosleep" != xno; then
+ dnl The system has a nanosleep function.
+
+ AC_REQUIRE([gl_MULTIARCH])
+ if test $APPLE_UNIVERSAL_BUILD = 1; then
+ # A universal build on Apple Mac OS X platforms.
+ # The test result would be 'no (mishandles large arguments)' in 64-bit
+ # mode but 'yes' in 32-bit mode. But we need a configuration result that
+ # is valid in both modes.
+ gl_cv_func_nanosleep='no (mishandles large arguments)'
+ fi
+
+ AC_CACHE_CHECK([for working nanosleep],
+ [gl_cv_func_nanosleep],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+ #include <errno.h>
+ #include <limits.h>
+ #include <signal.h>
+ #include <time.h>
+ #include <unistd.h>
+ #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+ #define TYPE_MAXIMUM(t) \
+ ((t) (! TYPE_SIGNED (t) \
+ ? (t) -1 \
+ : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
+
+ #if HAVE_DECL_ALARM
+ static void
+ check_for_SIGALRM (int sig)
+ {
+ if (sig != SIGALRM)
+ _exit (1);
+ }
+ #endif
+
+ int
+ main ()
+ {
+ static struct timespec ts_sleep;
+ static struct timespec ts_remaining;
+ /* Test for major problems first. */
+ if (! nanosleep)
+ return 2;
+ ts_sleep.tv_sec = 0;
+ ts_sleep.tv_nsec = 1;
+ #if HAVE_DECL_ALARM
+ {
+ static struct sigaction act;
+ act.sa_handler = check_for_SIGALRM;
+ sigemptyset (&act.sa_mask);
+ sigaction (SIGALRM, &act, NULL);
+ alarm (1);
+ if (nanosleep (&ts_sleep, NULL) != 0)
+ return 3;
+ /* Test for a minor problem: the handling of large arguments. */
+ ts_sleep.tv_sec = TYPE_MAXIMUM (time_t);
+ ts_sleep.tv_nsec = 999999999;
+ alarm (1);
+ if (nanosleep (&ts_sleep, &ts_remaining) != -1)
+ return 4;
+ if (errno != EINTR)
+ return 5;
+ if (ts_remaining.tv_sec <= TYPE_MAXIMUM (time_t) - 10)
+ return 6;
+ }
+ #else /* A simpler test for native Windows. */
+ if (nanosleep (&ts_sleep, &ts_remaining) < 0)
+ return 3;
+ #endif
+ return 0;
+ }]])],
+ [gl_cv_func_nanosleep=yes],
+ [case $? in dnl (
+ 4|5|6) gl_cv_func_nanosleep='no (mishandles large arguments)';; dnl (
+ *) gl_cv_func_nanosleep=no;;
+ esac],
+ [case "$host_os" in dnl ((
+ linux*) # Guess it halfway works when the kernel is Linux.
+ gl_cv_func_nanosleep='guessing no (mishandles large arguments)' ;;
+ mingw*) # Guess no on native Windows.
+ gl_cv_func_nanosleep='guessing no' ;;
+ *) # If we don't know, obey --enable-cross-guesses.
+ gl_cv_func_nanosleep="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_nanosleep" in
+ *yes)
+ REPLACE_NANOSLEEP=0
+ ;;
+ *)
+ REPLACE_NANOSLEEP=1
+ case "$gl_cv_func_nanosleep" in
+ *"mishandles large arguments"*)
+ AC_DEFINE([HAVE_BUG_BIG_NANOSLEEP], [1],
+ [Define to 1 if nanosleep mishandles large arguments.])
+ ;;
+ esac
+ ;;
+ esac
+ else
+ HAVE_NANOSLEEP=0
+ fi
+ LIBS=$nanosleep_save_libs
+])
diff --git a/gl/m4/nl_langinfo.m4 b/gl/m4/nl_langinfo.m4
new file mode 100644
index 0000000..d20a09c
--- /dev/null
+++ b/gl/m4/nl_langinfo.m4
@@ -0,0 +1,77 @@
+# nl_langinfo.m4 serial 8
+dnl Copyright (C) 2009-2022 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_NL_LANGINFO],
+[
+ AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
+ AC_REQUIRE([gl_LANGINFO_H])
+ AC_CHECK_FUNCS_ONCE([nl_langinfo])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
+ AC_REQUIRE([gl_PTHREADLIB])
+ AC_CHECK_HEADERS_ONCE([threads.h])
+ if test $ac_cv_func_nl_langinfo = yes; then
+ # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken.
+ AC_CACHE_CHECK([whether YESEXPR works],
+ [gl_cv_func_nl_langinfo_yesexpr_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[#include <langinfo.h>
+]], [[return !*nl_langinfo(YESEXPR);
+]])],
+ [gl_cv_func_nl_langinfo_yesexpr_works=yes],
+ [gl_cv_func_nl_langinfo_yesexpr_works=no],
+ [
+ case "$host_os" in
+ # Guess no on irix systems.
+ irix*) gl_cv_func_nl_langinfo_yesexpr_works="guessing no";;
+ # Guess yes elsewhere.
+ *) gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";;
+ esac
+ ])
+ ])
+ case $gl_cv_func_nl_langinfo_yesexpr_works in
+ *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;;
+ *) FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;;
+ esac
+ AC_DEFINE_UNQUOTED([FUNC_NL_LANGINFO_YESEXPR_WORKS],
+ [$FUNC_NL_LANGINFO_YESEXPR_WORKS],
+ [Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string.])
+ # On Solaris 10 and Solaris 11.3, nl_langinfo is not multithread-safe.
+ case "$host_os" in
+ solaris*) NL_LANGINFO_MTSAFE=0 ;;
+ *) NL_LANGINFO_MTSAFE=1 ;;
+ esac
+ AC_DEFINE_UNQUOTED([NL_LANGINFO_MTSAFE], [$NL_LANGINFO_MTSAFE],
+ [Define to 1 if nl_langinfo is multithread-safe.])
+ if test $HAVE_LANGINFO_CODESET = 1 \
+ && test $HAVE_LANGINFO_T_FMT_AMPM = 1 \
+ && test $HAVE_LANGINFO_ALTMON = 1 \
+ && test $HAVE_LANGINFO_ERA = 1 \
+ && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1 \
+ && test $NL_LANGINFO_MTSAFE = 1; then
+ :
+ else
+ REPLACE_NL_LANGINFO=1
+ AC_DEFINE([REPLACE_NL_LANGINFO], [1],
+ [Define if nl_langinfo exists but is overridden by gnulib.])
+ fi
+ else
+ HAVE_NL_LANGINFO=0
+ fi
+ if test $HAVE_NL_LANGINFO = 0 || test $HAVE_LANGINFO_CODESET = 0; then
+ LIB_NL_LANGINFO="$LIB_SETLOCALE_NULL"
+ else
+ LIB_NL_LANGINFO=
+ fi
+ dnl LIB_NL_LANGINFO is expected to be empty everywhere.
+ AC_SUBST([LIB_NL_LANGINFO])
+])
+
+# Prerequisites of lib/nl_langinfo-lock.c.
+AC_DEFUN([gl_PREREQ_NL_LANGINFO_LOCK],
+[
+ gl_VISIBILITY
+])
diff --git a/gl/m4/nls.m4 b/gl/m4/nls.m4
new file mode 100644
index 0000000..8f8a147
--- /dev/null
+++ b/gl/m4/nls.m4
@@ -0,0 +1,32 @@
+# nls.m4 serial 5 (gettext-0.18)
+dnl Copyright (C) 1995-2003, 2005-2006, 2008-2013 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+AC_PREREQ([2.50])
+
+AC_DEFUN([AM_NLS],
+[
+ AC_MSG_CHECKING([whether NLS is requested])
+ dnl Default is enabled NLS
+ AC_ARG_ENABLE([nls],
+ [ --disable-nls do not use Native Language Support],
+ USE_NLS=$enableval, USE_NLS=yes)
+ AC_MSG_RESULT([$USE_NLS])
+ AC_SUBST([USE_NLS])
+])
diff --git a/gl/m4/nocrash.m4 b/gl/m4/nocrash.m4
new file mode 100644
index 0000000..91f00c1
--- /dev/null
+++ b/gl/m4/nocrash.m4
@@ -0,0 +1,131 @@
+# nocrash.m4 serial 5
+dnl Copyright (C) 2005, 2009-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Based on libsigsegv, from Bruno Haible and Paolo Bonzini.
+
+AC_PREREQ([2.13])
+
+dnl Expands to some code for use in .c programs that will cause the configure
+dnl test to exit instead of crashing. This is useful to avoid triggering
+dnl action from a background debugger and to avoid core dumps.
+dnl Usage: ...
+dnl ]GL_NOCRASH[
+dnl ...
+dnl int main() { nocrash_init(); ... }
+AC_DEFUN([GL_NOCRASH],[[
+#include <stdlib.h>
+#if defined __MACH__ && defined __APPLE__
+/* Avoid a crash on Mac OS X. */
+#include <mach/mach.h>
+#include <mach/mach_error.h>
+#include <mach/thread_status.h>
+#include <mach/exception.h>
+#include <mach/task.h>
+#include <pthread.h>
+/* The exception port on which our thread listens. */
+static mach_port_t our_exception_port;
+/* The main function of the thread listening for exceptions of type
+ EXC_BAD_ACCESS. */
+static void *
+mach_exception_thread (void *arg)
+{
+ /* Buffer for a message to be received. */
+ struct {
+ mach_msg_header_t head;
+ mach_msg_body_t msgh_body;
+ char data[1024];
+ } msg;
+ mach_msg_return_t retval;
+ /* Wait for a message on the exception port. */
+ retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
+ our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
+ if (retval != MACH_MSG_SUCCESS)
+ abort ();
+ exit (1);
+}
+static void
+nocrash_init (void)
+{
+ mach_port_t self = mach_task_self ();
+ /* Allocate a port on which the thread shall listen for exceptions. */
+ if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
+ == KERN_SUCCESS) {
+ /* See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */
+ if (mach_port_insert_right (self, our_exception_port, our_exception_port,
+ MACH_MSG_TYPE_MAKE_SEND)
+ == KERN_SUCCESS) {
+ /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting
+ for us. */
+ exception_mask_t mask = EXC_MASK_BAD_ACCESS;
+ /* Create the thread listening on the exception port. */
+ pthread_attr_t attr;
+ pthread_t thread;
+ if (pthread_attr_init (&attr) == 0
+ && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
+ && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
+ pthread_attr_destroy (&attr);
+ /* Replace the exception port info for these exceptions with our own.
+ Note that we replace the exception port for the entire task, not only
+ for a particular thread. This has the effect that when our exception
+ port gets the message, the thread specific exception port has already
+ been asked, and we don't need to bother about it.
+ See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */
+ task_set_exception_ports (self, mask, our_exception_port,
+ EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
+ }
+ }
+ }
+}
+#elif defined _WIN32 && ! defined __CYGWIN__
+/* Avoid a crash on native Windows. */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <winerror.h>
+static LONG WINAPI
+exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
+{
+ switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
+ {
+ case EXCEPTION_ACCESS_VIOLATION:
+ case EXCEPTION_IN_PAGE_ERROR:
+ case EXCEPTION_STACK_OVERFLOW:
+ case EXCEPTION_GUARD_PAGE:
+ case EXCEPTION_PRIV_INSTRUCTION:
+ case EXCEPTION_ILLEGAL_INSTRUCTION:
+ case EXCEPTION_DATATYPE_MISALIGNMENT:
+ case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
+ case EXCEPTION_NONCONTINUABLE_EXCEPTION:
+ exit (1);
+ }
+ return EXCEPTION_CONTINUE_SEARCH;
+}
+static void
+nocrash_init (void)
+{
+ SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
+}
+#else
+/* Avoid a crash on POSIX systems. */
+#include <signal.h>
+#include <unistd.h>
+/* A POSIX signal handler. */
+static void
+exception_handler (int sig)
+{
+ _exit (1);
+}
+static void
+nocrash_init (void)
+{
+#ifdef SIGSEGV
+ signal (SIGSEGV, exception_handler);
+#endif
+#ifdef SIGBUS
+ signal (SIGBUS, exception_handler);
+#endif
+}
+#endif
+]])
diff --git a/gl/m4/nonblocking.m4 b/gl/m4/nonblocking.m4
new file mode 100644
index 0000000..b9d2325
--- /dev/null
+++ b/gl/m4/nonblocking.m4
@@ -0,0 +1,29 @@
+# nonblocking.m4 serial 3
+dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Tests whether non-blocking I/O is natively supported by read(), write().
+dnl Sets gl_cv_have_nonblocking.
+dnl Also tests whether open() supports O_NONBLOCK.
+dnl Sets gl_cv_have_open_O_NONBLOCK.
+AC_DEFUN([gl_NONBLOCKING_IO],
+[
+ dnl Ensure to expand the default settings once only, before all statements
+ dnl that occur in other macros.
+ AC_REQUIRE([gl_NONBLOCKING_IO_BODY])
+])
+
+AC_DEFUN([gl_NONBLOCKING_IO_BODY],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ mingw*) gl_cv_have_nonblocking=no ;;
+ *) gl_cv_have_nonblocking=yes ;;
+ esac
+ case "$host_os" in
+ mingw*) gl_cv_have_open_O_NONBLOCK=no ;;
+ *) gl_cv_have_open_O_NONBLOCK=yes ;;
+ esac
+])
diff --git a/gl/m4/off_t.m4 b/gl/m4/off_t.m4
new file mode 100644
index 0000000..0890ada
--- /dev/null
+++ b/gl/m4/off_t.m4
@@ -0,0 +1,18 @@
+# off_t.m4 serial 1
+dnl Copyright (C) 2012-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Check whether to override the 'off_t' type.
+dnl Set WINDOWS_64_BIT_OFF_T.
+
+AC_DEFUN([gl_TYPE_OFF_T],
+[
+ m4_ifdef([gl_LARGEFILE], [
+ AC_REQUIRE([gl_LARGEFILE])
+ ], [
+ WINDOWS_64_BIT_OFF_T=0
+ ])
+ AC_SUBST([WINDOWS_64_BIT_OFF_T])
+])
diff --git a/gl/m4/open-cloexec.m4 b/gl/m4/open-cloexec.m4
new file mode 100644
index 0000000..16cd5ec
--- /dev/null
+++ b/gl/m4/open-cloexec.m4
@@ -0,0 +1,21 @@
+# Test whether O_CLOEXEC is defined.
+
+dnl Copyright 2017-2022 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_PREPROC_O_CLOEXEC],
+[
+ AC_CACHE_CHECK([for O_CLOEXEC],
+ [gl_cv_macro_O_CLOEXEC],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <fcntl.h>
+ #ifndef O_CLOEXEC
+ choke me;
+ #endif
+ ]],
+ [[return O_CLOEXEC;]])],
+ [gl_cv_macro_O_CLOEXEC=yes],
+ [gl_cv_macro_O_CLOEXEC=no])])
+])
diff --git a/gl/m4/open-slash.m4 b/gl/m4/open-slash.m4
new file mode 100644
index 0000000..4fbf491
--- /dev/null
+++ b/gl/m4/open-slash.m4
@@ -0,0 +1,60 @@
+# open-slash.m4 serial 2
+dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Tests whether open() and creat() recognize a trailing slash.
+dnl Sets gl_cv_func_open_slash.
+AC_DEFUN([gl_OPEN_TRAILING_SLASH_BUG],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ dnl open("foo/") should not create a file when the file name has a
+ dnl trailing slash. FreeBSD only has the problem on symlinks.
+ AC_CHECK_FUNCS_ONCE([lstat])
+ AC_CACHE_CHECK([whether open recognizes a trailing slash],
+ [gl_cv_func_open_slash],
+ [# Assume that if we have lstat, we can also check symlinks.
+ if test $ac_cv_func_lstat = yes; then
+ touch conftest.tmp
+ ln -s conftest.tmp conftest.lnk
+ fi
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <fcntl.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+]GL_MDA_DEFINES[
+int main ()
+{
+ int result = 0;
+#if HAVE_LSTAT
+ if (open ("conftest.lnk/", O_RDONLY) != -1)
+ result |= 1;
+#endif
+ if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
+ result |= 2;
+ return result;
+}]])],
+ [gl_cv_func_open_slash=yes],
+ [gl_cv_func_open_slash=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
+ gl_cv_func_open_slash="guessing no" ;;
+ *)
+ gl_cv_func_open_slash="guessing yes" ;;
+ esac
+changequote([,])dnl
+ ])
+ rm -f conftest.sl conftest.tmp conftest.lnk
+ ])
+ case "$gl_cv_func_open_slash" in
+ *no)
+ AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1],
+ [Define to 1 if open() fails to recognize a trailing slash.])
+ ;;
+ esac
+])
diff --git a/gl/m4/open.m4 b/gl/m4/open.m4
new file mode 100644
index 0000000..f82fd6c
--- /dev/null
+++ b/gl/m4/open.m4
@@ -0,0 +1,56 @@
+# open.m4 serial 15
+dnl Copyright (C) 2007-2022 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_OPEN],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_PREPROC_O_CLOEXEC])
+ case "$host_os" in
+ mingw* | pw*)
+ REPLACE_OPEN=1
+ ;;
+ *)
+ dnl open("foo/") should not create a file when the file name has a
+ dnl trailing slash. FreeBSD only has the problem on symlinks.
+ AC_CHECK_FUNCS_ONCE([lstat])
+ if test "$gl_cv_macro_O_CLOEXEC" != yes; then
+ REPLACE_OPEN=1
+ fi
+ gl_OPEN_TRAILING_SLASH_BUG
+ case "$gl_cv_func_open_slash" in
+ *no)
+ REPLACE_OPEN=1
+ ;;
+ esac
+ ;;
+ esac
+ dnl Replace open() for supporting the gnulib-defined fchdir() function,
+ dnl to keep fchdir's bookkeeping up-to-date.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ if test $REPLACE_OPEN = 0; then
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ REPLACE_OPEN=1
+ fi
+ fi
+ ])
+ dnl Replace open() for supporting the gnulib-defined O_NONBLOCK flag.
+ m4_ifdef([gl_NONBLOCKING_IO], [
+ if test $REPLACE_OPEN = 0; then
+ gl_NONBLOCKING_IO
+ if test $gl_cv_have_open_O_NONBLOCK != yes; then
+ REPLACE_OPEN=1
+ fi
+ fi
+ ])
+])
+
+# Prerequisites of lib/open.c.
+AC_DEFUN([gl_PREREQ_OPEN],
+[
+ AC_REQUIRE([gl_PROMOTED_TYPE_MODE_T])
+ :
+])
diff --git a/gl/m4/openat.m4 b/gl/m4/openat.m4
new file mode 100644
index 0000000..de74799
--- /dev/null
+++ b/gl/m4/openat.m4
@@ -0,0 +1,38 @@
+# serial 46
+# See if we need to use our replacement for Solaris' openat et al functions.
+
+dnl Copyright (C) 2004-2022 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.
+
+# Written by Jim Meyering.
+
+AC_DEFUN([gl_FUNC_OPENAT],
+[
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_FUNCS_ONCE([openat])
+ AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+ AC_REQUIRE([gl_PREPROC_O_CLOEXEC])
+ case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink+$gl_cv_macro_O_CLOEXEC in
+ yes+*yes+yes)
+ ;;
+ yes+*)
+ # Solaris 10 lacks O_CLOEXEC.
+ # Solaris 9 has *at functions, but uniformly mishandles trailing
+ # slash in all of them.
+ REPLACE_OPENAT=1
+ ;;
+ *)
+ HAVE_OPENAT=0
+ ;;
+ esac
+])
+
+# Prerequisites of lib/openat.c.
+AC_DEFUN([gl_PREREQ_OPENAT],
+[
+ AC_REQUIRE([gl_PROMOTED_TYPE_MODE_T])
+ :
+])
diff --git a/gl/m4/opendir.m4 b/gl/m4/opendir.m4
new file mode 100644
index 0000000..7816dc5
--- /dev/null
+++ b/gl/m4/opendir.m4
@@ -0,0 +1,32 @@
+# opendir.m4 serial 5
+dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_OPENDIR],
+[
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ AC_CHECK_FUNCS([opendir])
+ if test $ac_cv_func_opendir = no; then
+ HAVE_OPENDIR=0
+ fi
+ dnl Replace opendir() for supporting the gnulib-defined fchdir() function,
+ dnl to keep fchdir's bookkeeping up-to-date.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ if test $HAVE_OPENDIR = 1; then
+ REPLACE_OPENDIR=1
+ fi
+ fi
+ ])
+ dnl Replace opendir() on OS/2 kLIBC to support dirfd() function replaced
+ dnl by gnulib.
+ case $host_os,$HAVE_OPENDIR in
+ os2*,1)
+ REPLACE_OPENDIR=1;;
+ esac
+])
diff --git a/gl/m4/pathmax.m4 b/gl/m4/pathmax.m4
new file mode 100644
index 0000000..44add99
--- /dev/null
+++ b/gl/m4/pathmax.m4
@@ -0,0 +1,42 @@
+# pathmax.m4 serial 11
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2022 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_PATHMAX],
+[
+ dnl Prerequisites of lib/pathmax.h.
+ AC_CHECK_HEADERS_ONCE([sys/param.h])
+])
+
+# Expands to a piece of C program that defines PATH_MAX in the same way as
+# "pathmax.h" will do.
+AC_DEFUN([gl_PATHMAX_SNIPPET], [[
+/* Arrange to define PATH_MAX, like "pathmax.h" does. */
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <limits.h>
+#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
+# include <sys/param.h>
+#endif
+#if !defined PATH_MAX && defined MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+#endif
+#ifdef __hpux
+# undef PATH_MAX
+# define PATH_MAX 1024
+#endif
+#if defined _WIN32 && ! defined __CYGWIN__
+# undef PATH_MAX
+# define PATH_MAX 260
+#endif
+]])
+
+# Prerequisites of gl_PATHMAX_SNIPPET.
+AC_DEFUN([gl_PATHMAX_SNIPPET_PREREQ],
+[
+ AC_CHECK_HEADERS_ONCE([unistd.h sys/param.h])
+])
diff --git a/gl/m4/pipe.m4 b/gl/m4/pipe.m4
new file mode 100644
index 0000000..62871c6
--- /dev/null
+++ b/gl/m4/pipe.m4
@@ -0,0 +1,15 @@
+# pipe.m4 serial 2
+dnl Copyright (C) 2010-2022 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_PIPE],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+
+ AC_CHECK_FUNCS_ONCE([pipe])
+ if test $ac_cv_func_pipe != yes; then
+ HAVE_PIPE=0
+ fi
+])
diff --git a/gl/m4/po.m4 b/gl/m4/po.m4
new file mode 100644
index 0000000..1c70b6c
--- /dev/null
+++ b/gl/m4/po.m4
@@ -0,0 +1,453 @@
+# po.m4 serial 21 (gettext-0.18.3)
+dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+AC_PREREQ([2.60])
+
+dnl Checks for all prerequisites of the po subdirectory.
+AC_DEFUN([AM_PO_SUBDIRS],
+[
+ AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+ AC_REQUIRE([AC_PROG_INSTALL])dnl
+ AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+ AC_REQUIRE([AC_PROG_SED])dnl
+ AC_REQUIRE([AM_NLS])dnl
+
+ dnl Release version of the gettext macros. This is used to ensure that
+ dnl the gettext macros and po/Makefile.in.in are in sync.
+ AC_SUBST([GETTEXT_MACRO_VERSION], [0.18])
+
+ dnl Perform the following tests also if --disable-nls has been given,
+ dnl because they are needed for "make dist" to work.
+
+ dnl Search for GNU msgfmt in the PATH.
+ dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
+ dnl The second test excludes FreeBSD msgfmt.
+ AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+ [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
+ (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+ :)
+ AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
+
+ dnl Test whether it is GNU msgfmt >= 0.15.
+changequote(,)dnl
+ case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
+ *) MSGFMT_015=$MSGFMT ;;
+ esac
+changequote([,])dnl
+ AC_SUBST([MSGFMT_015])
+changequote(,)dnl
+ case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
+ *) GMSGFMT_015=$GMSGFMT ;;
+ esac
+changequote([,])dnl
+ AC_SUBST([GMSGFMT_015])
+
+ dnl Search for GNU xgettext 0.12 or newer in the PATH.
+ dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
+ dnl The second test excludes FreeBSD xgettext.
+ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
+ (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+ :)
+ dnl Remove leftover from FreeBSD xgettext call.
+ rm -f messages.po
+
+ dnl Test whether it is GNU xgettext >= 0.15.
+changequote(,)dnl
+ case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
+ *) XGETTEXT_015=$XGETTEXT ;;
+ esac
+changequote([,])dnl
+ AC_SUBST([XGETTEXT_015])
+
+ dnl Search for GNU msgmerge 0.11 or newer in the PATH.
+ AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
+ [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
+
+ dnl Installation directories.
+ dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
+ dnl have to define it here, so that it can be used in po/Makefile.
+ test -n "$localedir" || localedir='${datadir}/locale'
+ AC_SUBST([localedir])
+
+ dnl Support for AM_XGETTEXT_OPTION.
+ test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
+ AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
+
+ AC_CONFIG_COMMANDS([po-directories], [[
+ for ac_file in $CONFIG_FILES; do
+ # Support "outfile[:infile[:infile...]]"
+ case "$ac_file" in
+ *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ esac
+ # PO directories have a Makefile.in generated from Makefile.in.in.
+ case "$ac_file" in */Makefile.in)
+ # Adjust a relative srcdir.
+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+ ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+ # In autoconf-2.13 it is called $ac_given_srcdir.
+ # In autoconf-2.50 it is called $srcdir.
+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+ case "$ac_given_srcdir" in
+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+ /*) top_srcdir="$ac_given_srcdir" ;;
+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+ # Treat a directory as a PO directory if and only if it has a
+ # POTFILES.in file. This allows packages to have multiple PO
+ # directories under different names or in different locations.
+ if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
+ rm -f "$ac_dir/POTFILES"
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
+ gt_tab=`printf '\t'`
+ cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+ POMAKEFILEDEPS="POTFILES.in"
+ # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
+ # on $ac_dir but don't depend on user-specified configuration
+ # parameters.
+ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+ # The LINGUAS file contains the set of available languages.
+ if test -n "$OBSOLETE_ALL_LINGUAS"; then
+ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+ fi
+ ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+ # Hide the ALL_LINGUAS assignment from automake < 1.5.
+ eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+ else
+ # The set of available languages was given in configure.in.
+ # Hide the ALL_LINGUAS assignment from automake < 1.5.
+ eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
+ fi
+ # Compute POFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+ # Compute UPDATEPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+ # Compute DUMMYPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+ # Compute GMOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+ case "$ac_given_srcdir" in
+ .) srcdirpre= ;;
+ *) srcdirpre='$(srcdir)/' ;;
+ esac
+ POFILES=
+ UPDATEPOFILES=
+ DUMMYPOFILES=
+ GMOFILES=
+ for lang in $ALL_LINGUAS; do
+ POFILES="$POFILES $srcdirpre$lang.po"
+ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+ DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+ done
+ # CATALOGS depends on both $ac_dir and the user's LINGUAS
+ # environment variable.
+ INST_LINGUAS=
+ if test -n "$ALL_LINGUAS"; then
+ for presentlang in $ALL_LINGUAS; do
+ useit=no
+ if test "%UNSET%" != "$LINGUAS"; then
+ desiredlanguages="$LINGUAS"
+ else
+ desiredlanguages="$ALL_LINGUAS"
+ fi
+ for desiredlang in $desiredlanguages; do
+ # Use the presentlang catalog if desiredlang is
+ # a. equal to presentlang, or
+ # b. a variant of presentlang (because in this case,
+ # presentlang can be used as a fallback for messages
+ # which are not translated in the desiredlang catalog).
+ case "$desiredlang" in
+ "$presentlang"*) useit=yes;;
+ esac
+ done
+ if test $useit = yes; then
+ INST_LINGUAS="$INST_LINGUAS $presentlang"
+ fi
+ done
+ fi
+ CATALOGS=
+ if test -n "$INST_LINGUAS"; then
+ for lang in $INST_LINGUAS; do
+ CATALOGS="$CATALOGS $lang.gmo"
+ done
+ fi
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
+ sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
+ for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
+ if test -f "$f"; then
+ case "$f" in
+ *.orig | *.bak | *~) ;;
+ *) cat "$f" >> "$ac_dir/Makefile" ;;
+ esac
+ fi
+ done
+ fi
+ ;;
+ esac
+ done]],
+ [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
+ # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
+ # from automake < 1.5.
+ eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
+ # Capture the value of LINGUAS because we need it to compute CATALOGS.
+ LINGUAS="${LINGUAS-%UNSET%}"
+ ])
+])
+
+dnl Postprocesses a Makefile in a directory containing PO files.
+AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
+[
+ # When this code is run, in config.status, two variables have already been
+ # set:
+ # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
+ # - LINGUAS is the value of the environment variable LINGUAS at configure
+ # time.
+
+changequote(,)dnl
+ # Adjust a relative srcdir.
+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+ ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+ # In autoconf-2.13 it is called $ac_given_srcdir.
+ # In autoconf-2.50 it is called $srcdir.
+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+ case "$ac_given_srcdir" in
+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+ /*) top_srcdir="$ac_given_srcdir" ;;
+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+ # Find a way to echo strings without interpreting backslash.
+ if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
+ gt_echo='echo'
+ else
+ if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
+ gt_echo='printf %s\n'
+ else
+ echo_func () {
+ cat <<EOT
+$*
+EOT
+ }
+ gt_echo='echo_func'
+ fi
+ fi
+
+ # A sed script that extracts the value of VARIABLE from a Makefile.
+ tab=`printf '\t'`
+ sed_x_variable='
+# Test if the hold space is empty.
+x
+s/P/P/
+x
+ta
+# Yes it was empty. Look if we have the expected variable definition.
+/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{
+ # Seen the first line of the variable definition.
+ s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=//
+ ba
+}
+bd
+:a
+# Here we are processing a line from the variable definition.
+# Remove comment, more precisely replace it with a space.
+s/#.*$/ /
+# See if the line ends in a backslash.
+tb
+:b
+s/\\$//
+# Print the line, without the trailing backslash.
+p
+tc
+# There was no trailing backslash. The end of the variable definition is
+# reached. Clear the hold space.
+s/^.*$//
+x
+bd
+:c
+# A trailing backslash means that the variable definition continues in the
+# next line. Put a nonempty string into the hold space to indicate this.
+s/^.*$/P/
+x
+:d
+'
+changequote([,])dnl
+
+ # Set POTFILES to the value of the Makefile variable POTFILES.
+ sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
+ POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
+ # Compute POTFILES_DEPS as
+ # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
+ POTFILES_DEPS=
+ for file in $POTFILES; do
+ POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
+ done
+ POMAKEFILEDEPS=""
+
+ if test -n "$OBSOLETE_ALL_LINGUAS"; then
+ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+ fi
+ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+ # The LINGUAS file contains the set of available languages.
+ ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+ else
+ # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
+ sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
+ ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
+ fi
+ # Hide the ALL_LINGUAS assignment from automake < 1.5.
+ eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+ # Compute POFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+ # Compute UPDATEPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+ # Compute DUMMYPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+ # Compute GMOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+ # Compute PROPERTIESFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
+ # Compute CLASSFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
+ # Compute QMFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
+ # Compute MSGFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
+ # Compute RESOURCESDLLFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
+ case "$ac_given_srcdir" in
+ .) srcdirpre= ;;
+ *) srcdirpre='$(srcdir)/' ;;
+ esac
+ POFILES=
+ UPDATEPOFILES=
+ DUMMYPOFILES=
+ GMOFILES=
+ PROPERTIESFILES=
+ CLASSFILES=
+ QMFILES=
+ MSGFILES=
+ RESOURCESDLLFILES=
+ for lang in $ALL_LINGUAS; do
+ POFILES="$POFILES $srcdirpre$lang.po"
+ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+ DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+ PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
+ CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
+ QMFILES="$QMFILES $srcdirpre$lang.qm"
+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+ MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
+ frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+ RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
+ done
+ # CATALOGS depends on both $ac_dir and the user's LINGUAS
+ # environment variable.
+ INST_LINGUAS=
+ if test -n "$ALL_LINGUAS"; then
+ for presentlang in $ALL_LINGUAS; do
+ useit=no
+ if test "%UNSET%" != "$LINGUAS"; then
+ desiredlanguages="$LINGUAS"
+ else
+ desiredlanguages="$ALL_LINGUAS"
+ fi
+ for desiredlang in $desiredlanguages; do
+ # Use the presentlang catalog if desiredlang is
+ # a. equal to presentlang, or
+ # b. a variant of presentlang (because in this case,
+ # presentlang can be used as a fallback for messages
+ # which are not translated in the desiredlang catalog).
+ case "$desiredlang" in
+ "$presentlang"*) useit=yes;;
+ esac
+ done
+ if test $useit = yes; then
+ INST_LINGUAS="$INST_LINGUAS $presentlang"
+ fi
+ done
+ fi
+ CATALOGS=
+ JAVACATALOGS=
+ QTCATALOGS=
+ TCLCATALOGS=
+ CSHARPCATALOGS=
+ if test -n "$INST_LINGUAS"; then
+ for lang in $INST_LINGUAS; do
+ CATALOGS="$CATALOGS $lang.gmo"
+ JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
+ QTCATALOGS="$QTCATALOGS $lang.qm"
+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+ TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
+ frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+ CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
+ done
+ fi
+
+ sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
+ tab=`printf '\t'`
+ if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
+ # Add dependencies that cannot be formulated as a simple suffix rule.
+ for lang in $ALL_LINGUAS; do
+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+ cat >> "$ac_file.tmp" <<EOF
+$frobbedlang.msg: $lang.po
+${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
+${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+EOF
+ done
+ fi
+ if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
+ # Add dependencies that cannot be formulated as a simple suffix rule.
+ for lang in $ALL_LINGUAS; do
+ frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+ cat >> "$ac_file.tmp" <<EOF
+$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
+${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
+${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+EOF
+ done
+ fi
+ if test -n "$POMAKEFILEDEPS"; then
+ cat >> "$ac_file.tmp" <<EOF
+Makefile: $POMAKEFILEDEPS
+EOF
+ fi
+ mv "$ac_file.tmp" "$ac_file"
+])
+
+dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
+AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
+[
+ XGETTEXT_EXTRA_OPTIONS=
+])
+
+dnl Registers an option to be passed to xgettext in the po subdirectory.
+AC_DEFUN([AM_XGETTEXT_OPTION],
+[
+ AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
+ XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
+])
diff --git a/gl/m4/printf-posix.m4 b/gl/m4/printf-posix.m4
new file mode 100644
index 0000000..d7dfb60
--- /dev/null
+++ b/gl/m4/printf-posix.m4
@@ -0,0 +1,48 @@
+# printf-posix.m4 serial 6 (gettext-0.18.2)
+dnl Copyright (C) 2003, 2007, 2009-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Test whether the printf() function supports POSIX/XSI format strings with
+dnl positions.
+
+AC_DEFUN([gt_PRINTF_POSIX],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
+ gt_cv_func_printf_posix,
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+/* The string "%2$d %1$d", with dollar characters protected from the shell's
+ dollar expansion (possibly an autoconf bug). */
+static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
+static char buf[100];
+int main ()
+{
+ sprintf (buf, format, 33, 55);
+ return (strcmp (buf, "55 33") != 0);
+}]])],
+ [gt_cv_func_printf_posix=yes],
+ [gt_cv_func_printf_posix=no],
+ [
+ AC_EGREP_CPP([notposix], [
+#if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
+ notposix
+#endif
+ ],
+ [gt_cv_func_printf_posix="guessing no"],
+ [gt_cv_func_printf_posix="guessing yes"])
+ ])
+ ])
+ case $gt_cv_func_printf_posix in
+ *yes)
+ AC_DEFINE([HAVE_POSIX_PRINTF], [1],
+ [Define if your printf() function supports format strings with positions.])
+ ;;
+ esac
+])
diff --git a/gl/m4/printf.m4 b/gl/m4/printf.m4
new file mode 100644
index 0000000..667452e
--- /dev/null
+++ b/gl/m4/printf.m4
@@ -0,0 +1,1728 @@
+# printf.m4 serial 73
+dnl Copyright (C) 2003, 2007-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Test whether the *printf family of functions supports the 'j', 'z', 't',
+dnl 'L' size specifiers. (ISO C99, POSIX:2001)
+dnl Result is gl_cv_func_printf_sizes_c99.
+
+AC_DEFUN([gl_PRINTF_SIZES_C99],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gl_AC_HEADER_STDINT_H])
+ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports size specifiers as in C99],
+ [gl_cv_func_printf_sizes_c99],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#if HAVE_STDINT_H_WITH_UINTMAX
+# include <stdint.h>
+#endif
+#if HAVE_INTTYPES_H_WITH_UINTMAX
+# include <inttypes.h>
+#endif
+static char buf[100];
+int main ()
+{
+ int result = 0;
+#if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX
+ buf[0] = '\0';
+ if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0
+ || strcmp (buf, "12345671 33") != 0)
+ result |= 1;
+#else
+ result |= 1;
+#endif
+ buf[0] = '\0';
+ if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0
+ || strcmp (buf, "12345672 33") != 0)
+ result |= 2;
+ buf[0] = '\0';
+ if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0
+ || strcmp (buf, "12345673 33") != 0)
+ result |= 4;
+ buf[0] = '\0';
+ if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0
+ || strcmp (buf, "1.5 33") != 0)
+ result |= 8;
+ return result;
+}]])],
+ [gl_cv_func_printf_sizes_c99=yes],
+ [gl_cv_func_printf_sizes_c99=no],
+ [
+ case "$host_os" in
+changequote(,)dnl
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ # Guess yes on FreeBSD >= 5.
+ freebsd[1-4].*) gl_cv_func_printf_sizes_c99="guessing no";;
+ freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ midnightbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ # Guess yes on Mac OS X >= 10.3.
+ darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";;
+ darwin*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ # Guess yes on OpenBSD >= 3.9.
+ openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+ gl_cv_func_printf_sizes_c99="guessing no";;
+ openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ # Guess yes on Solaris >= 2.10.
+ solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ solaris*) gl_cv_func_printf_sizes_c99="guessing no";;
+ # Guess yes on NetBSD >= 3.
+ netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+ gl_cv_func_printf_sizes_c99="guessing no";;
+ netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_printf_sizes_c99="guessing yes";;
+changequote([,])dnl
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_printf_sizes_c99="guessing yes"],
+ [gl_cv_func_printf_sizes_c99="guessing no"])
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_sizes_c99="$gl_cross_guess_normal";;
+ esac
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports 'long double'
+dnl arguments together with the 'L' size specifier. (ISO C99, POSIX:2001)
+dnl Result is gl_cv_func_printf_long_double.
+
+AC_DEFUN([gl_PRINTF_LONG_DOUBLE],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports 'long double' arguments],
+ [gl_cv_func_printf_long_double],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+static char buf[10000];
+int main ()
+{
+ int result = 0;
+ buf[0] = '\0';
+ if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0
+ || strcmp (buf, "1.750000 33") != 0)
+ result |= 1;
+ buf[0] = '\0';
+ if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0
+ || strcmp (buf, "1.750000e+00 33") != 0)
+ result |= 2;
+ buf[0] = '\0';
+ if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0
+ || strcmp (buf, "1.75 33") != 0)
+ result |= 4;
+ return result;
+}]])],
+ [gl_cv_func_printf_long_double=yes],
+ [gl_cv_func_printf_long_double=no],
+ [case "$host_os" in
+ # Guess no on BeOS.
+ beos*) gl_cv_func_printf_long_double="guessing no";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_printf_long_double="guessing yes";;
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_printf_long_double="guessing yes"],
+ [gl_cv_func_printf_long_double="guessing no"])
+ ;;
+ *) gl_cv_func_printf_long_double="guessing yes";;
+ esac
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports infinite and NaN
+dnl 'double' arguments and negative zero arguments in the %f, %e, %g
+dnl directives. (ISO C99, POSIX:2001)
+dnl Result is gl_cv_func_printf_infinite.
+
+AC_DEFUN([gl_PRINTF_INFINITE],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports infinite 'double' arguments],
+ [gl_cv_func_printf_infinite],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+static int
+strisnan (const char *string, size_t start_index, size_t end_index)
+{
+ if (start_index < end_index)
+ {
+ if (string[start_index] == '-')
+ start_index++;
+ if (start_index + 3 <= end_index
+ && memcmp (string + start_index, "nan", 3) == 0)
+ {
+ start_index += 3;
+ if (start_index == end_index
+ || (string[start_index] == '(' && string[end_index - 1] == ')'))
+ return 1;
+ }
+ }
+ return 0;
+}
+static int
+have_minus_zero ()
+{
+ static double plus_zero = 0.0;
+ double minus_zero = - plus_zero;
+ return memcmp (&plus_zero, &minus_zero, sizeof (double)) != 0;
+}
+static char buf[10000];
+static double zero = 0.0;
+int main ()
+{
+ int result = 0;
+ if (sprintf (buf, "%f", 1.0 / zero) < 0
+ || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
+ result |= 1;
+ if (sprintf (buf, "%f", -1.0 / zero) < 0
+ || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
+ result |= 1;
+ if (sprintf (buf, "%f", zero / zero) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 2;
+ if (sprintf (buf, "%e", 1.0 / zero) < 0
+ || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
+ result |= 4;
+ if (sprintf (buf, "%e", -1.0 / zero) < 0
+ || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
+ result |= 4;
+ if (sprintf (buf, "%e", zero / zero) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 8;
+ if (sprintf (buf, "%g", 1.0 / zero) < 0
+ || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
+ result |= 16;
+ if (sprintf (buf, "%g", -1.0 / zero) < 0
+ || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
+ result |= 16;
+ if (sprintf (buf, "%g", zero / zero) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 32;
+ /* This test fails on HP-UX 10.20. */
+ if (have_minus_zero ())
+ if (sprintf (buf, "%g", - zero) < 0
+ || strcmp (buf, "-0") != 0)
+ result |= 64;
+ return result;
+}]])],
+ [gl_cv_func_printf_infinite=yes],
+ [gl_cv_func_printf_infinite=no],
+ [
+ case "$host_os" in
+changequote(,)dnl
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_printf_infinite="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_printf_infinite="guessing yes";;
+ # Guess yes on FreeBSD >= 6.
+ freebsd[1-5].*) gl_cv_func_printf_infinite="guessing no";;
+ freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
+ midnightbsd*) gl_cv_func_printf_infinite="guessing yes";;
+ # Guess yes on Mac OS X >= 10.3.
+ darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";;
+ darwin*) gl_cv_func_printf_infinite="guessing yes";;
+ # Guess yes on HP-UX >= 11.
+ hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";;
+ hpux*) gl_cv_func_printf_infinite="guessing yes";;
+ # Guess yes on NetBSD >= 3.
+ netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+ gl_cv_func_printf_infinite="guessing no";;
+ netbsd*) gl_cv_func_printf_infinite="guessing yes";;
+ # Guess yes on OpenBSD >= 6.0.
+ openbsd[1-5].*) gl_cv_func_printf_infinite="guessing no";;
+ openbsd*) gl_cv_func_printf_infinite="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_printf_infinite="guessing yes";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_infinite="guessing no";;
+changequote([,])dnl
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_printf_infinite="guessing yes"],
+ [gl_cv_func_printf_infinite="guessing no"])
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_infinite="$gl_cross_guess_normal";;
+ esac
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports infinite and NaN
+dnl 'long double' arguments in the %f, %e, %g directives. (ISO C99, POSIX:2001)
+dnl Result is gl_cv_func_printf_infinite_long_double.
+
+AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE],
+[
+ AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gl_BIGENDIAN])
+ AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ dnl The user can set or unset the variable gl_printf_safe to indicate
+ dnl that he wishes a safe handling of non-IEEE-754 'long double' values.
+ if test -n "$gl_printf_safe"; then
+ AC_DEFINE([CHECK_PRINTF_SAFE], [1],
+ [Define if you wish *printf() functions that have a safe handling of
+ non-IEEE-754 'long double' values.])
+ fi
+ case "$gl_cv_func_printf_long_double" in
+ *yes)
+ AC_CACHE_CHECK([whether printf supports infinite 'long double' arguments],
+ [gl_cv_func_printf_infinite_long_double],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+]GL_NOCRASH[
+#include <float.h>
+#include <stdio.h>
+#include <string.h>
+static int
+strisnan (const char *string, size_t start_index, size_t end_index)
+{
+ if (start_index < end_index)
+ {
+ if (string[start_index] == '-')
+ start_index++;
+ if (start_index + 3 <= end_index
+ && memcmp (string + start_index, "nan", 3) == 0)
+ {
+ start_index += 3;
+ if (start_index == end_index
+ || (string[start_index] == '(' && string[end_index - 1] == ')'))
+ return 1;
+ }
+ }
+ return 0;
+}
+static char buf[10000];
+static long double zeroL = 0.0L;
+int main ()
+{
+ int result = 0;
+ nocrash_init();
+ if (sprintf (buf, "%Lf", 1.0L / zeroL) < 0
+ || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
+ result |= 1;
+ if (sprintf (buf, "%Lf", -1.0L / zeroL) < 0
+ || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
+ result |= 1;
+ if (sprintf (buf, "%Lf", zeroL / zeroL) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 1;
+ if (sprintf (buf, "%Le", 1.0L / zeroL) < 0
+ || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
+ result |= 1;
+ if (sprintf (buf, "%Le", -1.0L / zeroL) < 0
+ || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
+ result |= 1;
+ if (sprintf (buf, "%Le", zeroL / zeroL) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 1;
+ if (sprintf (buf, "%Lg", 1.0L / zeroL) < 0
+ || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
+ result |= 1;
+ if (sprintf (buf, "%Lg", -1.0L / zeroL) < 0
+ || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
+ result |= 1;
+ if (sprintf (buf, "%Lg", zeroL / zeroL) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 1;
+#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
+/* Representation of an 80-bit 'long double' as an initializer for a sequence
+ of 'unsigned int' words. */
+# ifdef WORDS_BIGENDIAN
+# define LDBL80_WORDS(exponent,manthi,mantlo) \
+ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
+ ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \
+ (unsigned int) (mantlo) << 16 \
+ }
+# else
+# define LDBL80_WORDS(exponent,manthi,mantlo) \
+ { mantlo, manthi, exponent }
+# endif
+ { /* Quiet NaN. */
+ static union { unsigned int word[4]; long double value; } x =
+ { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
+ if (sprintf (buf, "%Lf", x.value) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 2;
+ if (sprintf (buf, "%Le", x.value) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 2;
+ if (sprintf (buf, "%Lg", x.value) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 2;
+ }
+ {
+ /* Signalling NaN. */
+ static union { unsigned int word[4]; long double value; } x =
+ { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
+ if (sprintf (buf, "%Lf", x.value) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 2;
+ if (sprintf (buf, "%Le", x.value) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 2;
+ if (sprintf (buf, "%Lg", x.value) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 2;
+ }
+ { /* Pseudo-NaN. */
+ static union { unsigned int word[4]; long double value; } x =
+ { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
+ if (sprintf (buf, "%Lf", x.value) <= 0)
+ result |= 4;
+ if (sprintf (buf, "%Le", x.value) <= 0)
+ result |= 4;
+ if (sprintf (buf, "%Lg", x.value) <= 0)
+ result |= 4;
+ }
+ { /* Pseudo-Infinity. */
+ static union { unsigned int word[4]; long double value; } x =
+ { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
+ if (sprintf (buf, "%Lf", x.value) <= 0)
+ result |= 8;
+ if (sprintf (buf, "%Le", x.value) <= 0)
+ result |= 8;
+ if (sprintf (buf, "%Lg", x.value) <= 0)
+ result |= 8;
+ }
+ { /* Pseudo-Zero. */
+ static union { unsigned int word[4]; long double value; } x =
+ { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
+ if (sprintf (buf, "%Lf", x.value) <= 0)
+ result |= 16;
+ if (sprintf (buf, "%Le", x.value) <= 0)
+ result |= 16;
+ if (sprintf (buf, "%Lg", x.value) <= 0)
+ result |= 16;
+ }
+ { /* Unnormalized number. */
+ static union { unsigned int word[4]; long double value; } x =
+ { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
+ if (sprintf (buf, "%Lf", x.value) <= 0)
+ result |= 32;
+ if (sprintf (buf, "%Le", x.value) <= 0)
+ result |= 32;
+ if (sprintf (buf, "%Lg", x.value) <= 0)
+ result |= 32;
+ }
+ { /* Pseudo-Denormal. */
+ static union { unsigned int word[4]; long double value; } x =
+ { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
+ if (sprintf (buf, "%Lf", x.value) <= 0)
+ result |= 64;
+ if (sprintf (buf, "%Le", x.value) <= 0)
+ result |= 64;
+ if (sprintf (buf, "%Lg", x.value) <= 0)
+ result |= 64;
+ }
+#endif
+ return result;
+}]])],
+ [gl_cv_func_printf_infinite_long_double=yes],
+ [gl_cv_func_printf_infinite_long_double=no],
+ [case "$host_cpu" in
+ # Guess no on ia64, x86_64, i386.
+ ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";;
+ *)
+ case "$host_os" in
+changequote(,)dnl
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+ # Guess yes on FreeBSD >= 6.
+ freebsd[1-5].*) gl_cv_func_printf_infinite_long_double="guessing no";;
+ freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+ midnightbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+ # Guess yes on HP-UX >= 11.
+ hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
+ hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+ # Guess yes on OpenBSD >= 6.0.
+ openbsd[1-5].*) gl_cv_func_printf_infinite_long_double="guessing no";;
+ openbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_infinite_long_double="guessing no";;
+changequote([,])dnl
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_printf_infinite_long_double="guessing yes"],
+ [gl_cv_func_printf_infinite_long_double="guessing no"])
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_infinite_long_double="$gl_cross_guess_normal";;
+ esac
+ ;;
+ esac
+ ])
+ ])
+ ;;
+ *)
+ gl_cv_func_printf_infinite_long_double="irrelevant"
+ ;;
+ esac
+])
+
+dnl Test whether the *printf family of functions supports the 'a' and 'A'
+dnl conversion specifier for hexadecimal output of floating-point numbers.
+dnl (ISO C99, POSIX:2001)
+dnl Result is gl_cv_func_printf_directive_a.
+
+AC_DEFUN([gl_PRINTF_DIRECTIVE_A],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports the 'a' and 'A' directives],
+ [gl_cv_func_printf_directive_a],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+static char buf[100];
+static double zero = 0.0;
+int main ()
+{
+ int result = 0;
+ if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0
+ || (strcmp (buf, "0x1.922p+1 33") != 0
+ && strcmp (buf, "0x3.244p+0 33") != 0
+ && strcmp (buf, "0x6.488p-1 33") != 0
+ && strcmp (buf, "0xc.91p-2 33") != 0))
+ result |= 1;
+ if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0
+ || (strcmp (buf, "-0X1.922P+1 33") != 0
+ && strcmp (buf, "-0X3.244P+0 33") != 0
+ && strcmp (buf, "-0X6.488P-1 33") != 0
+ && strcmp (buf, "-0XC.91P-2 33") != 0))
+ result |= 2;
+ /* This catches a FreeBSD 13.0 bug: it doesn't round. */
+ if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
+ || (strcmp (buf, "0x1.83p+0 33") != 0
+ && strcmp (buf, "0x3.05p-1 33") != 0
+ && strcmp (buf, "0x6.0ap-2 33") != 0
+ && strcmp (buf, "0xc.14p-3 33") != 0))
+ result |= 4;
+ /* This catches a Mac OS X 10.12.4 (Darwin 16.5) bug: it doesn't round. */
+ if (sprintf (buf, "%.0a %d", 1.51, 33, 44, 55) < 0
+ || (strcmp (buf, "0x2p+0 33") != 0
+ && strcmp (buf, "0x3p-1 33") != 0
+ && strcmp (buf, "0x6p-2 33") != 0
+ && strcmp (buf, "0xcp-3 33") != 0))
+ result |= 4;
+ /* This catches a FreeBSD 6.1 bug. See
+ <https://lists.gnu.org/r/bug-gnulib/2007-04/msg00107.html> */
+ if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0
+ || buf[0] == '0')
+ result |= 8;
+ /* This catches a Mac OS X 10.3.9 (Darwin 7.9) bug. */
+ if (sprintf (buf, "%.1a", 1.999) < 0
+ || (strcmp (buf, "0x1.0p+1") != 0
+ && strcmp (buf, "0x2.0p+0") != 0
+ && strcmp (buf, "0x4.0p-1") != 0
+ && strcmp (buf, "0x8.0p-2") != 0))
+ result |= 16;
+ /* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a
+ glibc 2.4 bug <https://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */
+ if (sprintf (buf, "%.1La", 1.999L) < 0
+ || (strcmp (buf, "0x1.0p+1") != 0
+ && strcmp (buf, "0x2.0p+0") != 0
+ && strcmp (buf, "0x4.0p-1") != 0
+ && strcmp (buf, "0x8.0p-2") != 0))
+ result |= 32;
+ return result;
+}]])],
+ [gl_cv_func_printf_directive_a=yes],
+ [gl_cv_func_printf_directive_a=no],
+ [
+ case "$host_os" in
+ # Guess yes on glibc >= 2.5 systems.
+ *-gnu* | gnu*)
+ AC_EGREP_CPP([BZ2908], [
+ #include <features.h>
+ #ifdef __GNU_LIBRARY__
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)) && !defined __UCLIBC__
+ BZ2908
+ #endif
+ #endif
+ ],
+ [gl_cv_func_printf_directive_a="guessing yes"],
+ [gl_cv_func_printf_directive_a="guessing no"])
+ ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_printf_directive_a="guessing yes";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_directive_a="guessing no";;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_printf_directive_a="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_directive_a="$gl_cross_guess_normal";;
+ esac
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports the %F format
+dnl directive. (ISO C99, POSIX:2001)
+dnl Result is gl_cv_func_printf_directive_f.
+
+AC_DEFUN([gl_PRINTF_DIRECTIVE_F],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports the 'F' directive],
+ [gl_cv_func_printf_directive_f],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+static char buf[100];
+static double zero = 0.0;
+int main ()
+{
+ int result = 0;
+ if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0
+ || strcmp (buf, "1234567.000000 33") != 0)
+ result |= 1;
+ if (sprintf (buf, "%F", 1.0 / zero) < 0
+ || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0))
+ result |= 2;
+ /* This catches a Cygwin 1.5.x bug. */
+ if (sprintf (buf, "%.F", 1234.0) < 0
+ || strcmp (buf, "1234") != 0)
+ result |= 4;
+ return result;
+}]])],
+ [gl_cv_func_printf_directive_f=yes],
+ [gl_cv_func_printf_directive_f=no],
+ [
+ case "$host_os" in
+changequote(,)dnl
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_printf_directive_f="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_printf_directive_f="guessing yes";;
+ # Guess yes on FreeBSD >= 6.
+ freebsd[1-5].*) gl_cv_func_printf_directive_f="guessing no";;
+ freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
+ midnightbsd*) gl_cv_func_printf_directive_f="guessing yes";;
+ # Guess yes on Mac OS X >= 10.3.
+ darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";;
+ darwin*) gl_cv_func_printf_directive_f="guessing yes";;
+ # Guess yes on OpenBSD >= 6.0.
+ openbsd[1-5].*) gl_cv_func_printf_directive_f="guessing no";;
+ openbsd*) gl_cv_func_printf_directive_f="guessing yes";;
+ # Guess yes on Solaris >= 2.10.
+ solaris2.[1-9][0-9]*) gl_cv_func_printf_directive_f="guessing yes";;
+ solaris*) gl_cv_func_printf_directive_f="guessing no";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_directive_f="guessing no";;
+changequote([,])dnl
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_printf_directive_f="guessing yes"],
+ [gl_cv_func_printf_directive_f="guessing no"])
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_directive_f="$gl_cross_guess_normal";;
+ esac
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports the %n format
+dnl directive. (ISO C99, POSIX:2001)
+dnl Result is gl_cv_func_printf_directive_n.
+
+AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports the 'n' directive],
+ [gl_cv_func_printf_directive_n],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef _MSC_VER
+#include <inttypes.h>
+/* See page about "Parameter Validation" on msdn.microsoft.com.
+ <https://docs.microsoft.com/en-us/cpp/c-runtime-library/parameter-validation>
+ <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/set-invalid-parameter-handler-set-thread-local-invalid-parameter-handler> */
+static void cdecl
+invalid_parameter_handler (const wchar_t *expression,
+ const wchar_t *function,
+ const wchar_t *file, unsigned int line,
+ uintptr_t dummy)
+{
+ exit (1);
+}
+#endif
+static char fmtstring[10];
+static char buf[100];
+int main ()
+{
+ int count = -1;
+#ifdef _MSC_VER
+ _set_invalid_parameter_handler (invalid_parameter_handler);
+#endif
+ /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
+ support %n in format strings in read-only memory but not in writable
+ memory. */
+ strcpy (fmtstring, "%d %n");
+ if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0
+ || strcmp (buf, "123 ") != 0
+ || count != 4)
+ return 1;
+ return 0;
+}]])],
+ [gl_cv_func_printf_directive_n=yes],
+ [gl_cv_func_printf_directive_n=no],
+ [case "$host_os" in
+ # Guess no on glibc when _FORTIFY_SOURCE >= 2.
+ *-gnu* | gnu*) AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if _FORTIFY_SOURCE >= 2
+ error fail
+ #endif
+ ]])],
+ [gl_cv_func_printf_directive_n="guessing yes"],
+ [gl_cv_func_printf_directive_n="guessing no"])
+ ;;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_directive_n="guessing no";;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_printf_directive_n="guessing no";;
+ *) gl_cv_func_printf_directive_n="guessing yes";;
+ esac
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports the %ls format
+dnl directive and in particular, when a precision is specified, whether
+dnl the functions stop converting the wide string argument when the number
+dnl of bytes that have been produced by this conversion equals or exceeds
+dnl the precision.
+dnl Result is gl_cv_func_printf_directive_ls.
+
+AC_DEFUN([gl_PRINTF_DIRECTIVE_LS],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports the 'ls' directive],
+ [gl_cv_func_printf_directive_ls],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <wchar.h>
+#include <string.h>
+int main ()
+{
+ int result = 0;
+ char buf[100];
+ /* Test whether %ls works at all.
+ This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on
+ Cygwin 1.5. */
+ {
+ static const wchar_t wstring[] = { 'a', 'b', 'c', 0 };
+ buf[0] = '\0';
+ if (sprintf (buf, "%ls", wstring) < 0
+ || strcmp (buf, "abc") != 0)
+ result |= 1;
+ }
+ /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an
+ assertion failure inside libc), but not on OpenBSD 4.0. */
+ {
+ static const wchar_t wstring[] = { 'a', 0 };
+ buf[0] = '\0';
+ if (sprintf (buf, "%ls", wstring) < 0
+ || strcmp (buf, "a") != 0)
+ result |= 2;
+ }
+ /* Test whether precisions in %ls are supported as specified in ISO C 99
+ section 7.19.6.1:
+ "If a precision is specified, no more than that many bytes are written
+ (including shift sequences, if any), and the array shall contain a
+ null wide character if, to equal the multibyte character sequence
+ length given by the precision, the function would need to access a
+ wide character one past the end of the array."
+ This test fails on Solaris 10. */
+ {
+ static const wchar_t wstring[] = { 'a', 'b', (wchar_t) 0xfdfdfdfd, 0 };
+ buf[0] = '\0';
+ if (sprintf (buf, "%.2ls", wstring) < 0
+ || strcmp (buf, "ab") != 0)
+ result |= 8;
+ }
+ return result;
+}]])],
+ [gl_cv_func_printf_directive_ls=yes],
+ [gl_cv_func_printf_directive_ls=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on OpenBSD >= 6.0.
+ openbsd[1-5].*) gl_cv_func_printf_directive_ls="guessing no";;
+ openbsd*) gl_cv_func_printf_directive_ls="guessing yes";;
+ irix*) gl_cv_func_printf_directive_ls="guessing no";;
+ solaris*) gl_cv_func_printf_directive_ls="guessing no";;
+ cygwin*) gl_cv_func_printf_directive_ls="guessing no";;
+ beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_directive_ls="guessing no";;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_printf_directive_ls="guessing yes";;
+ *) gl_cv_func_printf_directive_ls="guessing yes";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports POSIX/XSI format
+dnl strings with positions. (POSIX:2001)
+dnl Result is gl_cv_func_printf_positions.
+
+AC_DEFUN([gl_PRINTF_POSITIONS],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports POSIX/XSI format strings with positions],
+ [gl_cv_func_printf_positions],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+/* The string "%2$d %1$d", with dollar characters protected from the shell's
+ dollar expansion (possibly an autoconf bug). */
+static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
+static char buf[100];
+int main ()
+{
+ sprintf (buf, format, 33, 55);
+ return (strcmp (buf, "55 33") != 0);
+}]])],
+ [gl_cv_func_printf_positions=yes],
+ [gl_cv_func_printf_positions=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
+ gl_cv_func_printf_positions="guessing no";;
+ beos*) gl_cv_func_printf_positions="guessing no";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_printf_positions="guessing yes";;
+ # Guess no on native Windows.
+ mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
+ *) gl_cv_func_printf_positions="guessing yes";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports POSIX/XSI format
+dnl strings with the ' flag for grouping of decimal digits. (POSIX:2001)
+dnl Result is gl_cv_func_printf_flag_grouping.
+
+AC_DEFUN([gl_PRINTF_FLAG_GROUPING],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports the grouping flag],
+ [gl_cv_func_printf_flag_grouping],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+static char buf[100];
+int main ()
+{
+ if (sprintf (buf, "%'d %d", 1234567, 99) < 0
+ || buf[strlen (buf) - 1] != '9')
+ return 1;
+ return 0;
+}]])],
+ [gl_cv_func_printf_flag_grouping=yes],
+ [gl_cv_func_printf_flag_grouping=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ cygwin*) gl_cv_func_printf_flag_grouping="guessing no";;
+ netbsd*) gl_cv_func_printf_flag_grouping="guessing no";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_flag_grouping="guessing no";;
+ # Guess no on native Windows.
+ mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
+ *) gl_cv_func_printf_flag_grouping="guessing yes";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports the - flag correctly.
+dnl (ISO C99.) See
+dnl <https://lists.gnu.org/r/bug-coreutils/2008-02/msg00035.html>
+dnl Result is gl_cv_func_printf_flag_leftadjust.
+
+AC_DEFUN([gl_PRINTF_FLAG_LEFTADJUST],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports the left-adjust flag correctly],
+ [gl_cv_func_printf_flag_leftadjust],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+static char buf[100];
+int main ()
+{
+ /* Check that a '-' flag is not annihilated by a negative width. */
+ if (sprintf (buf, "a%-*sc", -3, "b") < 0
+ || strcmp (buf, "ab c") != 0)
+ return 1;
+ return 0;
+}]])],
+ [gl_cv_func_printf_flag_leftadjust=yes],
+ [gl_cv_func_printf_flag_leftadjust=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on HP-UX 11.
+ hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
+ # Guess no on HP-UX 10 and older.
+ hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
+ # Guess yes otherwise.
+ *) gl_cv_func_printf_flag_leftadjust="guessing yes";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports padding of non-finite
+dnl values with the 0 flag correctly. (ISO C99 + TC1 + TC2.) See
+dnl <https://lists.gnu.org/r/bug-gnulib/2007-04/msg00107.html>
+dnl Result is gl_cv_func_printf_flag_zero.
+
+AC_DEFUN([gl_PRINTF_FLAG_ZERO],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports the zero flag correctly],
+ [gl_cv_func_printf_flag_zero],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+static char buf[100];
+static double zero = 0.0;
+int main ()
+{
+ if (sprintf (buf, "%010f", 1.0 / zero, 33, 44, 55) < 0
+ || (strcmp (buf, " inf") != 0
+ && strcmp (buf, " infinity") != 0))
+ return 1;
+ return 0;
+}]])],
+ [gl_cv_func_printf_flag_zero=yes],
+ [gl_cv_func_printf_flag_zero=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_printf_flag_zero="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_printf_flag_zero="guessing yes";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_flag_zero="guessing no";;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_printf_flag_zero="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_flag_zero="$gl_cross_guess_normal";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports large precisions.
+dnl On mingw, precisions larger than 512 are treated like 512, in integer,
+dnl floating-point or pointer output. On Solaris 10/x86, precisions larger
+dnl than 510 in floating-point output crash the program. On Solaris 10/SPARC,
+dnl precisions larger than 510 in floating-point output yield wrong results.
+dnl On AIX 7.1, precisions larger than 998 in floating-point output yield
+dnl wrong results. On BeOS, precisions larger than 1044 crash the program.
+dnl Result is gl_cv_func_printf_precision.
+
+AC_DEFUN([gl_PRINTF_PRECISION],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports large precisions],
+ [gl_cv_func_printf_precision],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+static char buf[5000];
+int main ()
+{
+ int result = 0;
+#ifdef __BEOS__
+ /* On BeOS, this would crash and show a dialog box. Avoid the crash. */
+ return 1;
+#endif
+ if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3)
+ result |= 1;
+ if (sprintf (buf, "%.4000f %d", 1.0, 33, 44) < 4000 + 5)
+ result |= 2;
+ if (sprintf (buf, "%.511f %d", 1.0, 33, 44) < 511 + 5
+ || buf[0] != '1')
+ result |= 4;
+ if (sprintf (buf, "%.999f %d", 1.0, 33, 44) < 999 + 5
+ || buf[0] != '1')
+ result |= 4;
+ return result;
+}]])],
+ [gl_cv_func_printf_precision=yes],
+ [gl_cv_func_printf_precision=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no only on Solaris, native Windows, and BeOS systems.
+ solaris*) gl_cv_func_printf_precision="guessing no" ;;
+ mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
+ beos*) gl_cv_func_printf_precision="guessing no" ;;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_printf_precision="guessing yes" ;;
+ *) gl_cv_func_printf_precision="guessing yes" ;;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions recovers gracefully in case
+dnl of an out-of-memory condition, or whether it crashes the entire program.
+dnl Result is gl_cv_func_printf_enomem.
+
+AC_DEFUN([gl_PRINTF_ENOMEM],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gl_MULTIARCH])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf survives out-of-memory conditions],
+ [gl_cv_func_printf_enomem],
+ [
+ gl_cv_func_printf_enomem="guessing no"
+ if test "$cross_compiling" = no; then
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[
+]GL_NOCRASH[
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <errno.h>
+int main()
+{
+ struct rlimit limit;
+ int ret;
+ nocrash_init ();
+ /* Some printf implementations allocate temporary space with malloc. */
+ /* On BSD systems, malloc() is limited by RLIMIT_DATA. */
+#ifdef RLIMIT_DATA
+ if (getrlimit (RLIMIT_DATA, &limit) < 0)
+ return 77;
+ if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
+ limit.rlim_max = 5000000;
+ limit.rlim_cur = limit.rlim_max;
+ if (setrlimit (RLIMIT_DATA, &limit) < 0)
+ return 77;
+#endif
+ /* On Linux systems, malloc() is limited by RLIMIT_AS. */
+#ifdef RLIMIT_AS
+ if (getrlimit (RLIMIT_AS, &limit) < 0)
+ return 77;
+ if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
+ limit.rlim_max = 5000000;
+ limit.rlim_cur = limit.rlim_max;
+ if (setrlimit (RLIMIT_AS, &limit) < 0)
+ return 77;
+#endif
+ /* Some printf implementations allocate temporary space on the stack. */
+#ifdef RLIMIT_STACK
+ if (getrlimit (RLIMIT_STACK, &limit) < 0)
+ return 77;
+ if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
+ limit.rlim_max = 5000000;
+ limit.rlim_cur = limit.rlim_max;
+ if (setrlimit (RLIMIT_STACK, &limit) < 0)
+ return 77;
+#endif
+ ret = printf ("%.5000000f", 1.0);
+ return !(ret == 5000002 || (ret < 0 && errno == ENOMEM));
+}
+ ]])])
+ if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
+ (./conftest 2>&AS_MESSAGE_LOG_FD
+ result=$?
+ _AS_ECHO_LOG([\$? = $result])
+ if test $result != 0 && test $result != 77; then result=1; fi
+ exit $result
+ ) >/dev/null 2>/dev/null
+ case $? in
+ 0) gl_cv_func_printf_enomem="yes" ;;
+ 77) gl_cv_func_printf_enomem="guessing no" ;;
+ *) gl_cv_func_printf_enomem="no" ;;
+ esac
+ else
+ gl_cv_func_printf_enomem="guessing no"
+ fi
+ rm -fr conftest*
+ else
+ dnl A universal build on Apple Mac OS X platforms.
+ dnl The result would be 'no' in 32-bit mode and 'yes' in 64-bit mode.
+ dnl But we need a configuration result that is valid in both modes.
+ gl_cv_func_printf_enomem="guessing no"
+ fi
+ fi
+ if test "$gl_cv_func_printf_enomem" = "guessing no"; then
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_printf_enomem="guessing yes";;
+ # Guess yes on Solaris.
+ solaris*) gl_cv_func_printf_enomem="guessing yes";;
+ # Guess yes on AIX.
+ aix*) gl_cv_func_printf_enomem="guessing yes";;
+ # Guess yes on HP-UX/hppa.
+ hpux*) case "$host_cpu" in
+ hppa*) gl_cv_func_printf_enomem="guessing yes";;
+ *) gl_cv_func_printf_enomem="guessing no";;
+ esac
+ ;;
+ # Guess yes on IRIX.
+ irix*) gl_cv_func_printf_enomem="guessing yes";;
+ # Guess yes on OSF/1.
+ osf*) gl_cv_func_printf_enomem="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_printf_enomem="guessing yes";;
+ # Guess yes on Haiku.
+ haiku*) gl_cv_func_printf_enomem="guessing yes";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_enomem="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_enomem="$gl_cross_guess_normal";;
+ esac
+changequote([,])dnl
+ fi
+ ])
+])
+
+dnl Test whether the snprintf function exists. (ISO C99, POSIX:2001)
+dnl Result is ac_cv_func_snprintf.
+
+AC_DEFUN([gl_SNPRINTF_PRESENCE],
+[
+ AC_CHECK_FUNCS_ONCE([snprintf])
+])
+
+dnl Test whether the string produced by the snprintf function is always NUL
+dnl terminated. (ISO C99, POSIX:2001)
+dnl Result is gl_cv_func_snprintf_truncation_c99.
+
+AC_DEFUN_ONCE([gl_SNPRINTF_TRUNCATION_C99],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([gl_SNPRINTF_PRESENCE])
+ AC_CACHE_CHECK([whether snprintf truncates the result as in C99],
+ [gl_cv_func_snprintf_truncation_c99],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+ va_list args;
+ int ret;
+ va_start (args, format);
+ ret = vsnprintf (buf, size, format, args);
+ va_end (args);
+ return ret;
+}
+#endif
+static char buf[100];
+int main ()
+{
+ strcpy (buf, "ABCDEF");
+ my_snprintf (buf, 3, "%d %d", 4567, 89);
+ if (memcmp (buf, "45\0DEF", 6) != 0)
+ return 1;
+ return 0;
+}]])],
+ [gl_cv_func_snprintf_truncation_c99=yes],
+ [gl_cv_func_snprintf_truncation_c99=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on FreeBSD >= 5.
+ freebsd[1-4].*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ midnightbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on Mac OS X >= 10.3.
+ darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on OpenBSD >= 3.9.
+ openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+ gl_cv_func_snprintf_truncation_c99="guessing no";;
+ openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on Solaris >= 2.6.
+ solaris2.[0-5] | solaris2.[0-5].*)
+ gl_cv_func_snprintf_truncation_c99="guessing no";;
+ solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on AIX >= 4.
+ aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on HP-UX >= 11.
+ hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on IRIX >= 6.5.
+ irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on OSF/1 >= 5.
+ osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on NetBSD >= 3.
+ netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+ gl_cv_func_snprintf_truncation_c99="guessing no";;
+ netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_snprintf_truncation_c99="$gl_cross_guess_normal";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+dnl Test whether the return value of the snprintf function is the number
+dnl of bytes (excluding the terminating NUL) that would have been produced
+dnl if the buffer had been large enough. (ISO C99, POSIX:2001)
+dnl For example, this test program fails on IRIX 6.5:
+dnl ---------------------------------------------------------------------
+dnl #include <stdio.h>
+dnl int main()
+dnl {
+dnl static char buf[8];
+dnl int retval = snprintf (buf, 3, "%d", 12345);
+dnl return retval >= 0 && retval < 3;
+dnl }
+dnl ---------------------------------------------------------------------
+dnl Result is gl_cv_func_snprintf_retval_c99.
+
+AC_DEFUN_ONCE([gl_SNPRINTF_RETVAL_C99],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([gl_SNPRINTF_PRESENCE])
+ AC_CACHE_CHECK([whether snprintf returns a byte count as in C99],
+ [gl_cv_func_snprintf_retval_c99],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+ va_list args;
+ int ret;
+ va_start (args, format);
+ ret = vsnprintf (buf, size, format, args);
+ va_end (args);
+ return ret;
+}
+#endif
+static char buf[100];
+int main ()
+{
+ strcpy (buf, "ABCDEF");
+ if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7)
+ return 1;
+ if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7)
+ return 2;
+ if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7)
+ return 3;
+ return 0;
+}]])],
+ [gl_cv_func_snprintf_retval_c99=yes],
+ [gl_cv_func_snprintf_retval_c99=no],
+ [case "$host_os" in
+changequote(,)dnl
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on FreeBSD >= 5.
+ freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";;
+ freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ midnightbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on Mac OS X >= 10.3.
+ darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";;
+ darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on OpenBSD >= 3.9.
+ openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+ gl_cv_func_snprintf_retval_c99="guessing no";;
+ openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on Solaris >= 2.10.
+ solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ solaris*) gl_cv_func_printf_sizes_c99="guessing no";;
+ # Guess yes on AIX >= 4.
+ aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";;
+ aix*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on NetBSD >= 3.
+ netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+ gl_cv_func_snprintf_retval_c99="guessing no";;
+ netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+changequote([,])dnl
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_snprintf_retval_c99="guessing yes"],
+ [gl_cv_func_snprintf_retval_c99="guessing no"])
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_snprintf_retval_c99="$gl_cross_guess_normal";;
+ esac
+ ])
+ ])
+])
+
+dnl Test whether the snprintf function supports the %n format directive
+dnl also in truncated portions of the format string. (ISO C99, POSIX:2001)
+dnl Result is gl_cv_func_snprintf_directive_n.
+
+AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([gl_SNPRINTF_PRESENCE])
+ AC_CACHE_CHECK([whether snprintf fully supports the 'n' directive],
+ [gl_cv_func_snprintf_directive_n],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+ va_list args;
+ int ret;
+ va_start (args, format);
+ ret = vsnprintf (buf, size, format, args);
+ va_end (args);
+ return ret;
+}
+#endif
+static char fmtstring[10];
+static char buf[100];
+int main ()
+{
+ int count = -1;
+ /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
+ support %n in format strings in read-only memory but not in writable
+ memory. */
+ strcpy (fmtstring, "%d %n");
+ my_snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55);
+ if (count != 6)
+ return 1;
+ return 0;
+}]])],
+ [gl_cv_func_snprintf_directive_n=yes],
+ [gl_cv_func_snprintf_directive_n=no],
+ [
+ case "$host_os" in
+ # Guess no on glibc when _FORTIFY_SOURCE >= 2.
+ *-gnu* | gnu*) AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if _FORTIFY_SOURCE >= 2
+ error fail
+ #endif
+ ]])],
+ [gl_cv_func_snprintf_directive_n="guessing yes"],
+ [gl_cv_func_snprintf_directive_n="guessing no"])
+ ;;
+changequote(,)dnl
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess yes on FreeBSD >= 5.
+ freebsd[1-4].*) gl_cv_func_snprintf_directive_n="guessing no";;
+ freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ midnightbsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess yes on Mac OS X >= 10.3.
+ darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";;
+ darwin*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess yes on Solaris >= 2.6.
+ solaris2.[0-5] | solaris2.[0-5].*)
+ gl_cv_func_snprintf_directive_n="guessing no";;
+ solaris*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess yes on AIX >= 4.
+ aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";;
+ aix*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess yes on IRIX >= 6.5.
+ irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess yes on OSF/1 >= 5.
+ osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";;
+ osf*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess yes on NetBSD >= 3.
+ netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+ gl_cv_func_snprintf_directive_n="guessing no";;
+ netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_snprintf_directive_n="guessing no";;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_snprintf_directive_n="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_snprintf_directive_n="$gl_cross_guess_normal";;
+changequote([,])dnl
+ esac
+ ])
+ ])
+])
+
+dnl Test whether the snprintf function, when passed a size = 1, writes any
+dnl output without bounds in this case, behaving like sprintf. This is the
+dnl case on Linux libc5.
+dnl Result is gl_cv_func_snprintf_size1.
+
+AC_DEFUN([gl_SNPRINTF_SIZE1],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([gl_SNPRINTF_PRESENCE])
+ AC_CACHE_CHECK([whether snprintf respects a size of 1],
+ [gl_cv_func_snprintf_size1],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+ va_list args;
+ int ret;
+ va_start (args, format);
+ ret = vsnprintf (buf, size, format, args);
+ va_end (args);
+ return ret;
+}
+#endif
+int main()
+{
+ static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
+ my_snprintf (buf, 1, "%d", 12345);
+ return buf[1] != 'E';
+}]])],
+ [gl_cv_func_snprintf_size1=yes],
+ [gl_cv_func_snprintf_size1=no],
+ [case "$host_os" in
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_snprintf_size1="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_snprintf_size1="guessing yes" ;;
+ *) gl_cv_func_snprintf_size1="guessing yes" ;;
+ esac
+ ])
+ ])
+])
+
+dnl Test whether the vsnprintf function, when passed a zero size, produces no
+dnl output. (ISO C99, POSIX:2001)
+dnl For example, snprintf nevertheless writes a NUL byte in this case
+dnl on OSF/1 5.1:
+dnl ---------------------------------------------------------------------
+dnl #include <stdio.h>
+dnl int main()
+dnl {
+dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
+dnl snprintf (buf, 0, "%d", 12345);
+dnl return buf[0] != 'D';
+dnl }
+dnl ---------------------------------------------------------------------
+dnl And vsnprintf writes any output without bounds in this case, behaving like
+dnl vsprintf, on HP-UX 11 and OSF/1 5.1:
+dnl ---------------------------------------------------------------------
+dnl #include <stdarg.h>
+dnl #include <stdio.h>
+dnl static int my_snprintf (char *buf, int size, const char *format, ...)
+dnl {
+dnl va_list args;
+dnl int ret;
+dnl va_start (args, format);
+dnl ret = vsnprintf (buf, size, format, args);
+dnl va_end (args);
+dnl return ret;
+dnl }
+dnl int main()
+dnl {
+dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
+dnl my_snprintf (buf, 0, "%d", 12345);
+dnl return buf[0] != 'D';
+dnl }
+dnl ---------------------------------------------------------------------
+dnl Result is gl_cv_func_vsnprintf_zerosize_c99.
+
+AC_DEFUN([gl_VSNPRINTF_ZEROSIZE_C99],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether vsnprintf respects a zero size as in C99],
+ [gl_cv_func_vsnprintf_zerosize_c99],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdarg.h>
+#include <stdio.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+ va_list args;
+ int ret;
+ va_start (args, format);
+ ret = vsnprintf (buf, size, format, args);
+ va_end (args);
+ return ret;
+}
+int main()
+{
+ static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
+ my_snprintf (buf, 0, "%d", 12345);
+ return buf[0] != 'D';
+}]])],
+ [gl_cv_func_vsnprintf_zerosize_c99=yes],
+ [gl_cv_func_vsnprintf_zerosize_c99=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on FreeBSD >= 5.
+ freebsd[1-4].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+ freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ midnightbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on Mac OS X >= 10.3.
+ darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+ darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on Cygwin.
+ cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on Solaris >= 2.6.
+ solaris2.[0-5] | solaris2.[0-5].*)
+ gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+ solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on AIX >= 4.
+ aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+ aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on IRIX >= 6.5.
+ irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on NetBSD >= 3.
+ netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+ gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+ netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on native Windows.
+ mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_vsnprintf_zerosize_c99="$gl_cross_guess_normal";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+dnl The results of these tests on various platforms are:
+dnl
+dnl 1 = gl_PRINTF_SIZES_C99
+dnl 2 = gl_PRINTF_LONG_DOUBLE
+dnl 3 = gl_PRINTF_INFINITE
+dnl 4 = gl_PRINTF_INFINITE_LONG_DOUBLE
+dnl 5 = gl_PRINTF_DIRECTIVE_A
+dnl 6 = gl_PRINTF_DIRECTIVE_F
+dnl 7 = gl_PRINTF_DIRECTIVE_N
+dnl 8 = gl_PRINTF_DIRECTIVE_LS
+dnl 9 = gl_PRINTF_POSITIONS
+dnl 10 = gl_PRINTF_FLAG_GROUPING
+dnl 11 = gl_PRINTF_FLAG_LEFTADJUST
+dnl 12 = gl_PRINTF_FLAG_ZERO
+dnl 13 = gl_PRINTF_PRECISION
+dnl 14 = gl_PRINTF_ENOMEM
+dnl 15 = gl_SNPRINTF_PRESENCE
+dnl 16 = gl_SNPRINTF_TRUNCATION_C99
+dnl 17 = gl_SNPRINTF_RETVAL_C99
+dnl 18 = gl_SNPRINTF_DIRECTIVE_N
+dnl 19 = gl_SNPRINTF_SIZE1
+dnl 20 = gl_VSNPRINTF_ZEROSIZE_C99
+dnl
+dnl 1 = checking whether printf supports size specifiers as in C99...
+dnl 2 = checking whether printf supports 'long double' arguments...
+dnl 3 = checking whether printf supports infinite 'double' arguments...
+dnl 4 = checking whether printf supports infinite 'long double' arguments...
+dnl 5 = checking whether printf supports the 'a' and 'A' directives...
+dnl 6 = checking whether printf supports the 'F' directive...
+dnl 7 = checking whether printf supports the 'n' directive...
+dnl 8 = checking whether printf supports the 'ls' directive...
+dnl 9 = checking whether printf supports POSIX/XSI format strings with positions...
+dnl 10 = checking whether printf supports the grouping flag...
+dnl 11 = checking whether printf supports the left-adjust flag correctly...
+dnl 12 = checking whether printf supports the zero flag correctly...
+dnl 13 = checking whether printf supports large precisions...
+dnl 14 = checking whether printf survives out-of-memory conditions...
+dnl 15 = checking for snprintf...
+dnl 16 = checking whether snprintf truncates the result as in C99...
+dnl 17 = checking whether snprintf returns a byte count as in C99...
+dnl 18 = checking whether snprintf fully supports the 'n' directive...
+dnl 19 = checking whether snprintf respects a size of 1...
+dnl 20 = checking whether vsnprintf respects a zero size as in C99...
+dnl
+dnl . = yes, # = no.
+dnl
+dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
+dnl glibc 2.5 . . . . . . . . . . . . . . . . . . . .
+dnl glibc 2.3.6 . . . . # . . . . . . . . . . . . . . .
+dnl FreeBSD 13.0 . . . . # . . . . . . . . # . . . . . .
+dnl FreeBSD 5.4, 6.1 . . . . # . . . . . . # . # . . . . . .
+dnl Mac OS X 10.13.5 . . . # # . # . . . . . . . . . . # . .
+dnl Mac OS X 10.5.8 . . . # # . . . . . . # . . . . . . . .
+dnl Mac OS X 10.3.9 . . . . # . . . . . . # . # . . . . . .
+dnl OpenBSD 6.0, 6.7 . . . . # . . . . . . . . # . . . . . .
+dnl OpenBSD 3.9, 4.0 . . # # # # . # . # . # . # . . . . . .
+dnl Cygwin 1.7.0 (2009) . . . # . . . ? . . . . . ? . . . . . .
+dnl Cygwin 1.5.25 (2008) . . . # # . . # . . . . . # . . . . . .
+dnl Cygwin 1.5.19 (2006) # . . # # # . # . # . # # # . . . . . .
+dnl Solaris 11.4 . . # # # . . # . . . # . . . . . . . .
+dnl Solaris 11.3 . . . . # . . # . . . . . . . . . . . .
+dnl Solaris 11.0 . . # # # . . # . . . # . . . . . . . .
+dnl Solaris 10 . . # # # . . # . . . # # . . . . . . .
+dnl Solaris 2.6 ... 9 # . # # # # . # . . . # # . . . # . . .
+dnl Solaris 2.5.1 # . # # # # . # . . . # . . # # # # # #
+dnl AIX 7.1 . . # # # . . . . . . # # . . . . . . .
+dnl AIX 5.2 . . # # # . . . . . . # . . . . . . . .
+dnl AIX 4.3.2, 5.1 # . # # # # . . . . . # . . . . # . . .
+dnl HP-UX 11.31 . . . . # . . . . . . # . . . . # # . .
+dnl HP-UX 11.{00,11,23} # . . . # # . . . . . # . . . . # # . #
+dnl HP-UX 10.20 # . # . # # . ? . . # # . . . . # # ? #
+dnl IRIX 6.5 # . # # # # . # . . . # . . . . # . . .
+dnl OSF/1 5.1 # . # # # # . . . . . # . . . . # . . #
+dnl OSF/1 4.0d # . # # # # . . . . . # . . # # # # # #
+dnl NetBSD 9.0 . . . . # . . . . . . . . . . . . . . .
+dnl NetBSD 5.0 . . . # # . . . . . . # . # . . . . . .
+dnl NetBSD 4.0 . ? ? ? ? ? . ? . ? ? ? ? ? . . . ? ? ?
+dnl NetBSD 3.0 . . . . # # . ? # # ? # . # . . . . . .
+dnl Haiku . . . # # # . # . . . . . ? . . ? . . .
+dnl BeOS # # . # # # . ? # . ? . # ? . . ? . . .
+dnl Android 4.3 . . # # # # # # . # . # . # . . . # . .
+dnl old mingw / msvcrt # # # # # # . . # # . # # ? . # # # . .
+dnl MSVC 9 # # # # # # # . # # . # # ? # # # # . .
+dnl mingw 2009-2011 . # . # . . . . # # . . . ? . . . . . .
+dnl mingw-w64 2011 # # # # # # . . # # . # # ? . # # # . .
diff --git a/gl/m4/progtest.m4 b/gl/m4/progtest.m4
new file mode 100644
index 0000000..7b39123
--- /dev/null
+++ b/gl/m4/progtest.m4
@@ -0,0 +1,91 @@
+# progtest.m4 serial 7 (gettext-0.18.2)
+dnl Copyright (C) 1996-2003, 2005, 2008-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+AC_PREREQ([2.50])
+
+# Search path for a program which passes the given test.
+
+dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
+dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN([AM_PATH_PROG_WITH_TEST],
+[
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+ # contains only /bin. Note that ksh looks also at the FPATH variable,
+ # so we have to set that as well for the test.
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ || PATH_SEPARATOR=';'
+ }
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
+else
+ ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL([ac_cv_path_$1],
+[case "[$]$1" in
+ [[\\/]]* | ?:[[\\/]]*)
+ ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in ifelse([$5], , $PATH, [$5]); do
+ IFS="$ac_save_IFS"
+ test -z "$ac_dir" && ac_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+ echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
+ if [$3]; then
+ ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ done
+ IFS="$ac_save_IFS"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+ ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
+ AC_MSG_RESULT([$][$1])
+else
+ AC_MSG_RESULT([no])
+fi
+AC_SUBST([$1])dnl
+])
diff --git a/gl/m4/pselect.m4 b/gl/m4/pselect.m4
new file mode 100644
index 0000000..8611441
--- /dev/null
+++ b/gl/m4/pselect.m4
@@ -0,0 +1,73 @@
+# pselect.m4 serial 10
+dnl Copyright (C) 2011-2022 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_PSELECT],
+[
+ AC_REQUIRE([gl_SYS_SELECT_H])
+ AC_REQUIRE([AC_C_RESTRICT])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_FUNCS_ONCE([pselect])
+
+ if test $ac_cv_func_pselect = yes; then
+ AC_CACHE_CHECK([whether signature of pselect conforms to POSIX],
+ [gl_cv_sig_pselect],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/select.h>
+ ]],
+ [[int (*p) (int, fd_set *, fd_set *, fd_set *restrict,
+ struct timespec const *restrict,
+ sigset_t const *restrict) = pselect;
+ return !p;]])],
+ [gl_cv_sig_pselect=yes],
+ [gl_cv_sig_pselect=no])])
+
+ dnl On FreeBSD 8.2, pselect() doesn't always reject bad fds.
+ AC_CACHE_CHECK([whether pselect detects invalid fds],
+ [gl_cv_func_pselect_detects_ebadf],
+ [
+ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/types.h>
+#include <sys/time.h>
+#if HAVE_SYS_SELECT_H
+# include <sys/select.h>
+#endif
+#include <unistd.h>
+#include <errno.h>
+]GL_MDA_DEFINES],
+[[
+ fd_set set;
+ dup2(0, 16);
+ FD_ZERO(&set);
+ FD_SET(16, &set);
+ close(16);
+ struct timespec timeout;
+ timeout.tv_sec = 0;
+ timeout.tv_nsec = 5000;
+ return pselect (17, &set, NULL, NULL, &timeout, NULL) != -1 || errno != EBADF;
+]])], [gl_cv_func_pselect_detects_ebadf=yes],
+ [gl_cv_func_pselect_detects_ebadf=no],
+ [
+ case "$host_os" in
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_pselect_detects_ebadf="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_pselect_detects_ebadf="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_pselect_detects_ebadf="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case $gl_cv_func_pselect_detects_ebadf in
+ *yes) ;;
+ *) REPLACE_PSELECT=1 ;;
+ esac
+ fi
+
+ if test $ac_cv_func_pselect = no || test $gl_cv_sig_pselect = no; then
+ REPLACE_PSELECT=1
+ fi
+])
diff --git a/gl/m4/pthread_rwlock_rdlock.m4 b/gl/m4/pthread_rwlock_rdlock.m4
new file mode 100644
index 0000000..8ad7839
--- /dev/null
+++ b/gl/m4/pthread_rwlock_rdlock.m4
@@ -0,0 +1,185 @@
+# pthread_rwlock_rdlock.m4 serial 4
+dnl Copyright (C) 2017-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Inspired by
+dnl https://github.com/linux-test-project/ltp/blob/master/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-2.c
+dnl by Intel Corporation.
+
+dnl Test whether in a situation where
+dnl - an rwlock is taken by a reader and has a writer waiting,
+dnl - an additional reader requests the lock,
+dnl - the waiting writer and the requesting reader threads have the same
+dnl priority,
+dnl the requesting reader thread gets blocked, so that at some point the
+dnl waiting writer can acquire the lock.
+dnl Without such a guarantee, when there a N readers and each of the readers
+dnl spends more than 1/Nth of the time with the lock held, there is a high
+dnl probability that the waiting writer will not get the lock in a given finite
+dnl time, a phenomenon called "writer starvation".
+dnl Without such a guarantee, applications have a hard time avoiding writer
+dnl starvation.
+dnl
+dnl POSIX:2017 makes this requirement only for implementations that support TPS
+dnl (Thread Priority Scheduling) and only for the scheduling policies SCHED_FIFO
+dnl and SCHED_RR, see
+dnl https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_rwlock_rdlock.html
+dnl but this test verifies the guarantee regardless of TPS and regardless of
+dnl scheduling policy.
+dnl Glibc does not provide this guarantee (and never will on Linux), see
+dnl https://sourceware.org/bugzilla/show_bug.cgi?id=13701
+dnl https://bugzilla.redhat.com/show_bug.cgi?id=1410052
+AC_DEFUN([gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER],
+[
+ AC_REQUIRE([gl_THREADLIB_EARLY])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether pthread_rwlock_rdlock prefers a writer to a reader],
+ [gl_cv_pthread_rwlock_rdlock_prefer_writer],
+ [save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBMULTITHREAD"
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <errno.h>
+#include <pthread.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#define SUCCEED() exit (0)
+#define FAILURE() exit (1)
+#define UNEXPECTED(n) (exit (10 + (n)))
+
+/* The main thread creates the waiting writer and the requesting reader threads
+ in the default way; this guarantees that they have the same priority.
+ We can reuse the main thread as first reader thread. */
+
+static pthread_rwlock_t lock;
+static pthread_t reader1;
+static pthread_t writer;
+static pthread_t reader2;
+static pthread_t timer;
+/* Used to pass control from writer to reader2 and from reader2 to timer,
+ as in a relay race.
+ Passing control from one running thread to another running thread
+ is most likely faster than to create the second thread. */
+static pthread_mutex_t baton;
+
+static void *
+timer_func (void *ignored)
+{
+ /* Step 13 (can be before or after step 12):
+ The timer thread takes the baton, then waits a moment to make sure
+ it can tell whether the second reader thread is blocked at step 12. */
+ if (pthread_mutex_lock (&baton))
+ UNEXPECTED (13);
+ usleep (100000);
+ /* By the time we get here, it's clear that the second reader thread is
+ blocked at step 12. This is the desired behaviour. */
+ SUCCEED ();
+}
+
+static void *
+reader2_func (void *ignored)
+{
+ int err;
+
+ /* Step 8 (can be before or after step 7):
+ The second reader thread takes the baton, then waits a moment to make sure
+ the writer thread has reached step 7. */
+ if (pthread_mutex_lock (&baton))
+ UNEXPECTED (8);
+ usleep (100000);
+ /* Step 9: The second reader thread requests the lock. */
+ err = pthread_rwlock_tryrdlock (&lock);
+ if (err == 0)
+ FAILURE ();
+ else if (err != EBUSY)
+ UNEXPECTED (9);
+ /* Step 10: Launch a timer, to test whether the next call blocks. */
+ if (pthread_create (&timer, NULL, timer_func, NULL))
+ UNEXPECTED (10);
+ /* Step 11: Release the baton. */
+ if (pthread_mutex_unlock (&baton))
+ UNEXPECTED (11);
+ /* Step 12: The second reader thread requests the lock. */
+ err = pthread_rwlock_rdlock (&lock);
+ if (err == 0)
+ FAILURE ();
+ else
+ UNEXPECTED (12);
+}
+
+static void *
+writer_func (void *ignored)
+{
+ /* Step 4: Take the baton, so that the second reader thread does not go ahead
+ too early. */
+ if (pthread_mutex_lock (&baton))
+ UNEXPECTED (4);
+ /* Step 5: Create the second reader thread. */
+ if (pthread_create (&reader2, NULL, reader2_func, NULL))
+ UNEXPECTED (5);
+ /* Step 6: Release the baton. */
+ if (pthread_mutex_unlock (&baton))
+ UNEXPECTED (6);
+ /* Step 7: The writer thread requests the lock. */
+ if (pthread_rwlock_wrlock (&lock))
+ UNEXPECTED (7);
+ return NULL;
+}
+
+int
+main ()
+{
+ reader1 = pthread_self ();
+
+ /* Step 1: The main thread initializes the lock and the baton. */
+ if (pthread_rwlock_init (&lock, NULL))
+ UNEXPECTED (1);
+ if (pthread_mutex_init (&baton, NULL))
+ UNEXPECTED (1);
+ /* Step 2: The main thread acquires the lock as a reader. */
+ if (pthread_rwlock_rdlock (&lock))
+ UNEXPECTED (2);
+ /* Step 3: Create the writer thread. */
+ if (pthread_create (&writer, NULL, writer_func, NULL))
+ UNEXPECTED (3);
+ /* Job done. Go to sleep. */
+ for (;;)
+ {
+ sleep (1);
+ }
+}
+]])],
+ [gl_cv_pthread_rwlock_rdlock_prefer_writer=yes],
+ [gl_cv_pthread_rwlock_rdlock_prefer_writer=no],
+ [case "$host_os" in
+ # Guess no on glibc systems.
+ *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
+ # Guess no on musl systems.
+ *-musl*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
+ # Guess no on bionic systems.
+ *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
+ # Guess yes on native Windows with the mingw-w64 winpthreads library.
+ # Guess no on native Windows with the gnulib windows-rwlock module.
+ mingw*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
+ gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes"
+ else
+ gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no"
+ fi
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ LIBS="$save_LIBS"
+ ])
+ case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in
+ *yes)
+ AC_DEFINE([HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER], [1],
+ [Define if the 'pthread_rwlock_rdlock' function prefers a writer to a reader.])
+ ;;
+ esac
+])
diff --git a/gl/m4/pthread_sigmask.m4 b/gl/m4/pthread_sigmask.m4
new file mode 100644
index 0000000..0aa8c53
--- /dev/null
+++ b/gl/m4/pthread_sigmask.m4
@@ -0,0 +1,274 @@
+# pthread_sigmask.m4 serial 21
+dnl Copyright (C) 2011-2022 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_PTHREAD_SIGMASK],
+[
+ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+
+ AC_CHECK_FUNCS_ONCE([pthread_sigmask])
+
+ dnl On MinGW pthread_sigmask is just a macro which always returns 0.
+ dnl It does not exist as a real function, which is required by POSIX.
+ AC_CACHE_CHECK([whether pthread_sigmask is a macro],
+ [gl_cv_func_pthread_sigmask_macro],
+ [AC_EGREP_CPP([headers_define_pthread_sigmask], [
+#include <pthread.h>
+#include <signal.h>
+#ifdef pthread_sigmask
+ headers_define_pthread_sigmask
+#endif],
+ [gl_cv_func_pthread_sigmask_macro=yes],
+ [gl_cv_func_pthread_sigmask_macro=no])
+ ])
+
+ LIB_PTHREAD_SIGMASK=
+
+ if test $gl_cv_func_pthread_sigmask_macro = yes; then
+ dnl pthread_sigmask is a dummy macro.
+ HAVE_PTHREAD_SIGMASK=0
+ dnl Make sure to '#undef pthread_sigmask' before defining it.
+ REPLACE_PTHREAD_SIGMASK=1
+ else
+ dnl Test whether the gnulib module 'threadlib' is in use.
+ dnl Some packages like Emacs use --avoid=threadlib.
+ dnl Write the symbol in such a way that it does not cause 'aclocal' to pick
+ dnl the threadlib.m4 file that is installed in $PREFIX/share/aclocal/.
+ m4_ifdef([gl_][THREADLIB], [
+ AC_REQUIRE([gl_][THREADLIB])
+
+ if test "$gl_threads_api" = posix; then
+ if test $ac_cv_func_pthread_sigmask = yes; then
+ dnl pthread_sigmask is available without -lpthread.
+ :
+ else
+ if test -n "$LIBMULTITHREAD"; then
+ AC_CACHE_CHECK([for pthread_sigmask in $LIBMULTITHREAD],
+ [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD],
+ [gl_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBMULTITHREAD"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pthread.h>
+ #include <signal.h>
+ ]],
+ [[return pthread_sigmask (0, (sigset_t *) 0, (sigset_t *) 0);]])
+ ],
+ [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=yes],
+ [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=no])
+ LIBS="$gl_save_LIBS"
+ ])
+ if test $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD = yes; then
+ dnl pthread_sigmask is available with -pthread or -lpthread.
+ LIB_PTHREAD_SIGMASK="$LIBMULTITHREAD"
+ else
+ dnl pthread_sigmask is not available at all.
+ HAVE_PTHREAD_SIGMASK=0
+ fi
+ else
+ dnl pthread_sigmask is not available at all.
+ HAVE_PTHREAD_SIGMASK=0
+ fi
+ fi
+ else
+ dnl pthread_sigmask may exist but does not interoperate with the chosen
+ dnl multithreading facility.
+ if test $ac_cv_func_pthread_sigmask = yes; then
+ REPLACE_PTHREAD_SIGMASK=1
+ else
+ HAVE_PTHREAD_SIGMASK=0
+ fi
+ fi
+ ], [
+ dnl The module 'threadlib' is not in use, due to --avoid=threadlib being
+ dnl specified.
+ dnl The package either has prepared CPPFLAGS and LIBS for use of
+ dnl POSIX:2008 threads, or wants to build single-threaded programs.
+ if test $ac_cv_func_pthread_sigmask = yes; then
+ dnl pthread_sigmask exists and does not require extra libraries.
+ dnl Assume that it is declared.
+ :
+ else
+ dnl pthread_sigmask either does not exist or needs extra libraries.
+ HAVE_PTHREAD_SIGMASK=0
+ dnl Define the symbol rpl_pthread_sigmask, not pthread_sigmask,
+ dnl so as to not accidentally override the system's pthread_sigmask
+ dnl symbol from libpthread. This is necessary on IRIX 6.5.
+ REPLACE_PTHREAD_SIGMASK=1
+ fi
+ ])
+ fi
+
+ AC_SUBST([LIB_PTHREAD_SIGMASK])
+ dnl We don't need a variable LTLIB_PTHREAD_SIGMASK, because when
+ dnl "$gl_threads_api" = posix, $LTLIBMULTITHREAD and $LIBMULTITHREAD are the
+ dnl same.
+
+ dnl Now test for some bugs in the system function.
+ if test $HAVE_PTHREAD_SIGMASK = 1; then
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ dnl On FreeBSD 13.0, MidnightBSD 1.1, HP-UX 11.31, Solaris 9, in programs
+ dnl that are not linked with -lpthread, the pthread_sigmask() function
+ dnl always returns 0 and has no effect.
+ if test -z "$LIB_PTHREAD_SIGMASK"; then
+ case " $LIBS " in
+ *' -pthread '*) ;;
+ *' -lpthread '*) ;;
+ *)
+ AC_CACHE_CHECK([whether pthread_sigmask works without -lpthread],
+ [gl_cv_func_pthread_sigmask_in_libc_works],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+ #include <pthread.h>
+ #include <signal.h>
+ #include <stddef.h>
+ int main ()
+ {
+ sigset_t set;
+ sigemptyset (&set);
+ return pthread_sigmask (1729, &set, NULL) != 0;
+ }]])],
+ [gl_cv_func_pthread_sigmask_in_libc_works=no],
+ [gl_cv_func_pthread_sigmask_in_libc_works=yes],
+ [
+ changequote(,)dnl
+ case "$host_os" in
+ freebsd* | midnightbsd* | hpux* | solaris | solaris2.[2-9]*)
+ gl_cv_func_pthread_sigmask_in_libc_works="guessing no";;
+ *)
+ gl_cv_func_pthread_sigmask_in_libc_works="guessing yes";;
+ esac
+ changequote([,])dnl
+ ])
+ ])
+ case "$gl_cv_func_pthread_sigmask_in_libc_works" in
+ *no)
+ REPLACE_PTHREAD_SIGMASK=1
+ AC_DEFINE([PTHREAD_SIGMASK_INEFFECTIVE], [1],
+ [Define to 1 if pthread_sigmask may return 0 and have no effect.])
+ ;;
+ esac;;
+ esac
+ fi
+
+ dnl On Cygwin 1.7.5, the pthread_sigmask() has a wrong return value
+ dnl convention: Upon failure, it returns -1 and sets errno.
+ AC_CACHE_CHECK([whether pthread_sigmask returns error numbers],
+ [gl_cv_func_pthread_sigmask_return_works],
+ [
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIB_PTHREAD_SIGMASK"
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <pthread.h>
+#include <signal.h>
+#include <stddef.h>
+int main ()
+{
+ sigset_t set;
+ sigemptyset (&set);
+ if (pthread_sigmask (1729, &set, NULL) == -1)
+ return 1;
+ return 0;
+}]])],
+ [gl_cv_func_pthread_sigmask_return_works=yes],
+ [gl_cv_func_pthread_sigmask_return_works=no],
+ [case "$host_os" in
+ cygwin*)
+ gl_cv_func_pthread_sigmask_return_works="guessing no";;
+ *)
+ gl_cv_func_pthread_sigmask_return_works="guessing yes";;
+ esac
+ ])
+ LIBS="$gl_save_LIBS"
+ ])
+ case "$gl_cv_func_pthread_sigmask_return_works" in
+ *no)
+ REPLACE_PTHREAD_SIGMASK=1
+ AC_DEFINE([PTHREAD_SIGMASK_FAILS_WITH_ERRNO], [1],
+ [Define to 1 if pthread_sigmask(), when it fails, returns -1 and sets errno.])
+ ;;
+ esac
+
+ dnl On IRIX 6.5, in a single-threaded program, pending signals are not
+ dnl immediately delivered when they are unblocked through pthread_sigmask,
+ dnl only a little while later.
+ AC_CACHE_CHECK([whether pthread_sigmask unblocks signals correctly],
+ [gl_cv_func_pthread_sigmask_unblock_works],
+ [
+ case "$host_os" in
+ irix*)
+ gl_cv_func_pthread_sigmask_unblock_works="guessing no";;
+ *)
+ gl_cv_func_pthread_sigmask_unblock_works="guessing yes";;
+ esac
+ m4_ifdef([gl_][THREADLIB],
+ [dnl Link against $LIBMULTITHREAD, not only $LIB_PTHREAD_SIGMASK.
+ dnl Otherwise we get a false positive on those platforms where
+ dnl $gl_cv_func_pthread_sigmask_in_libc_works is "no".
+ gl_save_LIBS=$LIBS
+ LIBS="$LIBS $LIBMULTITHREAD"])
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <pthread.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+]GL_MDA_DEFINES[
+static volatile int sigint_occurred;
+static void
+sigint_handler (int sig)
+{
+ sigint_occurred++;
+}
+int main ()
+{
+ sigset_t set;
+ int pid = getpid ();
+ char command[80];
+ signal (SIGINT, sigint_handler);
+ sigemptyset (&set);
+ sigaddset (&set, SIGINT);
+ if (!(pthread_sigmask (SIG_BLOCK, &set, NULL) == 0))
+ return 1;
+ sprintf (command, "sh -c 'sleep 1; kill -%d %d' &", SIGINT, pid);
+ if (!(system (command) == 0))
+ return 2;
+ sleep (2);
+ if (!(sigint_occurred == 0))
+ return 3;
+ if (!(pthread_sigmask (SIG_UNBLOCK, &set, NULL) == 0))
+ return 4;
+ if (!(sigint_occurred == 1)) /* This fails on IRIX. */
+ return 5;
+ return 0;
+}]])],
+ [:],
+ [gl_cv_func_pthread_sigmask_unblock_works=no],
+ [:])
+ m4_ifdef([gl_][THREADLIB], [LIBS=$gl_save_LIBS])
+ ])
+ case "$gl_cv_func_pthread_sigmask_unblock_works" in
+ *no)
+ REPLACE_PTHREAD_SIGMASK=1
+ AC_DEFINE([PTHREAD_SIGMASK_UNBLOCK_BUG], [1],
+ [Define to 1 if pthread_sigmask() unblocks signals incorrectly.])
+ ;;
+ esac
+ fi
+])
+
+# Prerequisite of lib/pthread_sigmask.c.
+AC_DEFUN([gl_PREREQ_PTHREAD_SIGMASK],
+[
+ if test $HAVE_PTHREAD_SIGMASK = 1; then
+ AC_DEFINE([HAVE_PTHREAD_SIGMASK], [1],
+ [Define to 1 if the pthread_sigmask function can be used (despite bugs).])
+ fi
+])
diff --git a/gl/m4/raise.m4 b/gl/m4/raise.m4
new file mode 100644
index 0000000..0c78d09
--- /dev/null
+++ b/gl/m4/raise.m4
@@ -0,0 +1,36 @@
+# raise.m4 serial 4
+dnl Copyright (C) 2011-2022 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_RAISE],
+[
+ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CHECK_FUNCS([raise])
+ if test $ac_cv_func_raise = no; then
+ HAVE_RAISE=0
+ else
+ m4_ifdef([gl_MSVC_INVAL], [
+ AC_REQUIRE([gl_MSVC_INVAL])
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_RAISE=1
+ fi
+ ])
+ m4_ifdef([gl_SIGNALBLOCKING], [
+ gl_SIGNALBLOCKING
+ if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
+ m4_ifdef([gl_SIGNAL_SIGPIPE], [
+ gl_SIGNAL_SIGPIPE
+ if test $gl_cv_header_signal_h_SIGPIPE != yes; then
+ REPLACE_RAISE=1
+ fi
+ ], [:])
+ fi
+ ])
+ fi
+])
+
+# Prerequisites of lib/raise.c.
+AC_DEFUN([gl_PREREQ_RAISE], [:])
diff --git a/gl/m4/rawmemchr.m4 b/gl/m4/rawmemchr.m4
new file mode 100644
index 0000000..dae4193
--- /dev/null
+++ b/gl/m4/rawmemchr.m4
@@ -0,0 +1,20 @@
+# rawmemchr.m4 serial 3
+dnl Copyright (C) 2003, 2007-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_RAWMEMCHR],
+[
+ dnl Persuade glibc <string.h> to declare rawmemchr().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+ AC_CHECK_FUNCS([rawmemchr])
+ if test $ac_cv_func_rawmemchr = no; then
+ HAVE_RAWMEMCHR=0
+ fi
+])
+
+# Prerequisites of lib/strchrnul.c.
+AC_DEFUN([gl_PREREQ_RAWMEMCHR], [:])
diff --git a/gl/m4/readdir.m4 b/gl/m4/readdir.m4
new file mode 100644
index 0000000..ff3d2ab
--- /dev/null
+++ b/gl/m4/readdir.m4
@@ -0,0 +1,15 @@
+# readdir.m4 serial 1
+dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_READDIR],
+[
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+
+ AC_CHECK_FUNCS([readdir])
+ if test $ac_cv_func_readdir = no; then
+ HAVE_READDIR=0
+ fi
+])
diff --git a/gl/m4/readlink.m4 b/gl/m4/readlink.m4
new file mode 100644
index 0000000..d1dd521
--- /dev/null
+++ b/gl/m4/readlink.m4
@@ -0,0 +1,114 @@
+# readlink.m4 serial 16
+dnl Copyright (C) 2003, 2007, 2009-2022 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_READLINK],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_FUNCS_ONCE([readlink])
+ if test $ac_cv_func_readlink = no; then
+ HAVE_READLINK=0
+ else
+ AC_CACHE_CHECK([whether readlink signature is correct],
+ [gl_cv_decl_readlink_works],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <unistd.h>
+ /* Cause compilation failure if original declaration has wrong type. */
+ ssize_t readlink (const char *, char *, size_t);]])],
+ [gl_cv_decl_readlink_works=yes], [gl_cv_decl_readlink_works=no])])
+ dnl Solaris 9 ignores trailing slash.
+ dnl FreeBSD 7.2 dereferences only one level of links with trailing slash.
+ AC_CACHE_CHECK([whether readlink handles trailing slash correctly],
+ [gl_cv_func_readlink_trailing_slash],
+ [# We have readlink, so assume ln -s works.
+ ln -s conftest.no-such conftest.link
+ ln -s conftest.link conftest.lnk2
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <unistd.h>
+]], [[char buf[20];
+ return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;]])],
+ [gl_cv_func_readlink_trailing_slash=yes],
+ [gl_cv_func_readlink_trailing_slash=no],
+ [case "$host_os" in
+ # Guess yes on Linux or glibc systems.
+ linux-* | linux | *-gnu* | gnu*)
+ gl_cv_func_readlink_trailing_slash="guessing yes" ;;
+ # Guess no on AIX or HP-UX.
+ aix* | hpux*)
+ gl_cv_func_readlink_trailing_slash="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *)
+ gl_cv_func_readlink_trailing_slash="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -f conftest.link conftest.lnk2])
+ case "$gl_cv_func_readlink_trailing_slash" in
+ *yes)
+ if test "$gl_cv_decl_readlink_works" != yes; then
+ REPLACE_READLINK=1
+ fi
+ ;;
+ *)
+ AC_DEFINE([READLINK_TRAILING_SLASH_BUG], [1], [Define to 1 if readlink
+ fails to recognize a trailing slash.])
+ REPLACE_READLINK=1
+ ;;
+ esac
+
+ AC_CACHE_CHECK([whether readlink truncates results correctly],
+ [gl_cv_func_readlink_truncate],
+ [# We have readlink, so assume ln -s works.
+ ln -s ab conftest.link
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <unistd.h>
+]], [[char c;
+ return readlink ("conftest.link", &c, 1) != 1;]])],
+ [gl_cv_func_readlink_truncate=yes],
+ [gl_cv_func_readlink_truncate=no],
+ [case "$host_os" in
+ # Guess yes on Linux or glibc systems.
+ linux-* | linux | *-gnu* | gnu*)
+ gl_cv_func_readlink_truncate="guessing yes" ;;
+ # Guess no on AIX or HP-UX.
+ aix* | hpux*)
+ gl_cv_func_readlink_truncate="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *)
+ gl_cv_func_readlink_truncate="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -f conftest.link conftest.lnk2])
+ case $gl_cv_func_readlink_truncate in
+ *yes)
+ if test "$gl_cv_decl_readlink_works" != yes; then
+ REPLACE_READLINK=1
+ fi
+ ;;
+ *)
+ AC_DEFINE([READLINK_TRUNCATE_BUG], [1], [Define to 1 if readlink
+ sets errno instead of truncating a too-long link.])
+ REPLACE_READLINK=1
+ ;;
+ esac
+ fi
+])
+
+# Like gl_FUNC_READLINK, except prepare for separate compilation
+# (no REPLACE_READLINK, no AC_LIBOBJ).
+AC_DEFUN([gl_FUNC_READLINK_SEPARATE],
+[
+ AC_CHECK_FUNCS_ONCE([readlink])
+ gl_PREREQ_READLINK
+])
+
+# Prerequisites of lib/readlink.c.
+AC_DEFUN([gl_PREREQ_READLINK],
+[
+ :
+])
diff --git a/gl/m4/readlinkat.m4 b/gl/m4/readlinkat.m4
new file mode 100644
index 0000000..63c5205
--- /dev/null
+++ b/gl/m4/readlinkat.m4
@@ -0,0 +1,39 @@
+# serial 6
+# See if we need to provide readlinkat replacement.
+
+dnl Copyright (C) 2009-2022 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.
+
+# Written by Eric Blake.
+
+AC_DEFUN([gl_FUNC_READLINKAT],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_FUNCS_ONCE([readlinkat])
+ AC_REQUIRE([gl_FUNC_READLINK])
+ if test $ac_cv_func_readlinkat = no; then
+ HAVE_READLINKAT=0
+ else
+ AC_CACHE_CHECK([whether readlinkat signature is correct],
+ [gl_cv_decl_readlinkat_works],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <unistd.h>
+ /* Check whether original declaration has correct type. */
+ ssize_t readlinkat (int, char const *, char *, size_t);]])],
+ [gl_cv_decl_readlinkat_works=yes],
+ [gl_cv_decl_readlinkat_works=no])])
+ # Assume readlinkat has the same bugs as readlink,
+ # as is the case on OS X 10.10 with trailing slashes.
+ case $gl_cv_decl_readlinkat_works,$gl_cv_func_readlink_trailing_slash,$gl_cv_func_readlink_truncate in
+ *yes,*yes,*yes)
+ ;;
+ *)
+ REPLACE_READLINKAT=1
+ ;;
+ esac
+ fi
+])
diff --git a/gl/m4/realloc.m4 b/gl/m4/realloc.m4
new file mode 100644
index 0000000..86e57c2
--- /dev/null
+++ b/gl/m4/realloc.m4
@@ -0,0 +1,63 @@
+# realloc.m4 serial 26
+dnl Copyright (C) 2007, 2009-2022 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.
+
+# This is adapted with modifications from upstream Autoconf here:
+# https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/functions.m4?id=v2.70#n1455
+AC_DEFUN([_AC_FUNC_REALLOC_IF],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
+ AC_CACHE_CHECK([whether realloc (0, 0) returns nonnull],
+ [ac_cv_func_realloc_0_nonnull],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdlib.h>
+ ]],
+ [[void *p = realloc (0, 0);
+ int result = !p;
+ free (p);
+ return result;]])
+ ],
+ [ac_cv_func_realloc_0_nonnull=yes],
+ [ac_cv_func_realloc_0_nonnull=no],
+ [case "$host_os" in
+ # Guess yes on platforms where we know the result.
+ *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \
+ | gnu* | *-musl* | midnightbsd* \
+ | hpux* | solaris* | cygwin* | mingw* | msys* )
+ ac_cv_func_realloc_0_nonnull="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) ac_cv_func_realloc_0_nonnull="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ AS_CASE([$ac_cv_func_realloc_0_nonnull], [*yes], [$1], [$2])
+])# AC_FUNC_REALLOC
+
+# gl_FUNC_REALLOC_GNU
+# -------------------
+# Replace realloc if it is not compatible with GNU libc.
+AC_DEFUN([gl_FUNC_REALLOC_GNU],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_REALLOC_POSIX])
+ if test $REPLACE_REALLOC_FOR_REALLOC_GNU = 0; then
+ _AC_FUNC_REALLOC_IF([], [REPLACE_REALLOC_FOR_REALLOC_GNU=1])
+ fi
+])# gl_FUNC_REALLOC_GNU
+
+# gl_FUNC_REALLOC_POSIX
+# ---------------------
+# Test whether 'realloc' is POSIX compliant (sets errno to ENOMEM when it
+# fails, and doesn't mess up with ptrdiff_t overflow),
+# and replace realloc if it is not.
+AC_DEFUN([gl_FUNC_REALLOC_POSIX],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_MALLOC_POSIX])
+ if test $REPLACE_MALLOC_FOR_MALLOC_POSIX = 1; then
+ REPLACE_REALLOC_FOR_REALLOC_POSIX=1
+ fi
+])
diff --git a/gl/m4/reallocarray.m4 b/gl/m4/reallocarray.m4
new file mode 100644
index 0000000..f39ab6e
--- /dev/null
+++ b/gl/m4/reallocarray.m4
@@ -0,0 +1,23 @@
+# reallocarray.m4 serial 3
+dnl Copyright (C) 2017-2022 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_REALLOCARRAY],
+[
+ dnl Persuade glibc <stdlib.h> to declare reallocarray.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([gl_CHECK_MALLOC_PTRDIFF])
+ AC_CHECK_FUNCS([reallocarray])
+ if test "$ac_cv_func_reallocarray" = no; then
+ HAVE_REALLOCARRAY=0
+ elif test "$gl_cv_malloc_ptrdiff" = no; then
+ REPLACE_REALLOCARRAY=1
+ fi
+])
+
+# Prerequisites of lib/reallocarray.c.
+AC_DEFUN([gl_PREREQ_REALLOCARRAY], [:])
diff --git a/gl/m4/regex.m4 b/gl/m4/regex.m4
new file mode 100644
index 0000000..4734298
--- /dev/null
+++ b/gl/m4/regex.m4
@@ -0,0 +1,396 @@
+# serial 73
+
+# Copyright (C) 1996-2001, 2003-2022 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+dnl Initially derived from code in GNU grep.
+dnl Mostly written by Jim Meyering.
+
+AC_PREREQ([2.50])
+
+AC_DEFUN([gl_REGEX],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_ARG_WITH([included-regex],
+ [AS_HELP_STRING([--without-included-regex],
+ [don't compile regex; this is the default on systems
+ with recent-enough versions of the GNU C Library
+ (use with caution on other systems).])])
+
+ case $with_included_regex in #(
+ yes|no) ac_use_included_regex=$with_included_regex
+ ;;
+ '')
+ # If the system regex support is good enough that it passes the
+ # following run test, then default to *not* using the included regex.c.
+ # If cross compiling, assume the test would fail and use the included
+ # regex.c.
+ AC_CHECK_DECLS_ONCE([alarm])
+ AC_CHECK_HEADERS_ONCE([malloc.h])
+ AC_CACHE_CHECK([for working re_compile_pattern],
+ [gl_cv_func_re_compile_pattern_working],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <regex.h>
+
+ #include <locale.h>
+ #include <limits.h>
+ #include <string.h>
+
+ #if defined M_CHECK_ACTION || HAVE_DECL_ALARM
+ # include <signal.h>
+ # include <unistd.h>
+ #endif
+
+ #if HAVE_MALLOC_H
+ # include <malloc.h>
+ #endif
+
+ #ifdef M_CHECK_ACTION
+ /* Exit with distinguishable exit code. */
+ static void sigabrt_no_core (int sig) { raise (SIGTERM); }
+ #endif
+ ]],
+ [[int result = 0;
+ static struct re_pattern_buffer regex;
+ unsigned char folded_chars[UCHAR_MAX + 1];
+ int i;
+ const char *s;
+ struct re_registers regs;
+
+ /* Some builds of glibc go into an infinite loop on this
+ test. Use alarm to force death, and mallopt to avoid
+ malloc recursion in diagnosing the corrupted heap. */
+#if HAVE_DECL_ALARM
+ signal (SIGALRM, SIG_DFL);
+ alarm (2);
+#endif
+#ifdef M_CHECK_ACTION
+ signal (SIGABRT, sigabrt_no_core);
+ mallopt (M_CHECK_ACTION, 2);
+#endif
+
+ if (setlocale (LC_ALL, "en_US.UTF-8"))
+ {
+ {
+ /* https://sourceware.org/ml/libc-hacker/2006-09/msg00008.html
+ This test needs valgrind to catch the bug on Debian
+ GNU/Linux 3.1 x86, but it might catch the bug better
+ on other platforms and it shouldn't hurt to try the
+ test here. */
+ static char const pat[] = "insert into";
+ static char const data[] =
+ "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK";
+ re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE
+ | RE_ICASE);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern (pat, sizeof pat - 1, &regex);
+ if (s)
+ result |= 1;
+ else
+ {
+ if (re_search (&regex, data, sizeof data - 1,
+ 0, sizeof data - 1, &regs)
+ != -1)
+ result |= 1;
+ regfree (&regex);
+ }
+ }
+
+ {
+ /* This test is from glibc bug 15078.
+ The test case is from Andreas Schwab in
+ <https://sourceware.org/ml/libc-alpha/2013-01/msg00967.html>.
+ */
+ static char const pat[] = "[^x]x";
+ static char const data[] =
+ /* <U1000><U103B><U103D><U1014><U103A><U102F><U1015><U103A> */
+ "\xe1\x80\x80"
+ "\xe1\x80\xbb"
+ "\xe1\x80\xbd"
+ "\xe1\x80\x94"
+ "\xe1\x80\xba"
+ "\xe1\x80\xaf"
+ "\xe1\x80\x95"
+ "\xe1\x80\xba"
+ "x";
+ re_set_syntax (0);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern (pat, sizeof pat - 1, &regex);
+ if (s)
+ result |= 1;
+ else
+ {
+ i = re_search (&regex, data, sizeof data - 1,
+ 0, sizeof data - 1, 0);
+ if (i != 0 && i != 21)
+ result |= 1;
+ regfree (&regex);
+ }
+ }
+
+ if (! setlocale (LC_ALL, "C"))
+ return 1;
+ }
+
+ /* This test is from glibc bug 3957, reported by Andrew Mackey. */
+ re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("a[^x]b", 6, &regex);
+ if (s)
+ result |= 2;
+ else
+ {
+ /* This should fail, but succeeds for glibc-2.5. */
+ if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
+ result |= 2;
+ regfree (&regex);
+ }
+
+ /* This regular expression is from Spencer ere test number 75
+ in grep-2.3. */
+ re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+ memset (&regex, 0, sizeof regex);
+ for (i = 0; i <= UCHAR_MAX; i++)
+ folded_chars[i] = i;
+ regex.translate = folded_chars;
+ s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, &regex);
+ /* This should fail with _Invalid character class name_ error. */
+ if (!s)
+ {
+ result |= 4;
+ regfree (&regex);
+ }
+
+ /* Ensure that [b-a] is diagnosed as invalid, when
+ using RE_NO_EMPTY_RANGES. */
+ re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("a[b-a]", 6, &regex);
+ if (s == 0)
+ {
+ result |= 8;
+ regfree (&regex);
+ }
+
+ /* This should succeed, but does not for glibc-2.1.3. */
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("{1", 2, &regex);
+ if (s)
+ result |= 8;
+ else
+ regfree (&regex);
+
+ /* The following example is derived from a problem report
+ against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("[an\371]*n", 7, &regex);
+ if (s)
+ result |= 8;
+ else
+ {
+ /* This should match, but does not for glibc-2.2.1. */
+ if (re_match (&regex, "an", 2, 0, &regs) != 2)
+ result |= 8;
+ else
+ {
+ free (regs.start);
+ free (regs.end);
+ }
+ regfree (&regex);
+ }
+
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("x", 1, &regex);
+ if (s)
+ result |= 8;
+ else
+ {
+ /* glibc-2.2.93 does not work with a negative RANGE argument. */
+ if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
+ result |= 8;
+ else
+ {
+ free (regs.start);
+ free (regs.end);
+ }
+ regfree (&regex);
+ }
+
+ /* The version of regex.c in older versions of gnulib
+ ignored RE_ICASE. Detect that problem too. */
+ re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("x", 1, &regex);
+ if (s)
+ result |= 16;
+ else
+ {
+ if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
+ result |= 16;
+ else
+ {
+ free (regs.start);
+ free (regs.end);
+ }
+ regfree (&regex);
+ }
+
+ /* Catch a bug reported by Vin Shelton in
+ https://lists.gnu.org/r/bug-coreutils/2007-06/msg00089.html
+ */
+ re_set_syntax (RE_SYNTAX_POSIX_BASIC
+ & ~RE_CONTEXT_INVALID_DUP
+ & ~RE_NO_EMPTY_RANGES);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("[[:alnum:]_-]\\\\+\$", 16, &regex);
+ if (s)
+ result |= 32;
+ else
+ regfree (&regex);
+
+ /* REG_STARTEND was added to glibc on 2004-01-15.
+ Reject older versions. */
+ if (! REG_STARTEND)
+ result |= 64;
+
+ /* Matching with the compiled form of this regexp would provoke
+ an assertion failure prior to glibc-2.28:
+ regexec.c:1375: pop_fail_stack: Assertion 'num >= 0' failed
+ With glibc-2.28, compilation fails and reports the invalid
+ back reference. */
+ re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("0|()0|\\\\1|0", 10, &regex);
+ if (!s)
+ {
+ memset (&regs, 0, sizeof regs);
+ i = re_search (&regex, "x", 1, 0, 1, &regs);
+ if (i != -1)
+ result |= 64;
+ if (0 <= i)
+ {
+ free (regs.start);
+ free (regs.end);
+ }
+ regfree (&regex);
+ }
+ else
+ {
+ if (strcmp (s, "Invalid back reference"))
+ result |= 64;
+ }
+
+ /* glibc bug 11053. */
+ re_set_syntax (RE_SYNTAX_POSIX_BASIC);
+ memset (&regex, 0, sizeof regex);
+ static char const pat_sub2[] = "\\\\(a*\\\\)*a*\\\\1";
+ s = re_compile_pattern (pat_sub2, sizeof pat_sub2 - 1, &regex);
+ if (s)
+ result |= 64;
+ else
+ {
+ memset (&regs, 0, sizeof regs);
+ static char const data[] = "a";
+ int datalen = sizeof data - 1;
+ i = re_search (&regex, data, datalen, 0, datalen, &regs);
+ if (i != 0)
+ result |= 64;
+ else if (regs.num_regs < 2)
+ result |= 64;
+ else if (! (regs.start[0] == 0 && regs.end[0] == 1))
+ result |= 64;
+ else if (! (regs.start[1] == 0 && regs.end[1] == 0))
+ result |= 64;
+ regfree (&regex);
+ free (regs.start);
+ free (regs.end);
+ }
+
+#if 0
+ /* It would be nice to reject hosts whose regoff_t values are too
+ narrow (including glibc on hosts with 64-bit ptrdiff_t and
+ 32-bit int), but we should wait until glibc implements this
+ feature. Otherwise, support for equivalence classes and
+ multibyte collation symbols would always be broken except
+ when compiling --without-included-regex. */
+ if (sizeof (regoff_t) < sizeof (ptrdiff_t)
+ || sizeof (regoff_t) < sizeof (ssize_t))
+ result |= 64;
+#endif
+
+ return result;
+ ]])],
+ [gl_cv_func_re_compile_pattern_working=yes],
+ [gl_cv_func_re_compile_pattern_working=no],
+ [case "$host_os" in
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_re_compile_pattern_working="guessing no" ;;
+ # Otherwise obey --enable-cross-guesses.
+ *) gl_cv_func_re_compile_pattern_working="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_re_compile_pattern_working" in #(
+ *yes) ac_use_included_regex=no;; #(
+ *no) ac_use_included_regex=yes;;
+ esac
+ ;;
+ *) AC_MSG_ERROR([Invalid value for --with-included-regex: $with_included_regex])
+ ;;
+ esac
+
+ if test $ac_use_included_regex = yes; then
+ AC_DEFINE([_REGEX_INCLUDE_LIMITS_H], [1],
+ [Define if you want <regex.h> to include <limits.h>, so that it
+ consistently overrides <limits.h>'s RE_DUP_MAX.])
+ AC_DEFINE([_REGEX_LARGE_OFFSETS], [1],
+ [Define if you want regoff_t to be at least as wide POSIX requires.])
+ AC_DEFINE([re_syntax_options], [rpl_re_syntax_options],
+ [Define to rpl_re_syntax_options if the replacement should be used.])
+ AC_DEFINE([re_set_syntax], [rpl_re_set_syntax],
+ [Define to rpl_re_set_syntax if the replacement should be used.])
+ AC_DEFINE([re_compile_pattern], [rpl_re_compile_pattern],
+ [Define to rpl_re_compile_pattern if the replacement should be used.])
+ AC_DEFINE([re_compile_fastmap], [rpl_re_compile_fastmap],
+ [Define to rpl_re_compile_fastmap if the replacement should be used.])
+ AC_DEFINE([re_search], [rpl_re_search],
+ [Define to rpl_re_search if the replacement should be used.])
+ AC_DEFINE([re_search_2], [rpl_re_search_2],
+ [Define to rpl_re_search_2 if the replacement should be used.])
+ AC_DEFINE([re_match], [rpl_re_match],
+ [Define to rpl_re_match if the replacement should be used.])
+ AC_DEFINE([re_match_2], [rpl_re_match_2],
+ [Define to rpl_re_match_2 if the replacement should be used.])
+ AC_DEFINE([re_set_registers], [rpl_re_set_registers],
+ [Define to rpl_re_set_registers if the replacement should be used.])
+ AC_DEFINE([re_comp], [rpl_re_comp],
+ [Define to rpl_re_comp if the replacement should be used.])
+ AC_DEFINE([re_exec], [rpl_re_exec],
+ [Define to rpl_re_exec if the replacement should be used.])
+ AC_DEFINE([regcomp], [rpl_regcomp],
+ [Define to rpl_regcomp if the replacement should be used.])
+ AC_DEFINE([regexec], [rpl_regexec],
+ [Define to rpl_regexec if the replacement should be used.])
+ AC_DEFINE([regerror], [rpl_regerror],
+ [Define to rpl_regerror if the replacement should be used.])
+ AC_DEFINE([regfree], [rpl_regfree],
+ [Define to rpl_regfree if the replacement should be used.])
+ fi
+])
+
+# Prerequisites of lib/regex.c and lib/regex_internal.c.
+AC_DEFUN([gl_PREREQ_REGEX],
+[
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+ AC_REQUIRE([AC_C_INLINE])
+ AC_REQUIRE([AC_C_RESTRICT])
+ AC_REQUIRE([AC_TYPE_MBSTATE_T])
+ AC_REQUIRE([gl_EEMALLOC])
+ AC_CHECK_HEADERS([libintl.h])
+ AC_CHECK_FUNCS_ONCE([isblank iswctype])
+ AC_CHECK_DECLS([isblank], [], [], [[#include <ctype.h>]])
+])
diff --git a/gl/m4/rename.m4 b/gl/m4/rename.m4
new file mode 100644
index 0000000..9f1a565
--- /dev/null
+++ b/gl/m4/rename.m4
@@ -0,0 +1,255 @@
+# serial 33
+
+# Copyright (C) 2001, 2003, 2005-2006, 2009-2022 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+dnl From Volker Borchert.
+dnl Determine whether rename works for source file names with a trailing slash.
+dnl The rename from SunOS 4.1.1_U1 doesn't.
+dnl
+dnl If it doesn't, then define RENAME_TRAILING_SLASH_BUG and arrange
+dnl to compile the wrapper function.
+dnl
+
+AC_DEFUN([gl_FUNC_RENAME],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([lstat])
+
+ dnl Solaris 11.3, AIX 7.1 mistakenly allow rename("file","name/").
+ dnl NetBSD 1.6 mistakenly forbids rename("dir","name/").
+ dnl FreeBSD 7.2 mistakenly allows rename("file","link-to-file/").
+ dnl The Solaris bug can be worked around without stripping
+ dnl trailing slash, while the NetBSD bug requires stripping;
+ dnl the two conditions can be distinguished by whether hard
+ dnl links are also broken.
+ AC_CACHE_CHECK([whether rename honors trailing slash on destination],
+ [gl_cv_func_rename_slash_dst_works],
+ [rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
+ touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
+ AC_MSG_ERROR([cannot create temporary files])
+ # Assume that if we have lstat, we can also check symlinks.
+ if test $ac_cv_func_lstat = yes; then
+ ln -s conftest.f conftest.lnk
+ fi
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+# include <stdio.h>
+# include <stdlib.h>
+ ]],
+ [[int result = 0;
+ if (rename ("conftest.f1", "conftest.f2/") == 0)
+ result |= 1;
+ if (rename ("conftest.d1", "conftest.d2/") != 0)
+ result |= 2;
+#if HAVE_LSTAT
+ if (rename ("conftest.f", "conftest.lnk/") == 0)
+ result |= 4;
+#endif
+ return result;
+ ]])],
+ [gl_cv_func_rename_slash_dst_works=yes],
+ [gl_cv_func_rename_slash_dst_works=no],
+ dnl When crosscompiling, assume rename is broken.
+ [case "$host_os" in
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_rename_slash_dst_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_rename_slash_dst_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
+ ])
+ case "$gl_cv_func_rename_slash_dst_works" in
+ *yes) ;;
+ *)
+ REPLACE_RENAME=1
+ AC_DEFINE([RENAME_TRAILING_SLASH_DEST_BUG], [1],
+ [Define if rename does not correctly handle slashes on the destination
+ argument, such as on Solaris 11 or NetBSD 1.6.])
+ ;;
+ esac
+
+ dnl SunOS 4.1.1_U1 mistakenly forbids rename("dir/","name").
+ dnl Solaris 9 mistakenly allows rename("file/","name").
+ dnl FreeBSD 7.2 mistakenly allows rename("link-to-file/","name").
+ dnl These bugs require stripping trailing slash to avoid corrupting
+ dnl symlinks with a trailing slash.
+ AC_CACHE_CHECK([whether rename honors trailing slash on source],
+ [gl_cv_func_rename_slash_src_works],
+ [rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
+ touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
+ AC_MSG_ERROR([cannot create temporary files])
+ # Assume that if we have lstat, we can also check symlinks.
+ if test $ac_cv_func_lstat = yes; then
+ ln -s conftest.f conftest.lnk
+ fi
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+# include <stdio.h>
+# include <stdlib.h>
+ ]],
+ [[int result = 0;
+ if (rename ("conftest.f1/", "conftest.d3") == 0)
+ result |= 1;
+ if (rename ("conftest.d1/", "conftest.d2") != 0)
+ result |= 2;
+#if HAVE_LSTAT
+ if (rename ("conftest.lnk/", "conftest.f") == 0)
+ result |= 4;
+#endif
+ return result;
+ ]])],
+ [gl_cv_func_rename_slash_src_works=yes],
+ [gl_cv_func_rename_slash_src_works=no],
+ dnl When crosscompiling, assume rename is broken.
+ [case "$host_os" in
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_rename_slash_src_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_rename_slash_src_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
+ ])
+ case "$gl_cv_func_rename_slash_src_works" in
+ *yes) ;;
+ *)
+ REPLACE_RENAME=1
+ AC_DEFINE([RENAME_TRAILING_SLASH_SOURCE_BUG], [1],
+ [Define if rename does not correctly handle slashes on the source
+ argument, such as on Solaris 9 or cygwin 1.5.])
+ ;;
+ esac
+
+ dnl NetBSD 1.6 and cygwin 1.5.x mistakenly reduce hard link count
+ dnl on rename("h1","h2").
+ dnl This bug requires stat'ting targets prior to attempting rename.
+ AC_CHECK_FUNCS_ONCE([link])
+ AC_CACHE_CHECK([whether rename manages hard links correctly],
+ [gl_cv_func_rename_link_works],
+ [if test $ac_cv_func_link = yes; then
+ if test $cross_compiling != yes; then
+ rm -rf conftest.f conftest.f1 conftest.f2
+ if touch conftest.f conftest.f2 && ln conftest.f conftest.f1 &&
+ set x `ls -i conftest.f conftest.f1` && test "$2" = "$4"; then
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+# include <errno.h>
+# include <stdio.h>
+# include <stdlib.h>
+# include <unistd.h>
+ ]GL_MDA_DEFINES],
+ [[int result = 0;
+ if (rename ("conftest.f", "conftest.f1"))
+ result |= 1;
+ if (unlink ("conftest.f1"))
+ result |= 2;
+
+ /* Allow either the POSIX-required behavior, where the
+ previous rename kept conftest.f, or the (better) NetBSD
+ behavior, where it removed conftest.f. */
+ if (rename ("conftest.f", "conftest.f") != 0
+ && errno != ENOENT)
+ result |= 4;
+
+ if (rename ("conftest.f1", "conftest.f1") == 0)
+ result |= 8;
+ if (rename ("conftest.f2", "conftest.f2") != 0)
+ result |= 16;
+ return result;
+ ]])],
+ [gl_cv_func_rename_link_works=yes],
+ [gl_cv_func_rename_link_works=no],
+ [dnl We don't get here.
+ :
+ ])
+ else
+ gl_cv_func_rename_link_works="guessing no"
+ fi
+ rm -rf conftest.f conftest.f1 conftest.f2
+ else
+ dnl When crosscompiling, assume rename is broken.
+ case "$host_os" in
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_rename_link_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_rename_link_works="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_rename_link_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_rename_link_works="$gl_cross_guess_normal" ;;
+ esac
+ fi
+ else
+ gl_cv_func_rename_link_works=yes
+ fi
+ ])
+ case "$gl_cv_func_rename_link_works" in
+ *yes) ;;
+ *)
+ REPLACE_RENAME=1
+ AC_DEFINE([RENAME_HARD_LINK_BUG], [1],
+ [Define if rename fails to leave hard links alone, as on NetBSD 1.6
+ or Cygwin 1.5.])
+ ;;
+ esac
+
+ dnl Cygwin 1.5.x mistakenly allows rename("dir","file").
+ dnl mingw mistakenly forbids rename("dir1","dir2").
+ dnl These bugs require stripping trailing slash to avoid corrupting
+ dnl symlinks with a trailing slash.
+ AC_CACHE_CHECK([whether rename manages existing destinations correctly],
+ [gl_cv_func_rename_dest_works],
+ [rm -rf conftest.f conftest.d1 conftest.d2
+ touch conftest.f && mkdir conftest.d1 conftest.d2 ||
+ AC_MSG_ERROR([cannot create temporary files])
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+# include <stdio.h>
+# include <stdlib.h>
+ ]],
+ [[int result = 0;
+ if (rename ("conftest.d1", "conftest.d2") != 0)
+ result |= 1;
+ if (rename ("conftest.d2", "conftest.f") == 0)
+ result |= 2;
+ return result;
+ ]])],
+ [gl_cv_func_rename_dest_works=yes],
+ [gl_cv_func_rename_dest_works=no],
+ dnl When crosscompiling, assume rename is broken.
+ [case "$host_os" in
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_rename_dest_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_rename_dest_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_rename_dest_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -rf conftest.f conftest.d1 conftest.d2
+ ])
+ case "$gl_cv_func_rename_dest_works" in
+ *yes) ;;
+ *)
+ REPLACE_RENAME=1
+ AC_DEFINE([RENAME_DEST_EXISTS_BUG], [1],
+ [Define if rename does not work when the destination file exists,
+ as on Cygwin 1.5 or Windows.])
+ ;;
+ esac
+])
diff --git a/gl/m4/renameat.m4 b/gl/m4/renameat.m4
new file mode 100644
index 0000000..e8f40d5
--- /dev/null
+++ b/gl/m4/renameat.m4
@@ -0,0 +1,25 @@
+# serial 3
+# See if we need to provide renameat replacement.
+
+dnl Copyright (C) 2009-2022 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.
+
+# Written by Eric Blake.
+
+AC_DEFUN([gl_FUNC_RENAMEAT],
+[
+ AC_REQUIRE([gl_FUNC_OPENAT])
+ AC_REQUIRE([gl_FUNC_RENAME])
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_HEADERS([linux/fs.h])
+ AC_CHECK_FUNCS_ONCE([renameat renameat2])
+ if test $ac_cv_func_renameat = no; then
+ HAVE_RENAMEAT=0
+ elif test $REPLACE_RENAME = 1; then
+ dnl Solaris 9 and 10 have the same bugs in renameat as in rename.
+ REPLACE_RENAMEAT=1
+ fi
+])
diff --git a/gl/m4/rewinddir.m4 b/gl/m4/rewinddir.m4
new file mode 100644
index 0000000..87c050f
--- /dev/null
+++ b/gl/m4/rewinddir.m4
@@ -0,0 +1,15 @@
+# rewinddir.m4 serial 1
+dnl Copyright (C) 2011-2022 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_REWINDDIR],
+[
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+
+ AC_CHECK_FUNCS([rewinddir])
+ if test $ac_cv_func_rewinddir = no; then
+ HAVE_REWINDDIR=0
+ fi
+])
diff --git a/gl/m4/rmdir.m4 b/gl/m4/rmdir.m4
new file mode 100644
index 0000000..5488027
--- /dev/null
+++ b/gl/m4/rmdir.m4
@@ -0,0 +1,54 @@
+# rmdir.m4 serial 18
+dnl Copyright (C) 2002, 2005, 2009-2022 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_RMDIR],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ dnl Detect cygwin 1.5.x bug.
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ AC_CACHE_CHECK([whether rmdir works], [gl_cv_func_rmdir_works],
+ [mkdir conftest.dir
+ touch conftest.file
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdio.h>
+ #include <errno.h>
+ #if HAVE_UNISTD_H
+ # include <unistd.h>
+ #else /* on Windows with MSVC */
+ # include <direct.h>
+ #endif
+ ]GL_MDA_DEFINES],
+ [[int result = 0;
+ if (!rmdir ("conftest.file/"))
+ result |= 1;
+ else if (errno != ENOTDIR)
+ result |= 2;
+ if (!rmdir ("conftest.dir/./"))
+ result |= 4;
+ return result;
+ ]])],
+ [gl_cv_func_rmdir_works=yes], [gl_cv_func_rmdir_works=no],
+ [case "$host_os" in
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_rmdir_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_rmdir_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -rf conftest.dir conftest.file])
+ case "$gl_cv_func_rmdir_works" in
+ *yes) ;;
+ *)
+ REPLACE_RMDIR=1
+ ;;
+ esac
+])
diff --git a/gl/m4/save-cwd.m4 b/gl/m4/save-cwd.m4
new file mode 100644
index 0000000..90073ee
--- /dev/null
+++ b/gl/m4/save-cwd.m4
@@ -0,0 +1,11 @@
+# serial 10
+dnl Copyright (C) 2002-2006, 2009-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Prerequisites for lib/save-cwd.c.
+AC_DEFUN([gl_SAVE_CWD],
+[
+ AC_CHECK_FUNCS_ONCE([fchdir])
+])
diff --git a/gl/m4/select.m4 b/gl/m4/select.m4
new file mode 100644
index 0000000..163f8fb
--- /dev/null
+++ b/gl/m4/select.m4
@@ -0,0 +1,117 @@
+# select.m4 serial 13
+dnl Copyright (C) 2009-2022 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_SELECT],
+[
+ AC_REQUIRE([gl_SYS_SELECT_H])
+ AC_REQUIRE([AC_C_RESTRICT])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([gl_SOCKETS])
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ REPLACE_SELECT=1
+ else
+ dnl On Interix 3.5, select(0, NULL, NULL, NULL, timeout) fails with error
+ dnl EFAULT.
+ AC_CHECK_HEADERS_ONCE([sys/select.h])
+ AC_CACHE_CHECK([whether select supports a 0 argument],
+ [gl_cv_func_select_supports0],
+ [
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
+#include <sys/time.h>
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+int main ()
+{
+ struct timeval timeout;
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 5;
+ return select (0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout) < 0;
+}]])], [gl_cv_func_select_supports0=yes], [gl_cv_func_select_supports0=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on Interix.
+ interix*) gl_cv_func_select_supports0="guessing no";;
+ # Guess yes otherwise.
+ *) gl_cv_func_select_supports0="guessing yes";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+ case "$gl_cv_func_select_supports0" in
+ *yes) ;;
+ *) REPLACE_SELECT=1 ;;
+ esac
+
+ dnl On FreeBSD 8.2, select() doesn't always reject bad fds.
+ AC_CACHE_CHECK([whether select detects invalid fds],
+ [gl_cv_func_select_detects_ebadf],
+ [
+ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/types.h>
+#include <sys/time.h>
+#if HAVE_SYS_SELECT_H
+# include <sys/select.h>
+#endif
+#include <unistd.h>
+#include <errno.h>
+]GL_MDA_DEFINES],
+[[
+ fd_set set;
+ dup2(0, 16);
+ FD_ZERO(&set);
+ FD_SET(16, &set);
+ close(16);
+ struct timeval timeout;
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 5;
+ return select (17, &set, NULL, NULL, &timeout) != -1 || errno != EBADF;
+]])], [gl_cv_func_select_detects_ebadf=yes],
+ [gl_cv_func_select_detects_ebadf=no],
+ [
+ case "$host_os" in
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_select_detects_ebadf="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_select_detects_ebadf="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case $gl_cv_func_select_detects_ebadf in
+ *yes) ;;
+ *) REPLACE_SELECT=1 ;;
+ esac
+ fi
+
+ dnl Determine the needed libraries.
+ LIB_SELECT="$LIBSOCKET"
+ if test $REPLACE_SELECT = 1; then
+ case "$host_os" in
+ mingw*)
+ dnl On the MSVC platform, the function MsgWaitForMultipleObjects
+ dnl (used in lib/select.c) requires linking with -luser32. On mingw,
+ dnl it is implicit.
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE([[
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+int
+main ()
+{
+ MsgWaitForMultipleObjects (0, NULL, 0, 0, 0);
+ return 0;
+}]])],
+ [],
+ [LIB_SELECT="$LIB_SELECT -luser32"])
+ ;;
+ esac
+ fi
+ AC_SUBST([LIB_SELECT])
+])
diff --git a/gl/m4/setenv.m4 b/gl/m4/setenv.m4
new file mode 100644
index 0000000..2000039
--- /dev/null
+++ b/gl/m4/setenv.m4
@@ -0,0 +1,166 @@
+# setenv.m4 serial 30
+dnl Copyright (C) 2001-2004, 2006-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_SETENV],
+[
+ AC_REQUIRE([gl_FUNC_SETENV_SEPARATE])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ if test $ac_cv_func_setenv = no; then
+ HAVE_SETENV=0
+ else
+ AC_CACHE_CHECK([whether setenv validates arguments],
+ [gl_cv_func_setenv_works],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+ ]], [[
+ int result = 0;
+ {
+ if (setenv ("", "", 0) != -1)
+ result |= 1;
+ else if (errno != EINVAL)
+ result |= 2;
+ }
+ {
+ if (setenv ("a", "=", 1) != 0)
+ result |= 4;
+ else if (strcmp (getenv ("a"), "=") != 0)
+ result |= 8;
+ }
+ return result;
+ ]])],
+ [gl_cv_func_setenv_works=yes], [gl_cv_func_setenv_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_setenv_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_setenv_works="$gl_cross_guess_normal" ;;
+ esac
+ ])])
+ case "$gl_cv_func_setenv_works" in
+ *yes) ;;
+ *)
+ REPLACE_SETENV=1
+ ;;
+ esac
+ fi
+])
+
+# Like gl_FUNC_SETENV, except prepare for separate compilation
+# (no REPLACE_SETENV, no AC_LIBOBJ).
+AC_DEFUN([gl_FUNC_SETENV_SEPARATE],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_CHECK_DECLS_ONCE([setenv])
+ if test $ac_cv_have_decl_setenv = no; then
+ HAVE_DECL_SETENV=0
+ fi
+ AC_CHECK_FUNCS_ONCE([setenv])
+ gl_PREREQ_SETENV
+])
+
+AC_DEFUN([gl_FUNC_UNSETENV],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_DECLS_ONCE([unsetenv])
+ if test $ac_cv_have_decl_unsetenv = no; then
+ HAVE_DECL_UNSETENV=0
+ fi
+ AC_CHECK_FUNCS([unsetenv])
+ if test $ac_cv_func_unsetenv = no; then
+ HAVE_UNSETENV=0
+ else
+ HAVE_UNSETENV=1
+ dnl Some BSDs return void, failing to do error checking.
+ AC_CACHE_CHECK([for unsetenv() return type], [gt_cv_func_unsetenv_ret],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#undef _BSD
+#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */
+#include <stdlib.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+int unsetenv (const char *name);
+ ]],
+ [[]])],
+ [gt_cv_func_unsetenv_ret='int'],
+ [gt_cv_func_unsetenv_ret='void'])])
+ if test $gt_cv_func_unsetenv_ret = 'void'; then
+ AC_DEFINE([VOID_UNSETENV], [1], [Define to 1 if unsetenv returns void
+ instead of int.])
+ REPLACE_UNSETENV=1
+ fi
+
+ dnl Solaris 10 unsetenv does not remove all copies of a name.
+ dnl Haiku alpha 2 unsetenv gets confused by assignment to environ.
+ dnl OpenBSD 4.7 unsetenv("") does not fail.
+ AC_CACHE_CHECK([whether unsetenv obeys POSIX],
+ [gl_cv_func_unsetenv_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <stdlib.h>
+ #include <errno.h>
+ extern char **environ;
+ ]GL_MDA_DEFINES],
+ [[
+ char entry1[] = "a=1";
+ char entry2[] = "b=2";
+ char *env[] = { entry1, entry2, NULL };
+ if (putenv ((char *) "a=1")) return 1;
+ if (putenv (entry2)) return 2;
+ entry2[0] = 'a';
+ unsetenv ("a");
+ if (getenv ("a")) return 3;
+ if (!unsetenv ("") || errno != EINVAL) return 4;
+ entry2[0] = 'b';
+ environ = env;
+ if (!getenv ("a")) return 5;
+ entry2[0] = 'a';
+ unsetenv ("a");
+ if (getenv ("a")) return 6;
+ ]])],
+ [gl_cv_func_unsetenv_works=yes],
+ [gl_cv_func_unsetenv_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_unsetenv_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_unsetenv_works" in
+ *yes) ;;
+ *)
+ REPLACE_UNSETENV=1
+ ;;
+ esac
+ fi
+])
+
+# Prerequisites of lib/setenv.c.
+AC_DEFUN([gl_PREREQ_SETENV],
+[
+ AC_REQUIRE([AC_FUNC_ALLOCA])
+ AC_REQUIRE([gl_ENVIRON])
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ AC_CHECK_HEADERS([search.h])
+ AC_CHECK_FUNCS([tsearch])
+])
+
+# Prerequisites of lib/unsetenv.c.
+AC_DEFUN([gl_PREREQ_UNSETENV],
+[
+ AC_REQUIRE([gl_ENVIRON])
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+])
diff --git a/gl/m4/setlocale_null.m4 b/gl/m4/setlocale_null.m4
new file mode 100644
index 0000000..09ea50e
--- /dev/null
+++ b/gl/m4/setlocale_null.m4
@@ -0,0 +1,98 @@
+# setlocale_null.m4 serial 5
+dnl Copyright (C) 2019-2022 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_SETLOCALE_NULL],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_PTHREADLIB])
+ AC_CHECK_HEADERS_ONCE([threads.h])
+
+ AC_CACHE_CHECK([whether setlocale (LC_ALL, NULL) is multithread-safe],
+ [gl_cv_func_setlocale_null_all_mtsafe],
+ [case "$host_os" in
+ # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin.
+ *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*)
+ gl_cv_func_setlocale_null_all_mtsafe=no ;;
+ # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows.
+ *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*)
+ gl_cv_func_setlocale_null_all_mtsafe=yes ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *)
+ gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ dnl On platforms without multithreading, there is no issue.
+ case "$host_os" in
+ mingw*) ;;
+ *)
+ if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
+ gl_cv_func_setlocale_null_all_mtsafe="trivially yes"
+ fi
+ ;;
+ esac
+ case "$gl_cv_func_setlocale_null_all_mtsafe" in
+ *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;;
+ *) SETLOCALE_NULL_ALL_MTSAFE=0 ;;
+ esac
+ AC_DEFINE_UNQUOTED([SETLOCALE_NULL_ALL_MTSAFE], [$SETLOCALE_NULL_ALL_MTSAFE],
+ [Define to 1 if setlocale (LC_ALL, NULL) is multithread-safe.])
+
+ dnl This is about a single category (not LC_ALL).
+ AC_CACHE_CHECK([whether setlocale (category, NULL) is multithread-safe],
+ [gl_cv_func_setlocale_null_one_mtsafe],
+ [case "$host_os" in
+ # Guess no on OpenBSD, AIX.
+ openbsd* | aix*)
+ gl_cv_func_setlocale_null_one_mtsafe=no ;;
+ # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows.
+ *-gnu* | gnu* | *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*)
+ gl_cv_func_setlocale_null_one_mtsafe=yes ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *)
+ gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ dnl On platforms without multithreading, there is no issue.
+ case "$host_os" in
+ mingw*) ;;
+ *)
+ if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
+ gl_cv_func_setlocale_null_one_mtsafe="trivially yes"
+ fi
+ ;;
+ esac
+ case "$gl_cv_func_setlocale_null_one_mtsafe" in
+ *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;;
+ *) SETLOCALE_NULL_ONE_MTSAFE=0 ;;
+ esac
+ AC_DEFINE_UNQUOTED([SETLOCALE_NULL_ONE_MTSAFE], [$SETLOCALE_NULL_ONE_MTSAFE],
+ [Define to 1 if setlocale (category, NULL) is multithread-safe.])
+
+ dnl Determine link dependencies of lib/setlocale_null.c and lib/setlocale-lock.c.
+ if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
+ case "$host_os" in
+ mingw*) LIB_SETLOCALE_NULL= ;;
+ *)
+ gl_WEAK_SYMBOLS
+ case "$gl_cv_have_weak" in
+ *yes) LIB_SETLOCALE_NULL= ;;
+ *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;;
+ esac
+ ;;
+ esac
+ else
+ LIB_SETLOCALE_NULL=
+ fi
+ dnl LIB_SETLOCALE_NULL is expected to be '-pthread' or '-lpthread' on AIX
+ dnl with gcc or xlc, and empty otherwise.
+ AC_SUBST([LIB_SETLOCALE_NULL])
+])
+
+# Prerequisites of lib/setlocale-lock.c.
+AC_DEFUN([gl_PREREQ_SETLOCALE_LOCK],
+[
+ gl_VISIBILITY
+])
diff --git a/gl/m4/sigaction.m4 b/gl/m4/sigaction.m4
new file mode 100644
index 0000000..62c83e0
--- /dev/null
+++ b/gl/m4/sigaction.m4
@@ -0,0 +1,40 @@
+# sigaction.m4 serial 7
+dnl Copyright (C) 2008-2022 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.
+
+# Determine if sigaction interface is present.
+AC_DEFUN([gl_SIGACTION],
+[
+ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([sigaction])
+ if test $ac_cv_func_sigaction = yes; then
+ AC_CHECK_MEMBERS([struct sigaction.sa_sigaction], , ,
+ [[#include <signal.h>]])
+ if test $ac_cv_member_struct_sigaction_sa_sigaction = no; then
+ HAVE_STRUCT_SIGACTION_SA_SIGACTION=0
+ fi
+ else
+ HAVE_SIGACTION=0
+ fi
+])
+
+# Prerequisites of the part of lib/signal.in.h and of lib/sigaction.c.
+AC_DEFUN([gl_PREREQ_SIGACTION],
+[
+ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+ AC_REQUIRE([AC_C_RESTRICT])
+ AC_REQUIRE([AC_TYPE_UID_T])
+ AC_REQUIRE([gl_PREREQ_SIG_HANDLER_H])
+ AC_CHECK_FUNCS_ONCE([sigaltstack siginterrupt])
+ AC_CHECK_TYPES([siginfo_t], [], [], [[
+#include <signal.h>
+ ]])
+ if test $ac_cv_type_siginfo_t = no; then
+ HAVE_SIGINFO_T=0
+ fi
+])
+
+# Prerequisites of lib/sig-handler.h.
+AC_DEFUN([gl_PREREQ_SIG_HANDLER_H], [:])
diff --git a/gl/m4/signal_h.m4 b/gl/m4/signal_h.m4
new file mode 100644
index 0000000..4c05c62
--- /dev/null
+++ b/gl/m4/signal_h.m4
@@ -0,0 +1,100 @@
+# signal_h.m4 serial 22
+dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_SIGNAL_H],
+[
+ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+ AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T])
+ gl_NEXT_HEADERS([signal.h])
+
+# AIX declares sig_atomic_t to already include volatile, and C89 compilers
+# then choke on 'volatile sig_atomic_t'. C99 requires that it compile.
+ AC_CHECK_TYPE([volatile sig_atomic_t], [],
+ [HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0], [[
+#include <signal.h>
+ ]])
+
+ dnl Ensure the type pid_t gets defined.
+ AC_REQUIRE([AC_TYPE_PID_T])
+
+ AC_REQUIRE([AC_TYPE_UID_T])
+
+ dnl Persuade glibc <signal.h> to define sighandler_t.
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_TYPE([sighandler_t], [], [HAVE_SIGHANDLER_T=0], [[
+#include <signal.h>
+ ]])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <signal.h>
+ ]], [pthread_sigmask sigaction
+ sigaddset sigdelset sigemptyset sigfillset sigismember
+ sigpending sigprocmask])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+])
+
+AC_DEFUN([gl_CHECK_TYPE_SIGSET_T],
+[
+ AC_CHECK_TYPES([sigset_t],
+ [gl_cv_type_sigset_t=yes], [gl_cv_type_sigset_t=no],
+ [[
+ #include <signal.h>
+ /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
+ #include <sys/types.h>
+ ]])
+ if test $gl_cv_type_sigset_t != yes; then
+ HAVE_SIGSET_T=0
+ fi
+])
+
+# gl_SIGNAL_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_SIGNAL_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_SIGNAL_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SIGNAL_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_SIGNAL_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_SIGMASK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RAISE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNAL_H_SIGPIPE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGPROCMASK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGACTION])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_SIGNAL_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_SIGNAL_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_POSIX_SIGNALBLOCKING=1; AC_SUBST([HAVE_POSIX_SIGNALBLOCKING])
+ HAVE_PTHREAD_SIGMASK=1; AC_SUBST([HAVE_PTHREAD_SIGMASK])
+ HAVE_RAISE=1; AC_SUBST([HAVE_RAISE])
+ HAVE_SIGSET_T=1; AC_SUBST([HAVE_SIGSET_T])
+ HAVE_SIGINFO_T=1; AC_SUBST([HAVE_SIGINFO_T])
+ HAVE_SIGACTION=1; AC_SUBST([HAVE_SIGACTION])
+ HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
+ AC_SUBST([HAVE_STRUCT_SIGACTION_SA_SIGACTION])
+ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
+ AC_SUBST([HAVE_TYPE_VOLATILE_SIG_ATOMIC_T])
+ HAVE_SIGHANDLER_T=1; AC_SUBST([HAVE_SIGHANDLER_T])
+ REPLACE_PTHREAD_SIGMASK=0; AC_SUBST([REPLACE_PTHREAD_SIGMASK])
+ REPLACE_RAISE=0; AC_SUBST([REPLACE_RAISE])
+])
diff --git a/gl/m4/signalblocking.m4 b/gl/m4/signalblocking.m4
new file mode 100644
index 0000000..b586ef5
--- /dev/null
+++ b/gl/m4/signalblocking.m4
@@ -0,0 +1,23 @@
+# signalblocking.m4 serial 17
+dnl Copyright (C) 2001-2002, 2006-2022 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.
+
+# Determine available signal blocking primitives. Three different APIs exist:
+# 1) POSIX: sigemptyset, sigaddset, sigprocmask
+# 2) SYSV: sighold, sigrelse
+# 3) BSD: sigblock, sigsetmask
+# For simplicity, here we check only for the POSIX signal blocking.
+AC_DEFUN([gl_SIGNALBLOCKING],
+[
+ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+ AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T])
+ HAVE_POSIX_SIGNALBLOCKING=0
+ if test "$gl_cv_type_sigset_t" = yes; then
+ AC_CHECK_FUNC([sigprocmask], [HAVE_POSIX_SIGNALBLOCKING=1])
+ fi
+])
+
+# Prerequisites of lib/sigprocmask.c.
+AC_DEFUN([gl_PREREQ_SIGPROCMASK], [:])
diff --git a/gl/m4/sigpipe.m4 b/gl/m4/sigpipe.m4
new file mode 100644
index 0000000..e052444
--- /dev/null
+++ b/gl/m4/sigpipe.m4
@@ -0,0 +1,29 @@
+# sigpipe.m4 serial 3
+dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Tests whether SIGPIPE is provided by <signal.h>.
+dnl Sets gl_cv_header_signal_h_SIGPIPE.
+AC_DEFUN([gl_SIGNAL_SIGPIPE],
+[
+ dnl Ensure to expand the default settings once only, before all statements
+ dnl that occur in other macros.
+ AC_REQUIRE([gl_SIGNAL_SIGPIPE_BODY])
+])
+
+AC_DEFUN([gl_SIGNAL_SIGPIPE_BODY],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_CACHE_CHECK([for SIGPIPE], [gl_cv_header_signal_h_SIGPIPE], [
+ AC_EGREP_CPP([booboo],[
+#include <signal.h>
+#if !defined SIGPIPE
+booboo
+#endif
+ ],
+ [gl_cv_header_signal_h_SIGPIPE=no],
+ [gl_cv_header_signal_h_SIGPIPE=yes])
+ ])
+])
diff --git a/gl/m4/size_max.m4 b/gl/m4/size_max.m4
new file mode 100644
index 0000000..1d6abae
--- /dev/null
+++ b/gl/m4/size_max.m4
@@ -0,0 +1,75 @@
+# size_max.m4 serial 12
+dnl Copyright (C) 2003, 2005-2006, 2008-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_PREREQ([2.61])
+
+AC_DEFUN([gl_SIZE_MAX],
+[
+ AC_CHECK_HEADERS([stdint.h])
+ dnl First test whether the system already has SIZE_MAX.
+ AC_CACHE_CHECK([for SIZE_MAX], [gl_cv_size_max], [
+ gl_cv_size_max=no
+ AC_EGREP_CPP([Found it], [
+#include <limits.h>
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#ifdef SIZE_MAX
+Found it
+#endif
+], [gl_cv_size_max=yes])
+ if test $gl_cv_size_max != yes; then
+ dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
+ dnl than the type 'unsigned long'. Try hard to find a definition that can
+ dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
+ AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1],
+ [#include <stddef.h>
+#include <limits.h>], [size_t_bits_minus_1=])
+ AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)],
+ [#include <stddef.h>], [fits_in_uint=])
+ if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
+ if test $fits_in_uint = 1; then
+ dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
+ dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stddef.h>
+ extern size_t foo;
+ extern unsigned long foo;
+ ]],
+ [[]])],
+ [fits_in_uint=0])
+ fi
+ dnl We cannot use 'expr' to simplify this expression, because 'expr'
+ dnl works only with 'long' integers in the host environment, while we
+ dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
+ if test $fits_in_uint = 1; then
+ gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
+ else
+ gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
+ fi
+ else
+ dnl Shouldn't happen, but who knows...
+ gl_cv_size_max='((size_t)~(size_t)0)'
+ fi
+ fi
+ ])
+ if test "$gl_cv_size_max" != yes; then
+ AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max],
+ [Define as the maximum value of type 'size_t', if the system doesn't define it.])
+ fi
+ dnl Don't redefine SIZE_MAX in config.h if config.h is re-included after
+ dnl <stdint.h>. Remember that the #undef in AH_VERBATIM gets replaced with
+ dnl #define by AC_DEFINE_UNQUOTED.
+ AH_VERBATIM([SIZE_MAX],
+[/* Define as the maximum value of type 'size_t', if the system doesn't define
+ it. */
+#ifndef SIZE_MAX
+# undef SIZE_MAX
+#endif])
+])
diff --git a/gl/m4/sleep.m4 b/gl/m4/sleep.m4
new file mode 100644
index 0000000..e73651f
--- /dev/null
+++ b/gl/m4/sleep.m4
@@ -0,0 +1,66 @@
+# sleep.m4 serial 11
+dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_SLEEP],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ dnl We expect to see the declaration of sleep() in a header file.
+ dnl Older versions of mingw have a sleep() function that is an alias to
+ dnl _sleep() in MSVCRT. It has a different signature than POSIX sleep():
+ dnl it takes the number of milliseconds as argument and returns void.
+ dnl mingw does not declare this function.
+ AC_CHECK_DECLS([sleep], , , [[#include <unistd.h>]])
+ AC_CHECK_FUNCS_ONCE([sleep])
+ if test $ac_cv_have_decl_sleep != yes; then
+ HAVE_SLEEP=0
+ else
+ dnl Cygwin 1.5.x has a bug where sleep can't exceed 49.7 days.
+ AC_CACHE_CHECK([for working sleep], [gl_cv_func_sleep_works],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <errno.h>
+#include <unistd.h>
+#include <signal.h>
+static void
+handle_alarm (int sig)
+{
+ if (sig != SIGALRM)
+ _exit (2);
+}
+]], [[
+ /* Failure to compile this test due to missing alarm is okay,
+ since all such platforms (mingw) also lack sleep. */
+ unsigned int pentecost = 50 * 24 * 60 * 60; /* 50 days. */
+ unsigned int remaining;
+ signal (SIGALRM, handle_alarm);
+ alarm (1);
+ remaining = sleep (pentecost);
+ if (remaining > pentecost)
+ return 3;
+ if (remaining <= pentecost - 10)
+ return 4;
+ return 0;
+ ]])],
+ [gl_cv_func_sleep_works=yes], [gl_cv_func_sleep_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_sleep_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_sleep_works="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_sleep_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_sleep_works="$gl_cross_guess_normal" ;;
+ esac
+ ])])
+ case "$gl_cv_func_sleep_works" in
+ *yes) ;;
+ *)
+ REPLACE_SLEEP=1
+ ;;
+ esac
+ fi
+])
diff --git a/gl/m4/socketlib.m4 b/gl/m4/socketlib.m4
new file mode 100644
index 0000000..b8bd0af
--- /dev/null
+++ b/gl/m4/socketlib.m4
@@ -0,0 +1,96 @@
+# socketlib.m4 serial 3
+dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl gl_SOCKETLIB
+dnl Determines the library to use for socket functions.
+dnl Sets and AC_SUBSTs LIBSOCKET.
+
+AC_DEFUN([gl_SOCKETLIB],
+[
+ gl_PREREQ_SYS_H_WINSOCK2 dnl for HAVE_WINSOCK2_H
+ LIBSOCKET=
+ if test $HAVE_WINSOCK2_H = 1; then
+ dnl Native Windows API (not Cygwin).
+ dnl If the function WSAStartup exists (declared in <winsock2.h> and
+ dnl defined through -lws2_32), we need to call it.
+ AC_CACHE_CHECK([for WSAStartup],
+ [gl_cv_func_wsastartup], [
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS -lws2_32"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[
+#ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+#endif]], [[
+ WORD wVersionRequested = MAKEWORD(1, 1);
+ WSADATA wsaData;
+ int err = WSAStartup(wVersionRequested, &wsaData);
+ WSACleanup ();
+ ]])
+ ],
+ [gl_cv_func_wsastartup=yes],
+ [gl_cv_func_wsastartup=no])
+ LIBS="$gl_save_LIBS"
+ ])
+ if test "$gl_cv_func_wsastartup" = "yes"; then
+ AC_DEFINE([WINDOWS_SOCKETS], [1], [Define if WSAStartup is needed.])
+ LIBSOCKET='-lws2_32'
+ fi
+ else
+ dnl Unix API.
+ dnl Solaris has most socket functions in libsocket.
+ dnl Haiku has most socket functions in libnetwork.
+ dnl BeOS has most socket functions in libnet.
+ dnl On HP-UX, do NOT link with libxnet, because in 64-bit mode this would
+ dnl break code (e.g. in libraries) that invokes accept(), getpeername(),
+ dnl getsockname(), getsockopt(), or recvfrom() with a 32-bit addrlen. See
+ dnl "man xopen_networking" for details.
+ AC_CACHE_CHECK([for library containing setsockopt], [gl_cv_lib_socket], [
+ gl_cv_lib_socket=
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();]], [[setsockopt();]])],
+ [],
+ [gl_save_LIBS="$LIBS"
+ LIBS="$gl_save_LIBS -lsocket"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();]], [[setsockopt();]])],
+ [gl_cv_lib_socket="-lsocket"])
+ if test -z "$gl_cv_lib_socket"; then
+ LIBS="$gl_save_LIBS -lnetwork"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();]], [[setsockopt();]])],
+ [gl_cv_lib_socket="-lnetwork"])
+ if test -z "$gl_cv_lib_socket"; then
+ LIBS="$gl_save_LIBS -lnet"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();]], [[setsockopt();]])],
+ [gl_cv_lib_socket="-lnet"])
+ fi
+ fi
+ LIBS="$gl_save_LIBS"
+ ])
+ if test -z "$gl_cv_lib_socket"; then
+ gl_cv_lib_socket="none needed"
+ fi
+ ])
+ if test "$gl_cv_lib_socket" != "none needed"; then
+ LIBSOCKET="$gl_cv_lib_socket"
+ fi
+ fi
+ AC_SUBST([LIBSOCKET])
+])
diff --git a/gl/m4/sockets.m4 b/gl/m4/sockets.m4
new file mode 100644
index 0000000..aa04acc
--- /dev/null
+++ b/gl/m4/sockets.m4
@@ -0,0 +1,17 @@
+# sockets.m4 serial 7
+dnl Copyright (C) 2008-2022 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_SOCKETS],
+[
+ AC_REQUIRE([AC_C_INLINE])
+ AC_REQUIRE([gl_SOCKETLIB])
+ gl_PREREQ_SOCKETS
+])
+
+# Prerequisites of lib/sockets.c.
+AC_DEFUN([gl_PREREQ_SOCKETS], [
+ :
+])
diff --git a/gl/m4/socklen.m4 b/gl/m4/socklen.m4
new file mode 100644
index 0000000..1390ac4
--- /dev/null
+++ b/gl/m4/socklen.m4
@@ -0,0 +1,76 @@
+# socklen.m4 serial 11
+dnl Copyright (C) 2005-2007, 2009-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Albert Chin, Windows fixes from Simon Josefsson.
+
+dnl Check for socklen_t: historically on BSD it is an int, and in
+dnl POSIX 1g it is a type of its own, but some platforms use different
+dnl types for the argument to getsockopt, getpeername, etc.:
+dnl HP-UX 10.20, IRIX 6.5, OSF/1 4.0, Interix 3.5, BeOS.
+dnl So we have to test to find something that will work.
+
+AC_DEFUN([gl_TYPE_SOCKLEN_T],
+ [AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])dnl
+ AC_CHECK_TYPE([socklen_t], ,
+ [AC_CACHE_CHECK([for socklen_t equivalent],
+ [gl_cv_socklen_t_equiv],
+ [# Systems have either "struct sockaddr *" or
+ # "void *" as the second argument to getpeername
+ gl_cv_socklen_t_equiv=
+ for arg2 in "struct sockaddr" void; do
+ for t in int size_t "unsigned int" "long int" "unsigned long int"; do
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ #include <sys/socket.h>
+
+ int getpeername (int, $arg2 *, $t *);]],
+ [[$t len;
+ getpeername (0, 0, &len);]])],
+ [gl_cv_socklen_t_equiv="$t"])
+ test "$gl_cv_socklen_t_equiv" != "" && break
+ done
+ test "$gl_cv_socklen_t_equiv" != "" && break
+ done
+ if test "$gl_cv_socklen_t_equiv" = ""; then
+ AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
+ fi
+ ])
+ AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv],
+ [type to use in place of socklen_t if not defined])],
+ [gl_SOCKET_HEADERS])])
+
+dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find
+dnl it there too. But on Cygwin, wc2tcpip.h must not be included. Users
+dnl of this module should use the same include pattern as gl_SOCKET_HEADERS.
+dnl When you change this macro, keep also in sync:
+dnl - gl_CHECK_SOCKET_HEADERS,
+dnl - the Include section of modules/socklen.
+AC_DEFUN([gl_SOCKET_HEADERS],
+[
+/* <sys/types.h> is not needed according to POSIX, but the
+ <sys/socket.h> in i386-unknown-freebsd4.10 and
+ powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#elif HAVE_WS2TCPIP_H
+# include <ws2tcpip.h>
+#endif
+])
+
+dnl Tests for the existence of the header for socket facilities.
+dnl Defines the C macros HAVE_SYS_SOCKET_H, HAVE_WS2TCPIP_H.
+dnl This macro must match gl_SOCKET_HEADERS.
+AC_DEFUN([gl_CHECK_SOCKET_HEADERS],
+ [AC_CHECK_HEADERS_ONCE([sys/socket.h])
+ if test $ac_cv_header_sys_socket_h = no; then
+ dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
+ dnl the check for those headers unconditional; yet cygwin reports
+ dnl that the headers are present but cannot be compiled (since on
+ dnl cygwin, all socket information should come from sys/socket.h).
+ AC_CHECK_HEADERS([ws2tcpip.h])
+ fi
+ ])
diff --git a/gl/m4/sockpfaf.m4 b/gl/m4/sockpfaf.m4
new file mode 100644
index 0000000..b1c4068
--- /dev/null
+++ b/gl/m4/sockpfaf.m4
@@ -0,0 +1,84 @@
+# sockpfaf.m4 serial 10
+dnl Copyright (C) 2004, 2006, 2009-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Test for some common socket protocol families (PF_INET, PF_INET6, ...)
+dnl and some common address families (AF_INET, AF_INET6, ...).
+dnl This test assumes that a system supports an address family if and only if
+dnl it supports the corresponding protocol family.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_SOCKET_FAMILIES],
+[
+ AC_REQUIRE([gl_SYS_SOCKET_H])
+ AC_CHECK_HEADERS_ONCE([netinet/in.h])
+
+ AC_CACHE_CHECK([for IPv4 sockets],
+ [gl_cv_socket_ipv4],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif]],
+[[int x = AF_INET; struct in_addr y; struct sockaddr_in z;
+ if (&x && &y && &z) return 0;]])],
+ gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)])
+ if test $gl_cv_socket_ipv4 = yes; then
+ AC_DEFINE([HAVE_IPV4], [1], [Define to 1 if <sys/socket.h> defines AF_INET.])
+ fi
+
+ AC_CACHE_CHECK([for IPv6 sockets],
+ [gl_cv_socket_ipv6],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif]],
+[[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
+ if (&x && &y && &z) return 0;]])],
+ gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)])
+ if test $gl_cv_socket_ipv6 = yes; then
+ AC_DEFINE([HAVE_IPV6], [1], [Define to 1 if <sys/socket.h> defines AF_INET6.])
+ fi
+])
+
+AC_DEFUN([gl_SOCKET_FAMILY_UNIX],
+[
+ AC_REQUIRE([gl_SYS_SOCKET_H])
+ AC_CHECK_HEADERS_ONCE([sys/un.h])
+
+ AC_CACHE_CHECK([for UNIX domain sockets],
+ [gl_cv_socket_unix],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif]],
+[[int x = AF_UNIX; struct sockaddr_un y;
+ if (&x && &y) return 0;]])],
+ gl_cv_socket_unix=yes, gl_cv_socket_unix=no)])
+ if test $gl_cv_socket_unix = yes; then
+ AC_DEFINE([HAVE_UNIXSOCKET], [1], [Define to 1 if <sys/socket.h> defines AF_UNIX.])
+ fi
+])
diff --git a/gl/m4/ssize_t.m4 b/gl/m4/ssize_t.m4
new file mode 100644
index 0000000..03b2b89
--- /dev/null
+++ b/gl/m4/ssize_t.m4
@@ -0,0 +1,23 @@
+# ssize_t.m4 serial 5 (gettext-0.18.2)
+dnl Copyright (C) 2001-2003, 2006, 2010-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Test whether ssize_t is defined.
+
+AC_DEFUN([gt_TYPE_SSIZE_T],
+[
+ AC_CACHE_CHECK([for ssize_t], [gt_cv_ssize_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>]],
+ [[int x = sizeof (ssize_t *) + sizeof (ssize_t);
+ return !x;]])],
+ [gt_cv_ssize_t=yes], [gt_cv_ssize_t=no])])
+ if test $gt_cv_ssize_t = no; then
+ AC_DEFINE([ssize_t], [int],
+ [Define as a signed type of the same size as size_t.])
+ fi
+])
diff --git a/gl/m4/stat-time.m4 b/gl/m4/stat-time.m4
new file mode 100644
index 0000000..342857d
--- /dev/null
+++ b/gl/m4/stat-time.m4
@@ -0,0 +1,83 @@
+# Checks for stat-related time functions.
+
+# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2022 Free Software
+# Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# st_atim.tv_nsec - Linux, Solaris, Cygwin
+# st_atimespec.tv_nsec - FreeBSD, NetBSD, if ! defined _POSIX_SOURCE
+# st_atimensec - FreeBSD, NetBSD, if defined _POSIX_SOURCE
+# st_atim.st__tim.tv_nsec - UnixWare (at least 2.1.2 through 7.1)
+
+# st_birthtimespec - FreeBSD, NetBSD (hidden on OpenBSD 3.9, anyway)
+# st_birthtim - Cygwin 1.7.0+
+
+AC_DEFUN([gl_STAT_TIME],
+[
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_HEADERS_ONCE([sys/time.h])
+
+ AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec],
+ [AC_CACHE_CHECK([whether struct stat.st_atim is of type struct timespec],
+ [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #if HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+ #include <time.h>
+ struct timespec ts;
+ struct stat st;
+ ]],
+ [[
+ st.st_atim = ts;
+ ]])],
+ [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes],
+ [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no])])
+ if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
+ AC_DEFINE([TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC], [1],
+ [Define to 1 if the type of the st_atim member of a struct stat is
+ struct timespec.])
+ fi],
+ [AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec], [],
+ [AC_CHECK_MEMBERS([struct stat.st_atimensec], [],
+ [AC_CHECK_MEMBERS([struct stat.st_atim.st__tim.tv_nsec], [], [],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])
+])
+
+# Check for st_birthtime, a feature from UFS2 (FreeBSD, NetBSD, OpenBSD, etc.)
+# and NTFS (Cygwin).
+# There was a time when this field was named st_createtime (21 June
+# 2002 to 16 July 2002) But that window is very small and applied only
+# to development code, so systems still using that configuration are
+# not supported. See revisions 1.10 and 1.11 of FreeBSD's
+# src/sys/ufs/ufs/dinode.h.
+#
+AC_DEFUN([gl_STAT_BIRTHTIME],
+[
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_HEADERS_ONCE([sys/time.h])
+ AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_nsec], [],
+ [AC_CHECK_MEMBERS([struct stat.st_birthtimensec], [],
+ [AC_CHECK_MEMBERS([struct stat.st_birthtim.tv_nsec], [], [],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])
+])
diff --git a/gl/m4/stat.m4 b/gl/m4/stat.m4
new file mode 100644
index 0000000..916eb88
--- /dev/null
+++ b/gl/m4/stat.m4
@@ -0,0 +1,85 @@
+# serial 18
+
+# Copyright (C) 2009-2022 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_STAT],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([lstat])
+ case "$host_os" in
+ mingw*)
+ dnl On this platform, the original stat() returns st_atime, st_mtime,
+ dnl st_ctime values that are affected by the time zone.
+ REPLACE_STAT=1
+ ;;
+ *)
+ dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/").
+ dnl (For mingw, this is due to a broken stat() override in libmingwex.a.)
+ dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/").
+ AC_CACHE_CHECK([whether stat handles trailing slashes on files],
+ [gl_cv_func_stat_file_slash],
+ [touch conftest.tmp
+ # Assume that if we have lstat, we can also check symlinks.
+ if test $ac_cv_func_lstat = yes; then
+ ln -s conftest.tmp conftest.lnk
+ fi
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/stat.h>
+]], [[int result = 0;
+ struct stat st;
+ if (!stat ("conftest.tmp/", &st))
+ result |= 1;
+#if HAVE_LSTAT
+ if (!stat ("conftest.lnk/", &st))
+ result |= 2;
+#endif
+ return result;
+ ]])],
+ [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no],
+ [case "$host_os" in
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_stat_file_slash="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -f conftest.tmp conftest.lnk])
+ case $gl_cv_func_stat_file_slash in
+ *no)
+ REPLACE_STAT=1
+ AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs
+ help when passed a file name with a trailing slash]);;
+ esac
+ case $host_os in
+ dnl Solaris stat can return a negative tv_nsec.
+ solaris*)
+ REPLACE_FSTAT=1 ;;
+ esac
+ ;;
+ esac
+])
+
+# Prerequisites of lib/stat.c and lib/stat-w32.c.
+AC_DEFUN([gl_PREREQ_STAT], [
+ AC_REQUIRE([gl_SYS_STAT_H])
+ AC_REQUIRE([gl_PREREQ_STAT_W32])
+ :
+])
+
+# Prerequisites of lib/stat-w32.c.
+AC_DEFUN([gl_PREREQ_STAT_W32], [
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ mingw*)
+ AC_CHECK_HEADERS([sdkddkver.h])
+ ;;
+ esac
+])
diff --git a/gl/m4/stdalign.m4 b/gl/m4/stdalign.m4
new file mode 100644
index 0000000..78577cb
--- /dev/null
+++ b/gl/m4/stdalign.m4
@@ -0,0 +1,56 @@
+# Check for stdalign.h that conforms to C11.
+
+dnl Copyright 2011-2022 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.
+
+# Prepare for substituting <stdalign.h> if it is not supported.
+
+AC_DEFUN([gl_STDALIGN_H],
+[
+ AC_CACHE_CHECK([for working stdalign.h],
+ [gl_cv_header_working_stdalign_h],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdint.h>
+ #include <stdalign.h>
+ #include <stddef.h>
+
+ /* Test that alignof yields a result consistent with offsetof.
+ This catches GCC bug 52023
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */
+ #ifdef __cplusplus
+ template <class t> struct alignof_helper { char a; t b; };
+ # define ao(type) offsetof (alignof_helper<type>, b)
+ #else
+ # define ao(type) offsetof (struct { char a; type b; }, b)
+ #endif
+ char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1];
+ char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1];
+ char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1];
+
+ /* Test _Alignas only on platforms where gnulib can help. */
+ #if \
+ ((defined __cplusplus && 201103 <= __cplusplus) \
+ || (__TINYC__ && defined __attribute__) \
+ || (defined __APPLE__ && defined __MACH__ \
+ ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
+ : __GNUC__) \
+ || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
+ || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \
+ || 1300 <= _MSC_VER)
+ struct alignas_test { char c; char alignas (8) alignas_8; };
+ char test_alignas[offsetof (struct alignas_test, alignas_8) == 8
+ ? 1 : -1];
+ #endif
+ ]])],
+ [gl_cv_header_working_stdalign_h=yes],
+ [gl_cv_header_working_stdalign_h=no])])
+
+ if test $gl_cv_header_working_stdalign_h = yes; then
+ GL_GENERATE_STDALIGN_H=false
+ else
+ GL_GENERATE_STDALIGN_H=true
+ fi
+])
diff --git a/gl/m4/stdarg.m4 b/gl/m4/stdarg.m4
new file mode 100644
index 0000000..eafa86c
--- /dev/null
+++ b/gl/m4/stdarg.m4
@@ -0,0 +1,76 @@
+# stdarg.m4 serial 8
+dnl Copyright (C) 2006, 2008-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Provide a working va_copy in combination with <stdarg.h>.
+
+AC_DEFUN([gl_STDARG_H],
+[
+ GL_GENERATE_STDARG_H=false
+ NEXT_STDARG_H='<stdarg.h>'
+ AC_CACHE_CHECK([for va_copy],
+ [gl_cv_func_va_copy],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdarg.h>]],
+ [[
+#ifndef va_copy
+void (*func) (va_list, va_list) = va_copy;
+#endif
+ ]])],
+ [gl_cv_func_va_copy=yes],
+ [gl_cv_func_va_copy=no])
+ ])
+ if test $gl_cv_func_va_copy = no; then
+ dnl Provide a substitute.
+ dnl Usually a simple definition in <config.h> is enough. Not so on AIX 5
+ dnl with some versions of the /usr/vac/bin/cc compiler. It has an <stdarg.h>
+ dnl which does '#undef va_copy', leading to a missing va_copy symbol. For
+ dnl this platform, we use an <stdarg.h> substitute. But we cannot use this
+ dnl approach on other platforms, because <stdarg.h> often defines only
+ dnl preprocessor macros and gl_ABSOLUTE_HEADER, gl_CHECK_NEXT_HEADERS do
+ dnl not work in this situation.
+ AC_EGREP_CPP([vaccine],
+ [#if defined _AIX && !defined __GNUC__
+ AIX vaccine
+ #endif
+ ], [gl_aixcc=yes], [gl_aixcc=no])
+ if test $gl_aixcc = yes; then
+ dnl Provide a substitute <stdarg.h> file.
+ GL_GENERATE_STDARG_H=true
+ gl_NEXT_HEADERS([stdarg.h])
+ dnl Fallback for the case when <stdarg.h> contains only macro definitions.
+ if test "$gl_cv_next_stdarg_h" = '""'; then
+ gl_cv_next_stdarg_h='"///usr/include/stdarg.h"'
+ NEXT_STDARG_H="$gl_cv_next_stdarg_h"
+ fi
+ else
+ dnl Provide a substitute in <config.h>, either __va_copy or as a simple
+ dnl assignment.
+ gl_CACHE_VAL_SILENT([gl_cv_func___va_copy], [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdarg.h>]],
+ [[
+#ifndef __va_copy
+error, bail out
+#endif
+ ]])],
+ [gl_cv_func___va_copy=yes],
+ [gl_cv_func___va_copy=no])])
+ if test $gl_cv_func___va_copy = yes; then
+ AC_DEFINE([va_copy], [__va_copy],
+ [Define as a macro for copying va_list variables.])
+ else
+ AH_VERBATIM([gl_VA_COPY], [/* A replacement for va_copy, if needed. */
+#define gl_va_copy(a,b) ((a) = (b))])
+ AC_DEFINE([va_copy], [gl_va_copy],
+ [Define as a macro for copying va_list variables.])
+ fi
+ fi
+ fi
+ AC_SUBST([NEXT_STDARG_H])
+])
diff --git a/gl/m4/stdbool.m4 b/gl/m4/stdbool.m4
new file mode 100644
index 0000000..3e6c400
--- /dev/null
+++ b/gl/m4/stdbool.m4
@@ -0,0 +1,117 @@
+# Check for stdbool.h that conforms to C99.
+
+dnl Copyright (C) 2002-2006, 2009-2022 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.
+
+#serial 9
+
+# Prepare for substituting <stdbool.h> if it is not supported.
+
+AC_DEFUN([gl_STDBOOL_H],
+[
+ AC_REQUIRE([AC_CHECK_HEADER_STDBOOL])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ dnl On some platforms, <stdbool.h> does not exist or does not conform to C99.
+ dnl On Solaris 10 with CC=cc CXX=CC, <stdbool.h> exists but is not usable
+ dnl in C++ mode (and no <cstdbool> exists). In this case, we use our
+ dnl replacement, also in C mode (for binary compatibility between C and C++).
+ if test "$ac_cv_header_stdbool_h" = yes; then
+ case "$host_os" in
+ solaris*)
+ if test -z "$GCC"; then
+ GL_GENERATE_STDBOOL_H=true
+ else
+ GL_GENERATE_STDBOOL_H=false
+ fi
+ ;;
+ *)
+ GL_GENERATE_STDBOOL_H=false
+ ;;
+ esac
+ else
+ GL_GENERATE_STDBOOL_H=true
+ fi
+
+ if test "$ac_cv_type__Bool" = yes; then
+ HAVE__BOOL=1
+ else
+ HAVE__BOOL=0
+ fi
+ AC_SUBST([HAVE__BOOL])
+])
+
+# This version of the macro is needed in autoconf <= 2.68.
+
+AC_DEFUN([AC_CHECK_HEADER_STDBOOL],
+ [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
+ [ac_cv_header_stdbool_h],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <stdbool.h>
+
+ #ifdef __cplusplus
+ typedef bool Bool;
+ #else
+ typedef _Bool Bool;
+ #ifndef bool
+ "error: bool is not defined"
+ #endif
+ #ifndef false
+ "error: false is not defined"
+ #endif
+ #if false
+ "error: false is not 0"
+ #endif
+ #ifndef true
+ "error: true is not defined"
+ #endif
+ #if true != 1
+ "error: true is not 1"
+ #endif
+ #endif
+
+ #ifndef __bool_true_false_are_defined
+ "error: __bool_true_false_are_defined is not defined"
+ #endif
+
+ struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s;
+
+ char a[true == 1 ? 1 : -1];
+ char b[false == 0 ? 1 : -1];
+ char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+ char d[(bool) 0.5 == true ? 1 : -1];
+ /* See body of main program for 'e'. */
+ char f[(Bool) 0.0 == false ? 1 : -1];
+ char g[true];
+ char h[sizeof (Bool)];
+ char i[sizeof s.t];
+ enum { j = false, k = true, l = false * true, m = true * 256 };
+ /* The following fails for
+ HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+ Bool n[m];
+ char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+ char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+ /* Catch a bug in an HP-UX C compiler. See
+ https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
+ */
+ Bool q = true;
+ Bool *pq = &q;
+ bool *qq = &q;
+ ]],
+ [[
+ bool e = &s;
+ *pq |= q; *pq |= ! q;
+ *qq |= q; *qq |= ! q;
+ /* Refer to every declared value, to avoid compiler optimizations. */
+ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+ + !m + !n + !o + !p + !q + !pq + !qq);
+ ]])],
+ [ac_cv_header_stdbool_h=yes],
+ [ac_cv_header_stdbool_h=no])])
+ AC_CHECK_TYPES([_Bool])
+])
diff --git a/gl/m4/stddef_h.m4 b/gl/m4/stddef_h.m4
new file mode 100644
index 0000000..abfd203
--- /dev/null
+++ b/gl/m4/stddef_h.m4
@@ -0,0 +1,97 @@
+# stddef_h.m4 serial 12
+dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl A placeholder for <stddef.h>, for platforms that have issues.
+
+AC_DEFUN_ONCE([gl_STDDEF_H],
+[
+ AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
+ AC_REQUIRE([gt_TYPE_WCHAR_T])
+
+ dnl Persuade OpenBSD <stddef.h> to declare max_align_t.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ GL_GENERATE_STDDEF_H=false
+
+ dnl Test whether the type max_align_t exists and whether its alignment
+ dnl "is as great as is supported by the implementation in all contexts".
+ AC_CACHE_CHECK([for good max_align_t],
+ [gl_cv_type_max_align_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stddef.h>
+ unsigned int s = sizeof (max_align_t);
+ #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
+ int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
+ int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1];
+ #endif
+ typedef struct { char a; max_align_t b; } max_helper;
+ typedef struct { char a; long b; } long_helper;
+ typedef struct { char a; double b; } double_helper;
+ typedef struct { char a; long double b; } long_double_helper;
+ int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1];
+ int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1];
+ int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1];
+ ]])],
+ [gl_cv_type_max_align_t=yes],
+ [gl_cv_type_max_align_t=no])
+ ])
+ if test $gl_cv_type_max_align_t = no; then
+ HAVE_MAX_ALIGN_T=0
+ GL_GENERATE_STDDEF_H=true
+ fi
+
+ if test $gt_cv_c_wchar_t = no; then
+ HAVE_WCHAR_T=0
+ GL_GENERATE_STDDEF_H=true
+ fi
+
+ AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions],
+ [gl_cv_decl_null_works],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stddef.h>
+ int test[2 * (sizeof NULL == sizeof (void *)) -1];
+]])],
+ [gl_cv_decl_null_works=yes],
+ [gl_cv_decl_null_works=no])])
+ if test $gl_cv_decl_null_works = no; then
+ REPLACE_NULL=1
+ GL_GENERATE_STDDEF_H=true
+ fi
+
+ if $GL_GENERATE_STDDEF_H; then
+ gl_NEXT_HEADERS([stddef.h])
+ fi
+])
+
+# gl_STDDEF_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_STDDEF_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_STDDEF_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_STDDEF_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDDEF_H_MODULE_INDICATOR_DEFAULTS], [
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_STDDEF_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_STDDEF_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ REPLACE_NULL=0; AC_SUBST([REPLACE_NULL])
+ HAVE_MAX_ALIGN_T=1; AC_SUBST([HAVE_MAX_ALIGN_T])
+ HAVE_WCHAR_T=1; AC_SUBST([HAVE_WCHAR_T])
+])
diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4
new file mode 100644
index 0000000..c3f0894
--- /dev/null
+++ b/gl/m4/stdint.m4
@@ -0,0 +1,531 @@
+# stdint.m4 serial 61
+dnl Copyright (C) 2001-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert and Bruno Haible.
+dnl Test whether <stdint.h> is supported or must be substituted.
+
+AC_PREREQ([2.61])
+
+AC_DEFUN_ONCE([gl_STDINT_H],
+[
+ AC_PREREQ([2.59])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ AC_REQUIRE([gl_LIMITS_H])
+ AC_REQUIRE([gt_TYPE_WINT_T])
+
+ dnl For backward compatibility. Some packages may still be testing these
+ dnl macros.
+ AC_DEFINE([HAVE_LONG_LONG_INT], [1],
+ [Define to 1 if the system has the type 'long long int'.])
+ AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
+ [Define to 1 if the system has the type 'unsigned long long int'.])
+
+ dnl Check for <wchar.h>, in the same way as gl_WCHAR_H does.
+ AC_CHECK_HEADERS_ONCE([wchar.h])
+ if test $ac_cv_header_wchar_h = yes; then
+ HAVE_WCHAR_H=1
+ else
+ HAVE_WCHAR_H=0
+ fi
+ AC_SUBST([HAVE_WCHAR_H])
+
+ dnl Check for <inttypes.h>.
+ AC_CHECK_HEADERS_ONCE([inttypes.h])
+ if test $ac_cv_header_inttypes_h = yes; then
+ HAVE_INTTYPES_H=1
+ else
+ HAVE_INTTYPES_H=0
+ fi
+ AC_SUBST([HAVE_INTTYPES_H])
+
+ dnl Check for <sys/types.h>.
+ AC_CHECK_HEADERS_ONCE([sys/types.h])
+ if test $ac_cv_header_sys_types_h = yes; then
+ HAVE_SYS_TYPES_H=1
+ else
+ HAVE_SYS_TYPES_H=0
+ fi
+ AC_SUBST([HAVE_SYS_TYPES_H])
+
+ gl_CHECK_NEXT_HEADERS([stdint.h])
+ if test $ac_cv_header_stdint_h = yes; then
+ HAVE_STDINT_H=1
+ else
+ HAVE_STDINT_H=0
+ fi
+ AC_SUBST([HAVE_STDINT_H])
+
+ dnl Now see whether we need a substitute <stdint.h>.
+ if test $ac_cv_header_stdint_h = yes; then
+ AC_CACHE_CHECK([whether stdint.h conforms to C99],
+ [gl_cv_header_working_stdint_h],
+ [gl_cv_header_working_stdint_h=no
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#define __STDC_CONSTANT_MACROS 1
+#define __STDC_LIMIT_MACROS 1
+#include <stdint.h>
+/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */
+#if !(defined WCHAR_MIN && defined WCHAR_MAX)
+#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
+#endif
+]
+gl_STDINT_INCLUDES
+[
+#ifdef INT8_MAX
+int8_t a1 = INT8_MAX;
+int8_t a1min = INT8_MIN;
+#endif
+#ifdef INT16_MAX
+int16_t a2 = INT16_MAX;
+int16_t a2min = INT16_MIN;
+#endif
+#ifdef INT32_MAX
+int32_t a3 = INT32_MAX;
+int32_t a3min = INT32_MIN;
+#endif
+#ifdef INT64_MAX
+int64_t a4 = INT64_MAX;
+int64_t a4min = INT64_MIN;
+#endif
+#ifdef UINT8_MAX
+uint8_t b1 = UINT8_MAX;
+#else
+typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
+#endif
+#ifdef UINT16_MAX
+uint16_t b2 = UINT16_MAX;
+#endif
+#ifdef UINT32_MAX
+uint32_t b3 = UINT32_MAX;
+#endif
+#ifdef UINT64_MAX
+uint64_t b4 = UINT64_MAX;
+#endif
+int_least8_t c1 = INT8_C (0x7f);
+int_least8_t c1max = INT_LEAST8_MAX;
+int_least8_t c1min = INT_LEAST8_MIN;
+int_least16_t c2 = INT16_C (0x7fff);
+int_least16_t c2max = INT_LEAST16_MAX;
+int_least16_t c2min = INT_LEAST16_MIN;
+int_least32_t c3 = INT32_C (0x7fffffff);
+int_least32_t c3max = INT_LEAST32_MAX;
+int_least32_t c3min = INT_LEAST32_MIN;
+int_least64_t c4 = INT64_C (0x7fffffffffffffff);
+int_least64_t c4max = INT_LEAST64_MAX;
+int_least64_t c4min = INT_LEAST64_MIN;
+uint_least8_t d1 = UINT8_C (0xff);
+uint_least8_t d1max = UINT_LEAST8_MAX;
+uint_least16_t d2 = UINT16_C (0xffff);
+uint_least16_t d2max = UINT_LEAST16_MAX;
+uint_least32_t d3 = UINT32_C (0xffffffff);
+uint_least32_t d3max = UINT_LEAST32_MAX;
+uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
+uint_least64_t d4max = UINT_LEAST64_MAX;
+int_fast8_t e1 = INT_FAST8_MAX;
+int_fast8_t e1min = INT_FAST8_MIN;
+int_fast16_t e2 = INT_FAST16_MAX;
+int_fast16_t e2min = INT_FAST16_MIN;
+int_fast32_t e3 = INT_FAST32_MAX;
+int_fast32_t e3min = INT_FAST32_MIN;
+int_fast64_t e4 = INT_FAST64_MAX;
+int_fast64_t e4min = INT_FAST64_MIN;
+uint_fast8_t f1 = UINT_FAST8_MAX;
+uint_fast16_t f2 = UINT_FAST16_MAX;
+uint_fast32_t f3 = UINT_FAST32_MAX;
+uint_fast64_t f4 = UINT_FAST64_MAX;
+#ifdef INTPTR_MAX
+intptr_t g = INTPTR_MAX;
+intptr_t gmin = INTPTR_MIN;
+#endif
+#ifdef UINTPTR_MAX
+uintptr_t h = UINTPTR_MAX;
+#endif
+intmax_t i = INTMAX_MAX;
+uintmax_t j = UINTMAX_MAX;
+
+/* Check that SIZE_MAX has the correct type, if possible. */
+#if 201112 <= __STDC_VERSION__
+int k = _Generic (SIZE_MAX, size_t: 0);
+#elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \
+ || (0x5110 <= __SUNPRO_C && !__STDC__))
+extern size_t k;
+extern __typeof__ (SIZE_MAX) k;
+#endif
+
+#include <limits.h> /* for CHAR_BIT */
+#define TYPE_MINIMUM(t) \
+ ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
+#define TYPE_MAXIMUM(t) \
+ ((t) ((t) 0 < (t) -1 \
+ ? (t) -1 \
+ : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
+struct s {
+ int check_PTRDIFF:
+ PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
+ && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
+ ? 1 : -1;
+ /* Detect bug in FreeBSD 6.0/ia64 and FreeBSD 13.0/arm64. */
+ int check_SIG_ATOMIC:
+ SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
+ && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
+ ? 1 : -1;
+ int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
+ int check_WCHAR:
+ WCHAR_MIN == TYPE_MINIMUM (wchar_t)
+ && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
+ ? 1 : -1;
+ /* Detect bug in mingw. */
+ int check_WINT:
+ WINT_MIN == TYPE_MINIMUM (wint_t)
+ && WINT_MAX == TYPE_MAXIMUM (wint_t)
+ ? 1 : -1;
+
+ /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */
+ int check_UINT8_C:
+ (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
+ int check_UINT16_C:
+ (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
+
+ /* Detect bugs in OpenBSD 3.9 stdint.h. */
+#ifdef UINT8_MAX
+ int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
+#endif
+#ifdef UINT16_MAX
+ int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
+#endif
+#ifdef UINT32_MAX
+ int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
+#endif
+#ifdef UINT64_MAX
+ int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
+#endif
+ int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
+ int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
+ int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
+ int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
+ int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
+ int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
+ int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
+ int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
+ int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
+ int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
+ int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
+};
+ ]])],
+ [dnl Determine whether the various *_MIN, *_MAX macros are usable
+ dnl in preprocessor expression. We could do it by compiling a test
+ dnl program for each of these macros. It is faster to run a program
+ dnl that inspects the macro expansion.
+ dnl This detects a bug on HP-UX 11.23/ia64.
+ AC_RUN_IFELSE([
+ AC_LANG_PROGRAM([[
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#define __STDC_CONSTANT_MACROS 1
+#define __STDC_LIMIT_MACROS 1
+#include <stdint.h>
+]
+gl_STDINT_INCLUDES
+[
+#include <stdio.h>
+#include <string.h>
+#define MVAL(macro) MVAL1(macro)
+#define MVAL1(expression) #expression
+static const char *macro_values[] =
+ {
+#ifdef INT8_MAX
+ MVAL (INT8_MAX),
+#endif
+#ifdef INT16_MAX
+ MVAL (INT16_MAX),
+#endif
+#ifdef INT32_MAX
+ MVAL (INT32_MAX),
+#endif
+#ifdef INT64_MAX
+ MVAL (INT64_MAX),
+#endif
+#ifdef UINT8_MAX
+ MVAL (UINT8_MAX),
+#endif
+#ifdef UINT16_MAX
+ MVAL (UINT16_MAX),
+#endif
+#ifdef UINT32_MAX
+ MVAL (UINT32_MAX),
+#endif
+#ifdef UINT64_MAX
+ MVAL (UINT64_MAX),
+#endif
+ NULL
+ };
+]], [[
+ const char **mv;
+ for (mv = macro_values; *mv != NULL; mv++)
+ {
+ const char *value = *mv;
+ /* Test whether it looks like a cast expression. */
+ if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0
+ || strncmp (value, "((unsigned short)"/*)*/, 17) == 0
+ || strncmp (value, "((unsigned char)"/*)*/, 16) == 0
+ || strncmp (value, "((int)"/*)*/, 6) == 0
+ || strncmp (value, "((signed short)"/*)*/, 15) == 0
+ || strncmp (value, "((signed char)"/*)*/, 14) == 0)
+ return mv - macro_values + 1;
+ }
+ return 0;
+]])],
+ [gl_cv_header_working_stdint_h=yes],
+ [],
+ [case "$host_os" in
+ # Guess yes on native Windows.
+ mingw*) gl_cv_header_working_stdint_h="guessing yes" ;;
+ # In general, assume it works.
+ *) gl_cv_header_working_stdint_h="guessing yes" ;;
+ esac
+ ])
+ ])
+ ])
+ fi
+
+ HAVE_C99_STDINT_H=0
+ HAVE_SYS_BITYPES_H=0
+ HAVE_SYS_INTTYPES_H=0
+ GL_GENERATE_STDINT_H=true
+ case "$gl_cv_header_working_stdint_h" in
+ *yes)
+ HAVE_C99_STDINT_H=1
+ dnl Now see whether the system <stdint.h> works without
+ dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined.
+ dnl If not, there would be problems when stdint.h is included from C++.
+ AC_CACHE_CHECK([whether stdint.h works without ISO C predefines],
+ [gl_cv_header_stdint_without_STDC_macros],
+ [gl_cv_header_stdint_without_STDC_macros=no
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#include <stdint.h>
+]
+gl_STDINT_INCLUDES
+[
+intmax_t im = INTMAX_MAX;
+int32_t i32 = INT32_C (0x7fffffff);
+ ]])],
+ [gl_cv_header_stdint_without_STDC_macros=yes])
+ ])
+
+ if test $gl_cv_header_stdint_without_STDC_macros = no; then
+ AC_DEFINE([__STDC_CONSTANT_MACROS], [1],
+ [Define to 1 if the system <stdint.h> predates C++11.])
+ AC_DEFINE([__STDC_LIMIT_MACROS], [1],
+ [Define to 1 if the system <stdint.h> predates C++11.])
+ fi
+ AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.],
+ [gl_cv_header_stdint_width],
+ [gl_cv_header_stdint_width=no
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ /* Work if build is not clean. */
+ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
+ #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+ #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+ #endif
+ #include <stdint.h>
+ ]gl_STDINT_INCLUDES[
+ int iw = UINTMAX_WIDTH;
+ ]])],
+ [gl_cv_header_stdint_width=yes])])
+ if test "$gl_cv_header_stdint_width" = yes; then
+ GL_GENERATE_STDINT_H=false
+ fi
+ ;;
+ *)
+ dnl Check for <sys/inttypes.h>, and for
+ dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5).
+ AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h])
+ if test $ac_cv_header_sys_inttypes_h = yes; then
+ HAVE_SYS_INTTYPES_H=1
+ fi
+ if test $ac_cv_header_sys_bitypes_h = yes; then
+ HAVE_SYS_BITYPES_H=1
+ fi
+ gl_STDINT_TYPE_PROPERTIES
+ ;;
+ esac
+
+ dnl The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH.
+ gl_REPLACE_LIMITS_H
+
+ AC_SUBST([HAVE_C99_STDINT_H])
+ AC_SUBST([HAVE_SYS_BITYPES_H])
+ AC_SUBST([HAVE_SYS_INTTYPES_H])
+])
+
+dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES)
+dnl Determine the size of each of the given types in bits.
+AC_DEFUN([gl_STDINT_BITSIZEOF],
+[
+ dnl Use a shell loop, to avoid bloating configure, and
+ dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
+ dnl config.h.in,
+ dnl - extra AC_SUBST calls, so that the right substitutions are made.
+ m4_foreach_w([gltype], [$1],
+ [AH_TEMPLATE([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
+ [Define to the number of bits in type ']gltype['.])])
+ for gltype in $1 ; do
+ AC_CACHE_CHECK([for bit size of $gltype], [gl_cv_bitsizeof_${gltype}],
+ [AC_COMPUTE_INT([result], [sizeof ($gltype) * CHAR_BIT],
+ [$2
+#include <limits.h>], [result=unknown])
+ eval gl_cv_bitsizeof_${gltype}=\$result
+ ])
+ eval result=\$gl_cv_bitsizeof_${gltype}
+ if test $result = unknown; then
+ dnl Use a nonempty default, because some compilers, such as IRIX 5 cc,
+ dnl do a syntax check even on unused #if conditions and give an error
+ dnl on valid C code like this:
+ dnl #if 0
+ dnl # if > 32
+ dnl # endif
+ dnl #endif
+ result=0
+ fi
+ GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+ AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result])
+ eval BITSIZEOF_${GLTYPE}=\$result
+ done
+ m4_foreach_w([gltype], [$1],
+ [AC_SUBST([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
+])
+
+dnl gl_CHECK_TYPES_SIGNED(TYPES, INCLUDES)
+dnl Determine the signedness of each of the given types.
+dnl Define HAVE_SIGNED_TYPE if type is signed.
+AC_DEFUN([gl_CHECK_TYPES_SIGNED],
+[
+ dnl Use a shell loop, to avoid bloating configure, and
+ dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
+ dnl config.h.in,
+ dnl - extra AC_SUBST calls, so that the right substitutions are made.
+ m4_foreach_w([gltype], [$1],
+ [AH_TEMPLATE([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
+ [Define to 1 if ']gltype[' is a signed integer type.])])
+ for gltype in $1 ; do
+ AC_CACHE_CHECK([whether $gltype is signed], [gl_cv_type_${gltype}_signed],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([$2[
+ int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];]])],
+ result=yes, result=no)
+ eval gl_cv_type_${gltype}_signed=\$result
+ ])
+ eval result=\$gl_cv_type_${gltype}_signed
+ GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+ if test "$result" = yes; then
+ AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], [1])
+ eval HAVE_SIGNED_${GLTYPE}=1
+ else
+ eval HAVE_SIGNED_${GLTYPE}=0
+ fi
+ done
+ m4_foreach_w([gltype], [$1],
+ [AC_SUBST([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
+])
+
+dnl gl_INTEGER_TYPE_SUFFIX(TYPES, INCLUDES)
+dnl Determine the suffix to use for integer constants of the given types.
+dnl Define t_SUFFIX for each such type.
+AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
+[
+ dnl Use a shell loop, to avoid bloating configure, and
+ dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
+ dnl config.h.in,
+ dnl - extra AC_SUBST calls, so that the right substitutions are made.
+ m4_foreach_w([gltype], [$1],
+ [AH_TEMPLATE(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX],
+ [Define to l, ll, u, ul, ull, etc., as suitable for
+ constants of type ']gltype['.])])
+ for gltype in $1 ; do
+ AC_CACHE_CHECK([for $gltype integer literal suffix],
+ [gl_cv_type_${gltype}_suffix],
+ [eval gl_cv_type_${gltype}_suffix=no
+ eval result=\$gl_cv_type_${gltype}_signed
+ if test "$result" = yes; then
+ glsufu=
+ else
+ glsufu=u
+ fi
+ for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
+ case $glsuf in
+ '') gltype1='int';;
+ l) gltype1='long int';;
+ ll) gltype1='long long int';;
+ i64) gltype1='__int64';;
+ u) gltype1='unsigned int';;
+ ul) gltype1='unsigned long int';;
+ ull) gltype1='unsigned long long int';;
+ ui64)gltype1='unsigned __int64';;
+ esac
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([$2[
+ extern $gltype foo;
+ extern $gltype1 foo;]])],
+ [eval gl_cv_type_${gltype}_suffix=\$glsuf])
+ eval result=\$gl_cv_type_${gltype}_suffix
+ test "$result" != no && break
+ done])
+ GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+ eval result=\$gl_cv_type_${gltype}_suffix
+ test "$result" = no && result=
+ eval ${GLTYPE}_SUFFIX=\$result
+ AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result])
+ done
+ m4_foreach_w([gltype], [$1],
+ [AC_SUBST(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])])
+])
+
+dnl gl_STDINT_INCLUDES
+AC_DEFUN([gl_STDINT_INCLUDES],
+[[
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <wchar.h>
+ #endif
+]])
+
+dnl gl_STDINT_TYPE_PROPERTIES
+dnl Compute HAVE_SIGNED_t, BITSIZEOF_t and t_SUFFIX, for all the types t
+dnl of interest to stdint.in.h.
+AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
+[
+ AC_REQUIRE([gl_MULTIARCH])
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ gl_STDINT_BITSIZEOF([ptrdiff_t size_t],
+ [gl_STDINT_INCLUDES])
+ fi
+ gl_STDINT_BITSIZEOF([sig_atomic_t wchar_t wint_t],
+ [gl_STDINT_INCLUDES])
+ gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t],
+ [gl_STDINT_INCLUDES])
+ gl_cv_type_ptrdiff_t_signed=yes
+ gl_cv_type_size_t_signed=no
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ gl_INTEGER_TYPE_SUFFIX([ptrdiff_t size_t],
+ [gl_STDINT_INCLUDES])
+ fi
+ gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t],
+ [gl_STDINT_INCLUDES])
+
+ dnl If wint_t is smaller than 'int', it cannot satisfy the ISO C 99
+ dnl requirement that wint_t is "unchanged by default argument promotions".
+ dnl In this case gnulib's <wchar.h> and <wctype.h> override wint_t.
+ dnl Set the variable BITSIZEOF_WINT_T accordingly.
+ if test $GNULIBHEADERS_OVERRIDE_WINT_T = 1; then
+ BITSIZEOF_WINT_T=32
+ fi
+])
diff --git a/gl/m4/stdint_h.m4 b/gl/m4/stdint_h.m4
new file mode 100644
index 0000000..b8684b6
--- /dev/null
+++ b/gl/m4/stdint_h.m4
@@ -0,0 +1,27 @@
+# stdint_h.m4 serial 9
+dnl Copyright (C) 1997-2004, 2006, 2008-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([gl_AC_HEADER_STDINT_H],
+[
+ AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ #include <stdint.h>]],
+ [[uintmax_t i = (uintmax_t) -1; return !i;]])],
+ [gl_cv_header_stdint_h=yes],
+ [gl_cv_header_stdint_h=no])])
+ if test $gl_cv_header_stdint_h = yes; then
+ AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1],
+ [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
+ and declares uintmax_t. ])
+ fi
+])
diff --git a/gl/m4/stdio_h.m4 b/gl/m4/stdio_h.m4
new file mode 100644
index 0000000..42e9607
--- /dev/null
+++ b/gl/m4/stdio_h.m4
@@ -0,0 +1,225 @@
+# stdio_h.m4 serial 59
+dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_STDIO_H],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AH_VERBATIM([MINGW_ANSI_STDIO],
+[/* Use GNU style printf and scanf. */
+#ifndef __USE_MINGW_ANSI_STDIO
+# undef __USE_MINGW_ANSI_STDIO
+#endif
+])
+ AC_DEFINE([__USE_MINGW_ANSI_STDIO])
+ gl_NEXT_HEADERS([stdio.h])
+
+ dnl Determine whether __USE_MINGW_ANSI_STDIO makes printf and
+ dnl inttypes.h behave like gnu instead of system; we must give our
+ dnl printf wrapper the right attribute to match.
+ AC_CACHE_CHECK([which flavor of printf attribute matches inttypes macros],
+ [gl_cv_func_printf_attribute_flavor],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #define __STDC_FORMAT_MACROS 1
+ #include <stdio.h>
+ #include <inttypes.h>
+ /* For non-mingw systems, compilation will trivially succeed.
+ For mingw, compilation will succeed for older mingw (system
+ printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */
+ #if (defined _WIN32 && ! defined __CYGWIN__) && \
+ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+ extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
+ #endif
+ ]])], [gl_cv_func_printf_attribute_flavor=system],
+ [gl_cv_func_printf_attribute_flavor=gnu])])
+ if test "$gl_cv_func_printf_attribute_flavor" = gnu; then
+ AC_DEFINE([GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU], [1],
+ [Define to 1 if printf and friends should be labeled with
+ attribute "__gnu_printf__" instead of "__printf__"])
+ fi
+
+ dnl This ifdef is an optimization, to avoid performing a configure check whose
+ dnl result is not used. But it does not make the test of
+ dnl GNULIB_STDIO_H_NONBLOCKING or GNULIB_NONBLOCKING redundant.
+ m4_ifdef([gl_NONBLOCKING_IO], [
+ gl_NONBLOCKING_IO
+ if test $gl_cv_have_nonblocking != yes; then
+ REPLACE_STDIO_READ_FUNCS=1
+ fi
+ ])
+
+ dnl This ifdef is an optimization, to avoid performing a configure check whose
+ dnl result is not used. But it does not make the test of
+ dnl GNULIB_STDIO_H_SIGPIPE or GNULIB_SIGPIPE redundant.
+ m4_ifdef([gl_SIGNAL_SIGPIPE], [
+ gl_SIGNAL_SIGPIPE
+ if test $gl_cv_header_signal_h_SIGPIPE != yes; then
+ REPLACE_STDIO_WRITE_FUNCS=1
+ fi
+ ])
+ dnl This ifdef is an optimization, to avoid performing a configure check whose
+ dnl result is not used. But it does not make the test of
+ dnl GNULIB_STDIO_H_NONBLOCKING or GNULIB_NONBLOCKING redundant.
+ m4_ifdef([gl_NONBLOCKING_IO], [
+ gl_NONBLOCKING_IO
+ if test $gl_cv_have_nonblocking != yes; then
+ REPLACE_STDIO_WRITE_FUNCS=1
+ fi
+ ])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use, and which is not
+ dnl guaranteed by both C89 and C11.
+ gl_WARN_ON_USE_PREPARE([[#include <stdio.h>
+ ]], [dprintf fpurge fseeko ftello getdelim getline gets pclose popen
+ renameat snprintf tmpfile vdprintf vsnprintf])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_CHECK_DECLS_ONCE([fcloseall])
+ if test $ac_cv_have_decl_fcloseall = no; then
+ HAVE_DECL_FCLOSEALL=0
+ fi
+])
+
+# gl_STDIO_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_STDIO_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_STDIO_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDIO_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCLOSE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FDOPEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFLUSH])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FGETC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FGETS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FOPEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FOPEN_GNU])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPRINTF_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPURGE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPUTC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPUTS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREAD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREOPEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSCANF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSEEK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSEEKO])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTELL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTELLO])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FWRITE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETCHAR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETDELIM])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLINE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OBSTACK_PRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OBSTACK_PRINTF_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PCLOSE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PERROR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POPEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PRINTF_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTCHAR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMOVE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RENAME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RENAMEAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SCANF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SNPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SPRINTF_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_NONBLOCKING])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_SIGPIPE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TMPFILE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VASPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFSCANF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSCANF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VDPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFPRINTF_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSNPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSPRINTF_POSIX])
+ dnl Support Microsoft deprecated alias function names by default.
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FCLOSEALL], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FDOPEN], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FILENO], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_GETW], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_PUTW], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_TEMPNAM], [1])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_STDIO_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_STDIO_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_DECL_FCLOSEALL=1; AC_SUBST([HAVE_DECL_FCLOSEALL])
+ HAVE_DECL_FPURGE=1; AC_SUBST([HAVE_DECL_FPURGE])
+ HAVE_DECL_FSEEKO=1; AC_SUBST([HAVE_DECL_FSEEKO])
+ HAVE_DECL_FTELLO=1; AC_SUBST([HAVE_DECL_FTELLO])
+ HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM])
+ HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE])
+ HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF])
+ HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF])
+ HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF])
+ HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF])
+ HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO])
+ HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO])
+ HAVE_PCLOSE=1; AC_SUBST([HAVE_PCLOSE])
+ HAVE_POPEN=1; AC_SUBST([HAVE_POPEN])
+ HAVE_RENAMEAT=1; AC_SUBST([HAVE_RENAMEAT])
+ HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF])
+ HAVE_VDPRINTF=1; AC_SUBST([HAVE_VDPRINTF])
+ REPLACE_DPRINTF=0; AC_SUBST([REPLACE_DPRINTF])
+ REPLACE_FCLOSE=0; AC_SUBST([REPLACE_FCLOSE])
+ REPLACE_FDOPEN=0; AC_SUBST([REPLACE_FDOPEN])
+ REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH])
+ REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN])
+ REPLACE_FOPEN_FOR_FOPEN_GNU=0; AC_SUBST([REPLACE_FOPEN_FOR_FOPEN_GNU])
+ REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF])
+ REPLACE_FPURGE=0; AC_SUBST([REPLACE_FPURGE])
+ REPLACE_FREOPEN=0; AC_SUBST([REPLACE_FREOPEN])
+ REPLACE_FSEEK=0; AC_SUBST([REPLACE_FSEEK])
+ REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO])
+ REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL])
+ REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO])
+ REPLACE_GETDELIM=0; AC_SUBST([REPLACE_GETDELIM])
+ REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE])
+ REPLACE_OBSTACK_PRINTF=0; AC_SUBST([REPLACE_OBSTACK_PRINTF])
+ REPLACE_PERROR=0; AC_SUBST([REPLACE_PERROR])
+ REPLACE_POPEN=0; AC_SUBST([REPLACE_POPEN])
+ REPLACE_PRINTF=0; AC_SUBST([REPLACE_PRINTF])
+ REPLACE_REMOVE=0; AC_SUBST([REPLACE_REMOVE])
+ REPLACE_RENAME=0; AC_SUBST([REPLACE_RENAME])
+ REPLACE_RENAMEAT=0; AC_SUBST([REPLACE_RENAMEAT])
+ REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF])
+ REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF])
+ REPLACE_STDIO_READ_FUNCS=0; AC_SUBST([REPLACE_STDIO_READ_FUNCS])
+ REPLACE_STDIO_WRITE_FUNCS=0; AC_SUBST([REPLACE_STDIO_WRITE_FUNCS])
+ REPLACE_TMPFILE=0; AC_SUBST([REPLACE_TMPFILE])
+ REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF])
+ REPLACE_VDPRINTF=0; AC_SUBST([REPLACE_VDPRINTF])
+ REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF])
+ REPLACE_VPRINTF=0; AC_SUBST([REPLACE_VPRINTF])
+ REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF])
+ REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF])
+])
diff --git a/gl/m4/stdlib_h.m4 b/gl/m4/stdlib_h.m4
new file mode 100644
index 0000000..9e20969
--- /dev/null
+++ b/gl/m4/stdlib_h.m4
@@ -0,0 +1,200 @@
+# stdlib_h.m4 serial 66
+dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_STDLIB_H],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ gl_NEXT_HEADERS([stdlib.h])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use, and which is not
+ dnl guaranteed by C89.
+ gl_WARN_ON_USE_PREPARE([[#include <stdlib.h>
+#if HAVE_SYS_LOADAVG_H
+/* OpenIndiana has a bug: <sys/time.h> must be included before
+ <sys/loadavg.h>. */
+# include <sys/time.h>
+# include <sys/loadavg.h>
+#endif
+#if HAVE_RANDOM_H
+# include <random.h>
+#endif
+ ]], [_Exit aligned_alloc atoll canonicalize_file_name free
+ getloadavg getsubopt grantpt
+ initstate initstate_r mbtowc mkdtemp mkostemp mkostemps mkstemp mkstemps
+ posix_memalign posix_openpt ptsname ptsname_r qsort_r
+ random random_r reallocarray realpath rpmatch secure_getenv setenv
+ setstate setstate_r srandom srandom_r
+ strtod strtol strtold strtoll strtoul strtoull unlockpt unsetenv])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_CHECK_DECLS_ONCE([ecvt])
+ if test $ac_cv_have_decl_ecvt = no; then
+ HAVE_DECL_ECVT=0
+ fi
+ AC_CHECK_DECLS_ONCE([fcvt])
+ if test $ac_cv_have_decl_fcvt = no; then
+ HAVE_DECL_FCVT=0
+ fi
+ AC_CHECK_DECLS_ONCE([gcvt])
+ if test $ac_cv_have_decl_gcvt = no; then
+ HAVE_DECL_GCVT=0
+ fi
+])
+
+# gl_STDLIB_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_STDLIB_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB__EXIT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ALIGNED_ALLOC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATOLL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CALLOC_GNU])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CALLOC_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CANONICALIZE_FILE_NAME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREE_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOADAVG])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETSUBOPT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GRANTPT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MALLOC_GNU])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MALLOC_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBTOWC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKDTEMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKOSTEMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKOSTEMPS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKSTEMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKSTEMPS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_MEMALIGN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_OPENPT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTSNAME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTSNAME_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTENV])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_QSORT_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RANDOM])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RANDOM_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALLOCARRAY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALLOC_GNU])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALLOC_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALPATH])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RPMATCH])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SECURE_GETENV])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETENV])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOUL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOULL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SYSTEM_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNLOCKPT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNSETENV])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTOMB])
+ dnl Support Microsoft deprecated alias function names by default.
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_ECVT], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FCVT], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_GCVT], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_MKTEMP], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_PUTENV], [1])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_STDLIB_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE__EXIT=1; AC_SUBST([HAVE__EXIT])
+ HAVE_ALIGNED_ALLOC=1; AC_SUBST([HAVE_ALIGNED_ALLOC])
+ HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL])
+ HAVE_CANONICALIZE_FILE_NAME=1; AC_SUBST([HAVE_CANONICALIZE_FILE_NAME])
+ HAVE_DECL_ECVT=1; AC_SUBST([HAVE_DECL_ECVT])
+ HAVE_DECL_FCVT=1; AC_SUBST([HAVE_DECL_FCVT])
+ HAVE_DECL_GCVT=1; AC_SUBST([HAVE_DECL_GCVT])
+ HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG])
+ HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT])
+ HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT])
+ HAVE_INITSTATE=1; AC_SUBST([HAVE_INITSTATE])
+ HAVE_DECL_INITSTATE=1; AC_SUBST([HAVE_DECL_INITSTATE])
+ HAVE_MBTOWC=1; AC_SUBST([HAVE_MBTOWC])
+ HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP])
+ HAVE_MKOSTEMP=1; AC_SUBST([HAVE_MKOSTEMP])
+ HAVE_MKOSTEMPS=1; AC_SUBST([HAVE_MKOSTEMPS])
+ HAVE_MKSTEMP=1; AC_SUBST([HAVE_MKSTEMP])
+ HAVE_MKSTEMPS=1; AC_SUBST([HAVE_MKSTEMPS])
+ HAVE_POSIX_MEMALIGN=1; AC_SUBST([HAVE_POSIX_MEMALIGN])
+ HAVE_POSIX_OPENPT=1; AC_SUBST([HAVE_POSIX_OPENPT])
+ HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME])
+ HAVE_PTSNAME_R=1; AC_SUBST([HAVE_PTSNAME_R])
+ HAVE_QSORT_R=1; AC_SUBST([HAVE_QSORT_R])
+ HAVE_RANDOM=1; AC_SUBST([HAVE_RANDOM])
+ HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H])
+ HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R])
+ HAVE_REALLOCARRAY=1; AC_SUBST([HAVE_REALLOCARRAY])
+ HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH])
+ HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH])
+ HAVE_SECURE_GETENV=1; AC_SUBST([HAVE_SECURE_GETENV])
+ HAVE_SETENV=1; AC_SUBST([HAVE_SETENV])
+ HAVE_DECL_SETENV=1; AC_SUBST([HAVE_DECL_SETENV])
+ HAVE_SETSTATE=1; AC_SUBST([HAVE_SETSTATE])
+ HAVE_DECL_SETSTATE=1; AC_SUBST([HAVE_DECL_SETSTATE])
+ HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD])
+ HAVE_STRTOL=1; AC_SUBST([HAVE_STRTOL])
+ HAVE_STRTOLD=1; AC_SUBST([HAVE_STRTOLD])
+ HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL])
+ HAVE_STRTOUL=1; AC_SUBST([HAVE_STRTOUL])
+ HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL])
+ HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA])
+ HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H])
+ HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT])
+ HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV])
+ REPLACE_ALIGNED_ALLOC=0; AC_SUBST([REPLACE_ALIGNED_ALLOC])
+ REPLACE_CALLOC_FOR_CALLOC_GNU=0; AC_SUBST([REPLACE_CALLOC_FOR_CALLOC_GNU])
+ REPLACE_CALLOC_FOR_CALLOC_POSIX=0; AC_SUBST([REPLACE_CALLOC_FOR_CALLOC_POSIX])
+ REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME])
+ REPLACE_FREE=0; AC_SUBST([REPLACE_FREE])
+ REPLACE_INITSTATE=0; AC_SUBST([REPLACE_INITSTATE])
+ REPLACE_MALLOC_FOR_MALLOC_GNU=0; AC_SUBST([REPLACE_MALLOC_FOR_MALLOC_GNU])
+ REPLACE_MALLOC_FOR_MALLOC_POSIX=0; AC_SUBST([REPLACE_MALLOC_FOR_MALLOC_POSIX])
+ REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC])
+ REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP])
+ REPLACE_POSIX_MEMALIGN=0; AC_SUBST([REPLACE_POSIX_MEMALIGN])
+ REPLACE_PTSNAME=0; AC_SUBST([REPLACE_PTSNAME])
+ REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R])
+ REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV])
+ REPLACE_QSORT_R=0; AC_SUBST([REPLACE_QSORT_R])
+ REPLACE_RANDOM=0; AC_SUBST([REPLACE_RANDOM])
+ REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R])
+ REPLACE_REALLOC_FOR_REALLOC_GNU=0; AC_SUBST([REPLACE_REALLOC_FOR_REALLOC_GNU])
+ REPLACE_REALLOC_FOR_REALLOC_POSIX=0; AC_SUBST([REPLACE_REALLOC_FOR_REALLOC_POSIX])
+ REPLACE_REALLOCARRAY=0; AC_SUBST([REPLACE_REALLOCARRAY])
+ REPLACE_REALPATH=0; AC_SUBST([REPLACE_REALPATH])
+ REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV])
+ REPLACE_SETSTATE=0; AC_SUBST([REPLACE_SETSTATE])
+ REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD])
+ REPLACE_STRTOL=0; AC_SUBST([REPLACE_STRTOL])
+ REPLACE_STRTOLD=0; AC_SUBST([REPLACE_STRTOLD])
+ REPLACE_STRTOLL=0; AC_SUBST([REPLACE_STRTOLL])
+ REPLACE_STRTOUL=0; AC_SUBST([REPLACE_STRTOUL])
+ REPLACE_STRTOULL=0; AC_SUBST([REPLACE_STRTOULL])
+ REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV])
+ REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB])
+])
diff --git a/gl/m4/stpcpy.m4 b/gl/m4/stpcpy.m4
new file mode 100644
index 0000000..241e68c
--- /dev/null
+++ b/gl/m4/stpcpy.m4
@@ -0,0 +1,25 @@
+# stpcpy.m4 serial 9
+dnl Copyright (C) 2002, 2007, 2009-2022 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_STPCPY],
+[
+ dnl Persuade glibc <string.h> to declare stpcpy().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ dnl The stpcpy() declaration in lib/string.in.h uses 'restrict'.
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+ AC_CHECK_FUNCS([stpcpy])
+ if test $ac_cv_func_stpcpy = no; then
+ HAVE_STPCPY=0
+ fi
+])
+
+# Prerequisites of lib/stpcpy.c.
+AC_DEFUN([gl_PREREQ_STPCPY], [
+ :
+])
diff --git a/gl/m4/strcase.m4 b/gl/m4/strcase.m4
new file mode 100644
index 0000000..d1ffaba
--- /dev/null
+++ b/gl/m4/strcase.m4
@@ -0,0 +1,45 @@
+# strcase.m4 serial 12
+dnl Copyright (C) 2002, 2005-2022 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_STRCASE],
+[
+ gl_FUNC_STRCASECMP
+ gl_FUNC_STRNCASECMP
+])
+
+AC_DEFUN([gl_FUNC_STRCASECMP],
+[
+ AC_REQUIRE([gl_STRINGS_H_DEFAULTS])
+ AC_CHECK_FUNCS([strcasecmp])
+ if test $ac_cv_func_strcasecmp = no; then
+ HAVE_STRCASECMP=0
+ fi
+])
+
+AC_DEFUN([gl_FUNC_STRNCASECMP],
+[
+ AC_REQUIRE([gl_STRINGS_H_DEFAULTS])
+ AC_CHECK_FUNCS([strncasecmp])
+ if test $ac_cv_func_strncasecmp = yes; then
+ HAVE_STRNCASECMP=1
+ else
+ HAVE_STRNCASECMP=0
+ fi
+ AC_CHECK_DECLS([strncasecmp])
+ if test $ac_cv_have_decl_strncasecmp = no; then
+ HAVE_DECL_STRNCASECMP=0
+ fi
+])
+
+# Prerequisites of lib/strcasecmp.c.
+AC_DEFUN([gl_PREREQ_STRCASECMP], [
+ :
+])
+
+# Prerequisites of lib/strncasecmp.c.
+AC_DEFUN([gl_PREREQ_STRNCASECMP], [
+ :
+])
diff --git a/gl/m4/strcasestr.m4 b/gl/m4/strcasestr.m4
new file mode 100644
index 0000000..6344b7e
--- /dev/null
+++ b/gl/m4/strcasestr.m4
@@ -0,0 +1,155 @@
+# strcasestr.m4 serial 28
+dnl Copyright (C) 2005, 2007-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Check that strcasestr is present and works.
+AC_DEFUN([gl_FUNC_STRCASESTR_SIMPLE],
+[
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+
+ dnl Persuade glibc <string.h> to declare strcasestr().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([gl_FUNC_MEMCHR])
+ AC_CHECK_FUNCS([strcasestr])
+ if test $ac_cv_func_strcasestr = no; then
+ HAVE_STRCASESTR=0
+ else
+ if test $REPLACE_MEMCHR = 1; then
+ REPLACE_STRCASESTR=1
+ else
+ dnl Detect https://sourceware.org/bugzilla/show_bug.cgi?id=12092
+ dnl and https://sourceware.org/bugzilla/show_bug.cgi?id=23637.
+ AC_CACHE_CHECK([whether strcasestr works],
+ [gl_cv_func_strcasestr_works_always],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+#include <string.h> /* for __GNU_LIBRARY__, strcasestr */
+#ifdef __GNU_LIBRARY__
+ #include <features.h>
+ #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
+ Unlucky user
+ #endif
+#endif
+#define P "_EF_BF_BD"
+#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
+#define NEEDLE P P P P P
+]],
+ [[return !!strcasestr (HAYSTACK, NEEDLE);
+ ]])],
+ [gl_cv_func_strcasestr_works_always=yes],
+ [gl_cv_func_strcasestr_works_always=no],
+ [dnl glibc 2.12 and cygwin 1.7.7 have a known bug. uClibc is not
+ dnl affected, since it uses different source code for strcasestr
+ dnl than glibc.
+ dnl Assume that it works on all other platforms, even if it is not
+ dnl linear.
+ AC_EGREP_CPP([Lucky user],
+ [
+#include <string.h> /* for __GNU_LIBRARY__ */
+#ifdef __GNU_LIBRARY__
+ #include <features.h>
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+ || defined __UCLIBC__
+ Lucky user
+ #endif
+#elif defined __CYGWIN__
+ #include <cygwin/version.h>
+ #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
+ Lucky user
+ #endif
+#else
+ Lucky user
+#endif
+ ],
+ [gl_cv_func_strcasestr_works_always="guessing yes"],
+ [gl_cv_func_strcasestr_works_always="$gl_cross_guess_normal"])
+ ])
+ ])
+ case "$gl_cv_func_strcasestr_works_always" in
+ *yes) ;;
+ *)
+ REPLACE_STRCASESTR=1
+ ;;
+ esac
+ fi
+ fi
+]) # gl_FUNC_STRCASESTR_SIMPLE
+
+dnl Additionally, check that strcasestr is efficient.
+AC_DEFUN([gl_FUNC_STRCASESTR],
+[
+ AC_REQUIRE([gl_FUNC_STRCASESTR_SIMPLE])
+ if test $HAVE_STRCASESTR = 1 && test $REPLACE_STRCASESTR = 0; then
+ AC_CACHE_CHECK([whether strcasestr works in linear time],
+ [gl_cv_func_strcasestr_linear],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <signal.h> /* for signal */
+#include <string.h> /* for strcasestr */
+#include <stdlib.h> /* for malloc */
+#include <unistd.h> /* for alarm */
+static void quit (int sig) { _exit (sig + 128); }
+]], [[
+ int result = 0;
+ size_t m = 1000000;
+ char *haystack = (char *) malloc (2 * m + 2);
+ char *needle = (char *) malloc (m + 2);
+ /* Failure to compile this test due to missing alarm is okay,
+ since all such platforms (mingw) also lack strcasestr. */
+ signal (SIGALRM, quit);
+ alarm (5);
+ /* Check for quadratic performance. */
+ if (haystack && needle)
+ {
+ memset (haystack, 'A', 2 * m);
+ haystack[2 * m] = 'B';
+ haystack[2 * m + 1] = 0;
+ memset (needle, 'A', m);
+ needle[m] = 'B';
+ needle[m + 1] = 0;
+ if (!strcasestr (haystack, needle))
+ result |= 1;
+ }
+ /* Free allocated memory, in case some sanitizer is watching. */
+ free (haystack);
+ free (needle);
+ return result;
+ ]])],
+ [gl_cv_func_strcasestr_linear=yes], [gl_cv_func_strcasestr_linear=no],
+ [dnl Only glibc > 2.12 and cygwin > 1.7.7 are known to have a
+ dnl strcasestr that works in linear time.
+ AC_EGREP_CPP([Lucky user],
+ [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+ && !defined __UCLIBC__
+ Lucky user
+ #endif
+#endif
+#ifdef __CYGWIN__
+ #include <cygwin/version.h>
+ #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
+ Lucky user
+ #endif
+#endif
+ ],
+ [gl_cv_func_strcasestr_linear="guessing yes"],
+ [gl_cv_func_strcasestr_linear="$gl_cross_guess_normal"])
+ ])
+ ])
+ case "$gl_cv_func_strcasestr_linear" in
+ *yes) ;;
+ *)
+ REPLACE_STRCASESTR=1
+ ;;
+ esac
+ fi
+]) # gl_FUNC_STRCASESTR
+
+# Prerequisites of lib/strcasestr.c.
+AC_DEFUN([gl_PREREQ_STRCASESTR], [
+ :
+])
diff --git a/gl/m4/strchrnul.m4 b/gl/m4/strchrnul.m4
new file mode 100644
index 0000000..630699b
--- /dev/null
+++ b/gl/m4/strchrnul.m4
@@ -0,0 +1,50 @@
+# strchrnul.m4 serial 10
+dnl Copyright (C) 2003, 2007, 2009-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_STRCHRNUL],
+[
+ dnl Persuade glibc <string.h> to declare strchrnul().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+ AC_CHECK_FUNCS([strchrnul])
+ if test $ac_cv_func_strchrnul = no; then
+ HAVE_STRCHRNUL=0
+ else
+ AC_CACHE_CHECK([whether strchrnul works],
+ [gl_cv_func_strchrnul_works],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <string.h> /* for strchrnul */
+]], [[const char *buf = "a";
+ return strchrnul (buf, 'b') != buf + 1;
+ ]])],
+ [gl_cv_func_strchrnul_works=yes],
+ [gl_cv_func_strchrnul_works=no],
+ [dnl Cygwin 1.7.9 introduced strchrnul, but it was broken until 1.7.10
+ AC_EGREP_CPP([Lucky user],
+ [
+#if defined __CYGWIN__
+ #include <cygwin/version.h>
+ #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 9)
+ Lucky user
+ #endif
+#else
+ Lucky user
+#endif
+ ],
+ [gl_cv_func_strchrnul_works="guessing yes"],
+ [gl_cv_func_strchrnul_works="guessing no"])
+ ])
+ ])
+ case "$gl_cv_func_strchrnul_works" in
+ *yes) ;;
+ *) REPLACE_STRCHRNUL=1 ;;
+ esac
+ fi
+])
+
+# Prerequisites of lib/strchrnul.c.
+AC_DEFUN([gl_PREREQ_STRCHRNUL], [:])
diff --git a/gl/m4/strdup.m4 b/gl/m4/strdup.m4
new file mode 100644
index 0000000..da8899d
--- /dev/null
+++ b/gl/m4/strdup.m4
@@ -0,0 +1,32 @@
+# strdup.m4 serial 15
+
+dnl Copyright (C) 2002-2022 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_STRDUP],
+[
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+ AC_CHECK_DECLS_ONCE([strdup])
+ if test $ac_cv_have_decl_strdup = no; then
+ HAVE_DECL_STRDUP=0
+ fi
+])
+
+AC_DEFUN([gl_FUNC_STRDUP_POSIX],
+[
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+ AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
+ if test $gl_cv_func_malloc_posix != yes; then
+ REPLACE_STRDUP=1
+ fi
+ AC_CHECK_DECLS_ONCE([strdup])
+ if test $ac_cv_have_decl_strdup = no; then
+ HAVE_DECL_STRDUP=0
+ fi
+])
+
+# Prerequisites of lib/strdup.c.
+AC_DEFUN([gl_PREREQ_STRDUP], [:])
diff --git a/gl/m4/strerror.m4 b/gl/m4/strerror.m4
new file mode 100644
index 0000000..4716649
--- /dev/null
+++ b/gl/m4/strerror.m4
@@ -0,0 +1,102 @@
+# strerror.m4 serial 23
+dnl Copyright (C) 2002, 2007-2022 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_STRERROR],
+[
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+ AC_REQUIRE([gl_HEADER_ERRNO_H])
+ AC_REQUIRE([gl_FUNC_STRERROR_0])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [
+ AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS])
+ ])
+ if test "$GL_GENERATE_ERRNO_H:$REPLACE_STRERROR_0" = false:0; then
+ AC_CACHE_CHECK([for working strerror function],
+ [gl_cv_func_working_strerror],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <string.h>
+ ]],
+ [[if (!*strerror (-2)) return 1;]])],
+ [gl_cv_func_working_strerror=yes],
+ [gl_cv_func_working_strerror=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_working_strerror="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_working_strerror="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_working_strerror" in
+ *yes) ;;
+ *)
+ dnl The system's strerror() fails to return a string for out-of-range
+ dnl integers. Replace it.
+ REPLACE_STRERROR=1
+ ;;
+ esac
+ m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [
+ dnl If the system's strerror_r or __xpg_strerror_r clobbers strerror's
+ dnl buffer, we must replace strerror.
+ case "$gl_cv_func_strerror_r_works" in
+ *no) REPLACE_STRERROR=1 ;;
+ esac
+ ])
+ else
+ dnl The system's strerror() cannot know about the new errno values we add
+ dnl to <errno.h>, or any fix for strerror(0). Replace it.
+ REPLACE_STRERROR=1
+ fi
+])
+
+dnl Detect if strerror(0) passes (that is, does not set errno, and does not
+dnl return a string that matches strerror(-1)).
+AC_DEFUN([gl_FUNC_STRERROR_0],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ REPLACE_STRERROR_0=0
+ AC_CACHE_CHECK([whether strerror(0) succeeds],
+ [gl_cv_func_strerror_0_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <string.h>
+ #include <errno.h>
+ ]],
+ [[int result = 0;
+ char *str;
+ errno = 0;
+ str = strerror (0);
+ if (!*str) result |= 1;
+ if (errno) result |= 2;
+ if (strstr (str, "nknown") || strstr (str, "ndefined"))
+ result |= 4;
+ return result;]])],
+ [gl_cv_func_strerror_0_works=yes],
+ [gl_cv_func_strerror_0_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_strerror_0_works="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_strerror_0_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_strerror_0_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_strerror_0_works" in
+ *yes) ;;
+ *)
+ REPLACE_STRERROR_0=1
+ AC_DEFINE([REPLACE_STRERROR_0], [1], [Define to 1 if strerror(0)
+ does not return a message implying success.])
+ ;;
+ esac
+])
diff --git a/gl/m4/string_h.m4 b/gl/m4/string_h.m4
new file mode 100644
index 0000000..9e09b96
--- /dev/null
+++ b/gl/m4/string_h.m4
@@ -0,0 +1,145 @@
+# Configure a GNU-like replacement for <string.h>.
+
+# Copyright (C) 2007-2022 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.
+
+# serial 34
+
+# Written by Paul Eggert.
+
+AC_DEFUN_ONCE([gl_STRING_H],
+[
+ dnl Ensure to expand the default settings once only, before all statements
+ dnl that occur in other macros.
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+ gl_NEXT_HEADERS([string.h])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use, and which is not
+ dnl guaranteed by C89.
+ gl_WARN_ON_USE_PREPARE([[#include <string.h>
+ ]],
+ [ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul
+ strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r
+ strerror_r strerrorname_np sigabbrev_np sigdescr_np strsignal strverscmp])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+])
+
+# gl_STRING_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_STRING_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_STRING_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_STRING_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_STRING_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPLICIT_BZERO])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFSL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFSLL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMCHR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMMEM])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMPCPY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMRCHR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RAWMEMCHR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STPCPY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STPNCPY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRCHRNUL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRDUP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNCAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNDUP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNLEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRPBRK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRSEP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRSTR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRCASESTR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOK_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSLEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSNLEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCHR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSRCHR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSTR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCASECMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSNCASECMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSPCASECMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCASESTR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCSPN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSPBRK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSPN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSEP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSTOK_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERROR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERROR_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERRORNAME_NP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGABBREV_NP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGDESCR_NP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRSIGNAL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRVERSCMP])
+ dnl Support Microsoft deprecated alias function names by default.
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_MEMCCPY], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_STRDUP], [1])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_STRING_H_MODULE_INDICATOR_DEFAULTS])
+ dnl Make sure the shell variable for GNULIB_FREE_POSIX is initialized.
+ gl_STDLIB_H_REQUIRE_DEFAULTS
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_STRING_H_DEFAULTS],
+[
+ HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_EXPLICIT_BZERO=1; AC_SUBST([HAVE_EXPLICIT_BZERO])
+ HAVE_FFSL=1; AC_SUBST([HAVE_FFSL])
+ HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL])
+ HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM])
+ HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY])
+ HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR])
+ HAVE_RAWMEMCHR=1; AC_SUBST([HAVE_RAWMEMCHR])
+ HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY])
+ HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY])
+ HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL])
+ HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP])
+ HAVE_DECL_STRNDUP=1; AC_SUBST([HAVE_DECL_STRNDUP])
+ HAVE_DECL_STRNLEN=1; AC_SUBST([HAVE_DECL_STRNLEN])
+ HAVE_STRPBRK=1; AC_SUBST([HAVE_STRPBRK])
+ HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP])
+ HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR])
+ HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R])
+ HAVE_DECL_STRERROR_R=1; AC_SUBST([HAVE_DECL_STRERROR_R])
+ HAVE_STRERRORNAME_NP=1; AC_SUBST([HAVE_STRERRORNAME_NP])
+ HAVE_SIGABBREV_NP=1; AC_SUBST([HAVE_SIGABBREV_NP])
+ HAVE_SIGDESCR_NP=1; AC_SUBST([HAVE_SIGDESCR_NP])
+ HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL])
+ HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP])
+ REPLACE_FFSLL=0; AC_SUBST([REPLACE_FFSLL])
+ REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR])
+ REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM])
+ REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY])
+ REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL])
+ REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP])
+ REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT])
+ REPLACE_STRNDUP=0; AC_SUBST([REPLACE_STRNDUP])
+ REPLACE_STRNLEN=0; AC_SUBST([REPLACE_STRNLEN])
+ REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR])
+ REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR])
+ REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R])
+ REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR])
+ REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R])
+ REPLACE_STRERRORNAME_NP=0; AC_SUBST([REPLACE_STRERRORNAME_NP])
+ REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL])
+ UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R])
+])
diff --git a/gl/m4/strings_h.m4 b/gl/m4/strings_h.m4
new file mode 100644
index 0000000..6965b7c
--- /dev/null
+++ b/gl/m4/strings_h.m4
@@ -0,0 +1,62 @@
+# Configure a replacement for <strings.h>.
+# serial 9
+
+# Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_STRINGS_H],
+[
+ dnl Ensure to expand the default settings once only, before all statements
+ dnl that occur in other macros.
+ AC_REQUIRE([gl_STRINGS_H_DEFAULTS])
+
+ gl_CHECK_NEXT_HEADERS([strings.h])
+ if test $ac_cv_header_strings_h = yes; then
+ HAVE_STRINGS_H=1
+ else
+ HAVE_STRINGS_H=0
+ fi
+ AC_SUBST([HAVE_STRINGS_H])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[
+ /* Minix 3.1.8 has a bug: <sys/types.h> must be included before
+ <strings.h>. */
+ #include <sys/types.h>
+ #include <strings.h>
+ ]], [ffs strcasecmp strncasecmp])
+])
+
+# gl_STRINGS_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_STRINGS_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_STRINGS_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_STRINGS_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_STRINGS_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFS])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_STRINGS_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_STRINGS_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_STRINGS_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_FFS=1; AC_SUBST([HAVE_FFS])
+ HAVE_STRCASECMP=1; AC_SUBST([HAVE_STRCASECMP])
+ HAVE_DECL_STRNCASECMP=1; AC_SUBST([HAVE_DECL_STRNCASECMP])
+])
diff --git a/gl/m4/strndup.m4 b/gl/m4/strndup.m4
new file mode 100644
index 0000000..a239d45
--- /dev/null
+++ b/gl/m4/strndup.m4
@@ -0,0 +1,58 @@
+# strndup.m4 serial 23
+dnl Copyright (C) 2002-2003, 2005-2022 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_STRNDUP],
+[
+ dnl Persuade glibc <string.h> to declare strndup().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+ AC_CHECK_DECLS_ONCE([strndup])
+ AC_CHECK_FUNCS_ONCE([strndup])
+ if test $ac_cv_have_decl_strndup = no; then
+ HAVE_DECL_STRNDUP=0
+ fi
+
+ if test $ac_cv_func_strndup = yes; then
+ HAVE_STRNDUP=1
+ # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'.
+ AC_CACHE_CHECK([for working strndup], [gl_cv_func_strndup_works],
+ [AC_RUN_IFELSE([
+ AC_LANG_PROGRAM([[#include <string.h>
+ #include <stdlib.h>]], [[
+#if !HAVE_DECL_STRNDUP
+ extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ char *strndup (const char *, size_t);
+#endif
+ int result;
+ char *s;
+ s = strndup ("some longer string", 15);
+ free (s);
+ s = strndup ("shorter string", 13);
+ result = s[13] != '\0';
+ free (s);
+ return result;]])],
+ [gl_cv_func_strndup_works=yes],
+ [gl_cv_func_strndup_works=no],
+ [
+changequote(,)dnl
+ case $host_os in
+ aix | aix[3-6]*) gl_cv_func_strndup_works="guessing no";;
+ *) gl_cv_func_strndup_works="guessing yes";;
+ esac
+changequote([,])dnl
+ ])])
+ case $gl_cv_func_strndup_works in
+ *no) REPLACE_STRNDUP=1 ;;
+ esac
+ else
+ HAVE_STRNDUP=0
+ fi
+])
diff --git a/gl/m4/strnlen.m4 b/gl/m4/strnlen.m4
new file mode 100644
index 0000000..0934274
--- /dev/null
+++ b/gl/m4/strnlen.m4
@@ -0,0 +1,30 @@
+# strnlen.m4 serial 14
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2022 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_STRNLEN],
+[
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+
+ dnl Persuade glibc <string.h> to declare strnlen().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_DECLS_ONCE([strnlen])
+ if test $ac_cv_have_decl_strnlen = no; then
+ HAVE_DECL_STRNLEN=0
+ else
+ m4_pushdef([AC_LIBOBJ], [:])
+ dnl Note: AC_FUNC_STRNLEN does AC_LIBOBJ([strnlen]).
+ AC_FUNC_STRNLEN
+ m4_popdef([AC_LIBOBJ])
+ if test $ac_cv_func_strnlen_working = no; then
+ REPLACE_STRNLEN=1
+ fi
+ fi
+])
+
+# Prerequisites of lib/strnlen.c.
+AC_DEFUN([gl_PREREQ_STRNLEN], [:])
diff --git a/gl/m4/strsep.m4 b/gl/m4/strsep.m4
new file mode 100644
index 0000000..602f96a
--- /dev/null
+++ b/gl/m4/strsep.m4
@@ -0,0 +1,23 @@
+# strsep.m4 serial 11
+dnl Copyright (C) 2002-2004, 2007, 2009-2022 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_STRSEP],
+[
+ dnl Persuade glibc <string.h> to declare strsep().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ dnl The strsep() declaration in lib/string.in.h uses 'restrict'.
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+ AC_CHECK_FUNCS([strsep])
+ if test $ac_cv_func_strsep = no; then
+ HAVE_STRSEP=0
+ fi
+])
+
+# Prerequisites of lib/strsep.c.
+AC_DEFUN([gl_PREREQ_STRSEP], [:])
diff --git a/gl/m4/sys_file_h.m4 b/gl/m4/sys_file_h.m4
new file mode 100644
index 0000000..61bd733
--- /dev/null
+++ b/gl/m4/sys_file_h.m4
@@ -0,0 +1,56 @@
+# Configure a replacement for <sys/file.h>.
+# serial 9
+
+# Copyright (C) 2008-2022 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 Richard W.M. Jones.
+
+AC_DEFUN_ONCE([gl_SYS_FILE_H],
+[
+ AC_REQUIRE([gl_SYS_FILE_H_DEFAULTS])
+
+ dnl <sys/file.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([sys/file.h])
+
+ if test $ac_cv_header_sys_file_h = yes; then
+ HAVE_SYS_FILE_H=1
+ else
+ HAVE_SYS_FILE_H=0
+ fi
+ AC_SUBST([HAVE_SYS_FILE_H])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <sys/file.h>
+ ]], [flock])
+])
+
+# gl_SYS_FILE_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_SYS_FILE_MODULE_INDICATOR],
+[
+ gl_SYS_FILE_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_FILE_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_FILE_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOCK])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_FILE_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_SYS_FILE_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_SYS_FILE_H_DEFAULTS],
+[
+ HAVE_FLOCK=1; AC_SUBST([HAVE_FLOCK])
+])
diff --git a/gl/m4/sys_ioctl_h.m4 b/gl/m4/sys_ioctl_h.m4
new file mode 100644
index 0000000..be65364
--- /dev/null
+++ b/gl/m4/sys_ioctl_h.m4
@@ -0,0 +1,79 @@
+# sys_ioctl_h.m4 serial 15
+dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Bruno Haible.
+
+AC_DEFUN_ONCE([gl_SYS_IOCTL_H],
+[
+ dnl Ensure to expand the default settings once only, before all statements
+ dnl that occur in other macros.
+ AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])
+
+ AC_CHECK_HEADERS_ONCE([sys/ioctl.h])
+ if test $ac_cv_header_sys_ioctl_h = yes; then
+ HAVE_SYS_IOCTL_H=1
+ dnl Test whether <sys/ioctl.h> declares ioctl(), or whether some other
+ dnl header file, such as <unistd.h> or <stropts.h>, is needed for that.
+ AC_CACHE_CHECK([whether <sys/ioctl.h> declares ioctl],
+ [gl_cv_decl_ioctl_in_sys_ioctl_h],
+ [dnl We cannot use AC_CHECK_DECL because it produces its own messages.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/ioctl.h>]],
+ [[(void) ioctl;]])],
+ [gl_cv_decl_ioctl_in_sys_ioctl_h=yes],
+ [gl_cv_decl_ioctl_in_sys_ioctl_h=no])
+ ])
+ else
+ HAVE_SYS_IOCTL_H=0
+ fi
+ AC_SUBST([HAVE_SYS_IOCTL_H])
+ dnl <sys/ioctl.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([sys/ioctl.h])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <sys/ioctl.h>
+/* Some platforms declare ioctl in the wrong header. */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <unistd.h>
+#endif
+ ]], [ioctl])
+])
+
+# gl_SYS_IOCTL_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_SYS_IOCTL_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_SYS_IOCTL_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_IOCTL_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_IOCTL_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_IOCTL])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_IOCTL_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_SYS_IOCTL_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ SYS_IOCTL_H_HAVE_WINSOCK2_H=0; AC_SUBST([SYS_IOCTL_H_HAVE_WINSOCK2_H])
+ SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
+ AC_SUBST([SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS])
+ REPLACE_IOCTL=0; AC_SUBST([REPLACE_IOCTL])
+])
diff --git a/gl/m4/sys_random_h.m4 b/gl/m4/sys_random_h.m4
new file mode 100644
index 0000000..a5ba85c
--- /dev/null
+++ b/gl/m4/sys_random_h.m4
@@ -0,0 +1,68 @@
+# sys_random_h.m4 serial 8
+dnl Copyright (C) 2020-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_SYS_RANDOM_H],
+[
+ AC_REQUIRE([gl_SYS_RANDOM_H_DEFAULTS])
+ dnl <sys/random.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([sys/random.h])
+ if test $ac_cv_header_sys_random_h = yes; then
+ HAVE_SYS_RANDOM_H=1
+ else
+ HAVE_SYS_RANDOM_H=0
+ fi
+ AC_SUBST([HAVE_SYS_RANDOM_H])
+
+ m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])])
+ if test $ac_cv_header_sys_random_h = yes; then
+ UNISTD_H_HAVE_SYS_RANDOM_H=1
+ fi
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[
+#if HAVE_SYS_RANDOM_H
+/* Additional includes are needed before <sys/random.h> on uClibc
+ and Mac OS X. */
+# include <sys/types.h>
+# include <stdlib.h>
+# include <sys/random.h>
+#endif
+ ]],
+ [getrandom])
+])
+
+# gl_SYS_RANDOM_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_SYS_RANDOM_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_SYS_RANDOM_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_RANDOM_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_RANDOM_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETRANDOM])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_RANDOM_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_SYS_RANDOM_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_SYS_RANDOM_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_GETRANDOM=1; AC_SUBST([HAVE_GETRANDOM])
+ REPLACE_GETRANDOM=0; AC_SUBST([REPLACE_GETRANDOM])
+])
diff --git a/gl/m4/sys_select_h.m4 b/gl/m4/sys_select_h.m4
new file mode 100644
index 0000000..2743cd1
--- /dev/null
+++ b/gl/m4/sys_select_h.m4
@@ -0,0 +1,110 @@
+# sys_select_h.m4 serial 23
+dnl Copyright (C) 2006-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_SYS_SELECT_H],
+[
+ AC_REQUIRE([gl_SYS_SELECT_H_DEFAULTS])
+ AC_REQUIRE([AC_C_RESTRICT])
+ AC_CACHE_CHECK([whether <sys/select.h> is self-contained],
+ [gl_cv_header_sys_select_h_selfcontained],
+ [
+ dnl Test against two bugs:
+ dnl 1. On many platforms, <sys/select.h> assumes prior inclusion of
+ dnl <sys/types.h>.
+ dnl 2. On OSF/1 4.0, <sys/select.h> provides only a forward declaration
+ dnl of 'struct timeval', and no definition of this type.
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/select.h>]],
+ [[struct timeval b;]])],
+ [gl_cv_header_sys_select_h_selfcontained=yes],
+ [gl_cv_header_sys_select_h_selfcontained=no])
+ dnl Test against another bug:
+ dnl 3. On Solaris 10, <sys/select.h> provides an FD_ZERO implementation
+ dnl that relies on memset(), but without including <string.h>.
+ if test $gl_cv_header_sys_select_h_selfcontained = yes; then
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <sys/select.h>]],
+ [[int memset; int bzero;]])
+ ],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[#include <sys/select.h>]], [[
+ #undef memset
+ #define memset nonexistent_memset
+ extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ void *memset (void *, int, unsigned long);
+ #undef bzero
+ #define bzero nonexistent_bzero
+ extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ void bzero (void *, unsigned long);
+ fd_set fds;
+ FD_ZERO (&fds);
+ ]])
+ ],
+ [],
+ [gl_cv_header_sys_select_h_selfcontained=no])
+ ])
+ fi
+ ])
+ dnl <sys/select.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([sys/select.h])
+ if test $ac_cv_header_sys_select_h = yes; then
+ HAVE_SYS_SELECT_H=1
+ else
+ HAVE_SYS_SELECT_H=0
+ fi
+ AC_SUBST([HAVE_SYS_SELECT_H])
+ gl_PREREQ_SYS_H_WINSOCK2
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[
+/* Some systems require prerequisite headers. */
+#include <sys/types.h>
+#if !(defined __GLIBC__ && !defined __UCLIBC__) && HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#include <sys/select.h>
+ ]], [pselect select])
+])
+
+# gl_SYS_SELECT_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_SYS_SELECT_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_SYS_SELECT_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_SELECT_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_SELECT_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PSELECT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SELECT])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_SELECT_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_SYS_SELECT_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_SYS_SELECT_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_PSELECT=1; AC_SUBST([HAVE_PSELECT])
+ REPLACE_PSELECT=0; AC_SUBST([REPLACE_PSELECT])
+ REPLACE_SELECT=0; AC_SUBST([REPLACE_SELECT])
+])
diff --git a/gl/m4/sys_socket_h.m4 b/gl/m4/sys_socket_h.m4
new file mode 100644
index 0000000..ba3ae68
--- /dev/null
+++ b/gl/m4/sys_socket_h.m4
@@ -0,0 +1,206 @@
+# sys_socket_h.m4 serial 29
+dnl Copyright (C) 2005-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Simon Josefsson.
+
+AC_DEFUN_ONCE([gl_SYS_SOCKET_H],
+[
+ AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ dnl On OSF/1, the functions recv(), send(), recvfrom(), sendto() have
+ dnl old-style declarations (with return type 'int' instead of 'ssize_t')
+ dnl unless _POSIX_PII_SOCKET is defined.
+ case "$host_os" in
+ osf*)
+ AC_DEFINE([_POSIX_PII_SOCKET], [1],
+ [Define to 1 in order to get the POSIX compatible declarations
+ of socket functions.])
+ ;;
+ esac
+
+ GL_GENERATE_SYS_SOCKET_H=false
+ AC_CACHE_CHECK([whether <sys/socket.h> is self-contained],
+ [gl_cv_header_sys_socket_h_selfcontained],
+ [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[]])],
+ [gl_cv_header_sys_socket_h_selfcontained=yes],
+ [gl_cv_header_sys_socket_h_selfcontained=no])
+ ])
+ if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
+ dnl If the shutdown function exists, <sys/socket.h> should define
+ dnl SHUT_RD, SHUT_WR, SHUT_RDWR.
+ AC_CHECK_FUNCS([shutdown])
+ if test $ac_cv_func_shutdown = yes; then
+ AC_CACHE_CHECK([whether <sys/socket.h> defines the SHUT_* macros],
+ [gl_cv_header_sys_socket_h_shut],
+ [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <sys/socket.h>]],
+ [[int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };]])],
+ [gl_cv_header_sys_socket_h_shut=yes],
+ [gl_cv_header_sys_socket_h_shut=no])
+ ])
+ if test $gl_cv_header_sys_socket_h_shut = no; then
+ GL_GENERATE_SYS_SOCKET_H=true
+ fi
+ fi
+ fi
+ # We need to check for ws2tcpip.h now.
+ gl_PREREQ_SYS_H_SOCKET
+ AC_CHECK_TYPES([struct sockaddr_storage, sa_family_t],,,[
+ /* sys/types.h is not needed according to POSIX, but the
+ sys/socket.h in i386-unknown-freebsd4.10 and
+ powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+])
+ if test $ac_cv_type_struct_sockaddr_storage = no; then
+ HAVE_STRUCT_SOCKADDR_STORAGE=0
+ fi
+ if test $ac_cv_type_sa_family_t = no; then
+ HAVE_SA_FAMILY_T=0
+ fi
+ if test $ac_cv_type_struct_sockaddr_storage != no; then
+ AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family],
+ [],
+ [HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0],
+ [#include <sys/types.h>
+ #ifdef HAVE_SYS_SOCKET_H
+ #include <sys/socket.h>
+ #endif
+ #ifdef HAVE_WS2TCPIP_H
+ #include <ws2tcpip.h>
+ #endif
+ ])
+ fi
+ if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \
+ || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then
+ GL_GENERATE_SYS_SOCKET_H=true
+ fi
+ gl_PREREQ_SYS_H_WINSOCK2
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[
+/* Some systems require prerequisite headers. */
+#include <sys/types.h>
+#include <sys/socket.h>
+ ]], [socket connect accept bind getpeername getsockname getsockopt
+ listen recv send recvfrom sendto setsockopt shutdown accept4])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+])
+
+AC_DEFUN([gl_PREREQ_SYS_H_SOCKET],
+[
+ dnl Check prerequisites of the <sys/socket.h> replacement.
+ AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])
+ gl_CHECK_NEXT_HEADERS([sys/socket.h])
+ if test $ac_cv_header_sys_socket_h = yes; then
+ HAVE_SYS_SOCKET_H=1
+ else
+ HAVE_SYS_SOCKET_H=0
+ fi
+ AC_SUBST([HAVE_SYS_SOCKET_H])
+ gl_PREREQ_SYS_H_WS2TCPIP
+])
+
+# Common prerequisites of the <sys/socket.h> replacement and of the
+# <sys/select.h> replacement.
+# Sets and substitutes HAVE_WINSOCK2_H.
+AC_DEFUN([gl_PREREQ_SYS_H_WINSOCK2],
+[
+ m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])])
+ m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])])
+ AC_CHECK_HEADERS_ONCE([sys/socket.h])
+ if test $ac_cv_header_sys_socket_h != yes; then
+ dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
+ dnl the check for those headers unconditional; yet cygwin reports
+ dnl that the headers are present but cannot be compiled (since on
+ dnl cygwin, all socket information should come from sys/socket.h).
+ AC_CHECK_HEADERS([winsock2.h])
+ fi
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ HAVE_WINSOCK2_H=1
+ UNISTD_H_HAVE_WINSOCK2_H=1
+ SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+ else
+ HAVE_WINSOCK2_H=0
+ fi
+ AC_SUBST([HAVE_WINSOCK2_H])
+])
+
+# Common prerequisites of the <sys/socket.h> replacement and of the
+# <arpa/inet.h> replacement.
+# Sets and substitutes HAVE_WS2TCPIP_H.
+AC_DEFUN([gl_PREREQ_SYS_H_WS2TCPIP],
+[
+ AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])
+ if test $ac_cv_header_sys_socket_h = yes; then
+ HAVE_WS2TCPIP_H=0
+ else
+ if test $ac_cv_header_ws2tcpip_h = yes; then
+ HAVE_WS2TCPIP_H=1
+ else
+ HAVE_WS2TCPIP_H=0
+ fi
+ fi
+ AC_SUBST([HAVE_WS2TCPIP_H])
+])
+
+# gl_SYS_SOCKET_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_SYS_SOCKET_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_SOCKET_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_SOCKET_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SOCKET])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CONNECT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACCEPT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_BIND])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPEERNAME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETSOCKNAME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETSOCKOPT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LISTEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RECV])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SEND])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RECVFROM])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SENDTO])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETSOCKOPT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SHUTDOWN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACCEPT4])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_SOCKET_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS],
+[
+ HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE])
+ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1;
+ AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY])
+ HAVE_SA_FAMILY_T=1; AC_SUBST([HAVE_SA_FAMILY_T])
+ HAVE_ACCEPT4=1; AC_SUBST([HAVE_ACCEPT4])
+])
diff --git a/gl/m4/sys_stat_h.m4 b/gl/m4/sys_stat_h.m4
new file mode 100644
index 0000000..2adbfde
--- /dev/null
+++ b/gl/m4/sys_stat_h.m4
@@ -0,0 +1,129 @@
+# sys_stat_h.m4 serial 42 -*- Autoconf -*-
+dnl Copyright (C) 2006-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Eric Blake.
+dnl Provide a GNU-like <sys/stat.h>.
+
+AC_DEFUN_ONCE([gl_SYS_STAT_H],
+[
+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+
+ dnl Check for broken stat macros.
+ AC_REQUIRE([AC_HEADER_STAT])
+
+ gl_CHECK_NEXT_HEADERS([sys/stat.h])
+
+ dnl Ensure the type mode_t gets defined.
+ AC_REQUIRE([AC_TYPE_MODE_T])
+
+ dnl Whether to enable precise timestamps in 'struct stat'.
+ m4_ifdef([gl_WINDOWS_STAT_TIMESPEC], [
+ AC_REQUIRE([gl_WINDOWS_STAT_TIMESPEC])
+ ], [
+ WINDOWS_STAT_TIMESPEC=0
+ ])
+ AC_SUBST([WINDOWS_STAT_TIMESPEC])
+
+ dnl Whether to ensure that struct stat.st_size is 64-bit wide.
+ m4_ifdef([gl_LARGEFILE], [
+ AC_REQUIRE([gl_LARGEFILE])
+ ], [
+ WINDOWS_64_BIT_ST_SIZE=0
+ ])
+ AC_SUBST([WINDOWS_64_BIT_ST_SIZE])
+
+ dnl Define types that are supposed to be defined in <sys/types.h> or
+ dnl <sys/stat.h>.
+ AC_CHECK_TYPE([nlink_t], [],
+ [AC_DEFINE([nlink_t], [int],
+ [Define to the type of st_nlink in struct stat, or a supertype.])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <sys/stat.h>
+ ]], [chmod fchmodat fstat fstatat futimens getumask lchmod lstat
+ mkdirat mkfifo mkfifoat mknod mknodat stat utimensat])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+])
+
+# gl_SYS_STAT_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_SYS_STAT_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_STAT_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_STAT_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_UNISTD_H_REQUIRE_DEFAULTS dnl for REPLACE_FCHDIR
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CHMOD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCHMODAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSTAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSTATAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FUTIMENS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETUMASK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LCHMOD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LSTAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKDIR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKDIRAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKFIFO])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKFIFOAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKNOD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKNODAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UTIMENSAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OVERRIDES_STRUCT_STAT])
+ dnl Support Microsoft deprecated alias function names by default.
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CHMOD], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_MKDIR], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_UMASK], [1])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_STAT_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_FCHMODAT=1; AC_SUBST([HAVE_FCHMODAT])
+ HAVE_FSTATAT=1; AC_SUBST([HAVE_FSTATAT])
+ HAVE_FUTIMENS=1; AC_SUBST([HAVE_FUTIMENS])
+ HAVE_GETUMASK=1; AC_SUBST([HAVE_GETUMASK])
+ HAVE_LCHMOD=1; AC_SUBST([HAVE_LCHMOD])
+ HAVE_LSTAT=1; AC_SUBST([HAVE_LSTAT])
+ HAVE_MKDIRAT=1; AC_SUBST([HAVE_MKDIRAT])
+ HAVE_MKFIFO=1; AC_SUBST([HAVE_MKFIFO])
+ HAVE_MKFIFOAT=1; AC_SUBST([HAVE_MKFIFOAT])
+ HAVE_MKNOD=1; AC_SUBST([HAVE_MKNOD])
+ HAVE_MKNODAT=1; AC_SUBST([HAVE_MKNODAT])
+ HAVE_UTIMENSAT=1; AC_SUBST([HAVE_UTIMENSAT])
+ REPLACE_CHMOD=0; AC_SUBST([REPLACE_CHMOD])
+ REPLACE_FCHMODAT=0; AC_SUBST([REPLACE_FCHMODAT])
+ REPLACE_FSTAT=0; AC_SUBST([REPLACE_FSTAT])
+ REPLACE_FSTATAT=0; AC_SUBST([REPLACE_FSTATAT])
+ REPLACE_FUTIMENS=0; AC_SUBST([REPLACE_FUTIMENS])
+ REPLACE_LSTAT=0; AC_SUBST([REPLACE_LSTAT])
+ REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR])
+ REPLACE_MKFIFO=0; AC_SUBST([REPLACE_MKFIFO])
+ REPLACE_MKFIFOAT=0; AC_SUBST([REPLACE_MKFIFOAT])
+ REPLACE_MKNOD=0; AC_SUBST([REPLACE_MKNOD])
+ REPLACE_MKNODAT=0; AC_SUBST([REPLACE_MKNODAT])
+ REPLACE_STAT=0; AC_SUBST([REPLACE_STAT])
+ REPLACE_UTIMENSAT=0; AC_SUBST([REPLACE_UTIMENSAT])
+])
diff --git a/gl/m4/sys_time_h.m4 b/gl/m4/sys_time_h.m4
new file mode 100644
index 0000000..bc5e2b1
--- /dev/null
+++ b/gl/m4/sys_time_h.m4
@@ -0,0 +1,120 @@
+# Configure a replacement for <sys/time.h>.
+# serial 12
+
+# Copyright (C) 2007, 2009-2022 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 and Martin Lambers.
+
+AC_DEFUN_ONCE([gl_SYS_TIME_H],
+[
+ dnl Use AC_REQUIRE here, so that the REPLACE_GETTIMEOFDAY=0 statement
+ dnl below is expanded once only, before all REPLACE_GETTIMEOFDAY=1
+ dnl statements that occur in other macros.
+ AC_REQUIRE([gl_SYS_TIME_H_DEFAULTS])
+ AC_REQUIRE([AC_C_RESTRICT])
+ AC_CHECK_HEADERS_ONCE([sys/time.h])
+ gl_CHECK_NEXT_HEADERS([sys/time.h])
+
+ if test $ac_cv_header_sys_time_h != yes; then
+ HAVE_SYS_TIME_H=0
+ fi
+
+ dnl On native Windows with MSVC, 'struct timeval' is defined in <winsock2.h>
+ dnl only. So include that header in the list.
+ gl_PREREQ_SYS_H_WINSOCK2
+ AC_CACHE_CHECK([for struct timeval], [gl_cv_sys_struct_timeval],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#if HAVE_SYS_TIME_H
+ #include <sys/time.h>
+ #endif
+ #include <time.h>
+ #if HAVE_WINSOCK2_H
+ # include <winsock2.h>
+ #endif
+ ]],
+ [[static struct timeval x; x.tv_sec = x.tv_usec;]])],
+ [gl_cv_sys_struct_timeval=yes],
+ [gl_cv_sys_struct_timeval=no])
+ ])
+ if test $gl_cv_sys_struct_timeval != yes; then
+ HAVE_STRUCT_TIMEVAL=0
+ else
+ dnl On native Windows with a 64-bit 'time_t', 'struct timeval' is defined
+ dnl (in <sys/time.h> and <winsock2.h> for mingw64, in <winsock2.h> only
+ dnl for MSVC) with a tv_sec field of type 'long' (32-bit!), which is
+ dnl smaller than the 'time_t' type mandated by POSIX.
+ dnl On OpenBSD 5.1 amd64, tv_sec is 64 bits and time_t 32 bits, but
+ dnl that is good enough.
+ AC_CACHE_CHECK([for wide-enough struct timeval.tv_sec member],
+ [gl_cv_sys_struct_timeval_tv_sec],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#if HAVE_SYS_TIME_H
+ #include <sys/time.h>
+ #endif
+ #include <time.h>
+ #if HAVE_WINSOCK2_H
+ # include <winsock2.h>
+ #endif
+ ]],
+ [[static struct timeval x;
+ typedef int verify_tv_sec_type[
+ sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
+ ];
+ ]])],
+ [gl_cv_sys_struct_timeval_tv_sec=yes],
+ [gl_cv_sys_struct_timeval_tv_sec=no])
+ ])
+ if test $gl_cv_sys_struct_timeval_tv_sec != yes; then
+ REPLACE_STRUCT_TIMEVAL=1
+ fi
+ fi
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[
+#if HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#include <time.h>
+ ]], [gettimeofday])
+])
+
+# gl_SYS_TIME_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_SYS_TIME_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_SYS_TIME_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_TIME_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_TIME_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETTIMEOFDAY])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_TIME_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_SYS_TIME_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_SYS_TIME_H_DEFAULTS],
+[
+ dnl Assume POSIX behavior unless another module says otherwise.
+ HAVE_GETTIMEOFDAY=1; AC_SUBST([HAVE_GETTIMEOFDAY])
+ HAVE_STRUCT_TIMEVAL=1; AC_SUBST([HAVE_STRUCT_TIMEVAL])
+ HAVE_SYS_TIME_H=1; AC_SUBST([HAVE_SYS_TIME_H])
+ REPLACE_GETTIMEOFDAY=0; AC_SUBST([REPLACE_GETTIMEOFDAY])
+ REPLACE_STRUCT_TIMEVAL=0; AC_SUBST([REPLACE_STRUCT_TIMEVAL])
+])
diff --git a/gl/m4/sys_types_h.m4 b/gl/m4/sys_types_h.m4
new file mode 100644
index 0000000..a5bef22
--- /dev/null
+++ b/gl/m4/sys_types_h.m4
@@ -0,0 +1,70 @@
+# sys_types_h.m4 serial 13
+dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_SYS_TYPES_H],
+[
+ AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS])
+
+ dnl Use sane struct stat types in OpenVMS 8.2 and later.
+ AC_DEFINE([_USE_STD_STAT], 1, [For standard stat data types on VMS.])
+
+ gl_NEXT_HEADERS([sys/types.h])
+
+ dnl Ensure the type pid_t gets defined.
+ AC_REQUIRE([AC_TYPE_PID_T])
+
+ dnl Ensure the type mode_t gets defined.
+ AC_REQUIRE([AC_TYPE_MODE_T])
+
+ dnl Whether to override the 'off_t' type.
+ AC_REQUIRE([gl_TYPE_OFF_T])
+
+ dnl Whether to override the 'dev_t' and 'ino_t' types.
+ m4_ifdef([gl_WINDOWS_STAT_INODES], [
+ AC_REQUIRE([gl_WINDOWS_STAT_INODES])
+ ], [
+ WINDOWS_STAT_INODES=0
+ ])
+ AC_SUBST([WINDOWS_STAT_INODES])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_TYPES_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_TYPE_H_MODULE_INDICATOR_DEFAULTS], [
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_TYPE_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
+[
+])
+
+# This works around a buggy version in autoconf <= 2.69.
+# See <https://lists.gnu.org/r/autoconf/2016-08/msg00014.html>
+# The 2.70 version isn't quoted properly, so override it too.
+
+m4_version_prereq([2.70.1], [], [
+
+m4_undefine([AC_HEADER_MAJOR])
+AC_DEFUN([AC_HEADER_MAJOR],
+[AC_CHECK_HEADERS_ONCE([sys/types.h])
+AC_CHECK_HEADER([sys/mkdev.h],
+ [AC_DEFINE([MAJOR_IN_MKDEV], [1],
+ [Define to 1 if `major', `minor', and `makedev' are
+ declared in <mkdev.h>.])])
+if test $ac_cv_header_sys_mkdev_h = no; then
+ AC_CHECK_HEADER([sys/sysmacros.h],
+ [AC_DEFINE([MAJOR_IN_SYSMACROS], [1],
+ [Define to 1 if `major', `minor', and `makedev'
+ are declared in <sysmacros.h>.])])
+fi
+])# AC_HEADER_MAJOR
+
+])
diff --git a/gl/m4/sys_uio_h.m4 b/gl/m4/sys_uio_h.m4
new file mode 100644
index 0000000..36f55ea
--- /dev/null
+++ b/gl/m4/sys_uio_h.m4
@@ -0,0 +1,46 @@
+# sys_uio_h.m4 serial 3
+dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_SYS_UIO_H],
+[
+ AC_REQUIRE([gl_SYS_UIO_H_DEFAULTS])
+ dnl <sys/uio.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([sys/uio.h])
+ if test $ac_cv_header_sys_uio_h = yes; then
+ HAVE_SYS_UIO_H=1
+ else
+ HAVE_SYS_UIO_H=0
+ fi
+ AC_SUBST([HAVE_SYS_UIO_H])
+])
+
+# gl_SYS_UIO_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_SYS_UIO_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_SYS_UIO_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_UIO_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_UIO_H_MODULE_INDICATOR_DEFAULTS], [
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_UIO_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_SYS_UIO_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_SYS_UIO_H_DEFAULTS],
+[
+])
diff --git a/gl/m4/sysexits.m4 b/gl/m4/sysexits.m4
new file mode 100644
index 0000000..fe590b3
--- /dev/null
+++ b/gl/m4/sysexits.m4
@@ -0,0 +1,42 @@
+# sysexits.m4 serial 7
+dnl Copyright (C) 2003, 2005, 2007, 2009-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_SYSEXITS],
+[
+ AC_CHECK_HEADERS_ONCE([sysexits.h])
+ if test $ac_cv_header_sysexits_h = yes; then
+ HAVE_SYSEXITS_H=1
+ gl_CHECK_NEXT_HEADERS([sysexits.h])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sysexits.h>]],
+ [[switch (0)
+ {
+ case EX_OK:
+ case EX_USAGE:
+ case EX_DATAERR:
+ case EX_NOINPUT:
+ case EX_NOUSER:
+ case EX_NOHOST:
+ case EX_UNAVAILABLE:
+ case EX_SOFTWARE:
+ case EX_OSERR:
+ case EX_OSFILE:
+ case EX_CANTCREAT:
+ case EX_IOERR:
+ case EX_TEMPFAIL:
+ case EX_PROTOCOL:
+ case EX_NOPERM:
+ case EX_CONFIG:
+ break;
+ }
+ ]])],
+ [GL_GENERATE_SYSEXITS_H=false],
+ [GL_GENERATE_SYSEXITS_H=true])
+ else
+ HAVE_SYSEXITS_H=0
+ GL_GENERATE_SYSEXITS_H=true
+ fi
+ AC_SUBST([HAVE_SYSEXITS_H])
+])
diff --git a/gl/m4/tempname.m4 b/gl/m4/tempname.m4
new file mode 100644
index 0000000..22ccec1
--- /dev/null
+++ b/gl/m4/tempname.m4
@@ -0,0 +1,19 @@
+#serial 5
+
+# Copyright (C) 2006-2007, 2009-2022 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.
+
+# glibc provides __gen_tempname as a wrapper for mk[ds]temp. Expose
+# it as a public API, and provide it on systems that are lacking.
+AC_DEFUN([gl_FUNC_GEN_TEMPNAME],
+[
+ gl_PREREQ_TEMPNAME
+])
+
+# Prerequisites of lib/tempname.c.
+AC_DEFUN([gl_PREREQ_TEMPNAME],
+[
+ :
+])
diff --git a/gl/m4/termios_h.m4 b/gl/m4/termios_h.m4
new file mode 100644
index 0000000..6c83538
--- /dev/null
+++ b/gl/m4/termios_h.m4
@@ -0,0 +1,58 @@
+# termios_h.m4 serial 7
+dnl Copyright (C) 2010-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_TERMIOS_H],
+[
+ dnl Ensure to expand the default settings once only, before all statements
+ dnl that occur in other macros.
+ AC_REQUIRE([gl_TERMIOS_H_DEFAULTS])
+
+ gl_CHECK_NEXT_HEADERS([termios.h])
+ if test $ac_cv_header_termios_h != yes; then
+ HAVE_TERMIOS_H=0
+ fi
+
+ dnl Ensure the type pid_t gets defined.
+ AC_REQUIRE([AC_TYPE_PID_T])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use, and which is not
+ dnl guaranteed by C89.
+ gl_WARN_ON_USE_PREPARE([[#include <termios.h>]],
+ [tcgetsid])
+])
+
+# gl_TERMIOS_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_TERMIOS_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_TERMIOS_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_TERMIOS_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_TERMIOS_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TCGETSID])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_TERMIOS_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_TERMIOS_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_TERMIOS_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_DECL_TCGETSID=1; AC_SUBST([HAVE_DECL_TCGETSID])
+ HAVE_TERMIOS_H=1; AC_SUBST([HAVE_TERMIOS_H])
+])
diff --git a/gl/m4/threadlib.m4 b/gl/m4/threadlib.m4
new file mode 100644
index 0000000..ecb4970
--- /dev/null
+++ b/gl/m4/threadlib.m4
@@ -0,0 +1,664 @@
+# threadlib.m4 serial 32
+dnl Copyright (C) 2005-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_PREREQ([2.60])
+
+dnl The general structure of the multithreading modules in gnulib is that we
+dnl have three set of modules:
+dnl
+dnl * POSIX API:
+dnl pthread, which combines
+dnl pthread-h
+dnl pthread-thread
+dnl pthread-once
+dnl pthread-mutex
+dnl pthread-rwlock
+dnl pthread-cond
+dnl pthread-tss
+dnl pthread-spin
+dnl sched_yield
+dnl
+dnl * ISO C API:
+dnl threads, which combines
+dnl threads-h
+dnl thrd
+dnl mtx
+dnl cnd
+dnl tss
+dnl
+dnl * Gnulib API, with an implementation that can be chosen at configure
+dnl time through the option --enable-threads=...
+dnl thread
+dnl lock
+dnl cond
+dnl tls
+dnl yield
+dnl
+dnl They are independent, except for the fact that
+dnl - the implementation of the ISO C API may use the POSIX (or some other
+dnl platform dependent) API,
+dnl - the implementation of the Gnulib API may use the POSIX or ISO C or
+dnl some other platform dependent API, depending on the --enable-threads
+dnl option.
+dnl
+dnl This file contains macros for all of these APIs!
+
+dnl ============================================================================
+dnl Macros for all thread APIs
+
+AC_DEFUN([gl_ANYTHREADLIB_EARLY],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ if test -z "$gl_anythreadlib_early_done"; then
+ case "$host_os" in
+ osf*)
+ # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
+ # groks <pthread.h>. cc also understands the flag -pthread, but
+ # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
+ # 2. putting a flag into CPPFLAGS that has an effect on the linker
+ # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
+ # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
+ CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+ ;;
+ esac
+ # Some systems optimize for single-threaded programs by default, and
+ # need special flags to disable these optimizations. For example, the
+ # definition of 'errno' in <errno.h>.
+ case "$host_os" in
+ aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
+ solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
+ esac
+ gl_anythreadlib_early_done=done
+ fi
+])
+
+dnl Checks whether the compiler and linker support weak declarations of symbols.
+
+AC_DEFUN([gl_WEAK_SYMBOLS],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([whether imported symbols can be declared weak],
+ [gl_cv_have_weak],
+ [case "$host_os" in
+ cygwin*)
+ dnl On Cygwin 3.2.0 with gcc 10.2, the test below would succeed, but
+ dnl programs that use pthread_in_use() with weak symbol references
+ dnl crash miserably at runtime.
+ gl_cv_have_weak="guessing no"
+ ;;
+ *)
+ gl_cv_have_weak=no
+ dnl First, test whether the compiler accepts it syntactically.
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern void xyzzy ();
+#pragma weak xyzzy]],
+ [[xyzzy();]])],
+ [gl_cv_have_weak=maybe])
+ if test $gl_cv_have_weak = maybe; then
+ dnl Second, test whether it actually works. On Cygwin 1.7.2, with
+ dnl gcc 4.3, symbols declared weak always evaluate to the address 0.
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#pragma weak fputs
+int main ()
+{
+ return (fputs == NULL);
+}]])],
+ [gl_cv_have_weak=yes],
+ [gl_cv_have_weak=no],
+ [dnl When cross-compiling, assume that only ELF platforms support
+ dnl weak symbols.
+ AC_EGREP_CPP([Extensible Linking Format],
+ [#ifdef __ELF__
+ Extensible Linking Format
+ #endif
+ ],
+ [gl_cv_have_weak="guessing yes"],
+ [gl_cv_have_weak="guessing no"])
+ ])
+ fi
+ ;;
+ esac
+ dnl But when linking statically, weak symbols don't work.
+ case " $LDFLAGS " in
+ *" -static "*) gl_cv_have_weak=no ;;
+ esac
+ dnl Test for a bug in FreeBSD 11: A link error occurs when using a weak
+ dnl symbol and linking against a shared library that has a dependency on
+ dnl the shared library that defines the symbol.
+ case "$gl_cv_have_weak" in
+ *yes)
+ case "$host_os" in
+ freebsd* | dragonfly* | midnightbsd*)
+ : > conftest1.c
+ $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&AS_MESSAGE_LOG_FD 2>&1
+ cat <<EOF > conftest2.c
+#include <pthread.h>
+#pragma weak pthread_mutexattr_gettype
+int main ()
+{
+ return (pthread_mutexattr_gettype != NULL);
+}
+EOF
+ $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&AS_MESSAGE_LOG_FD 2>&1 \
+ || gl_cv_have_weak=no
+ rm -f conftest1.c libempty.so conftest2.c conftest
+ ;;
+ esac
+ ;;
+ esac
+ ])
+ case "$gl_cv_have_weak" in
+ *yes)
+ AC_DEFINE([HAVE_WEAK_SYMBOLS], [1],
+ [Define to 1 if the compiler and linker support weak declarations of symbols.])
+ ;;
+ esac
+])
+
+dnl ============================================================================
+dnl Macros for the POSIX API
+
+dnl gl_PTHREADLIB
+dnl -------------
+dnl Tests for the libraries needs for using the POSIX threads API.
+dnl Sets the variable LIBPTHREAD to the linker options for use in a Makefile.
+dnl Sets the variable LIBPMULTITHREAD, for programs that really need
+dnl multithread functionality. The difference between LIBPTHREAD and
+dnl LIBPMULTITHREAD is that on platforms supporting weak symbols, typically
+dnl LIBPTHREAD is empty whereas LIBPMULTITHREAD is not.
+dnl Sets the variable LIB_SCHED_YIELD to the linker options needed to use the
+dnl sched_yield() function.
+dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
+dnl multithread-safe programs.
+dnl Defines the C macro HAVE_PTHREAD_API if (at least parts of) the POSIX
+dnl threads API is available.
+
+dnl The guts of gl_PTHREADLIB. Needs to be expanded only once.
+
+AC_DEFUN([gl_PTHREADLIB_BODY],
+[
+ AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+ if test -z "$gl_pthreadlib_body_done"; then
+ gl_pthread_api=no
+ LIBPTHREAD=
+ LIBPMULTITHREAD=
+ # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
+ # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
+ AC_CHECK_HEADER([pthread.h],
+ [gl_have_pthread_h=yes], [gl_have_pthread_h=no])
+ if test "$gl_have_pthread_h" = yes; then
+ # Other possible tests:
+ # -lpthreads (FSU threads, PCthreads)
+ # -lgthreads
+ # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
+ # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
+ # the second one only in libpthread, and lock.c needs it.
+ #
+ # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
+ # needs -pthread for some reason. See:
+ # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
+ save_LIBS=$LIBS
+ for gl_pthread in '' '-pthread'; do
+ LIBS="$LIBS $gl_pthread"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pthread.h>
+ pthread_mutex_t m;
+ pthread_mutexattr_t ma;
+ ]],
+ [[pthread_mutex_lock (&m);
+ pthread_mutexattr_init (&ma);]])],
+ [gl_pthread_api=yes
+ LIBPTHREAD=$gl_pthread
+ LIBPMULTITHREAD=$gl_pthread])
+ LIBS=$save_LIBS
+ test $gl_pthread_api = yes && break
+ done
+ echo "$as_me:__oline__: gl_pthread_api=$gl_pthread_api" >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: LIBPTHREAD=$LIBPTHREAD" >&AS_MESSAGE_LOG_FD
+
+ gl_pthread_in_glibc=no
+ # On Linux with glibc >= 2.34, libc contains the fully functional
+ # pthread functions.
+ case "$host_os" in
+ linux*)
+ AC_EGREP_CPP([Lucky user],
+ [#include <features.h>
+ #ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 34) || (__GLIBC__ > 2)
+ Lucky user
+ #endif
+ #endif
+ ],
+ [gl_pthread_in_glibc=yes],
+ [])
+ ;;
+ esac
+ echo "$as_me:__oline__: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&AS_MESSAGE_LOG_FD
+
+ # Test for libpthread by looking for pthread_kill. (Not pthread_self,
+ # since it is defined as a macro on OSF/1.)
+ if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
+ # The program links fine without libpthread. But it may actually
+ # need to link with libpthread in order to create multiple threads.
+ AC_CHECK_LIB([pthread], [pthread_kill],
+ [if test $gl_pthread_in_glibc = yes; then
+ LIBPMULTITHREAD=
+ else
+ LIBPMULTITHREAD=-lpthread
+ # On Solaris and HP-UX, most pthread functions exist also in libc.
+ # Therefore pthread_in_use() needs to actually try to create a
+ # thread: pthread_create from libc will fail, whereas
+ # pthread_create will actually create a thread.
+ # On Solaris 10 or newer, this test is no longer needed, because
+ # libc contains the fully functional pthread functions.
+ case "$host_os" in
+ solaris | solaris2.[1-9] | solaris2.[1-9].* | hpux*)
+ AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
+ [Define if the pthread_in_use() detection is hard.])
+ esac
+ fi
+ ])
+ elif test $gl_pthread_api != yes; then
+ # Some library is needed. Try libpthread and libc_r.
+ AC_CHECK_LIB([pthread], [pthread_kill],
+ [gl_pthread_api=yes
+ LIBPTHREAD=-lpthread
+ LIBPMULTITHREAD=-lpthread])
+ if test $gl_pthread_api != yes; then
+ # For FreeBSD 4.
+ AC_CHECK_LIB([c_r], [pthread_kill],
+ [gl_pthread_api=yes
+ LIBPTHREAD=-lc_r
+ LIBPMULTITHREAD=-lc_r])
+ fi
+ fi
+ echo "$as_me:__oline__: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&AS_MESSAGE_LOG_FD
+ fi
+ AC_MSG_CHECKING([whether POSIX threads API is available])
+ AC_MSG_RESULT([$gl_pthread_api])
+ AC_SUBST([LIBPTHREAD])
+ AC_SUBST([LIBPMULTITHREAD])
+ if test $gl_pthread_api = yes; then
+ AC_DEFINE([HAVE_PTHREAD_API], [1],
+ [Define if you have the <pthread.h> header and the POSIX threads API.])
+ fi
+
+ dnl On some systems, sched_yield is in librt, rather than in libpthread.
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sched.h>]],
+ [[sched_yield ();]])],
+ [LIB_SCHED_YIELD=
+ ],
+ [dnl Solaris 7...10 has sched_yield in librt, not in libpthread or libc.
+ AC_CHECK_LIB([rt], [sched_yield], [LIB_SCHED_YIELD=-lrt],
+ [dnl Solaris 2.5.1, 2.6 has sched_yield in libposix4, not librt.
+ AC_CHECK_LIB([posix4], [sched_yield], [LIB_SCHED_YIELD=-lposix4])])
+ ])
+ AC_SUBST([LIB_SCHED_YIELD])
+
+ gl_pthreadlib_body_done=done
+ fi
+])
+
+AC_DEFUN([gl_PTHREADLIB],
+[
+ AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+ gl_PTHREADLIB_BODY
+])
+
+dnl ============================================================================
+dnl Macros for the ISO C API
+
+dnl gl_STDTHREADLIB
+dnl ---------------
+dnl Tests for the libraries needs for using the ISO C threads API.
+dnl Sets the variable LIBSTDTHREAD to the linker options for use in a Makefile.
+dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
+dnl multithread-safe programs.
+dnl Defines the C macro HAVE_THREADS_H if (at least parts of) the ISO C threads
+dnl API is available.
+
+dnl The guts of gl_STDTHREADLIB. Needs to be expanded only once.
+
+AC_DEFUN([gl_STDTHREADLIB_BODY],
+[
+ AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ if test -z "$gl_stdthreadlib_body_done"; then
+ AC_CHECK_HEADERS_ONCE([threads.h])
+
+ case "$host_os" in
+ mingw*)
+ LIBSTDTHREAD=
+ ;;
+ *)
+ gl_PTHREADLIB_BODY
+ if test $ac_cv_header_threads_h = yes; then
+ dnl glibc >= 2.29 has thrd_create in libpthread.
+ dnl FreeBSD >= 10 has thrd_create in libstdthreads; this library depends
+ dnl on libpthread (for the symbol 'pthread_mutexattr_gettype').
+ dnl glibc >= 2.34, AIX >= 7.1, and Solaris >= 11.4 have thrd_create in
+ dnl libc.
+ AC_CHECK_FUNCS([thrd_create])
+ if test $ac_cv_func_thrd_create = yes; then
+ LIBSTDTHREAD=
+ else
+ AC_CHECK_LIB([stdthreads], [thrd_create], [
+ LIBSTDTHREAD='-lstdthreads -lpthread'
+ ], [
+ dnl Guess that thrd_create is in libpthread.
+ LIBSTDTHREAD="$LIBPMULTITHREAD"
+ ])
+ fi
+ else
+ dnl Libraries needed by thrd.c, mtx.c, cnd.c, tss.c.
+ LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD"
+ fi
+ ;;
+ esac
+ AC_SUBST([LIBSTDTHREAD])
+
+ AC_MSG_CHECKING([whether ISO C threads API is available])
+ AC_MSG_RESULT([$ac_cv_header_threads_h])
+ gl_stdthreadlib_body_done=done
+ fi
+])
+
+AC_DEFUN([gl_STDTHREADLIB],
+[
+ AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+ gl_STDTHREADLIB_BODY
+])
+
+dnl ============================================================================
+dnl Macros for the Gnulib API
+
+dnl gl_THREADLIB
+dnl ------------
+dnl Tests for a multithreading library to be used.
+dnl If the configure.ac contains a definition of the gl_THREADLIB_DEFAULT_NO
+dnl (it must be placed before the invocation of gl_THREADLIB_EARLY!), then the
+dnl default is 'no', otherwise it is system dependent. In both cases, the user
+dnl can change the choice through the options --enable-threads=choice or
+dnl --disable-threads.
+dnl Defines at most one of the macros USE_ISOC_THREADS, USE_POSIX_THREADS,
+dnl USE_ISOC_AND_POSIX_THREADS, USE_WINDOWS_THREADS.
+dnl The choice --enable-threads=isoc+posix is available only on platforms that
+dnl have both the ISO C and the POSIX threads APIs. It has the effect of using
+dnl the ISO C API for most things and the POSIX API only for creating and
+dnl controlling threads (because there is no equivalent to pthread_atfork in
+dnl the ISO C API).
+dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
+dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
+dnl libtool).
+dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
+dnl programs that really need multithread functionality. The difference
+dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
+dnl symbols, typically LIBTHREAD is empty whereas LIBMULTITHREAD is not.
+dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
+dnl multithread-safe programs.
+dnl Since support for GNU pth was removed, $LTLIBTHREAD and $LIBTHREAD have the
+dnl same value, and similarly $LTLIBMULTITHREAD and $LIBMULTITHREAD have the
+dnl same value. Only system libraries are needed.
+
+AC_DEFUN([gl_THREADLIB_EARLY],
+[
+ AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
+])
+
+dnl The guts of gl_THREADLIB_EARLY. Needs to be expanded only once.
+
+AC_DEFUN([gl_THREADLIB_EARLY_BODY],
+[
+ dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
+ dnl influences the result of the autoconf tests that test for *_unlocked
+ dnl declarations, on AIX 5 at least. Therefore it must come early.
+ AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl
+ AC_BEFORE([$0], [gl_ARGP])dnl
+
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems.
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+ dnl Check for multithreading.
+ m4_ifdef([gl_THREADLIB_DEFAULT_NO],
+ [m4_divert_text([DEFAULTS], [gl_use_threads_default=no])],
+ [m4_divert_text([DEFAULTS], [gl_use_threads_default=])])
+ m4_divert_text([DEFAULTS], [gl_use_winpthreads_default=])
+ AC_ARG_ENABLE([threads],
+AS_HELP_STRING([--enable-threads={isoc|posix|isoc+posix|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
+AS_HELP_STRING([--disable-threads], [build without multithread safety])]),
+ [gl_use_threads=$enableval],
+ [if test -n "$gl_use_threads_default"; then
+ gl_use_threads="$gl_use_threads_default"
+ else
+changequote(,)dnl
+ case "$host_os" in
+ dnl Disable multithreading by default on OSF/1, because it interferes
+ dnl with fork()/exec(): When msgexec is linked with -lpthread, its
+ dnl child process gets an endless segmentation fault inside execvp().
+ osf*) gl_use_threads=no ;;
+ dnl Disable multithreading by default on Cygwin 1.5.x, because it has
+ dnl bugs that lead to endless loops or crashes. See
+ dnl <https://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
+ cygwin*)
+ case `uname -r` in
+ 1.[0-5].*) gl_use_threads=no ;;
+ *) gl_use_threads=yes ;;
+ esac
+ ;;
+ dnl Obey gl_AVOID_WINPTHREAD on mingw.
+ mingw*)
+ case "$gl_use_winpthreads_default" in
+ yes) gl_use_threads=posix ;;
+ no) gl_use_threads=windows ;;
+ *) gl_use_threads=yes ;;
+ esac
+ ;;
+ *) gl_use_threads=yes ;;
+ esac
+changequote([,])dnl
+ fi
+ ])
+ if test "$gl_use_threads" = yes \
+ || test "$gl_use_threads" = isoc \
+ || test "$gl_use_threads" = posix \
+ || test "$gl_use_threads" = isoc+posix; then
+ # For using <threads.h> or <pthread.h>:
+ gl_ANYTHREADLIB_EARLY
+ fi
+])
+
+dnl The guts of gl_THREADLIB. Needs to be expanded only once.
+
+AC_DEFUN([gl_THREADLIB_BODY],
+[
+ AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
+ gl_threads_api=none
+ LIBTHREAD=
+ LTLIBTHREAD=
+ LIBMULTITHREAD=
+ LTLIBMULTITHREAD=
+ if test "$gl_use_threads" != no; then
+ dnl Check whether the compiler and linker support weak declarations.
+ gl_WEAK_SYMBOLS
+ if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
+ dnl If we use weak symbols to implement pthread_in_use / pth_in_use /
+ dnl thread_in_use, we also need to test whether the ISO C 11 thrd_create
+ dnl facility is in use.
+ AC_CHECK_HEADERS_ONCE([threads.h])
+ :
+ fi
+ if test "$gl_use_threads" = isoc || test "$gl_use_threads" = isoc+posix; then
+ AC_CHECK_HEADERS_ONCE([threads.h])
+ gl_have_isoc_threads="$ac_cv_header_threads_h"
+ fi
+ if test "$gl_use_threads" = yes \
+ || test "$gl_use_threads" = posix \
+ || test "$gl_use_threads" = isoc+posix; then
+ gl_PTHREADLIB_BODY
+ LIBTHREAD=$LIBPTHREAD LTLIBTHREAD=$LIBPTHREAD
+ LIBMULTITHREAD=$LIBPMULTITHREAD LTLIBMULTITHREAD=$LIBPMULTITHREAD
+ if test $gl_pthread_api = yes; then
+ if test "$gl_use_threads" = isoc+posix && test "$gl_have_isoc_threads" = yes; then
+ gl_threads_api='isoc+posix'
+ AC_DEFINE([USE_ISOC_AND_POSIX_THREADS], [1],
+ [Define if the combination of the ISO C and POSIX multithreading APIs can be used.])
+ LIBTHREAD= LTLIBTHREAD=
+ else
+ gl_threads_api=posix
+ AC_DEFINE([USE_POSIX_THREADS], [1],
+ [Define if the POSIX multithreading library can be used.])
+ if test -z "$LIBMULTITHREAD" && test -z "$LTLIBMULTITHREAD"; then
+ AC_DEFINE([USE_POSIX_THREADS_FROM_LIBC], [1],
+ [Define if references to the POSIX multithreading library are satisfied by libc.])
+ else
+ if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
+ AC_DEFINE([USE_POSIX_THREADS_WEAK], [1],
+ [Define if references to the POSIX multithreading library should be made weak.])
+ LIBTHREAD= LTLIBTHREAD=
+ else
+ case "$host_os" in
+ freebsd* | dragonfly* | midnightbsd*)
+ if test "x$LIBTHREAD" != "x$LIBMULTITHREAD"; then
+ dnl If weak symbols can't tell whether pthread_create(), pthread_key_create()
+ dnl etc. will succeed, we need a runtime test.
+ AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
+ [Define if the pthread_in_use() detection is hard.])
+ fi
+ ;;
+ esac
+ fi
+ fi
+ fi
+ fi
+ fi
+ if test $gl_threads_api = none; then
+ if test "$gl_use_threads" = isoc && test "$gl_have_isoc_threads" = yes; then
+ gl_STDTHREADLIB_BODY
+ LIBTHREAD=$LIBSTDTHREAD LTLIBTHREAD=$LIBSTDTHREAD
+ LIBMULTITHREAD=$LIBSTDTHREAD LTLIBMULTITHREAD=$LIBSTDTHREAD
+ gl_threads_api=isoc
+ AC_DEFINE([USE_ISOC_THREADS], [1],
+ [Define if the ISO C multithreading library can be used.])
+ fi
+ fi
+ if test $gl_threads_api = none; then
+ case "$gl_use_threads" in
+ yes | windows | win32) # The 'win32' is for backward compatibility.
+ if { case "$host_os" in
+ mingw*) true;;
+ *) false;;
+ esac
+ }; then
+ gl_threads_api=windows
+ AC_DEFINE([USE_WINDOWS_THREADS], [1],
+ [Define if the native Windows multithreading API can be used.])
+ fi
+ ;;
+ esac
+ fi
+ fi
+ AC_MSG_CHECKING([for multithread API to use])
+ AC_MSG_RESULT([$gl_threads_api])
+ AC_SUBST([LIBTHREAD])
+ AC_SUBST([LTLIBTHREAD])
+ AC_SUBST([LIBMULTITHREAD])
+ AC_SUBST([LTLIBMULTITHREAD])
+])
+
+AC_DEFUN([gl_THREADLIB],
+[
+ AC_REQUIRE([gl_THREADLIB_EARLY])
+ AC_REQUIRE([gl_THREADLIB_BODY])
+])
+
+
+dnl gl_DISABLE_THREADS
+dnl ------------------
+dnl Sets the gl_THREADLIB default so that threads are not used by default.
+dnl The user can still override it at installation time, by using the
+dnl configure option '--enable-threads'.
+
+AC_DEFUN([gl_DISABLE_THREADS], [
+ m4_divert_text([INIT_PREPARE], [gl_use_threads_default=no])
+])
+
+
+dnl gl_AVOID_WINPTHREAD
+dnl -------------------
+dnl Sets the gl_THREADLIB default so that on mingw, a dependency to the
+dnl libwinpthread DLL (mingw-w64 winpthreads library) is avoided.
+dnl The user can still override it at installation time, by using the
+dnl configure option '--enable-threads'.
+
+AC_DEFUN([gl_AVOID_WINPTHREAD], [
+ m4_divert_text([INIT_PREPARE], [gl_use_winpthreads_default=no])
+])
+
+
+dnl ============================================================================
+
+
+dnl Survey of platforms:
+dnl
+dnl Platform Available Compiler Supports test-lock
+dnl flavours option weak result
+dnl --------------- --------- --------- -------- ---------
+dnl Linux 2.4/glibc posix -lpthread Y OK
+dnl
+dnl Linux/glibc 2.34 posix Y OK
+dnl
+dnl GNU Hurd/glibc posix -lpthread Y OK
+dnl
+dnl Ubuntu 14.04 posix -pthread Y OK
+dnl
+dnl FreeBSD 5.3 posix -lc_r Y
+dnl posix -lkse ? Y
+dnl posix -lpthread ? Y
+dnl posix -lthr Y
+dnl
+dnl FreeBSD 5.2 posix -lc_r Y
+dnl posix -lkse Y
+dnl posix -lthr Y
+dnl
+dnl FreeBSD 4.0,4.10 posix -lc_r Y OK
+dnl
+dnl NetBSD 1.6 --
+dnl
+dnl OpenBSD 3.4 posix -lpthread Y OK
+dnl
+dnl Mac OS X 10.[123] posix -lpthread Y OK
+dnl
+dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK
+dnl
+dnl HP-UX 11 posix -lpthread N (cc) OK
+dnl Y (gcc)
+dnl
+dnl IRIX 6.5 posix -lpthread Y 0.5
+dnl
+dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK
+dnl
+dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK
+dnl -lpthread (gcc) Y
+dnl
+dnl Cygwin posix -lpthread Y OK
+dnl
+dnl Mingw windows N OK
+dnl
+dnl BeOS 5 --
+dnl
+dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
+dnl turned off:
+dnl OK if all three tests terminate OK,
+dnl 0.5 if the first test terminates OK but the second one loops endlessly,
+dnl 0.0 if the first test already loops endlessly.
diff --git a/gl/m4/time_h.m4 b/gl/m4/time_h.m4
new file mode 100644
index 0000000..98d7b6e
--- /dev/null
+++ b/gl/m4/time_h.m4
@@ -0,0 +1,177 @@
+# Configure a more-standard replacement for <time.h>.
+
+# Copyright (C) 2000-2001, 2003-2007, 2009-2022 Free Software Foundation, Inc.
+
+# serial 19
+
+# 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 and Jim Meyering.
+
+AC_DEFUN_ONCE([gl_TIME_H],
+[
+ dnl Ensure to expand the default settings once only, before all statements
+ dnl that occur in other macros.
+ AC_REQUIRE([gl_TIME_H_DEFAULTS])
+
+ gl_NEXT_HEADERS([time.h])
+ AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_CACHE_CHECK([for TIME_UTC in <time.h>],
+ [gl_cv_time_h_has_TIME_UTC],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <time.h>
+ ]],
+ [[static int x = TIME_UTC; x++;]])],
+ [gl_cv_time_h_has_TIME_UTC=yes],
+ [gl_cv_time_h_has_TIME_UTC=no])])
+ if test $gl_cv_time_h_has_TIME_UTC = yes; then
+ TIME_H_DEFINES_TIME_UTC=1
+ else
+ TIME_H_DEFINES_TIME_UTC=0
+ fi
+ AC_SUBST([TIME_H_DEFINES_TIME_UTC])
+])
+
+dnl Check whether 'struct timespec' is declared
+dnl in time.h, sys/time.h, pthread.h, or unistd.h.
+
+AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
+[
+ AC_CHECK_HEADERS_ONCE([sys/time.h])
+ AC_CACHE_CHECK([for struct timespec in <time.h>],
+ [gl_cv_sys_struct_timespec_in_time_h],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <time.h>
+ ]],
+ [[static struct timespec x; x.tv_sec = x.tv_nsec;]])],
+ [gl_cv_sys_struct_timespec_in_time_h=yes],
+ [gl_cv_sys_struct_timespec_in_time_h=no])])
+
+ TIME_H_DEFINES_STRUCT_TIMESPEC=0
+ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
+ PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
+ UNISTD_H_DEFINES_STRUCT_TIMESPEC=0
+ if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
+ TIME_H_DEFINES_STRUCT_TIMESPEC=1
+ else
+ AC_CACHE_CHECK([for struct timespec in <sys/time.h>],
+ [gl_cv_sys_struct_timespec_in_sys_time_h],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/time.h>
+ ]],
+ [[static struct timespec x; x.tv_sec = x.tv_nsec;]])],
+ [gl_cv_sys_struct_timespec_in_sys_time_h=yes],
+ [gl_cv_sys_struct_timespec_in_sys_time_h=no])])
+ if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
+ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
+ else
+ AC_CACHE_CHECK([for struct timespec in <pthread.h>],
+ [gl_cv_sys_struct_timespec_in_pthread_h],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pthread.h>
+ ]],
+ [[static struct timespec x; x.tv_sec = x.tv_nsec;]])],
+ [gl_cv_sys_struct_timespec_in_pthread_h=yes],
+ [gl_cv_sys_struct_timespec_in_pthread_h=no])])
+ if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
+ PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
+ else
+ AC_CACHE_CHECK([for struct timespec in <unistd.h>],
+ [gl_cv_sys_struct_timespec_in_unistd_h],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <unistd.h>
+ ]],
+ [[static struct timespec x; x.tv_sec = x.tv_nsec;]])],
+ [gl_cv_sys_struct_timespec_in_unistd_h=yes],
+ [gl_cv_sys_struct_timespec_in_unistd_h=no])])
+ if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then
+ UNISTD_H_DEFINES_STRUCT_TIMESPEC=1
+ fi
+ fi
+ fi
+ fi
+ AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC])
+ AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC])
+ AC_SUBST([PTHREAD_H_DEFINES_STRUCT_TIMESPEC])
+ AC_SUBST([UNISTD_H_DEFINES_STRUCT_TIMESPEC])
+])
+
+# gl_TIME_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_TIME_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_TIME_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_TIME_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_TIME_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CTIME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKTIME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALTIME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NANOSLEEP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRFTIME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRPTIME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMEGM])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMESPEC_GET])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMESPEC_GETRES])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIME_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIME_RZ])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TZSET])
+ dnl Support Microsoft deprecated alias function names by default.
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_TZSET], [1])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_TIME_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_TIME_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_TIME_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_DECL_LOCALTIME_R=1; AC_SUBST([HAVE_DECL_LOCALTIME_R])
+ HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP])
+ HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME])
+ HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM])
+ HAVE_TIMESPEC_GET=1; AC_SUBST([HAVE_TIMESPEC_GET])
+ HAVE_TIMESPEC_GETRES=1; AC_SUBST([HAVE_TIMESPEC_GETRES])
+ dnl Even GNU libc does not have timezone_t yet.
+ HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T])
+ dnl If another module says to replace or to not replace, do that.
+ dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK;
+ dnl this lets maintainers check for portability.
+ REPLACE_CTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_CTIME])
+ REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R])
+ REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME])
+ REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP])
+ REPLACE_STRFTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_STRFTIME])
+ REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM])
+ REPLACE_TZSET=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TZSET])
+
+ dnl Hack so that the time module doesn't depend on the sys_time module.
+ dnl First, default GNULIB_GETTIMEOFDAY to 0 if sys_time is absent.
+ : ${GNULIB_GETTIMEOFDAY=0}; AC_SUBST([GNULIB_GETTIMEOFDAY])
+ dnl Second, it's OK to not use GNULIB_PORTCHECK for REPLACE_GMTIME
+ dnl and REPLACE_LOCALTIME, as portability to Solaris 2.6 and earlier
+ dnl is no longer a big deal.
+ REPLACE_GMTIME=0; AC_SUBST([REPLACE_GMTIME])
+ REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME])
+])
diff --git a/gl/m4/timespec.m4 b/gl/m4/timespec.m4
new file mode 100644
index 0000000..6a1afef
--- /dev/null
+++ b/gl/m4/timespec.m4
@@ -0,0 +1,11 @@
+#serial 15
+
+# Copyright (C) 2000-2001, 2003-2007, 2009-2022 Free Software Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+dnl From Jim Meyering
+
+AC_DEFUN([gl_TIMESPEC], [:])
diff --git a/gl/m4/uintmax_t.m4 b/gl/m4/uintmax_t.m4
new file mode 100644
index 0000000..c6ff800
--- /dev/null
+++ b/gl/m4/uintmax_t.m4
@@ -0,0 +1,30 @@
+# uintmax_t.m4 serial 12
+dnl Copyright (C) 1997-2004, 2007-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+AC_PREREQ([2.13])
+
+# Define uintmax_t to 'unsigned long' or 'unsigned long long'
+# if it is not already defined in <stdint.h> or <inttypes.h>.
+
+AC_DEFUN([gl_AC_TYPE_UINTMAX_T],
+[
+ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
+ AC_REQUIRE([gl_AC_HEADER_STDINT_H])
+ if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
+ AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
+ test $ac_cv_type_unsigned_long_long_int = yes \
+ && ac_type='unsigned long long' \
+ || ac_type='unsigned long'
+ AC_DEFINE_UNQUOTED([uintmax_t], [$ac_type],
+ [Define to unsigned long or unsigned long long
+ if <stdint.h> and <inttypes.h> don't define.])
+ else
+ AC_DEFINE([HAVE_UINTMAX_T], [1],
+ [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
+ fi
+])
diff --git a/gl/m4/unistd-safer.m4 b/gl/m4/unistd-safer.m4
new file mode 100644
index 0000000..33158a4
--- /dev/null
+++ b/gl/m4/unistd-safer.m4
@@ -0,0 +1,10 @@
+#serial 9
+dnl Copyright (C) 2002, 2005-2006, 2009-2022 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_UNISTD_SAFER],
+[
+ AC_CHECK_FUNCS_ONCE([pipe])
+])
diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4
new file mode 100644
index 0000000..4c66ccc
--- /dev/null
+++ b/gl/m4/unistd_h.m4
@@ -0,0 +1,270 @@
+# unistd_h.m4 serial 90
+dnl Copyright (C) 2006-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Simon Josefsson, Bruno Haible.
+
+AC_DEFUN_ONCE([gl_UNISTD_H],
+[
+ dnl Ensure to expand the default settings once only, before all statements
+ dnl that occur in other macros.
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+
+ gl_CHECK_NEXT_HEADERS([unistd.h])
+ if test $ac_cv_header_unistd_h = yes; then
+ HAVE_UNISTD_H=1
+ else
+ HAVE_UNISTD_H=0
+ fi
+ AC_SUBST([HAVE_UNISTD_H])
+
+ dnl Ensure the type pid_t gets defined.
+ AC_REQUIRE([AC_TYPE_PID_T])
+
+ dnl Determine WINDOWS_64_BIT_OFF_T.
+ AC_REQUIRE([gl_TYPE_OFF_T])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+/* Some systems declare various items in the wrong headers. */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <fcntl.h>
+# include <stdio.h>
+# include <stdlib.h>
+# if defined _WIN32 && ! defined __CYGWIN__
+# include <io.h>
+# endif
+#endif
+ ]], [access chdir chown copy_file_range dup dup2 dup3 environ euidaccess
+ execl execle execlp execv execve execvp execvpe
+ faccessat fchdir
+ fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize
+ getentropy getgroups gethostname getlogin getlogin_r getpagesize getpass
+ getusershell setusershell endusershell
+ group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite
+ readlink readlinkat rmdir sethostname sleep symlink symlinkat
+ truncate ttyname_r unlink unlinkat usleep])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_CHECK_DECLS_ONCE([execvpe])
+ if test $ac_cv_have_decl_execvpe = no; then
+ HAVE_DECL_EXECVPE=0
+ fi
+])
+
+# gl_UNISTD_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_UNISTD_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_UNISTD_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_UNISTD_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACCESS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CHDIR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CHOWN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CLOSE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPY_FILE_RANGE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUP2])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUP3])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ENVIRON])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EUIDACCESS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECLE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECLP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECV])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECVE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECVP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECVPE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FACCESSAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCHDIR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCHOWNAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FDATASYNC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSYNC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTRUNCATE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETCWD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETDOMAINNAME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETDTABLESIZE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETENTROPY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETGROUPS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETHOSTNAME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOGIN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOGIN_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETOPT_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPAGESIZE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPASS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPASS_GNU])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETUSERSHELL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GROUP_MEMBER])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISATTY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LCHOWN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LINK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LINKAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LSEEK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PIPE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PIPE2])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PREAD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PWRITE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_READ])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_READLINK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_READLINKAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RMDIR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETHOSTNAME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SLEEP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SYMLINK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SYMLINKAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCATE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TTYNAME_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_GETOPT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_NONBLOCKING])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_SIGPIPE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNLINK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNLINKAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_USLEEP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WRITE])
+ dnl Support Microsoft deprecated alias function names by default.
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_ACCESS], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CHDIR], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CLOSE], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_DUP], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_DUP2], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECL], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECLE], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECLP], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECV], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECVE], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECVP], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECVPE], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_GETCWD], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_GETPID], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_ISATTY], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_LSEEK], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_READ], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_RMDIR], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_SWAB], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_UNLINK], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_WRITE], [1])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_UNISTD_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_UNISTD_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_CHOWN=1; AC_SUBST([HAVE_CHOWN])
+ HAVE_COPY_FILE_RANGE=1; AC_SUBST([HAVE_COPY_FILE_RANGE])
+ HAVE_DUP3=1; AC_SUBST([HAVE_DUP3])
+ HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS])
+ HAVE_EXECVPE=1; AC_SUBST([HAVE_EXECVPE])
+ HAVE_FACCESSAT=1; AC_SUBST([HAVE_FACCESSAT])
+ HAVE_FCHDIR=1; AC_SUBST([HAVE_FCHDIR])
+ HAVE_FCHOWNAT=1; AC_SUBST([HAVE_FCHOWNAT])
+ HAVE_FDATASYNC=1; AC_SUBST([HAVE_FDATASYNC])
+ HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC])
+ HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE])
+ HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE])
+ HAVE_GETENTROPY=1; AC_SUBST([HAVE_GETENTROPY])
+ HAVE_GETGROUPS=1; AC_SUBST([HAVE_GETGROUPS])
+ HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME])
+ HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN])
+ HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE])
+ HAVE_GETPASS=1; AC_SUBST([HAVE_GETPASS])
+ HAVE_GROUP_MEMBER=1; AC_SUBST([HAVE_GROUP_MEMBER])
+ HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN])
+ HAVE_LINK=1; AC_SUBST([HAVE_LINK])
+ HAVE_LINKAT=1; AC_SUBST([HAVE_LINKAT])
+ HAVE_PIPE=1; AC_SUBST([HAVE_PIPE])
+ HAVE_PIPE2=1; AC_SUBST([HAVE_PIPE2])
+ HAVE_PREAD=1; AC_SUBST([HAVE_PREAD])
+ HAVE_PWRITE=1; AC_SUBST([HAVE_PWRITE])
+ HAVE_READLINK=1; AC_SUBST([HAVE_READLINK])
+ HAVE_READLINKAT=1; AC_SUBST([HAVE_READLINKAT])
+ HAVE_SETHOSTNAME=1; AC_SUBST([HAVE_SETHOSTNAME])
+ HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP])
+ HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK])
+ HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT])
+ HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT])
+ HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP])
+ HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON])
+ HAVE_DECL_EXECVPE=1; AC_SUBST([HAVE_DECL_EXECVPE])
+ HAVE_DECL_FCHDIR=1; AC_SUBST([HAVE_DECL_FCHDIR])
+ HAVE_DECL_FDATASYNC=1; AC_SUBST([HAVE_DECL_FDATASYNC])
+ HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME])
+ HAVE_DECL_GETLOGIN=1; AC_SUBST([HAVE_DECL_GETLOGIN])
+ HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
+ HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE])
+ HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL])
+ HAVE_DECL_SETHOSTNAME=1; AC_SUBST([HAVE_DECL_SETHOSTNAME])
+ HAVE_DECL_TRUNCATE=1; AC_SUBST([HAVE_DECL_TRUNCATE])
+ HAVE_DECL_TTYNAME_R=1; AC_SUBST([HAVE_DECL_TTYNAME_R])
+ HAVE_OS_H=0; AC_SUBST([HAVE_OS_H])
+ HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H])
+ REPLACE_ACCESS=0; AC_SUBST([REPLACE_ACCESS])
+ REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN])
+ REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE])
+ REPLACE_COPY_FILE_RANGE=0; AC_SUBST([REPLACE_COPY_FILE_RANGE])
+ REPLACE_DUP=0; AC_SUBST([REPLACE_DUP])
+ REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2])
+ REPLACE_EXECL=0; AC_SUBST([REPLACE_EXECL])
+ REPLACE_EXECLE=0; AC_SUBST([REPLACE_EXECLE])
+ REPLACE_EXECLP=0; AC_SUBST([REPLACE_EXECLP])
+ REPLACE_EXECV=0; AC_SUBST([REPLACE_EXECV])
+ REPLACE_EXECVE=0; AC_SUBST([REPLACE_EXECVE])
+ REPLACE_EXECVP=0; AC_SUBST([REPLACE_EXECVP])
+ REPLACE_EXECVPE=0; AC_SUBST([REPLACE_EXECVPE])
+ REPLACE_FACCESSAT=0; AC_SUBST([REPLACE_FACCESSAT])
+ REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT])
+ REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE])
+ REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD])
+ REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME])
+ REPLACE_GETDTABLESIZE=0; AC_SUBST([REPLACE_GETDTABLESIZE])
+ REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R])
+ REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS])
+ REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE])
+ REPLACE_GETPASS=0; AC_SUBST([REPLACE_GETPASS])
+ REPLACE_GETPASS_FOR_GETPASS_GNU=0; AC_SUBST([REPLACE_GETPASS_FOR_GETPASS_GNU])
+ REPLACE_ISATTY=0; AC_SUBST([REPLACE_ISATTY])
+ REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN])
+ REPLACE_LINK=0; AC_SUBST([REPLACE_LINK])
+ REPLACE_LINKAT=0; AC_SUBST([REPLACE_LINKAT])
+ REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK])
+ REPLACE_PREAD=0; AC_SUBST([REPLACE_PREAD])
+ REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE])
+ REPLACE_READ=0; AC_SUBST([REPLACE_READ])
+ REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK])
+ REPLACE_READLINKAT=0; AC_SUBST([REPLACE_READLINKAT])
+ REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR])
+ REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP])
+ REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK])
+ REPLACE_SYMLINKAT=0; AC_SUBST([REPLACE_SYMLINKAT])
+ REPLACE_TRUNCATE=0; AC_SUBST([REPLACE_TRUNCATE])
+ REPLACE_TTYNAME_R=0; AC_SUBST([REPLACE_TTYNAME_R])
+ REPLACE_UNLINK=0; AC_SUBST([REPLACE_UNLINK])
+ REPLACE_UNLINKAT=0; AC_SUBST([REPLACE_UNLINKAT])
+ REPLACE_USLEEP=0; AC_SUBST([REPLACE_USLEEP])
+ REPLACE_WRITE=0; AC_SUBST([REPLACE_WRITE])
+ UNISTD_H_HAVE_SYS_RANDOM_H=0; AC_SUBST([UNISTD_H_HAVE_SYS_RANDOM_H])
+ UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H])
+ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
+ AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS])
+])
diff --git a/gl/m4/unlink.m4 b/gl/m4/unlink.m4
new file mode 100644
index 0000000..e25b567
--- /dev/null
+++ b/gl/m4/unlink.m4
@@ -0,0 +1,135 @@
+# unlink.m4 serial 15
+dnl Copyright (C) 2009-2022 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_UNLINK],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+
+ dnl Detect FreeBSD 7.2, AIX 7.1, Solaris 9 bug.
+ AC_CACHE_CHECK([whether unlink honors trailing slashes],
+ [gl_cv_func_unlink_honors_slashes],
+ [touch conftest.file
+ # Assume that if we have lstat, we can also check symlinks.
+ if test $ac_cv_func_lstat = yes; then
+ ln -s conftest.file conftest.lnk
+ fi
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#if HAVE_UNISTD_H
+ # include <unistd.h>
+ #else /* on Windows with MSVC */
+ # include <io.h>
+ #endif
+ #include <errno.h>
+ ]GL_MDA_DEFINES],
+ [[int result = 0;
+ if (!unlink ("conftest.file/"))
+ result |= 1;
+ else if (errno != ENOTDIR)
+ result |= 2;
+#if HAVE_LSTAT
+ if (!unlink ("conftest.lnk/"))
+ result |= 4;
+ else if (errno != ENOTDIR)
+ result |= 8;
+#endif
+ return result;
+ ]])],
+ [gl_cv_func_unlink_honors_slashes=yes],
+ [gl_cv_func_unlink_honors_slashes=no],
+ [case "$host_os" in
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_unlink_honors_slashes="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_unlink_honors_slashes="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_unlink_honors_slashes="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_unlink_honors_slashes="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -f conftest.file conftest.lnk])
+ case "$gl_cv_func_unlink_honors_slashes" in
+ *no)
+ REPLACE_UNLINK=1
+ ;;
+ esac
+
+ dnl Detect Mac OS X 10.5.6 bug: On read-write HFS mounts, unlink("..") or
+ dnl unlink("../..") succeeds without doing anything.
+ AC_CACHE_CHECK([whether unlink of a parent directory fails as it should],
+ [gl_cv_func_unlink_parent_fails],
+ [case "$host_os" in
+ darwin*)
+ dnl Try to unlink a subdirectory of /tmp, because /tmp is usually on a
+ dnl HFS mount on Mac OS X. Use a subdirectory, owned by the current
+ dnl user, because otherwise unlink() may fail due to permissions
+ dnl reasons, and because when running as root we don't want to risk
+ dnl destroying the entire /tmp.
+ if {
+ # Use the mktemp program if available. If not available, hide the error
+ # message.
+ tmp=`(umask 077 && mktemp -d /tmp/gtXXXXXX) 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+ } ||
+ {
+ # Use a simple mkdir command. It is guaranteed to fail if the directory
+ # already exists. $RANDOM is bash specific and expands to empty in shells
+ # other than bash, ksh and zsh. Its use does not increase security;
+ # rather, it minimizes the probability of failure in a very cluttered /tmp
+ # directory.
+ tmp=/tmp/gt$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+ }; then
+ mkdir "$tmp/subdir"
+ GL_SUBDIR_FOR_UNLINK="$tmp/subdir"
+ export GL_SUBDIR_FOR_UNLINK
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+ #include <stdlib.h>
+ #if HAVE_UNISTD_H
+ # include <unistd.h>
+ #else /* on Windows with MSVC */
+ # include <direct.h>
+ # include <io.h>
+ #endif
+ ]GL_MDA_DEFINES[
+ int main ()
+ {
+ int result = 0;
+ if (chdir (getenv ("GL_SUBDIR_FOR_UNLINK")) != 0)
+ result |= 1;
+ else if (unlink ("..") == 0)
+ result |= 2;
+ return result;
+ }
+ ]])],
+ [gl_cv_func_unlink_parent_fails=yes],
+ [gl_cv_func_unlink_parent_fails=no],
+ [# If we don't know, obey --enable-cross-guesses.
+ gl_cv_func_unlink_parent_fails="$gl_cross_guess_normal"
+ ])
+ unset GL_SUBDIR_FOR_UNLINK
+ rm -rf "$tmp"
+ else
+ gl_cv_func_unlink_parent_fails="guessing no"
+ fi
+ ;;
+ *)
+ gl_cv_func_unlink_parent_fails="guessing yes"
+ ;;
+ esac
+ ])
+ case "$gl_cv_func_unlink_parent_fails" in
+ *no)
+ REPLACE_UNLINK=1
+ AC_DEFINE([UNLINK_PARENT_BUG], [1],
+ [Define to 1 if unlink() on a parent directory may succeed])
+ ;;
+ esac
+])
diff --git a/gl/m4/unlinkat.m4 b/gl/m4/unlinkat.m4
new file mode 100644
index 0000000..55af07d
--- /dev/null
+++ b/gl/m4/unlinkat.m4
@@ -0,0 +1,34 @@
+# unlinkat.m4 serial 2
+dnl Copyright (C) 2004-2022 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.
+
+# Written by Jim Meyering.
+
+AC_DEFUN([gl_FUNC_UNLINKAT],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_FUNCS_ONCE([unlinkat])
+ AC_REQUIRE([gl_FUNC_UNLINK])
+ AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+ if test $ac_cv_func_unlinkat = no; then
+ HAVE_UNLINKAT=0
+ else
+ case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
+ *no)
+ # Solaris 9 has *at functions, but uniformly mishandles trailing
+ # slash in all of them.
+ REPLACE_UNLINKAT=1
+ ;;
+ *)
+ # GNU/Hurd has unlinkat, but it has the same bug as unlink.
+ # Darwin has unlinkat, but it has the same UNLINK_PARENT_BUG.
+ if test $REPLACE_UNLINK = 1; then
+ REPLACE_UNLINKAT=1
+ fi
+ ;;
+ esac
+ fi
+])
diff --git a/gl/m4/utime.m4 b/gl/m4/utime.m4
new file mode 100644
index 0000000..d73e8aa
--- /dev/null
+++ b/gl/m4/utime.m4
@@ -0,0 +1,76 @@
+# utime.m4 serial 4
+dnl Copyright (C) 2017-2022 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_UTIME],
+[
+ AC_REQUIRE([gl_UTIME_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CHECK_FUNCS_ONCE([lstat])
+ case "$host_os" in
+ mingw*)
+ dnl On this platform, the original utime() or _utime() produces
+ dnl timestamps that are affected by the time zone.
+ dnl Use the function name 'rpl_utime' always, in order to avoid a
+ dnl possible conflict with the function name 'utime' from oldnames.lib
+ dnl (MSVC) or liboldnames.a (mingw).
+ REPLACE_UTIME=1
+ ;;
+ *)
+ AC_CHECK_FUNCS([utime])
+ if test $ac_cv_func_utime = no; then
+ HAVE_UTIME=0
+ else
+ dnl On macOS 10.13, utime("link-to-file/", NULL) mistakenly succeeds.
+ AC_CACHE_CHECK([whether utime handles trailing slashes on files],
+ [gl_cv_func_utime_file_slash],
+ [touch conftest.tmp
+ # Assume that if we have lstat, we can also check symlinks.
+ if test $ac_cv_func_lstat = yes; then
+ ln -s conftest.tmp conftest.lnk
+ fi
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stddef.h>
+ #include <utime.h>
+ ]],
+ [[int result = 0;
+ if (!utime ("conftest.tmp/", NULL))
+ result |= 1;
+ #if HAVE_LSTAT
+ if (!utime ("conftest.lnk/", NULL))
+ result |= 2;
+ #endif
+ return result;
+ ]])],
+ [gl_cv_func_utime_file_slash=yes],
+ [gl_cv_func_utime_file_slash=no],
+ [case "$host_os" in
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_utime_file_slash="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_utime_file_slash="guessing yes" ;;
+ # Guess no on macOS.
+ darwin*) gl_cv_func_utime_file_slash="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_utime_file_slash="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -f conftest.tmp conftest.lnk
+ ])
+ case $gl_cv_func_stat_file_slash in
+ *no)
+ REPLACE_UTIME=1
+ AC_DEFINE([REPLACE_FUNC_UTIME_FILE], [1],
+ [Define to 1 if utime needs help when passed a file name with a trailing slash])
+ ;;
+ esac
+ fi
+ ;;
+ esac
+])
+
+# Prerequisites of lib/utime.c.
+AC_DEFUN([gl_PREREQ_UTIME], [:])
diff --git a/gl/m4/utime_h.m4 b/gl/m4/utime_h.m4
new file mode 100644
index 0000000..739ef11
--- /dev/null
+++ b/gl/m4/utime_h.m4
@@ -0,0 +1,63 @@
+# utime_h.m4 serial 8
+dnl Copyright (C) 2017-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN_ONCE([gl_UTIME_H],
+[
+ AC_REQUIRE([gl_UTIME_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])])
+ AC_CHECK_HEADERS_ONCE([utime.h])
+ gl_CHECK_NEXT_HEADERS([utime.h])
+
+ if test $ac_cv_header_utime_h = yes; then
+ HAVE_UTIME_H=1
+ else
+ HAVE_UTIME_H=0
+ fi
+ AC_SUBST([HAVE_UTIME_H])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <utime.h>
+ ]],
+ [utime])
+])
+
+# gl_UTIME_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_UTIME_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_UTIME_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_UTIME_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_UTIME_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UTIME])
+ dnl Support Microsoft deprecated alias function names by default.
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_UTIME], [1])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_UTIME_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_UTIME_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_UTIME_H_DEFAULTS],
+[
+ dnl Assume POSIX behavior unless another module says otherwise.
+ HAVE_UTIME=1; AC_SUBST([HAVE_UTIME])
+ REPLACE_UTIME=0; AC_SUBST([REPLACE_UTIME])
+])
diff --git a/gl/m4/utimens.m4 b/gl/m4/utimens.m4
new file mode 100644
index 0000000..62aec78
--- /dev/null
+++ b/gl/m4/utimens.m4
@@ -0,0 +1,52 @@
+dnl Copyright (C) 2003-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl serial 11
+
+AC_DEFUN([gl_UTIMENS],
+[
+ dnl Prerequisites of lib/utimens.c.
+ AC_REQUIRE([gl_FUNC_UTIMES])
+ AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_FUNCS_ONCE([futimes futimesat futimens utimensat lutimes])
+
+ if test $ac_cv_func_futimens = no && test $ac_cv_func_futimesat = yes; then
+ dnl FreeBSD 8.0-rc2 mishandles futimesat(fd,NULL,time). It is not
+ dnl standardized, but Solaris implemented it first and uses it as
+ dnl its only means to set fd time.
+ AC_CACHE_CHECK([whether futimesat handles NULL file],
+ [gl_cv_func_futimesat_works],
+ [touch conftest.file
+ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <stddef.h>
+#include <sys/times.h>
+#include <fcntl.h>
+]GL_MDA_DEFINES],
+ [[int fd = open ("conftest.file", O_RDWR);
+ if (fd < 0) return 1;
+ if (futimesat (fd, NULL, NULL)) return 2;
+ ]])],
+ [gl_cv_func_futimesat_works=yes],
+ [gl_cv_func_futimesat_works=no],
+ [case "$host_os" in
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_futimesat_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_futimesat_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_futimesat_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -f conftest.file])
+ case "$gl_cv_func_futimesat_works" in
+ *yes) ;;
+ *)
+ AC_DEFINE([FUTIMESAT_NULL_BUG], [1],
+ [Define to 1 if futimesat mishandles a NULL file name.])
+ ;;
+ esac
+ fi
+])
diff --git a/gl/m4/utimes.m4 b/gl/m4/utimes.m4
new file mode 100644
index 0000000..bf22161
--- /dev/null
+++ b/gl/m4/utimes.m4
@@ -0,0 +1,161 @@
+# Detect some bugs in glibc's implementation of utimes.
+# serial 8
+
+dnl Copyright (C) 2003-2005, 2009-2022 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.
+
+# See if we need to work around bugs in glibc's implementation of
+# utimes from 2003-07-12 to 2003-09-17.
+# First, there was a bug that would make utimes set mtime
+# and atime to zero (1970-01-01) unconditionally.
+# Then, there was code to round rather than truncate.
+# Then, there was an implementation (sparc64, Linux-2.4.28, glibc-2.3.3)
+# that didn't honor the NULL-means-set-to-current-time semantics.
+# Finally, there was also a version of utimes that failed on read-only
+# files, while utime worked fine (linux-2.2.20, glibc-2.2.5).
+#
+# From Jim Meyering, with suggestions from Paul Eggert.
+
+AC_DEFUN([gl_FUNC_UTIMES],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether the utimes function works],
+ [gl_cv_func_working_utimes],
+ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/time.h>
+#include <time.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <utime.h>
+#include <errno.h>
+]GL_MDA_DEFINES[
+
+static int
+inorder (time_t a, time_t b, time_t c)
+{
+ return a <= b && b <= c;
+}
+
+int
+main ()
+{
+ int result = 0;
+ char const *file = "conftest.utimes";
+ /* On OS/2, file timestamps must be on or after 1980 in local time,
+ with an even number of seconds. */
+ static struct timeval timeval[2] = {{315620000 + 10, 10},
+ {315620000 + 1000000, 999998}};
+
+ /* Test whether utimes() essentially works. */
+ {
+ struct stat sbuf;
+ FILE *f = fopen (file, "w");
+ if (f == NULL)
+ result |= 1;
+ else if (fclose (f) != 0)
+ result |= 1;
+ else if (utimes (file, timeval) != 0)
+ result |= 2;
+ else if (lstat (file, &sbuf) != 0)
+ result |= 1;
+ else if (!(sbuf.st_atime == timeval[0].tv_sec
+ && sbuf.st_mtime == timeval[1].tv_sec))
+ result |= 4;
+ if (unlink (file) != 0)
+ result |= 1;
+ }
+
+ /* Test whether utimes() with a NULL argument sets the file's timestamp
+ to the current time. Use 'fstat' as well as 'time' to
+ determine the "current" time, to accommodate NFS file systems
+ if there is a time skew between the host and the NFS server. */
+ {
+ int fd = open (file, O_WRONLY|O_CREAT, 0644);
+ if (fd < 0)
+ result |= 1;
+ else
+ {
+ time_t t0, t2;
+ struct stat st0, st1, st2;
+ if (time (&t0) == (time_t) -1)
+ result |= 1;
+ else if (fstat (fd, &st0) != 0)
+ result |= 1;
+ else if (utimes (file, timeval) != 0
+ && (errno != EACCES
+ /* OS/2 kLIBC utimes fails on opened files. */
+ || close (fd) != 0
+ || utimes (file, timeval) != 0
+ || (fd = open (file, O_WRONLY)) < 0))
+ result |= 2;
+ else if (utimes (file, NULL) != 0
+ && (errno != EACCES
+ /* OS/2 kLIBC utimes fails on opened files. */
+ || close (fd) != 0
+ || utimes (file, NULL) != 0
+ || (fd = open (file, O_WRONLY)) < 0))
+ result |= 8;
+ else if (fstat (fd, &st1) != 0)
+ result |= 1;
+ else if (write (fd, "\n", 1) != 1)
+ result |= 1;
+ else if (fstat (fd, &st2) != 0)
+ result |= 1;
+ else if (time (&t2) == (time_t) -1)
+ result |= 1;
+ else
+ {
+ int m_ok_POSIX = inorder (t0, st1.st_mtime, t2);
+ int m_ok_NFS = inorder (st0.st_mtime, st1.st_mtime, st2.st_mtime);
+ if (! (st1.st_atime == st1.st_mtime))
+ result |= 16;
+ if (! (m_ok_POSIX || m_ok_NFS))
+ result |= 32;
+ }
+ if (close (fd) != 0)
+ result |= 1;
+ }
+ if (unlink (file) != 0)
+ result |= 1;
+ }
+
+ /* Test whether utimes() with a NULL argument works on read-only files. */
+ {
+ int fd = open (file, O_WRONLY|O_CREAT, 0444);
+ if (fd < 0)
+ result |= 1;
+ else if (close (fd) != 0)
+ result |= 1;
+ else if (utimes (file, NULL) != 0)
+ result |= 64;
+ if (unlink (file) != 0)
+ result |= 1;
+ }
+
+ return result;
+}
+ ]])],
+ [gl_cv_func_working_utimes=yes],
+ [gl_cv_func_working_utimes=no],
+ [case "$host_os" in
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_working_utimes="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_working_utimes="guessing no" ;;
+ *) gl_cv_func_working_utimes="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+
+ case "$gl_cv_func_working_utimes" in
+ *yes)
+ AC_DEFINE([HAVE_WORKING_UTIMES], [1], [Define if utimes works properly.])
+ ;;
+ esac
+])
diff --git a/gl/m4/vasnprintf.m4 b/gl/m4/vasnprintf.m4
new file mode 100644
index 0000000..afdece7
--- /dev/null
+++ b/gl/m4/vasnprintf.m4
@@ -0,0 +1,298 @@
+# vasnprintf.m4 serial 38
+dnl Copyright (C) 2002-2004, 2006-2022 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_VASNPRINTF],
+[
+ AC_CHECK_FUNCS_ONCE([vasnprintf])
+ if test $ac_cv_func_vasnprintf = no; then
+ gl_REPLACE_VASNPRINTF
+ fi
+])
+
+AC_DEFUN([gl_REPLACE_VASNPRINTF],
+[
+ AC_CHECK_FUNCS_ONCE([vasnprintf])
+ AC_LIBOBJ([vasnprintf])
+ AC_LIBOBJ([printf-args])
+ AC_LIBOBJ([printf-parse])
+ AC_LIBOBJ([asnprintf])
+ if test $ac_cv_func_vasnprintf = yes; then
+ AC_DEFINE([REPLACE_VASNPRINTF], [1],
+ [Define if vasnprintf exists but is overridden by gnulib.])
+ fi
+ gl_PREREQ_PRINTF_ARGS
+ gl_PREREQ_PRINTF_PARSE
+ gl_PREREQ_VASNPRINTF
+ gl_PREREQ_ASNPRINTF
+])
+
+# Prerequisites of lib/printf-args.h, lib/printf-args.c.
+AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
+[
+ AC_REQUIRE([gt_TYPE_WCHAR_T])
+ AC_REQUIRE([gt_TYPE_WINT_T])
+])
+
+# Prerequisites of lib/printf-parse.h, lib/printf-parse.c.
+AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
+[
+ AC_REQUIRE([gl_FEATURES_H])
+ AC_REQUIRE([gt_TYPE_WCHAR_T])
+ AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([AC_TYPE_SIZE_T])
+ AC_CHECK_TYPE([ptrdiff_t], ,
+ [AC_DEFINE([ptrdiff_t], [long],
+ [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
+ ])
+ AC_REQUIRE([gt_AC_TYPE_INTMAX_T])
+])
+
+# Prerequisites of lib/vasnprintf.c.
+AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
+[
+ AC_REQUIRE([AC_FUNC_ALLOCA])
+ AC_REQUIRE([gt_TYPE_WCHAR_T])
+ AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
+ dnl Use the _snprintf function only if it is declared (because on NetBSD it
+ dnl is defined as a weak alias of snprintf; we prefer to use the latter).
+ AC_CHECK_DECLS([_snprintf], , , [[#include <stdio.h>]])
+ dnl Knowing DBL_EXPBIT0_WORD and DBL_EXPBIT0_BIT enables an optimization
+ dnl in the code for NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE.
+ AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION])
+ dnl We can avoid a lot of code by assuming that snprintf's return value
+ dnl conforms to ISO C99. So check that.
+ AC_REQUIRE([gl_SNPRINTF_RETVAL_C99])
+ case "$gl_cv_func_snprintf_retval_c99" in
+ *yes)
+ AC_DEFINE([HAVE_SNPRINTF_RETVAL_C99], [1],
+ [Define if the return value of the snprintf function is the number of
+ of bytes (excluding the terminating NUL) that would have been produced
+ if the buffer had been large enough.])
+ ;;
+ esac
+ dnl Additionally, the use of %n can be eliminated by assuming that snprintf
+ dnl always produces NUL-terminated strings (no truncation).
+ AC_REQUIRE([gl_SNPRINTF_TRUNCATION_C99])
+ case "$gl_cv_func_snprintf_truncation_c99" in
+ *yes)
+ AC_DEFINE([HAVE_SNPRINTF_TRUNCATION_C99], [1],
+ [Define if the string produced by the snprintf function is always NUL
+ terminated.])
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting 'long double'
+# arguments.
+AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE],
+[
+ AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
+ case "$gl_cv_func_printf_long_double" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1],
+ [Define if the vasnprintf implementation needs special code for
+ 'long double' arguments.])
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting infinite 'double'
+# arguments.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE],
+[
+ AC_REQUIRE([gl_PRINTF_INFINITE])
+ case "$gl_cv_func_printf_infinite" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], [1],
+ [Define if the vasnprintf implementation needs special code for
+ infinite 'double' arguments.])
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting infinite 'long double'
+# arguments.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE],
+[
+ AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE])
+ dnl There is no need to set NEED_PRINTF_INFINITE_LONG_DOUBLE if
+ dnl NEED_PRINTF_LONG_DOUBLE is already set.
+ AC_REQUIRE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE])
+ case "$gl_cv_func_printf_long_double" in
+ *yes)
+ case "$gl_cv_func_printf_infinite_long_double" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], [1],
+ [Define if the vasnprintf implementation needs special code for
+ infinite 'long double' arguments.])
+ ;;
+ esac
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting the 'a' directive.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A],
+[
+ AC_REQUIRE([gl_PRINTF_DIRECTIVE_A])
+ case "$gl_cv_func_printf_directive_a" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], [1],
+ [Define if the vasnprintf implementation needs special code for
+ the 'a' and 'A' directives.])
+ AC_CHECK_FUNCS([nl_langinfo])
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting the 'F' directive.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F],
+[
+ AC_REQUIRE([gl_PRINTF_DIRECTIVE_F])
+ case "$gl_cv_func_printf_directive_f" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], [1],
+ [Define if the vasnprintf implementation needs special code for
+ the 'F' directive.])
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting the 'ls' directive.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_LS],
+[
+ AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS])
+ case "$gl_cv_func_printf_directive_ls" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_DIRECTIVE_LS], [1],
+ [Define if the vasnprintf implementation needs special code for
+ the 'ls' directive.])
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting the ' flag.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING],
+[
+ AC_REQUIRE([gl_PRINTF_FLAG_GROUPING])
+ case "$gl_cv_func_printf_flag_grouping" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], [1],
+ [Define if the vasnprintf implementation needs special code for the
+ ' flag.])
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting the '-' flag.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST],
+[
+ AC_REQUIRE([gl_PRINTF_FLAG_LEFTADJUST])
+ case "$gl_cv_func_printf_flag_leftadjust" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], [1],
+ [Define if the vasnprintf implementation needs special code for the
+ '-' flag.])
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting the 0 flag.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO],
+[
+ AC_REQUIRE([gl_PRINTF_FLAG_ZERO])
+ case "$gl_cv_func_printf_flag_zero" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_FLAG_ZERO], [1],
+ [Define if the vasnprintf implementation needs special code for the
+ 0 flag.])
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting large precisions.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION],
+[
+ AC_REQUIRE([gl_PRINTF_PRECISION])
+ case "$gl_cv_func_printf_precision" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], [1],
+ [Define if the vasnprintf implementation needs special code for
+ supporting large precisions without arbitrary bounds.])
+ AC_DEFINE([NEED_PRINTF_DOUBLE], [1],
+ [Define if the vasnprintf implementation needs special code for
+ 'double' arguments.])
+ AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1],
+ [Define if the vasnprintf implementation needs special code for
+ 'long double' arguments.])
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for surviving out-of-memory
+# conditions.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_ENOMEM],
+[
+ AC_REQUIRE([gl_PRINTF_ENOMEM])
+ case "$gl_cv_func_printf_enomem" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_ENOMEM], [1],
+ [Define if the vasnprintf implementation needs special code for
+ surviving out-of-memory conditions.])
+ AC_DEFINE([NEED_PRINTF_DOUBLE], [1],
+ [Define if the vasnprintf implementation needs special code for
+ 'double' arguments.])
+ AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1],
+ [Define if the vasnprintf implementation needs special code for
+ 'long double' arguments.])
+ ;;
+ esac
+])
+
+# Prerequisites of lib/vasnprintf.c including all extras for POSIX compliance.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_EXTRAS],
+[
+ AC_REQUIRE([gl_PREREQ_VASNPRINTF])
+ gl_PREREQ_VASNPRINTF_LONG_DOUBLE
+ gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE
+ gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE
+ gl_PREREQ_VASNPRINTF_DIRECTIVE_A
+ gl_PREREQ_VASNPRINTF_DIRECTIVE_F
+ gl_PREREQ_VASNPRINTF_DIRECTIVE_LS
+ gl_PREREQ_VASNPRINTF_FLAG_GROUPING
+ gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST
+ gl_PREREQ_VASNPRINTF_FLAG_ZERO
+ gl_PREREQ_VASNPRINTF_PRECISION
+ gl_PREREQ_VASNPRINTF_ENOMEM
+])
+
+# Prerequisites of lib/asnprintf.c.
+AC_DEFUN([gl_PREREQ_ASNPRINTF],
+[
+])
diff --git a/gl/m4/vasprintf.m4 b/gl/m4/vasprintf.m4
new file mode 100644
index 0000000..b92977b
--- /dev/null
+++ b/gl/m4/vasprintf.m4
@@ -0,0 +1,46 @@
+# vasprintf.m4 serial 6
+dnl Copyright (C) 2002-2003, 2006-2007, 2009-2022 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_VASPRINTF],
+[
+ AC_CHECK_FUNCS([vasprintf])
+ if test $ac_cv_func_vasprintf = no; then
+ gl_REPLACE_VASPRINTF
+ fi
+])
+
+AC_DEFUN([gl_REPLACE_VASPRINTF],
+[
+ AC_LIBOBJ([vasprintf])
+ AC_LIBOBJ([asprintf])
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ if test $ac_cv_func_vasprintf = yes; then
+ REPLACE_VASPRINTF=1
+ else
+ HAVE_VASPRINTF=0
+ fi
+ gl_PREREQ_VASPRINTF_H
+ gl_PREREQ_VASPRINTF
+ gl_PREREQ_ASPRINTF
+])
+
+# Prerequisites of the vasprintf portion of lib/stdio.h.
+AC_DEFUN([gl_PREREQ_VASPRINTF_H],
+[
+ dnl Persuade glibc <stdio.h> to declare asprintf() and vasprintf().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+])
+
+# Prerequisites of lib/vasprintf.c.
+AC_DEFUN([gl_PREREQ_VASPRINTF],
+[
+])
+
+# Prerequisites of lib/asprintf.c.
+AC_DEFUN([gl_PREREQ_ASPRINTF],
+[
+])
diff --git a/gl/m4/visibility.m4 b/gl/m4/visibility.m4
new file mode 100644
index 0000000..4a212a4
--- /dev/null
+++ b/gl/m4/visibility.m4
@@ -0,0 +1,82 @@
+# visibility.m4 serial 8
+dnl Copyright (C) 2005, 2008, 2010-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl Tests whether the compiler supports the command-line option
+dnl -fvisibility=hidden and the function and variable attributes
+dnl __attribute__((__visibility__("hidden"))) and
+dnl __attribute__((__visibility__("default"))).
+dnl Does *not* test for __visibility__("protected") - which has tricky
+dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
+dnl Mac OS X.
+dnl Does *not* test for __visibility__("internal") - which has processor
+dnl dependent semantics.
+dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
+dnl "really only recommended for legacy code".
+dnl Set the variable CFLAG_VISIBILITY.
+dnl Defines and sets the variable HAVE_VISIBILITY.
+
+AC_DEFUN([gl_VISIBILITY],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ CFLAG_VISIBILITY=
+ HAVE_VISIBILITY=0
+ if test -n "$GCC"; then
+ dnl First, check whether -Werror can be added to the command line, or
+ dnl whether it leads to an error because of some other option that the
+ dnl user has put into $CC $CFLAGS $CPPFLAGS.
+ AC_CACHE_CHECK([whether the -Werror option is usable],
+ [gl_cv_cc_vis_werror],
+ [gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]], [[]])],
+ [gl_cv_cc_vis_werror=yes],
+ [gl_cv_cc_vis_werror=no])
+ CFLAGS="$gl_save_CFLAGS"
+ ])
+ dnl Now check whether visibility declarations are supported.
+ AC_CACHE_CHECK([for simple visibility declarations],
+ [gl_cv_cc_visibility],
+ [gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+ dnl We use the option -Werror and a function dummyfunc, because on some
+ dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
+ dnl "visibility attribute not supported in this configuration; ignored"
+ dnl at the first function definition in every compilation unit, and we
+ dnl don't want to use the option in this case.
+ if test $gl_cv_cc_vis_werror = yes; then
+ CFLAGS="$CFLAGS -Werror"
+ fi
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+ extern __attribute__((__visibility__("default"))) int exportedvar;
+ extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+ extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+ void dummyfunc (void);
+ int hiddenvar;
+ int exportedvar;
+ int hiddenfunc (void) { return 51; }
+ int exportedfunc (void) { return 1225736919; }
+ void dummyfunc (void) {}
+ ]],
+ [[]])],
+ [gl_cv_cc_visibility=yes],
+ [gl_cv_cc_visibility=no])
+ CFLAGS="$gl_save_CFLAGS"
+ ])
+ if test $gl_cv_cc_visibility = yes; then
+ CFLAG_VISIBILITY="-fvisibility=hidden"
+ HAVE_VISIBILITY=1
+ fi
+ fi
+ AC_SUBST([CFLAG_VISIBILITY])
+ AC_SUBST([HAVE_VISIBILITY])
+ AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
+ [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
+])
diff --git a/gl/m4/vsnprintf.m4 b/gl/m4/vsnprintf.m4
new file mode 100644
index 0000000..02b448f
--- /dev/null
+++ b/gl/m4/vsnprintf.m4
@@ -0,0 +1,62 @@
+# vsnprintf.m4 serial 7
+dnl Copyright (C) 2002-2004, 2007-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Libintl 0.17 will replace vsnprintf only if it does not support %1$s,
+dnl but defers to any gnulib vsnprintf replacements. Therefore, gnulib
+dnl must guarantee that the decision for replacing vsnprintf is a superset
+dnl of the reasons checked by libintl.
+AC_DEFUN([gl_FUNC_VSNPRINTF],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ gl_cv_func_vsnprintf_usable=no
+ AC_CHECK_FUNCS([vsnprintf])
+ if test $ac_cv_func_vsnprintf = yes; then
+ gl_SNPRINTF_SIZE1
+ case "$gl_cv_func_snprintf_size1" in
+ *yes)
+ gl_SNPRINTF_RETVAL_C99
+ case "$gl_cv_func_snprintf_retval_c99" in
+ *yes)
+ gl_PRINTF_POSITIONS
+ case "$gl_cv_func_printf_positions" in
+ *yes)
+ gl_cv_func_vsnprintf_usable=yes
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ if test $gl_cv_func_vsnprintf_usable = no; then
+ gl_REPLACE_VSNPRINTF
+ fi
+ AC_CHECK_DECLS_ONCE([vsnprintf])
+ if test $ac_cv_have_decl_vsnprintf = no; then
+ HAVE_DECL_VSNPRINTF=0
+ fi
+])
+
+AC_DEFUN([gl_REPLACE_VSNPRINTF],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_LIBOBJ([vsnprintf])
+ if test $ac_cv_func_vsnprintf = yes; then
+ REPLACE_VSNPRINTF=1
+ else
+ AC_CHECK_DECLS_ONCE([vsnprintf])
+ if test $ac_cv_have_decl_vsnprintf = yes; then
+ dnl If the function is declared but does not appear to exist, it may be
+ dnl defined as an inline function. In order to avoid a conflict, we have
+ dnl to define rpl_vsnprintf, not vsnprintf.
+ REPLACE_VSNPRINTF=1
+ fi
+ fi
+ gl_PREREQ_VSNPRINTF
+])
+
+# Prerequisites of lib/vsnprintf.c.
+AC_DEFUN([gl_PREREQ_VSNPRINTF], [:])
diff --git a/gl/m4/warn-on-use.m4 b/gl/m4/warn-on-use.m4
new file mode 100644
index 0000000..d43355a
--- /dev/null
+++ b/gl/m4/warn-on-use.m4
@@ -0,0 +1,49 @@
+# warn-on-use.m4 serial 9
+dnl Copyright (C) 2010-2022 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.
+
+# gl_WARN_ON_USE_PREPARE(INCLUDES, NAMES)
+# ---------------------------------------
+# If the module 'posixcheck' is in use:
+#
+# For each whitespace-separated element in the list of NAMES, define
+# HAVE_RAW_DECL_name if the function has a declaration among INCLUDES
+# even after being undefined as a macro.
+#
+# See warn-on-use.h for some hints on how to poison function names, as
+# well as ideas on poisoning global variables and macros. NAMES may
+# include global variables, but remember that only functions work with
+# _GL_WARN_ON_USE. Typically, INCLUDES only needs to list a single
+# header, but if the replacement header pulls in other headers because
+# some systems declare functions in the wrong header, then INCLUDES
+# should do likewise.
+#
+# It is generally safe to assume declarations for functions declared
+# in the intersection of C89 and C11 (such as printf) without
+# needing gl_WARN_ON_USE_PREPARE.
+AC_DEFUN([gl_WARN_ON_USE_PREPARE],
+[
+ m4_ifdef([gl_POSIXCHECK],
+ [m4_foreach_w([gl_decl], [$2],
+ [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])),
+ [Define to 1 if ]m4_defn([gl_decl])[ is declared even after
+ undefining macros.])])dnl
+ for gl_func in m4_flatten([$2]); do
+ AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl
+ AC_CACHE_CHECK([whether $gl_func is declared without a macro],
+ [gl_Symbol],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1],
+[[#undef $gl_func
+ (void) $gl_func;]])],
+ [AS_VAR_SET([gl_Symbol], [yes])], [AS_VAR_SET([gl_Symbol], [no])])])
+ AS_VAR_IF([gl_Symbol], [yes],
+ [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
+ dnl shortcut - if the raw declaration exists, then set a cache
+ dnl variable to allow skipping any later AC_CHECK_DECL efforts
+ eval ac_cv_have_decl_$gl_func=yes])
+ AS_VAR_POPDEF([gl_Symbol])dnl
+ done
+ ])
+])
diff --git a/gl/m4/warnings.m4 b/gl/m4/warnings.m4
new file mode 100644
index 0000000..60088f9
--- /dev/null
+++ b/gl/m4/warnings.m4
@@ -0,0 +1,110 @@
+# warnings.m4 serial 16
+dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Simon Josefsson
+
+# gl_AS_VAR_APPEND(VAR, VALUE)
+# ----------------------------
+# Provide the functionality of AS_VAR_APPEND if Autoconf does not have it.
+m4_ifdef([AS_VAR_APPEND],
+[m4_copy([AS_VAR_APPEND], [gl_AS_VAR_APPEND])],
+[m4_define([gl_AS_VAR_APPEND],
+[AS_VAR_SET([$1], [AS_VAR_GET([$1])$2])])])
+
+
+# gl_COMPILER_OPTION_IF(OPTION, [IF-SUPPORTED], [IF-NOT-SUPPORTED],
+# [PROGRAM = AC_LANG_PROGRAM()])
+# -----------------------------------------------------------------
+# Check if the compiler supports OPTION when compiling PROGRAM.
+#
+# The effects of this macro depend on the current language (_AC_LANG).
+AC_DEFUN([gl_COMPILER_OPTION_IF],
+[
+AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl
+AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl
+AS_LITERAL_IF([$1],
+ [m4_pushdef([gl_Positive], m4_bpatsubst([$1], [^-Wno-], [-W]))],
+ [gl_positive="$1"
+case $gl_positive in
+ -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;;
+esac
+m4_pushdef([gl_Positive], [$gl_positive])])dnl
+AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], [gl_Warn], [
+ gl_save_compiler_FLAGS="$gl_Flags"
+ gl_AS_VAR_APPEND(m4_defn([gl_Flags]),
+ [" $gl_unknown_warnings_are_errors ]m4_defn([gl_Positive])["])
+ AC_LINK_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([[]])])],
+ [AS_VAR_SET([gl_Warn], [yes])],
+ [AS_VAR_SET([gl_Warn], [no])])
+ gl_Flags="$gl_save_compiler_FLAGS"
+])
+AS_VAR_IF(gl_Warn, [yes], [$2], [$3])
+m4_popdef([gl_Positive])dnl
+AS_VAR_POPDEF([gl_Flags])dnl
+AS_VAR_POPDEF([gl_Warn])dnl
+])
+
+# gl_UNKNOWN_WARNINGS_ARE_ERRORS
+# ------------------------------
+# Clang doesn't complain about unknown warning options unless one also
+# specifies -Wunknown-warning-option -Werror. Detect this.
+#
+# The effects of this macro depend on the current language (_AC_LANG).
+AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS],
+[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+
+# Specialization for _AC_LANG = C. This macro can be AC_REQUIREd.
+AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C)],
+[
+ AC_LANG_PUSH([C])
+ gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL
+ AC_LANG_POP([C])
+])
+
+# Specialization for _AC_LANG = C++. This macro can be AC_REQUIREd.
+AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)],
+[
+ AC_LANG_PUSH([C++])
+ gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL
+ AC_LANG_POP([C++])
+])
+
+# Specialization for _AC_LANG = Objective C. This macro can be AC_REQUIREd.
+AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(Objective C)],
+[
+ AC_LANG_PUSH([Objective C])
+ gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL
+ AC_LANG_POP([Objective C])
+])
+
+AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL],
+[gl_COMPILER_OPTION_IF([-Werror -Wunknown-warning-option],
+ [gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'],
+ [gl_unknown_warnings_are_errors=])])
+
+# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS/WARN_CXXFLAGS],
+# [PROGRAM = AC_LANG_PROGRAM()])
+# -----------------------------------------------------------
+# Adds parameter to WARN_CFLAGS/WARN_CXXFLAGS if the compiler supports it
+# when compiling PROGRAM. For example, gl_WARN_ADD([-Wparentheses]).
+#
+# If VARIABLE is a variable name, AC_SUBST it.
+#
+# The effects of this macro depend on the current language (_AC_LANG).
+AC_DEFUN([gl_WARN_ADD],
+[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS(]_AC_LANG[)])
+gl_COMPILER_OPTION_IF([$1],
+ [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_]_AC_LANG_PREFIX[FLAGS]], [[$2]]), [" $1"])],
+ [],
+ [$3])
+m4_ifval([$2],
+ [AS_LITERAL_IF([$2], [AC_SUBST([$2])])],
+ [AC_SUBST([WARN_]_AC_LANG_PREFIX[FLAGS])])dnl
+])
+
+# Local Variables:
+# mode: autoconf
+# End:
diff --git a/gl/m4/wchar_h.m4 b/gl/m4/wchar_h.m4
new file mode 100644
index 0000000..4baba1a
--- /dev/null
+++ b/gl/m4/wchar_h.m4
@@ -0,0 +1,257 @@
+dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
+
+dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Eric Blake.
+
+# wchar_h.m4 serial 55
+
+AC_DEFUN_ONCE([gl_WCHAR_H],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_REQUIRE([gl_WCHAR_H_INLINE_OK])
+ dnl Prepare for creating substitute <wchar.h>.
+ dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
+ dnl character support).
+ dnl <wchar.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([wchar.h])
+ if test $ac_cv_header_wchar_h = yes; then
+ HAVE_WCHAR_H=1
+ else
+ HAVE_WCHAR_H=0
+ fi
+ AC_SUBST([HAVE_WCHAR_H])
+
+ AC_REQUIRE([gl_FEATURES_H])
+
+ AC_REQUIRE([gt_TYPE_WINT_T])
+ if test $gt_cv_c_wint_t = yes; then
+ HAVE_WINT_T=1
+ else
+ HAVE_WINT_T=0
+ fi
+ AC_SUBST([HAVE_WINT_T])
+
+ AC_REQUIRE([gl_TYPE_WINT_T_PREREQ])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[
+ #include <wchar.h>
+ ]],
+ [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb
+ wcsrtombs wcsnrtombs wcwidth
+ wmemchr wmemcmp wmemcpy wmemmove wmempcpy wmemset
+ wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp
+ wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr
+ wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth wcsftime
+ ])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_CHECK_DECLS([wcsdup], [], [], [[
+ #include <wchar.h>
+ ]])
+ if test $ac_cv_have_decl_wcsdup = no; then
+ HAVE_DECL_WCSDUP=0
+ fi
+])
+
+dnl Check whether <wchar.h> is usable at all.
+AC_DEFUN([gl_WCHAR_H_INLINE_OK],
+[
+ dnl Test whether <wchar.h> suffers due to the transition from '__inline' to
+ dnl 'gnu_inline'. See <https://sourceware.org/bugzilla/show_bug.cgi?id=4022>
+ dnl and <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>. In summary,
+ dnl glibc version 2.5 or older, together with gcc version 4.3 or newer and
+ dnl the option -std=c99 or -std=gnu99, leads to a broken <wchar.h>.
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([whether <wchar.h> uses 'inline' correctly],
+ [gl_cv_header_wchar_h_correct_inline],
+ [gl_cv_header_wchar_h_correct_inline=yes
+ case "$host_os" in
+ *-gnu* | gnu*)
+ AC_LANG_CONFTEST([
+ AC_LANG_SOURCE([[
+ #define wcstod renamed_wcstod
+ #include <wchar.h>
+ extern int zero (void);
+ int main () { return zero(); }
+ ]])])
+ dnl Do not rename the object file from conftest.$ac_objext to
+ dnl conftest1.$ac_objext, as this will cause the link to fail on
+ dnl z/OS when using the XPLINK object format (due to duplicate
+ dnl CSECT names). Instead, temporarily redefine $ac_compile so
+ dnl that the object file has the latter name from the start.
+ save_ac_compile="$ac_compile"
+ ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
+ if echo '#include "conftest.c"' >conftest1.c \
+ && AC_TRY_EVAL([ac_compile]); then
+ AC_LANG_CONFTEST([
+ AC_LANG_SOURCE([[
+ #define wcstod renamed_wcstod
+ #include <wchar.h>
+ int zero (void) { return 0; }
+ ]])])
+ dnl See note above about renaming object files.
+ ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
+ if echo '#include "conftest.c"' >conftest2.c \
+ && AC_TRY_EVAL([ac_compile]); then
+ if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then
+ :
+ else
+ gl_cv_header_wchar_h_correct_inline=no
+ fi
+ fi
+ fi
+ ac_compile="$save_ac_compile"
+ rm -f conftest[12].c conftest[12].$ac_objext conftest$ac_exeext
+ ;;
+ esac
+ ])
+ if test $gl_cv_header_wchar_h_correct_inline = no; then
+ AC_MSG_ERROR([<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
+This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
+C99 mode. You have four options:
+ - Add the flag -fgnu89-inline to CC and reconfigure, or
+ - Fix your include files, using parts of
+ <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
+ - Use a gcc version older than 4.3, or
+ - Don't use the flags -std=c99 or -std=gnu99.
+Configuration aborted.])
+ fi
+])
+
+# gl_WCHAR_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_WCHAR_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_WCHAR_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_WCHAR_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_BTOWC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTOB])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSINIT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBRTOWC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBRLEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSRTOWCS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSNRTOWCS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCRTOMB])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSRTOMBS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNRTOMBS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCWIDTH])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMCHR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMCMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMCPY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMMOVE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMPCPY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMSET])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSLEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNLEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCPY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCPCPY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNCPY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCPNCPY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNCAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNCMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCASECMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNCASECMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCOLL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSXFRM])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSDUP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCHR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSRCHR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCSPN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSSPN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSPBRK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSSTR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSTOK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSWIDTH])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSFTIME])
+ dnl Support Microsoft deprecated alias function names by default.
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_WCSDUP], [1])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_WCHAR_H_MODULE_INDICATOR_DEFAULTS])
+ dnl Make sure the shell variable for GNULIB_FREE_POSIX is initialized.
+ gl_STDLIB_H_REQUIRE_DEFAULTS
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_WCHAR_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC])
+ HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT])
+ HAVE_MBRTOWC=1; AC_SUBST([HAVE_MBRTOWC])
+ HAVE_MBRLEN=1; AC_SUBST([HAVE_MBRLEN])
+ HAVE_MBSRTOWCS=1; AC_SUBST([HAVE_MBSRTOWCS])
+ HAVE_MBSNRTOWCS=1; AC_SUBST([HAVE_MBSNRTOWCS])
+ HAVE_WCRTOMB=1; AC_SUBST([HAVE_WCRTOMB])
+ HAVE_WCSRTOMBS=1; AC_SUBST([HAVE_WCSRTOMBS])
+ HAVE_WCSNRTOMBS=1; AC_SUBST([HAVE_WCSNRTOMBS])
+ HAVE_WMEMCHR=1; AC_SUBST([HAVE_WMEMCHR])
+ HAVE_WMEMCMP=1; AC_SUBST([HAVE_WMEMCMP])
+ HAVE_WMEMCPY=1; AC_SUBST([HAVE_WMEMCPY])
+ HAVE_WMEMMOVE=1; AC_SUBST([HAVE_WMEMMOVE])
+ HAVE_WMEMPCPY=1; AC_SUBST([HAVE_WMEMPCPY])
+ HAVE_WMEMSET=1; AC_SUBST([HAVE_WMEMSET])
+ HAVE_WCSLEN=1; AC_SUBST([HAVE_WCSLEN])
+ HAVE_WCSNLEN=1; AC_SUBST([HAVE_WCSNLEN])
+ HAVE_WCSCPY=1; AC_SUBST([HAVE_WCSCPY])
+ HAVE_WCPCPY=1; AC_SUBST([HAVE_WCPCPY])
+ HAVE_WCSNCPY=1; AC_SUBST([HAVE_WCSNCPY])
+ HAVE_WCPNCPY=1; AC_SUBST([HAVE_WCPNCPY])
+ HAVE_WCSCAT=1; AC_SUBST([HAVE_WCSCAT])
+ HAVE_WCSNCAT=1; AC_SUBST([HAVE_WCSNCAT])
+ HAVE_WCSCMP=1; AC_SUBST([HAVE_WCSCMP])
+ HAVE_WCSNCMP=1; AC_SUBST([HAVE_WCSNCMP])
+ HAVE_WCSCASECMP=1; AC_SUBST([HAVE_WCSCASECMP])
+ HAVE_WCSNCASECMP=1; AC_SUBST([HAVE_WCSNCASECMP])
+ HAVE_WCSCOLL=1; AC_SUBST([HAVE_WCSCOLL])
+ HAVE_WCSXFRM=1; AC_SUBST([HAVE_WCSXFRM])
+ HAVE_WCSDUP=1; AC_SUBST([HAVE_WCSDUP])
+ HAVE_WCSCHR=1; AC_SUBST([HAVE_WCSCHR])
+ HAVE_WCSRCHR=1; AC_SUBST([HAVE_WCSRCHR])
+ HAVE_WCSCSPN=1; AC_SUBST([HAVE_WCSCSPN])
+ HAVE_WCSSPN=1; AC_SUBST([HAVE_WCSSPN])
+ HAVE_WCSPBRK=1; AC_SUBST([HAVE_WCSPBRK])
+ HAVE_WCSSTR=1; AC_SUBST([HAVE_WCSSTR])
+ HAVE_WCSTOK=1; AC_SUBST([HAVE_WCSTOK])
+ HAVE_WCSWIDTH=1; AC_SUBST([HAVE_WCSWIDTH])
+ HAVE_WCSFTIME=1; AC_SUBST([HAVE_WCSFTIME])
+ HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB])
+ HAVE_DECL_WCSDUP=1; AC_SUBST([HAVE_DECL_WCSDUP])
+ HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH])
+ REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T])
+ REPLACE_BTOWC=0; AC_SUBST([REPLACE_BTOWC])
+ REPLACE_WCTOB=0; AC_SUBST([REPLACE_WCTOB])
+ REPLACE_MBSINIT=0; AC_SUBST([REPLACE_MBSINIT])
+ REPLACE_MBRTOWC=0; AC_SUBST([REPLACE_MBRTOWC])
+ REPLACE_MBRLEN=0; AC_SUBST([REPLACE_MBRLEN])
+ REPLACE_MBSRTOWCS=0; AC_SUBST([REPLACE_MBSRTOWCS])
+ REPLACE_MBSNRTOWCS=0; AC_SUBST([REPLACE_MBSNRTOWCS])
+ REPLACE_WCRTOMB=0; AC_SUBST([REPLACE_WCRTOMB])
+ REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS])
+ REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS])
+ REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH])
+ REPLACE_WCSWIDTH=0; AC_SUBST([REPLACE_WCSWIDTH])
+ REPLACE_WCSFTIME=0; AC_SUBST([REPLACE_WCSFTIME])
+ REPLACE_WCSTOK=0; AC_SUBST([REPLACE_WCSTOK])
+])
diff --git a/gl/m4/wchar_t.m4 b/gl/m4/wchar_t.m4
new file mode 100644
index 0000000..268e3e5
--- /dev/null
+++ b/gl/m4/wchar_t.m4
@@ -0,0 +1,24 @@
+# wchar_t.m4 serial 4 (gettext-0.18.2)
+dnl Copyright (C) 2002-2003, 2008-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Test whether <stddef.h> has the 'wchar_t' type.
+dnl Prerequisite: AC_PROG_CC
+
+AC_DEFUN([gt_TYPE_WCHAR_T],
+[
+ AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stddef.h>
+ wchar_t foo = (wchar_t)'\0';]],
+ [[]])],
+ [gt_cv_c_wchar_t=yes],
+ [gt_cv_c_wchar_t=no])])
+ if test $gt_cv_c_wchar_t = yes; then
+ AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.])
+ fi
+])
diff --git a/gl/m4/wcrtomb.m4 b/gl/m4/wcrtomb.m4
new file mode 100644
index 0000000..fee21d7
--- /dev/null
+++ b/gl/m4/wcrtomb.m4
@@ -0,0 +1,146 @@
+# wcrtomb.m4 serial 17
+dnl Copyright (C) 2008-2022 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_WCRTOMB],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+
+ AC_REQUIRE([AC_TYPE_MBSTATE_T])
+ gl_MBSTATE_T_BROKEN
+
+ AC_CHECK_FUNCS_ONCE([wcrtomb])
+ if test $ac_cv_func_wcrtomb = no; then
+ HAVE_WCRTOMB=0
+ AC_CHECK_DECLS([wcrtomb],,, [[
+ #include <wchar.h>
+ ]])
+ if test $ac_cv_have_decl_wcrtomb = yes; then
+ dnl On Minix 3.1.8, the system's <wchar.h> declares wcrtomb() although
+ dnl it does not have the function. Avoid a collision with gnulib's
+ dnl replacement.
+ REPLACE_WCRTOMB=1
+ fi
+ else
+ dnl We don't actually need to override wcrtomb when redefining the semantics
+ dnl of the mbstate_t type. Tested on 32-bit AIX.
+ dnl if test $REPLACE_MBSTATE_T = 1; then
+ dnl REPLACE_WCRTOMB=1
+ dnl fi
+ if test $REPLACE_WCRTOMB = 0; then
+ dnl On Android 4.3, wcrtomb produces wrong characters in the C locale.
+ dnl On AIX 4.3, OSF/1 5.1 and Solaris <= 11.3, wcrtomb (NULL, 0, NULL)
+ dnl sometimes returns 0 instead of 1.
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gt_LOCALE_FR])
+ AC_REQUIRE([gt_LOCALE_FR_UTF8])
+ AC_REQUIRE([gt_LOCALE_JA])
+ AC_REQUIRE([gt_LOCALE_ZH_CN])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether wcrtomb works in the C locale],
+ [gl_cv_func_wcrtomb_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <string.h>
+#include <stdlib.h>
+#include <wchar.h>
+int main ()
+{
+ mbstate_t state;
+ char out[64];
+ int count;
+ memset (&state, 0, sizeof (state));
+ out[0] = 'x';
+ count = wcrtomb (out, L'a', &state);
+ return !(count == 1 && out[0] == 'a');
+}]])],
+ [gl_cv_func_wcrtomb_works=yes],
+ [gl_cv_func_wcrtomb_works=no],
+ [case "$host_os" in
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_wcrtomb_works="guessing no";;
+ # Guess yes otherwise.
+ *) gl_cv_func_wcrtomb_works="guessing yes";;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_wcrtomb_works" in
+ *yes) ;;
+ *) AC_DEFINE([WCRTOMB_C_LOCALE_BUG], [1],
+ [Define if the wcrtomb function does not work in the C locale.])
+ REPLACE_WCRTOMB=1 ;;
+ esac
+ fi
+ if test $REPLACE_WCRTOMB = 0; then
+ AC_CACHE_CHECK([whether wcrtomb return value is correct],
+ [gl_cv_func_wcrtomb_retval],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on AIX 4, OSF/1, Solaris, native Windows.
+ aix4* | osf* | solaris* | mingw*) gl_cv_func_wcrtomb_retval="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_wcrtomb_retval="guessing yes" ;;
+ esac
+changequote([,])dnl
+ if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+#include <stdlib.h>
+int main ()
+{
+ int result = 0;
+ if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+ {
+ if (wcrtomb (NULL, 0, NULL) != 1)
+ result |= 1;
+ }
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ if (wcrtomb (NULL, 0, NULL) != 1)
+ result |= 2;
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ if (mbtowc (&wc, "\303\274", 2) == 2)
+ if (wcrtomb (NULL, wc, NULL) != 1)
+ result |= 2;
+ }
+ }
+ if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+ {
+ if (wcrtomb (NULL, 0, NULL) != 1)
+ result |= 4;
+ }
+ if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+ {
+ if (wcrtomb (NULL, 0, NULL) != 1)
+ result |= 8;
+ }
+ return result;
+}]])],
+ [gl_cv_func_wcrtomb_retval=yes],
+ [gl_cv_func_wcrtomb_retval=no],
+ [:])
+ fi
+ ])
+ case "$gl_cv_func_wcrtomb_retval" in
+ *yes) ;;
+ *) AC_DEFINE([WCRTOMB_RETVAL_BUG], [1],
+ [Define if the wcrtomb function has an incorrect return value.])
+ REPLACE_WCRTOMB=1 ;;
+ esac
+ fi
+ fi
+])
+
+# Prerequisites of lib/wcrtomb.c.
+AC_DEFUN([gl_PREREQ_WCRTOMB], [
+ :
+])
diff --git a/gl/m4/wctype_h.m4 b/gl/m4/wctype_h.m4
new file mode 100644
index 0000000..702cb39
--- /dev/null
+++ b/gl/m4/wctype_h.m4
@@ -0,0 +1,200 @@
+# wctype_h.m4 serial 30
+
+dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
+
+dnl Copyright (C) 2006-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Paul Eggert.
+
+AC_DEFUN_ONCE([gl_WCTYPE_H],
+[
+ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CHECK_FUNCS_ONCE([iswcntrl])
+ if test $ac_cv_func_iswcntrl = yes; then
+ HAVE_ISWCNTRL=1
+ else
+ HAVE_ISWCNTRL=0
+ fi
+ AC_SUBST([HAVE_ISWCNTRL])
+
+ AC_REQUIRE([gt_TYPE_WINT_T])
+ if test $gt_cv_c_wint_t = yes; then
+ HAVE_WINT_T=1
+ else
+ HAVE_WINT_T=0
+ fi
+ AC_SUBST([HAVE_WINT_T])
+
+ AC_REQUIRE([gl_TYPE_WINT_T_PREREQ])
+
+ gl_CHECK_NEXT_HEADERS([wctype.h])
+ if test $ac_cv_header_wctype_h = yes; then
+ if test $ac_cv_func_iswcntrl = yes; then
+ dnl Linux libc5 has an iswprint function that returns 0 for all arguments.
+ dnl The other functions are likely broken in the same way.
+ AC_CACHE_CHECK([whether iswcntrl works], [gl_cv_func_iswcntrl_works],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+ #include <wchar.h>
+ #include <wctype.h>
+ int main () { return iswprint ('x') == 0; }
+ ]])],
+ [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no],
+ [dnl Guess no on Linux libc5, yes otherwise.
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
+ #if __GNU_LIBRARY__ == 1
+ Linux libc5 i18n is broken.
+ #endif]], [[]])],
+ [gl_cv_func_iswcntrl_works="guessing yes"],
+ [gl_cv_func_iswcntrl_works="guessing no"])
+ ])
+ ])
+ fi
+ HAVE_WCTYPE_H=1
+ else
+ HAVE_WCTYPE_H=0
+ fi
+ AC_SUBST([HAVE_WCTYPE_H])
+
+ if test $GNULIBHEADERS_OVERRIDE_WINT_T = 1; then
+ REPLACE_ISWCNTRL=1
+ else
+ case "$gl_cv_func_iswcntrl_works" in
+ *yes) REPLACE_ISWCNTRL=0 ;;
+ *) REPLACE_ISWCNTRL=1 ;;
+ esac
+ fi
+ AC_SUBST([REPLACE_ISWCNTRL])
+
+ if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+ dnl Redefine all of iswcntrl, ..., iswxdigit in <wctype.h>.
+ :
+ fi
+
+ if test $REPLACE_ISWCNTRL = 1; then
+ REPLACE_TOWLOWER=1
+ else
+ AC_CHECK_FUNCS([towlower])
+ if test $ac_cv_func_towlower = yes; then
+ REPLACE_TOWLOWER=0
+ else
+ AC_CHECK_DECLS([towlower],,,
+ [[#include <wchar.h>
+ #if HAVE_WCTYPE_H
+ # include <wctype.h>
+ #endif
+ ]])
+ if test $ac_cv_have_decl_towlower = yes; then
+ dnl On Minix 3.1.8, the system's <wctype.h> declares towlower() and
+ dnl towupper() although it does not have the functions. Avoid a
+ dnl collision with gnulib's replacement.
+ REPLACE_TOWLOWER=1
+ else
+ REPLACE_TOWLOWER=0
+ fi
+ fi
+ fi
+ AC_SUBST([REPLACE_TOWLOWER])
+
+ if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then
+ dnl Redefine towlower, towupper in <wctype.h>.
+ :
+ fi
+
+ dnl We assume that the wctype() and iswctype() functions exist if and only
+ dnl if the type wctype_t is defined in <wchar.h> or in <wctype.h> if that
+ dnl exists.
+ dnl HP-UX 11.00 declares all these in <wchar.h> and lacks <wctype.h>.
+ AC_CACHE_CHECK([for wctype_t], [gl_cv_type_wctype_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <wchar.h>
+ #if HAVE_WCTYPE_H
+ # include <wctype.h>
+ #endif
+ wctype_t a;
+ ]],
+ [[]])],
+ [gl_cv_type_wctype_t=yes],
+ [gl_cv_type_wctype_t=no])
+ ])
+ if test $gl_cv_type_wctype_t = no; then
+ HAVE_WCTYPE_T=0
+ fi
+
+ dnl We assume that the wctrans() and towctrans() functions exist if and only
+ dnl if the type wctrans_t is defined in <wctype.h>.
+ AC_CACHE_CHECK([for wctrans_t], [gl_cv_type_wctrans_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <wchar.h>
+ #include <wctype.h>
+ wctrans_t a;
+ ]],
+ [[]])],
+ [gl_cv_type_wctrans_t=yes],
+ [gl_cv_type_wctrans_t=no])
+ ])
+ if test $gl_cv_type_wctrans_t = no; then
+ HAVE_WCTRANS_T=0
+ fi
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <wchar.h>
+#endif
+#include <wctype.h>
+ ]],
+ [wctype iswctype wctrans towctrans
+ ])
+])
+
+# gl_WCTYPE_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_WCTYPE_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_WCTYPE_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_WCTYPE_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_WCTYPE_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWBLANK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWDIGIT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWXDIGIT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTYPE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWCTYPE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTRANS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOWCTRANS])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_WCTYPE_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_WCTYPE_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_ISWBLANK=1; AC_SUBST([HAVE_ISWBLANK])
+ HAVE_WCTYPE_T=1; AC_SUBST([HAVE_WCTYPE_T])
+ HAVE_WCTRANS_T=1; AC_SUBST([HAVE_WCTRANS_T])
+ REPLACE_ISWBLANK=0; AC_SUBST([REPLACE_ISWBLANK])
+ REPLACE_ISWDIGIT=0; AC_SUBST([REPLACE_ISWDIGIT])
+ REPLACE_ISWXDIGIT=0; AC_SUBST([REPLACE_ISWXDIGIT])
+])
diff --git a/gl/m4/wint_t.m4 b/gl/m4/wint_t.m4
new file mode 100644
index 0000000..adc5866
--- /dev/null
+++ b/gl/m4/wint_t.m4
@@ -0,0 +1,57 @@
+# wint_t.m4 serial 11
+dnl Copyright (C) 2003, 2007-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Test whether <wchar.h> has the 'wint_t' type and whether gnulib's
+dnl <wchar.h> or <wctype.h> would, if present, override 'wint_t'.
+dnl Prerequisite: AC_PROG_CC
+
+AC_DEFUN([gt_TYPE_WINT_T],
+[
+ AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <wchar.h>
+ wint_t foo = (wchar_t)'\0';]],
+ [[]])],
+ [gt_cv_c_wint_t=yes],
+ [gt_cv_c_wint_t=no])])
+ if test $gt_cv_c_wint_t = yes; then
+ AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.])
+
+ dnl Determine whether gnulib's <wchar.h> or <wctype.h> would, if present,
+ dnl override 'wint_t'.
+ AC_CACHE_CHECK([whether wint_t is large enough],
+ [gl_cv_type_wint_t_large_enough],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <wchar.h>
+ int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
+ ]])],
+ [gl_cv_type_wint_t_large_enough=yes],
+ [gl_cv_type_wint_t_large_enough=no])])
+ if test $gl_cv_type_wint_t_large_enough = no; then
+ GNULIBHEADERS_OVERRIDE_WINT_T=1
+ else
+ GNULIBHEADERS_OVERRIDE_WINT_T=0
+ fi
+ else
+ GNULIBHEADERS_OVERRIDE_WINT_T=0
+ fi
+ AC_SUBST([GNULIBHEADERS_OVERRIDE_WINT_T])
+])
+
+dnl Prerequisites of the 'wint_t' override.
+AC_DEFUN([gl_TYPE_WINT_T_PREREQ],
+[
+ AC_CHECK_HEADERS_ONCE([crtdefs.h])
+ if test $ac_cv_header_crtdefs_h = yes; then
+ HAVE_CRTDEFS_H=1
+ else
+ HAVE_CRTDEFS_H=0
+ fi
+ AC_SUBST([HAVE_CRTDEFS_H])
+])
diff --git a/gl/m4/wmemchr.m4 b/gl/m4/wmemchr.m4
new file mode 100644
index 0000000..e75b551
--- /dev/null
+++ b/gl/m4/wmemchr.m4
@@ -0,0 +1,25 @@
+# wmemchr.m4 serial 5
+dnl Copyright (C) 2011-2022 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_WMEMCHR],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ dnl We cannot use AC_CHECK_FUNCS here, because the MSVC 9 header files
+ dnl provide this function as an inline function definition.
+ AC_CACHE_CHECK([for wmemchr], [gl_cv_func_wmemchr],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <wchar.h>
+ ]],
+ [[return ! wmemchr ((const wchar_t *) 0, (wchar_t) ' ', 0);]])
+ ],
+ [gl_cv_func_wmemchr=yes],
+ [gl_cv_func_wmemchr=no])
+ ])
+ if test $gl_cv_func_wmemchr = no; then
+ HAVE_WMEMCHR=0
+ fi
+])
diff --git a/gl/m4/wmempcpy.m4 b/gl/m4/wmempcpy.m4
new file mode 100644
index 0000000..9765039
--- /dev/null
+++ b/gl/m4/wmempcpy.m4
@@ -0,0 +1,21 @@
+# wmempcpy.m4 serial 1
+dnl Copyright (C) 2020-2022 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_WMEMPCPY],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+
+ dnl Persuade glibc <wchar.h> to declare wmempcpy().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ dnl The wmempcpy() declaration in lib/wchar.in.h uses 'restrict'.
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_CHECK_FUNCS_ONCE([wmempcpy])
+ if test $ac_cv_func_wmempcpy = no; then
+ HAVE_WMEMPCPY=0
+ fi
+])
diff --git a/gl/m4/xalloc.m4 b/gl/m4/xalloc.m4
new file mode 100644
index 0000000..17a9c06
--- /dev/null
+++ b/gl/m4/xalloc.m4
@@ -0,0 +1,7 @@
+# xalloc.m4 serial 18
+dnl Copyright (C) 2002-2006, 2009-2022 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_XALLOC], [:])
diff --git a/gl/m4/xgetcwd.m4 b/gl/m4/xgetcwd.m4
new file mode 100644
index 0000000..8b48535
--- /dev/null
+++ b/gl/m4/xgetcwd.m4
@@ -0,0 +1,10 @@
+#serial 8
+dnl Copyright (C) 2002-2006, 2009-2022 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_XGETCWD],
+[
+ :
+])
diff --git a/gl/m4/xsize.m4 b/gl/m4/xsize.m4
new file mode 100644
index 0000000..0109049
--- /dev/null
+++ b/gl/m4/xsize.m4
@@ -0,0 +1,12 @@
+# xsize.m4 serial 5
+dnl Copyright (C) 2003-2004, 2008-2022 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_XSIZE],
+[
+ dnl Prerequisites of lib/xsize.h.
+ AC_REQUIRE([gl_SIZE_MAX])
+ AC_CHECK_HEADERS([stdint.h])
+])
diff --git a/gl/m4/xstrndup.m4 b/gl/m4/xstrndup.m4
new file mode 100644
index 0000000..41eabd3
--- /dev/null
+++ b/gl/m4/xstrndup.m4
@@ -0,0 +1,15 @@
+# xstrndup.m4 serial 2
+dnl Copyright (C) 2003, 2009-2022 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_XSTRNDUP],
+[
+ gl_PREREQ_XSTRNDUP
+])
+
+# Prerequisites of lib/xstrndup.c.
+AC_DEFUN([gl_PREREQ_XSTRNDUP], [
+ :
+])
diff --git a/gl/m4/xvasprintf.m4 b/gl/m4/xvasprintf.m4
new file mode 100644
index 0000000..10480a2
--- /dev/null
+++ b/gl/m4/xvasprintf.m4
@@ -0,0 +1,8 @@
+# xvasprintf.m4 serial 2
+dnl Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Prerequisites of lib/xvasprintf.c.
+AC_DEFUN([gl_XVASPRINTF], [:])
diff --git a/gl/m4/year2038.m4 b/gl/m4/year2038.m4
new file mode 100644
index 0000000..06db589
--- /dev/null
+++ b/gl/m4/year2038.m4
@@ -0,0 +1,124 @@
+# year2038.m4 serial 7
+dnl Copyright (C) 2017-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Attempt to ensure that 'time_t' can go past the year 2038 and that
+dnl the functions 'time', 'stat', etc. work with post-2038 timestamps.
+
+AC_DEFUN([gl_YEAR2038_EARLY],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ mingw*)
+ AC_DEFINE([__MINGW_USE_VC2005_COMPAT], [1],
+ [For 64-bit time_t on 32-bit mingw.])
+ ;;
+ esac
+])
+
+# gl_YEAR2038_TEST_INCLUDES
+# -------------------------
+AC_DEFUN([gl_YEAR2038_TEST_INCLUDES],
+[[
+ #include <time.h>
+ /* Check that time_t can represent 2**32 - 1 correctly. */
+ #define LARGE_TIME_T \\
+ ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30)))
+ int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535
+ && LARGE_TIME_T % 65537 == 0)
+ ? 1 : -1];
+]])
+
+# gl_YEAR2038_BODY(REQUIRE-YEAR2038-SAFE)
+-----------------------------------------
+AC_DEFUN([gl_YEAR2038_BODY],
+[
+ AC_ARG_ENABLE([year2038],
+ [ --disable-year2038 omit support for timestamps past the year 2038])
+ AS_IF([test "$enable_year2038" != no],
+ [
+ dnl On many systems, time_t is already a 64-bit type.
+ dnl On those systems where time_t is still 32-bit, it requires kernel
+ dnl and libc support to make it 64-bit. For glibc 2.34 and later on Linux,
+ dnl defining _TIME_BITS=64 and _FILE_OFFSET_BITS=64 is needed on x86 and ARM.
+ dnl
+ dnl On native Windows, the system include files define types __time32_t
+ dnl and __time64_t. By default, time_t is an alias of
+ dnl - __time32_t on 32-bit mingw,
+ dnl - __time64_t on 64-bit mingw and on MSVC (since MSVC 8).
+ dnl But when compiling with -D__MINGW_USE_VC2005_COMPAT, time_t is an
+ dnl alias of __time64_t.
+ dnl And when compiling with -D_USE_32BIT_TIME_T, time_t is an alias of
+ dnl __time32_t.
+ AC_CACHE_CHECK([for time_t past the year 2038], [gl_cv_type_time_t_y2038],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([gl_YEAR2038_TEST_INCLUDES])],
+ [gl_cv_type_time_t_y2038=yes], [gl_cv_type_time_t_y2038=no])
+ ])
+ if test "$gl_cv_type_time_t_y2038" = no; then
+ AC_CACHE_CHECK([for 64-bit time_t with _TIME_BITS=64],
+ [gl_cv_type_time_t_bits_macro],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([[#define _TIME_BITS 64
+ #define _FILE_OFFSET_BITS 64
+ ]gl_YEAR2038_TEST_INCLUDES])],
+ [gl_cv_type_time_t_bits_macro=yes],
+ [gl_cv_type_time_t_bits_macro=no])
+ ])
+ if test "$gl_cv_type_time_t_bits_macro" = yes; then
+ AC_DEFINE([_TIME_BITS], [64],
+ [Number of bits in a timestamp, on hosts where this is settable.])
+ dnl AC_SYS_LARGFILE also defines this; it's OK if we do too.
+ AC_DEFINE([_FILE_OFFSET_BITS], [64],
+ [Number of bits in a file offset, on hosts where this is settable.])
+ gl_cv_type_time_t_y2038=yes
+ fi
+ fi
+ if test $gl_cv_type_time_t_y2038 = no; then
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef _USE_32BIT_TIME_T
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [AC_MSG_FAILURE(
+ [The 'time_t' type stops working after January 2038.
+ Remove _USE_32BIT_TIME_T from the compiler flags.])],
+ [# If not cross-compiling and $1 says we should check,
+ # and 'touch' works with a large timestamp, then evidently wider time_t
+ # is desired and supported, so fail and ask the builder to fix the
+ # problem. Otherwise, just warn the builder.
+ m4_ifval([$1],
+ [if test $cross_compiling = no \
+ && TZ=UTC0 touch -t 210602070628.15 conftest.time 2>/dev/null; then
+ case `TZ=UTC0 LC_ALL=C ls -l conftest.time 2>/dev/null` in
+ *'Feb 7 2106'* | *'Feb 7 17:10'*)
+ AC_MSG_FAILURE(
+ [The 'time_t' type stops working after January 2038,
+ and your system appears to support a wider 'time_t'.
+ Try configuring with 'CC="${CC} -m64"'.
+ To build with a 32-bit time_t anyway (not recommended),
+ configure with '--disable-year2038'.]);;
+ esac
+ rm -f conftest.time
+ fi])
+ if test "$gl_warned_about_y2038" != yes; then
+ AC_MSG_WARN(
+ [The 'time_t' type stops working after January 2038,
+ and this package needs a wider 'time_t' type
+ if there is any way to access timestamps after that.
+ Configure with 'CC="${CC} -m64"' perhaps?])
+ gl_warned_about_y2038=yes
+ fi
+ ])
+ fi])
+])
+
+AC_DEFUN([gl_YEAR2038],
+[
+ gl_YEAR2038_BODY([require-year2038-safe])
+])
diff --git a/gl/m4/zzgnulib.m4 b/gl/m4/zzgnulib.m4
new file mode 100644
index 0000000..fd73a20
--- /dev/null
+++ b/gl/m4/zzgnulib.m4
@@ -0,0 +1,23 @@
+# zzgnulib.m4 serial 1
+dnl Copyright (C) 2020-2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This file must be named something that sorts after all other
+dnl package- or gnulib-provided .m4 files - at least for those packages
+dnl that redefine AC_PROG_CC.
+
+dnl Redefine AC_PROG_CC so that it ends with invocations of gl_COMPILER_CLANG
+dnl and gl_COMPILER_PREPARE_CHECK_DECL.
+m4_define([AC_PROG_CC],
+ m4_defn([AC_PROG_CC])[
+gl_COMPILER_CLANG
+gl_COMPILER_PREPARE_CHECK_DECL
+])
+
+# gl_ZZGNULIB
+# -----------
+# Witness macro that this file has been included. Needed to force
+# Automake to include this file after all other gnulib .m4 files.
+AC_DEFUN([gl_ZZGNULIB])
diff --git a/gl/po/LINGUAS b/gl/po/LINGUAS
new file mode 100644
index 0000000..407b1de
--- /dev/null
+++ b/gl/po/LINGUAS
@@ -0,0 +1,40 @@
+# Set of available languages.
+af
+be
+bg
+ca
+cs
+da
+de
+el
+eo
+es
+et
+eu
+fi
+fr
+ga
+gl
+hu
+it
+ja
+ka
+ko
+ms
+nb
+nl
+pl
+pt
+pt_BR
+ro
+ru
+rw
+sk
+sl
+sr
+sv
+tr
+uk
+vi
+zh_CN
+zh_TW
diff --git a/gl/po/Makefile.in.in b/gl/po/Makefile.in.in
new file mode 100644
index 0000000..fabdc76
--- /dev/null
+++ b/gl/po/Makefile.in.in
@@ -0,0 +1,454 @@
+# Makefile for PO directory in any package using GNU gettext.
+# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+#
+# This file can be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU General Public
+# License but which still want to provide support for the GNU gettext
+# functionality.
+# Please note that the actual code of GNU gettext is covered by the GNU
+# General Public License and is *not* in the public domain.
+#
+# Origin: gettext-0.18.3
+GETTEXT_MACRO_VERSION = 0.18
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+
+SED = @SED@
+SHELL = /bin/sh
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datarootdir = @datarootdir@
+datadir = @datadir@
+localedir = @localedir@
+gettextsrcdir = $(datadir)/gettext/po
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+
+# We use $(mkdir_p).
+# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
+# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
+# @install_sh@ does not start with $(SHELL), so we add it.
+# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined
+# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
+# versions, $(mkinstalldirs) and $(install_sh) are unused.
+mkinstalldirs = $(SHELL) @install_sh@ -d
+install_sh = $(SHELL) @install_sh@
+MKDIR_P = @MKDIR_P@
+mkdir_p = @mkdir_p@
+
+GMSGFMT_ = @GMSGFMT@
+GMSGFMT_no = @GMSGFMT@
+GMSGFMT_yes = @GMSGFMT_015@
+GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
+MSGFMT_ = @MSGFMT@
+MSGFMT_no = @MSGFMT@
+MSGFMT_yes = @MSGFMT_015@
+MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
+XGETTEXT_ = @XGETTEXT@
+XGETTEXT_no = @XGETTEXT@
+XGETTEXT_yes = @XGETTEXT_015@
+XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
+MSGMERGE = msgmerge
+MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGINIT = msginit
+MSGCONV = msgconv
+MSGFILTER = msgfilter
+
+POFILES = @POFILES@
+GMOFILES = @GMOFILES@
+UPDATEPOFILES = @UPDATEPOFILES@
+DUMMYPOFILES = @DUMMYPOFILES@
+DISTFILES.common = Makefile.in.in remove-potcdate.sin \
+$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
+DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
+$(POFILES) $(GMOFILES) \
+$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
+
+POTFILES = \
+
+CATALOGS = @CATALOGS@
+
+# Makevars gets inserted here. (Don't remove this line!)
+
+.SUFFIXES:
+.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
+
+.po.mo:
+ @echo "$(MSGFMT) -c -o $@ $<"; \
+ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
+
+.po.gmo:
+ @lang=`echo $* | sed -e 's,.*/,,'`; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
+ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+
+.sin.sed:
+ sed -e '/^#/d' $< > t-$@
+ mv t-$@ $@
+
+
+all: all-@USE_NLS@
+
+all-yes: stamp-po
+all-no:
+
+# Ensure that the gettext macros and this Makefile.in.in are in sync.
+CHECK_MACRO_VERSION = \
+ test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \
+ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \
+ exit 1; \
+ }
+
+# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
+# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
+# we don't want to bother translators with empty POT files). We assume that
+# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
+# In this case, stamp-po is a nop (i.e. a phony target).
+
+# stamp-po is a timestamp denoting the last time at which the CATALOGS have
+# been loosely updated. Its purpose is that when a developer or translator
+# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
+# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
+# invocations of "make" will do nothing. This timestamp would not be necessary
+# if updating the $(CATALOGS) would always touch them; however, the rule for
+# $(POFILES) has been designed to not touch files that don't need to be
+# changed.
+stamp-po: $(srcdir)/$(DOMAIN).pot
+ @$(CHECK_MACRO_VERSION)
+ test ! -f $(srcdir)/$(DOMAIN).pot || \
+ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
+ @test ! -f $(srcdir)/$(DOMAIN).pot || { \
+ echo "touch stamp-po" && \
+ echo timestamp > stamp-poT && \
+ mv stamp-poT stamp-po; \
+ }
+
+# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
+# otherwise packages like GCC can not be built if only parts of the source
+# have been downloaded.
+
+# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
+# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
+# The determination of whether the package xyz is a GNU one is based on the
+# heuristic whether some file in the top level directory mentions "GNU xyz".
+# If GNU 'find' is available, we avoid grepping through monster files.
+$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
+ if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \
+ LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep 'GNU @PACKAGE@' /dev/null '{}' ';' 2>/dev/null; \
+ else \
+ LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \
+ fi; \
+ } | grep -v 'libtool:' >/dev/null; then \
+ package_gnu='GNU '; \
+ else \
+ package_gnu=''; \
+ fi; \
+ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
+ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
+ else \
+ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
+ fi; \
+ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
+ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
+ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
+ --files-from=$(srcdir)/POTFILES.in \
+ --copyright-holder='$(COPYRIGHT_HOLDER)' \
+ --msgid-bugs-address="$$msgid_bugs_address" \
+ ;; \
+ *) \
+ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
+ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
+ --files-from=$(srcdir)/POTFILES.in \
+ --copyright-holder='$(COPYRIGHT_HOLDER)' \
+ --package-name="$${package_gnu}@PACKAGE@" \
+ --package-version='@VERSION@' \
+ --msgid-bugs-address="$$msgid_bugs_address" \
+ ;; \
+ esac
+ test ! -f $(DOMAIN).po || { \
+ if test -f $(srcdir)/$(DOMAIN).pot; then \
+ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
+ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
+ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
+ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
+ else \
+ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
+ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+ fi; \
+ else \
+ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+ fi; \
+ }
+
+# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
+# every "make" invocation, only create it when it is missing.
+# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
+$(srcdir)/$(DOMAIN).pot:
+ $(MAKE) $(DOMAIN).pot-update
+
+# This target rebuilds a PO file if $(DOMAIN).pot has changed.
+# Note that a PO file is not touched if it doesn't need to be changed.
+$(POFILES): $(srcdir)/$(DOMAIN).pot
+ @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
+ if test -f "$(srcdir)/$${lang}.po"; then \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \
+ cd $(srcdir) \
+ && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
+ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \
+ *) \
+ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \
+ esac; \
+ }; \
+ else \
+ $(MAKE) $${lang}.po-create; \
+ fi
+
+
+install: install-exec install-data
+install-exec:
+install-data: install-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
+ for file in $(DISTFILES.common) Makevars.template; do \
+ $(INSTALL_DATA) $(srcdir)/$$file \
+ $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ for file in Makevars; do \
+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+install-data-no: all
+install-data-yes: all
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ $(mkdir_p) $(DESTDIR)$$dir; \
+ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
+ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
+ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
+ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+ if test -n "$$lc"; then \
+ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+ for file in *; do \
+ if test -f $$file; then \
+ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+ fi; \
+ done); \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ else \
+ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+ :; \
+ else \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ fi; \
+ fi; \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
+ fi; \
+ done; \
+ done
+
+install-strip: install
+
+installdirs: installdirs-exec installdirs-data
+installdirs-exec:
+installdirs-data: installdirs-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
+ else \
+ : ; \
+ fi
+installdirs-data-no:
+installdirs-data-yes:
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ $(mkdir_p) $(DESTDIR)$$dir; \
+ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+ if test -n "$$lc"; then \
+ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+ for file in *; do \
+ if test -f $$file; then \
+ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+ fi; \
+ done); \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ else \
+ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+ :; \
+ else \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ fi; \
+ fi; \
+ fi; \
+ done; \
+ done
+
+# Define this as empty until I found a useful application.
+installcheck:
+
+uninstall: uninstall-exec uninstall-data
+uninstall-exec:
+uninstall-data: uninstall-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ for file in $(DISTFILES.common) Makevars.template; do \
+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+uninstall-data-no:
+uninstall-data-yes:
+ catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ done; \
+ done
+
+check: all
+
+info dvi ps pdf html tags TAGS ctags CTAGS ID:
+
+mostlyclean:
+ rm -f remove-potcdate.sed
+ rm -f stamp-poT
+ rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
+ rm -fr *.o
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f Makefile Makefile.in POTFILES *.mo
+
+maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ rm -f stamp-po $(GMOFILES)
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir:
+ $(MAKE) update-po
+ @$(MAKE) dist2
+# This is a separate target because 'update-po' must be executed before.
+dist2: stamp-po $(DISTFILES)
+ dists="$(DISTFILES)"; \
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ dists="$$dists Makevars.template"; \
+ fi; \
+ if test -f $(srcdir)/$(DOMAIN).pot; then \
+ dists="$$dists $(DOMAIN).pot stamp-po"; \
+ fi; \
+ if test -f $(srcdir)/ChangeLog; then \
+ dists="$$dists ChangeLog"; \
+ fi; \
+ for i in 0 1 2 3 4 5 6 7 8 9; do \
+ if test -f $(srcdir)/ChangeLog.$$i; then \
+ dists="$$dists ChangeLog.$$i"; \
+ fi; \
+ done; \
+ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
+ for file in $$dists; do \
+ if test -f $$file; then \
+ cp -p $$file $(distdir) || exit 1; \
+ else \
+ cp -p $(srcdir)/$$file $(distdir) || exit 1; \
+ fi; \
+ done
+
+update-po: Makefile
+ $(MAKE) $(DOMAIN).pot-update
+ test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
+ $(MAKE) update-gmo
+
+# General rule for creating PO files.
+
+.nop.po-create:
+ @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
+ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
+ exit 1
+
+# General rule for updating PO files.
+
+.nop.po-update:
+ @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
+ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
+ tmpdir=`pwd`; \
+ echo "$$lang:"; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
+ cd $(srcdir); \
+ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
+ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
+ *) \
+ $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
+ esac; \
+ }; then \
+ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+ rm -f $$tmpdir/$$lang.new.po; \
+ else \
+ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+ :; \
+ else \
+ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+ exit 1; \
+ fi; \
+ fi; \
+ else \
+ echo "msgmerge for $$lang.po failed!" 1>&2; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ fi
+
+$(DUMMYPOFILES):
+
+update-gmo: Makefile $(GMOFILES)
+ @:
+
+# Recreate Makefile by invoking config.status. Explicitly invoke the shell,
+# because execution permission bits may not work on the current file system.
+# Use @SHELL@, which is the shell determined by autoconf for the use by its
+# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient.
+Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
+ cd $(top_builddir) \
+ && @SHELL@ ./config.status $(subdir)/$@.in po-directories
+
+force:
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/gl/po/Makevars b/gl/po/Makevars
new file mode 100644
index 0000000..6447e83
--- /dev/null
+++ b/gl/po/Makevars
@@ -0,0 +1,68 @@
+## DO NOT EDIT! GENERATED AUTOMATICALLY!
+# Copyright (C) 2002-2022 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 file. If not, see <https://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License,
+# this file may be distributed as part of a program that
+# contains a configuration script generated by Autoconf, under
+# the same distribution terms as the rest of that program.
+#
+# Generated by gnulib-tool.
+
+# Usually the message domain is the same as the package name.
+# But here it has a '-gnulib' suffix.
+DOMAIN = man-db-gnulib
+
+# These two variables depend on the location of this directory.
+subdir = gl/po
+top_builddir = ../..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = \
+ --keyword=_ --flag=_:1:pass-c-format \
+ --keyword=N_ --flag=N_:1:pass-c-format \
+ --keyword='proper_name:1,"This is a proper name. See the gettext manual, section Names."' \
+ --keyword='proper_name_utf8:1,"This is a proper name. See the gettext manual, section Names."' \
+ --flag=error:3:c-format --flag=error_at_line:5:c-format
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file. gnulib is copyrighted by the FSF.
+COPYRIGHT_HOLDER = Free Software Foundation, Inc.
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+# in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+# understood.
+# - Strings which make invalid assumptions about notation of date, time or
+# money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = bug-gnulib@gnu.org
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used. It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
+
+# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
+# context. Possible values are "yes" and "no". Set this to yes if the
+# package uses functions taking also a message context, like pgettext(), or
+# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
+USE_MSGCTXT = no
diff --git a/gl/po/POTFILES.in b/gl/po/POTFILES.in
new file mode 100644
index 0000000..d168187
--- /dev/null
+++ b/gl/po/POTFILES.in
@@ -0,0 +1,405 @@
+## DO NOT EDIT! GENERATED AUTOMATICALLY!
+# Copyright (C) 2002-2022 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 file. If not, see <https://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License,
+# this file may be distributed as part of a program that
+# contains a configuration script generated by Autoconf, under
+# the same distribution terms as the rest of that program.
+#
+# Generated by gnulib-tool.
+
+# List of files which contain translatable strings.
+gl/lib/_Noreturn.h
+gl/lib/alloca.c
+gl/lib/alloca.in.h
+gl/lib/arg-nonnull.h
+gl/lib/argp-ba.c
+gl/lib/argp-eexst.c
+gl/lib/argp-fmtstream.c
+gl/lib/argp-fmtstream.h
+gl/lib/argp-fs-xinl.c
+gl/lib/argp-help.c
+gl/lib/argp-namefrob.h
+gl/lib/argp-parse.c
+gl/lib/argp-pin.c
+gl/lib/argp-pv.c
+gl/lib/argp-pvh.c
+gl/lib/argp-xinl.c
+gl/lib/argp.h
+gl/lib/asnprintf.c
+gl/lib/asprintf.c
+gl/lib/assure.h
+gl/lib/at-func.c
+gl/lib/at-func2.c
+gl/lib/attribute.h
+gl/lib/basename-lgpl.c
+gl/lib/basename-lgpl.h
+gl/lib/basename.c
+gl/lib/bitrotate.c
+gl/lib/bitrotate.h
+gl/lib/btowc.c
+gl/lib/c++defs.h
+gl/lib/calloc.c
+gl/lib/canonicalize-lgpl.c
+gl/lib/canonicalize.c
+gl/lib/canonicalize.h
+gl/lib/cdefs.h
+gl/lib/chdir-long.c
+gl/lib/chdir-long.h
+gl/lib/chown.c
+gl/lib/cloexec.c
+gl/lib/cloexec.h
+gl/lib/close.c
+gl/lib/closedir.c
+gl/lib/ctype.in.h
+gl/lib/dirent-private.h
+gl/lib/dirent.in.h
+gl/lib/dirfd.c
+gl/lib/dirname-lgpl.c
+gl/lib/dirname.c
+gl/lib/dirname.h
+gl/lib/dup-safer-flag.c
+gl/lib/dup-safer.c
+gl/lib/dup.c
+gl/lib/dup2.c
+gl/lib/dynarray.h
+gl/lib/eloop-threshold.h
+gl/lib/errno.in.h
+gl/lib/error.c
+gl/lib/error.h
+gl/lib/exitfail.c
+gl/lib/exitfail.h
+gl/lib/fchdir.c
+gl/lib/fchown-stub.c
+gl/lib/fcntl.c
+gl/lib/fcntl.in.h
+gl/lib/fd-hook.c
+gl/lib/fd-hook.h
+gl/lib/fd-safer-flag.c
+gl/lib/fd-safer.c
+gl/lib/fdopendir.c
+gl/lib/file-set.c
+gl/lib/file-set.h
+gl/lib/filename.h
+gl/lib/filenamecat-lgpl.c
+gl/lib/filenamecat.h
+gl/lib/flexmember.h
+gl/lib/float+.h
+gl/lib/float.c
+gl/lib/float.in.h
+gl/lib/flock.c
+gl/lib/fnmatch.c
+gl/lib/fnmatch.in.h
+gl/lib/fnmatch_loop.c
+gl/lib/free.c
+gl/lib/fstat.c
+gl/lib/fstatat.c
+gl/lib/getcwd-lgpl.c
+gl/lib/getcwd.c
+gl/lib/getdelim.c
+gl/lib/getdtablesize.c
+gl/lib/getline.c
+gl/lib/getlogin_r.c
+gl/lib/getopt-cdefs.in.h
+gl/lib/getopt-core.h
+gl/lib/getopt-ext.h
+gl/lib/getopt-pfx-core.h
+gl/lib/getopt-pfx-ext.h
+gl/lib/getopt.c
+gl/lib/getopt.in.h
+gl/lib/getopt1.c
+gl/lib/getopt_int.h
+gl/lib/getprogname.c
+gl/lib/getprogname.h
+gl/lib/getrandom.c
+gl/lib/gettext.h
+gl/lib/gettime.c
+gl/lib/gettimeofday.c
+gl/lib/gl_anyhash1.h
+gl/lib/gl_anyhash2.h
+gl/lib/gl_anyhash_primes.h
+gl/lib/gl_anylinked_list1.h
+gl/lib/gl_anylinked_list2.h
+gl/lib/gl_anyrbtree_list1.h
+gl/lib/gl_anyrbtree_list2.h
+gl/lib/gl_anytree_list1.h
+gl/lib/gl_anytree_list2.h
+gl/lib/gl_array_list.c
+gl/lib/gl_array_list.h
+gl/lib/gl_hash_map.c
+gl/lib/gl_hash_map.h
+gl/lib/gl_hash_set.c
+gl/lib/gl_hash_set.h
+gl/lib/gl_linkedhash_list.c
+gl/lib/gl_linkedhash_list.h
+gl/lib/gl_list.c
+gl/lib/gl_list.h
+gl/lib/gl_map.c
+gl/lib/gl_map.h
+gl/lib/gl_rbtree_list.c
+gl/lib/gl_rbtree_list.h
+gl/lib/gl_set.c
+gl/lib/gl_set.h
+gl/lib/gl_xlist.c
+gl/lib/gl_xlist.h
+gl/lib/gl_xmap.c
+gl/lib/gl_xmap.h
+gl/lib/gl_xset.c
+gl/lib/gl_xset.h
+gl/lib/glob-libc.h
+gl/lib/glob.c
+gl/lib/glob.in.h
+gl/lib/glob_internal.h
+gl/lib/glob_pattern_p.c
+gl/lib/globfree.c
+gl/lib/glthread/lock.c
+gl/lib/glthread/lock.h
+gl/lib/glthread/threadlib.c
+gl/lib/hard-locale.c
+gl/lib/hard-locale.h
+gl/lib/hash-pjw-bare.c
+gl/lib/hash-pjw-bare.h
+gl/lib/hash-pjw.c
+gl/lib/hash-pjw.h
+gl/lib/hash-triple-simple.c
+gl/lib/hash-triple.h
+gl/lib/hash.c
+gl/lib/hash.h
+gl/lib/ialloc.c
+gl/lib/ialloc.h
+gl/lib/idpriv-drop.c
+gl/lib/idpriv-droptemp.c
+gl/lib/idpriv.h
+gl/lib/idx.h
+gl/lib/intprops.h
+gl/lib/inttypes.in.h
+gl/lib/ioctl.c
+gl/lib/isblank.c
+gl/lib/itold.c
+gl/lib/langinfo.in.h
+gl/lib/lc-charset-dispatch.c
+gl/lib/lc-charset-dispatch.h
+gl/lib/lchown.c
+gl/lib/libc-config.h
+gl/lib/limits.in.h
+gl/lib/localcharset.c
+gl/lib/localcharset.h
+gl/lib/locale.in.h
+gl/lib/localeconv.c
+gl/lib/lstat.c
+gl/lib/malloc.c
+gl/lib/malloc/dynarray-skeleton.c
+gl/lib/malloc/dynarray.h
+gl/lib/malloc/dynarray_at_failure.c
+gl/lib/malloc/dynarray_emplace_enlarge.c
+gl/lib/malloc/dynarray_finalize.c
+gl/lib/malloc/dynarray_resize.c
+gl/lib/malloc/dynarray_resize_clear.c
+gl/lib/malloc/scratch_buffer.h
+gl/lib/malloc/scratch_buffer_dupfree.c
+gl/lib/malloc/scratch_buffer_grow.c
+gl/lib/malloc/scratch_buffer_grow_preserve.c
+gl/lib/malloc/scratch_buffer_set_array_size.c
+gl/lib/malloca.c
+gl/lib/malloca.h
+gl/lib/mbrtowc-impl-utf8.h
+gl/lib/mbrtowc-impl.h
+gl/lib/mbrtowc.c
+gl/lib/mbsinit.c
+gl/lib/mbsrtowcs-impl.h
+gl/lib/mbsrtowcs-state.c
+gl/lib/mbsrtowcs.c
+gl/lib/mbtowc-impl.h
+gl/lib/mbtowc-lock.c
+gl/lib/mbtowc-lock.h
+gl/lib/mbtowc.c
+gl/lib/memchr.c
+gl/lib/memchr.valgrind
+gl/lib/memmem.c
+gl/lib/mempcpy.c
+gl/lib/memrchr.c
+gl/lib/minmax.h
+gl/lib/mkdir.c
+gl/lib/mkdtemp.c
+gl/lib/mkstemp.c
+gl/lib/msvc-inval.c
+gl/lib/msvc-inval.h
+gl/lib/msvc-nothrow.c
+gl/lib/msvc-nothrow.h
+gl/lib/nanosleep.c
+gl/lib/nl_langinfo-lock.c
+gl/lib/nl_langinfo.c
+gl/lib/nonblocking.c
+gl/lib/nonblocking.h
+gl/lib/open.c
+gl/lib/openat-die.c
+gl/lib/openat-priv.h
+gl/lib/openat-proc.c
+gl/lib/openat.c
+gl/lib/openat.h
+gl/lib/opendir.c
+gl/lib/pathmax.h
+gl/lib/pipe-safer.c
+gl/lib/pipe.c
+gl/lib/printf-args.c
+gl/lib/printf-args.h
+gl/lib/printf-parse.c
+gl/lib/printf-parse.h
+gl/lib/progname.c
+gl/lib/progname.h
+gl/lib/pselect.c
+gl/lib/pthread_sigmask.c
+gl/lib/raise.c
+gl/lib/rawmemchr.c
+gl/lib/rawmemchr.valgrind
+gl/lib/readdir.c
+gl/lib/readlink.c
+gl/lib/readlinkat.c
+gl/lib/realloc.c
+gl/lib/reallocarray.c
+gl/lib/regcomp.c
+gl/lib/regex.c
+gl/lib/regex.h
+gl/lib/regex_internal.c
+gl/lib/regex_internal.h
+gl/lib/regexec.c
+gl/lib/rename.c
+gl/lib/renameat.c
+gl/lib/renameatu.c
+gl/lib/renameatu.h
+gl/lib/rewinddir.c
+gl/lib/rmdir.c
+gl/lib/same-inode.h
+gl/lib/save-cwd.c
+gl/lib/save-cwd.h
+gl/lib/scratch_buffer.h
+gl/lib/select.c
+gl/lib/setenv.c
+gl/lib/setlocale-lock.c
+gl/lib/setlocale_null.c
+gl/lib/setlocale_null.h
+gl/lib/sig-handler.c
+gl/lib/sig-handler.h
+gl/lib/sigaction.c
+gl/lib/signal.in.h
+gl/lib/sigprocmask.c
+gl/lib/size_max.h
+gl/lib/sleep.c
+gl/lib/sockets.c
+gl/lib/sockets.h
+gl/lib/stat-time.c
+gl/lib/stat-time.h
+gl/lib/stat-w32.c
+gl/lib/stat-w32.h
+gl/lib/stat.c
+gl/lib/stdalign.in.h
+gl/lib/stdarg.in.h
+gl/lib/stdbool.in.h
+gl/lib/stddef.in.h
+gl/lib/stdint.in.h
+gl/lib/stdio-read.c
+gl/lib/stdio-write.c
+gl/lib/stdio.in.h
+gl/lib/stdlib.in.h
+gl/lib/stdopen.c
+gl/lib/stdopen.h
+gl/lib/stpcpy.c
+gl/lib/str-two-way.h
+gl/lib/strcasecmp.c
+gl/lib/strcasestr.c
+gl/lib/strchrnul.c
+gl/lib/strchrnul.valgrind
+gl/lib/strdup.c
+gl/lib/streq.h
+gl/lib/strerror-override.c
+gl/lib/strerror-override.h
+gl/lib/strerror.c
+gl/lib/string.in.h
+gl/lib/strings.in.h
+gl/lib/stripslash.c
+gl/lib/strncasecmp.c
+gl/lib/strndup.c
+gl/lib/strnlen.c
+gl/lib/strnlen1.c
+gl/lib/strnlen1.h
+gl/lib/strsep.c
+gl/lib/sys_file.in.h
+gl/lib/sys_ioctl.in.h
+gl/lib/sys_random.in.h
+gl/lib/sys_select.in.h
+gl/lib/sys_socket.c
+gl/lib/sys_socket.in.h
+gl/lib/sys_stat.in.h
+gl/lib/sys_time.in.h
+gl/lib/sys_types.in.h
+gl/lib/sys_uio.in.h
+gl/lib/sysexits.in.h
+gl/lib/tempname.c
+gl/lib/tempname.h
+gl/lib/termios.in.h
+gl/lib/time.in.h
+gl/lib/timespec.c
+gl/lib/timespec.h
+gl/lib/unistd--.h
+gl/lib/unistd-safer.h
+gl/lib/unistd.c
+gl/lib/unistd.in.h
+gl/lib/unlink.c
+gl/lib/unlinkat.c
+gl/lib/utime.c
+gl/lib/utime.in.h
+gl/lib/utimens.c
+gl/lib/utimens.h
+gl/lib/vasnprintf.c
+gl/lib/vasnprintf.h
+gl/lib/vasprintf.c
+gl/lib/verify.h
+gl/lib/verror.c
+gl/lib/verror.h
+gl/lib/vsnprintf.c
+gl/lib/w32sock.h
+gl/lib/warn-on-use.h
+gl/lib/wchar.in.h
+gl/lib/wcrtomb.c
+gl/lib/wctype-h.c
+gl/lib/wctype.in.h
+gl/lib/windows-initguard.h
+gl/lib/windows-mutex.c
+gl/lib/windows-mutex.h
+gl/lib/windows-once.c
+gl/lib/windows-once.h
+gl/lib/windows-recmutex.c
+gl/lib/windows-recmutex.h
+gl/lib/windows-rwlock.c
+gl/lib/windows-rwlock.h
+gl/lib/wmemchr-impl.h
+gl/lib/wmemchr.c
+gl/lib/wmempcpy.c
+gl/lib/xalloc-die.c
+gl/lib/xalloc-oversized.h
+gl/lib/xalloc.h
+gl/lib/xasprintf.c
+gl/lib/xgetcwd.c
+gl/lib/xgetcwd.h
+gl/lib/xmalloc.c
+gl/lib/xsize.c
+gl/lib/xsize.h
+gl/lib/xstdopen.c
+gl/lib/xstdopen.h
+gl/lib/xstrndup.c
+gl/lib/xstrndup.h
+gl/lib/xvasprintf.c
+gl/lib/xvasprintf.h
diff --git a/gl/po/Rules-quot b/gl/po/Rules-quot
new file mode 100644
index 0000000..5931e53
--- /dev/null
+++ b/gl/po/Rules-quot
@@ -0,0 +1,47 @@
+# Special Makefile rules for English message catalogs with quotation marks.
+
+DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot
+
+.SUFFIXES: .insert-header .po-update-en
+
+en@quot.po-create:
+ $(MAKE) en@quot.po-update
+en@boldquot.po-create:
+ $(MAKE) en@boldquot.po-update
+
+en@quot.po-update: en@quot.po-update-en
+en@boldquot.po-update: en@boldquot.po-update-en
+
+.insert-header.po-update-en:
+ @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
+ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
+ tmpdir=`pwd`; \
+ echo "$$lang:"; \
+ ll=`echo $$lang | sed -e 's/@.*//'`; \
+ LC_ALL=C; export LC_ALL; \
+ cd $(srcdir); \
+ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \
+ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+ rm -f $$tmpdir/$$lang.new.po; \
+ else \
+ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+ :; \
+ else \
+ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+ exit 1; \
+ fi; \
+ fi; \
+ else \
+ echo "creation of $$lang.po failed!" 1>&2; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ fi
+
+en@quot.insert-header: insert-header.sin
+ sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header
+
+en@boldquot.insert-header: insert-header.sin
+ sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header
+
+mostlyclean: mostlyclean-quot
+mostlyclean-quot:
+ rm -f *.insert-header
diff --git a/gl/po/af.gmo b/gl/po/af.gmo
new file mode 100644
index 0000000..f08a9ca
--- /dev/null
+++ b/gl/po/af.gmo
Binary files differ
diff --git a/gl/po/af.po b/gl/po/af.po
new file mode 100644
index 0000000..9498c8d
--- /dev/null
+++ b/gl/po/af.po
@@ -0,0 +1,542 @@
+# coreutils-5.2.1.af.po.
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# This file is distributed under the same license as the PACKAGE package.
+# Petri Jooste <rkwjpj@puknet.puk.ac.za>, 2004.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: coreutils 5.2.1\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2004-03-17 11:58+0200\n"
+"Last-Translator: Petri Jooste <rkwjpj@puk.ac.za>\n"
+"Language-Team: Afrikaans <i18n@af.org.za>\n"
+"Language: af\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr ""
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr ""
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:1374
+#, fuzzy
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Verpligte parameters vir langformaat opsies is ook verpligtend vir "
+"kortformaat opsies.\n"
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr ""
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr ""
+
+#: gl/lib/argp-help.c:1756
+#, fuzzy
+msgid " [OPTION...]"
+msgstr "Gebruik so: %s [OPSIE]...\n"
+
+#: gl/lib/argp-help.c:1783
+#, fuzzy, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Probeer `%s --help' vir meer inligting.\n"
+
+#: gl/lib/argp-help.c:1811
+#, fuzzy, c-format
+msgid "Report bugs to %s.\n"
+msgstr ""
+"\n"
+"Rapporteer foute aan <%s>.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Onbekende stelselfout"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr ""
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr ""
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "NAAM"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr ""
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr ""
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr ""
+
+#: gl/lib/argp-parse.c:154
+#, fuzzy
+msgid "print program version"
+msgstr "leesfout"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr ""
+
+#: gl/lib/argp-parse.c:624
+#, fuzzy, c-format
+msgid "%s: Too many arguments\n"
+msgstr "te veel parameters\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr ""
+
+#: gl/lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: opsie `%s' is dubbelsinnig\n"
+
+#: gl/lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: opsie `%s' is dubbelsinnig\n"
+
+#: gl/lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: onbekende opsie `%c%s'\n"
+
+#: gl/lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: opsie `%c%s' laat nie 'n parameter toe nie\n"
+
+#: gl/lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: opsie `%s' benodig 'n parameter\n"
+
+#: gl/lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: ongeldige opsie -- %c\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: opsie benodig 'n parameter -- %c\n"
+
+#: gl/lib/openat-die.c:38
+#, fuzzy, c-format
+msgid "unable to record current working directory"
+msgstr "kon nie na aanvanklike werkgids terugkeer nie"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "kon nie na aanvanklike werkgids terugkeer nie"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr ""
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr ""
+
+#: gl/lib/regcomp.c:128
+#, fuzzy
+msgid "Invalid regular expression"
+msgstr "%s: ongeldige relmatige uitdrukking: %s"
+
+#: gl/lib/regcomp.c:131
+#, fuzzy
+msgid "Invalid collation character"
+msgstr "ongeldige karakterklas `%s'"
+
+#: gl/lib/regcomp.c:134
+#, fuzzy
+msgid "Invalid character class name"
+msgstr "ongeldige karakterklas `%s'"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr ""
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr ""
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr ""
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr ""
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr ""
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr ""
+
+#: gl/lib/regcomp.c:155
+#, fuzzy
+msgid "Invalid range end"
+msgstr "%s: ongeldige relmatige uitdrukking: %s"
+
+#: gl/lib/regcomp.c:158
+#, fuzzy
+msgid "Memory exhausted"
+msgstr "geheue uitgeput"
+
+#: gl/lib/regcomp.c:161
+#, fuzzy
+msgid "Invalid preceding regular expression"
+msgstr "%s: ongeldige relmatige uitdrukking: %s"
+
+#: gl/lib/regcomp.c:164
+#, fuzzy
+msgid "Premature end of regular expression"
+msgstr "fout in soektog met relmatige uitdrukking"
+
+#: gl/lib/regcomp.c:167
+#, fuzzy
+msgid "Regular expression too big"
+msgstr "%s: ongeldige relmatige uitdrukking: %s"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ""
+
+#: gl/lib/regcomp.c:650
+#, fuzzy
+msgid "No previous regular expression"
+msgstr "fout in soektog met relmatige uitdrukking"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "geheue uitgeput"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "ongeldige parameter %s vir %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "dubbelsinnige parameter %s vir %s"
+
+#, c-format
+#~ msgid "Valid arguments are:"
+#~ msgstr "Geldige parameters is soos volg:"
+
+#~ msgid "write error"
+#~ msgstr "skryffout"
+
+#, fuzzy, c-format
+#~ msgid "error while opening \"%s\" for reading"
+#~ msgstr "kan nie %s oopmaak om te lees nie"
+
+#, fuzzy, c-format
+#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgstr "kan nie %s oopmaak om te lees nie"
+
+#, fuzzy, c-format
+#~ msgid "error reading \"%s\""
+#~ msgstr "fout met die les van %s"
+
+#, fuzzy, c-format
+#~ msgid "error writing \"%s\""
+#~ msgstr "fout met die skryf na %s"
+
+#, fuzzy, c-format
+#~ msgid "error after reading \"%s\""
+#~ msgstr "fout met die les van %s"
+
+#, fuzzy
+#~ msgid "fdopen() failed"
+#~ msgstr "'open' het gefaal"
+
+#, fuzzy, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s: seek het misluk"
+
+#~ msgid "regular empty file"
+#~ msgstr "gewone le ler"
+
+#~ msgid "regular file"
+#~ msgstr "gewone ler"
+
+#~ msgid "directory"
+#~ msgstr "lergids"
+
+#~ msgid "block special file"
+#~ msgstr "spesiale blokler"
+
+#~ msgid "character special file"
+#~ msgstr "spesiale karakterler"
+
+#~ msgid "fifo"
+#~ msgstr "fifo"
+
+#~ msgid "symbolic link"
+#~ msgstr "simboliese skakel"
+
+#~ msgid "socket"
+#~ msgstr "sok"
+
+#~ msgid "message queue"
+#~ msgstr "boodskapwagtou"
+
+#~ msgid "semaphore"
+#~ msgstr "semafoor"
+
+#~ msgid "shared memory object"
+#~ msgstr "gedeeldegeheue-objek"
+
+#, fuzzy
+#~ msgid "typed memory object"
+#~ msgstr "gedeeldegeheue-objek"
+
+#~ msgid "weird file"
+#~ msgstr "vreemde ler"
+
+#, fuzzy
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "fifo-lers word nie ondersteun nie"
+
+#, fuzzy
+#~ msgid "ai_family not supported"
+#~ msgstr "fifo-lers word nie ondersteun nie"
+
+#, fuzzy
+#~ msgid "ai_socktype not supported"
+#~ msgstr "fifo-lers word nie ondersteun nie"
+
+#, fuzzy
+#~ msgid "System error"
+#~ msgstr "skryffout"
+
+#, fuzzy
+#~ msgid "Unknown error"
+#~ msgstr "Onbekende stelselfout"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: opsie `--%s' laat nie 'n parameter toe nie\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: onbekende opsie `--%s'\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: onwettige opsie -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: opsie `-W %s' is dubbelsinnig\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: opsie `-W %s' laat nie 'n parameter toe nie\n"
+
+#~ msgid "block size"
+#~ msgstr "blokgrootte"
+
+#, c-format
+#~ msgid "%s exists but is not a directory"
+#~ msgstr "%s bestaan maar is nie 'n lergids nie"
+
+#, c-format
+#~ msgid "cannot change owner and/or group of %s"
+#~ msgstr "kan nie die eienaar en/of groep van %s verander nie"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "Kan nie lergids %s skep nie."
+
+#, c-format
+#~ msgid "cannot chdir to directory %s"
+#~ msgstr "kan nie chdir doen om na gids %s te gaan nie"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "kan nie toegangsregte van %s verander nie"
+
+#, fuzzy
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "magtigings vir %s kon nie behou word nie"
+
+#, fuzzy
+#~ msgid "cannot create pipe"
+#~ msgstr "kan nie die skakel %s skep nie"
+
+#~ msgid "`"
+#~ msgstr "`"
+
+#~ msgid "'"
+#~ msgstr "'"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[jJ]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "iconv-funksie onbruikbaar"
+
+#~ msgid "iconv function not available"
+#~ msgstr "iconv-funksie is nie beskikbaar nie"
+
+#~ msgid "character out of range"
+#~ msgstr "karakter is buite die grense"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "kan nie U+%04X omskakel na 'n plaaslike karakterstel nie"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "kan nie U+%04X omskakel na 'n plaaslike karakterstel nie: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "ongeldige gebruiker"
+
+#~ msgid "invalid group"
+#~ msgstr "ongeldige groep "
+
+#~ msgid "cannot get the login group of a numeric UID"
+#~ msgstr "kan nie die aantekengroep van 'n numeriese UID verkry nie"
+
+# TRANSLATORS: %s denotes an author name.
+# TRANSLATORS: %s denotes an author name.
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Geskryf deur %s.\n"
+
+# TRANSLATORS: Each %s denotes an author name.
+# TRANSLATORS: Each %s denotes an author name.
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Geskryf deur %s en %s.\n"
+
+# TRANSLATORS: Each %s denotes an author name.
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Geskryf deur %s, %s en %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Geskryf deur %s, %s, %s \n"
+#~ "en %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Geskryf deur %s, %s, %s, \n"
+#~ "%s en %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Geskryf deur %s, %s, %s, \n"
+#~ "%s, %s en %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Geskryf deur %s, %s, %s, \n"
+#~ "%s, %s, %s en %s.\n"
+
+# TRANSLATORS: Each %s denotes an author name.
+# You can use line breaks, estimating that each author name occupies
+# ca. 16 screen columns and that a screen line has ca. 80 columns.
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Geskryf deur %s, %s, %s, \n"
+#~ "%s, %s, %s, %s\n"
+#~ "en %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Geskryf deur %s, %s, %s, \n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s en %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Geskryf deur %s, %s, %s, \n"
+#~ "%s, %s, %s, %s\n"
+#~ "%s, %s en ander.\n"
+
+#~ msgid "string comparison failed"
+#~ msgstr "stringvergelyking het gefaal"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Stel LC_ALL='C' om die probleem te systap"
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Die stringe wat vergelyk is, is %s en %s."
diff --git a/gl/po/be.gmo b/gl/po/be.gmo
new file mode 100644
index 0000000..743b52e
--- /dev/null
+++ b/gl/po/be.gmo
Binary files differ
diff --git a/gl/po/be.po b/gl/po/be.po
new file mode 100644
index 0000000..20dda41
--- /dev/null
+++ b/gl/po/be.po
@@ -0,0 +1,485 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+# This file is distributed under the same license as the coreutils package.
+# Ales Nyakhaychyk <nab@mail.by>, 2002, 2003.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: coreutils 5.0.91\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2003-10-30 01:10+0200\n"
+"Last-Translator: Ales Nyakhaychyk <nab@mail.by>\n"
+"Language-Team: Belarusian <i18n@mova.org>\n"
+"Language: be\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
+"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"X-Generator: KBabel 1.0.2\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr ""
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr ""
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:1374
+#, fuzzy
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr "Довады, абавязковыя для доўгіх выбараў, абавязковыя й для кароткіх.\n"
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr ""
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr ""
+
+#: gl/lib/argp-help.c:1756
+#, fuzzy
+msgid " [OPTION...]"
+msgstr "Выкарыстаньне: %s [ВЫБАР]...\n"
+
+#: gl/lib/argp-help.c:1783
+#, fuzzy, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Паспрабуйце \"%s --help\" для больш падрабязных зьвестак.\n"
+
+#: gl/lib/argp-help.c:1811
+#, fuzzy, c-format
+msgid "Report bugs to %s.\n"
+msgstr ""
+"\n"
+"Паведамляйце пра памылкі на <%s>.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Невядомая сыстэмная памылка"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr ""
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr ""
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "НАЗВА"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr ""
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr ""
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr ""
+
+#: gl/lib/argp-parse.c:154
+#, fuzzy
+msgid "print program version"
+msgstr "памылка чытаньня"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr ""
+
+#: gl/lib/argp-parse.c:624
+#, fuzzy, c-format
+msgid "%s: Too many arguments\n"
+msgstr "зашмат довадаў\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr ""
+
+#: gl/lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: выбар `%s' неадназначны\n"
+
+#: gl/lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: выбар `%s' неадназначны\n"
+
+#: gl/lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: нераспазнаны выбар `%c%s'\n"
+
+#: gl/lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: выбар `%c%s' не дазваляе довад\n"
+
+#: gl/lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: выбар `%s' патрабуе довад\n"
+
+#: gl/lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: нерэчаісны выбар -- %c\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: выбар патрабуе довад -- %c\n"
+
+#: gl/lib/openat-die.c:38
+#, fuzzy, c-format
+msgid "unable to record current working directory"
+msgstr "немагчыма вярнуцца ў пачатковую працоўную тэчку"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "немагчыма вярнуцца ў пачатковую працоўную тэчку"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr ""
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr ""
+
+#: gl/lib/regcomp.c:128
+#, fuzzy
+msgid "Invalid regular expression"
+msgstr "%s: нерэчаісны звычайны выраз: %s"
+
+#: gl/lib/regcomp.c:131
+#, fuzzy
+msgid "Invalid collation character"
+msgstr "нерэчаісны знак %s у радку рэжыму %s"
+
+#: gl/lib/regcomp.c:134
+#, fuzzy
+msgid "Invalid character class name"
+msgstr "нерэчаісны знак %s у радку рэжыму %s"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr ""
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr ""
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr ""
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr ""
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr ""
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr ""
+
+#: gl/lib/regcomp.c:155
+#, fuzzy
+msgid "Invalid range end"
+msgstr "%s: нерэчаісны звычайны выраз: %s"
+
+#: gl/lib/regcomp.c:158
+#, fuzzy
+msgid "Memory exhausted"
+msgstr "памяць вычарпана"
+
+#: gl/lib/regcomp.c:161
+#, fuzzy
+msgid "Invalid preceding regular expression"
+msgstr "%s: нерэчаісны звычайны выраз: %s"
+
+#: gl/lib/regcomp.c:164
+#, fuzzy
+msgid "Premature end of regular expression"
+msgstr "памылка ў пошуку звычайнага выразу"
+
+#: gl/lib/regcomp.c:167
+#, fuzzy
+msgid "Regular expression too big"
+msgstr "%s: нерэчаісны звычайны выраз: %s"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ""
+
+#: gl/lib/regcomp.c:650
+#, fuzzy
+msgid "No previous regular expression"
+msgstr "памылка ў пошуку звычайнага выразу"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "памяць вычарпана"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "нерэчаісны довад %s для %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "неадназначны довад %s для %s"
+
+#, c-format
+#~ msgid "Valid arguments are:"
+#~ msgstr "Рэчаісныя довады:"
+
+#~ msgid "write error"
+#~ msgstr "памылка запісу"
+
+#, fuzzy, c-format
+#~ msgid "error while opening \"%s\" for reading"
+#~ msgstr "немагыма адчыніць %s для чытаньня"
+
+#, fuzzy, c-format
+#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgstr "немагыма адчыніць %s для чытаньня"
+
+#, fuzzy, c-format
+#~ msgid "error reading \"%s\""
+#~ msgstr "памылка чытаньня %s"
+
+#, fuzzy, c-format
+#~ msgid "error writing \"%s\""
+#~ msgstr "памылка запісу %s"
+
+#, fuzzy, c-format
+#~ msgid "error after reading \"%s\""
+#~ msgstr "памылка чытаньня %s"
+
+#, fuzzy
+#~ msgid "fdopen() failed"
+#~ msgstr "памылка адкрыцьця"
+
+#, fuzzy, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s: збой seek"
+
+#~ msgid "regular empty file"
+#~ msgstr "звычайны парожні файл"
+
+#~ msgid "regular file"
+#~ msgstr "звычайны файл"
+
+#~ msgid "directory"
+#~ msgstr "тэчка"
+
+#~ msgid "block special file"
+#~ msgstr "асаблівы кавалкавы файл"
+
+#~ msgid "character special file"
+#~ msgstr "асаблівы знакавы файл"
+
+#~ msgid "fifo"
+#~ msgstr "fifo"
+
+#~ msgid "symbolic link"
+#~ msgstr "знакавае лучыва"
+
+#~ msgid "socket"
+#~ msgstr "socket"
+
+#~ msgid "message queue"
+#~ msgstr "чарга паведамленьняў"
+
+#~ msgid "semaphore"
+#~ msgstr "сэмафор"
+
+#~ msgid "shared memory object"
+#~ msgstr "абьект з агульнай памяцьцю"
+
+#, fuzzy
+#~ msgid "typed memory object"
+#~ msgstr "абьект з агульнай памяцьцю"
+
+#~ msgid "weird file"
+#~ msgstr "лёсавы файл"
+
+#, fuzzy
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "fifo файлы непадтрымліваюцца"
+
+#, fuzzy
+#~ msgid "ai_family not supported"
+#~ msgstr "fifo файлы непадтрымліваюцца"
+
+#, fuzzy
+#~ msgid "ai_socktype not supported"
+#~ msgstr "fifo файлы непадтрымліваюцца"
+
+#, fuzzy
+#~ msgid "System error"
+#~ msgstr "памылка запісу"
+
+#, fuzzy
+#~ msgid "Unknown error"
+#~ msgstr "Невядомая сыстэмная памылка"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: выбар `--%s' не дазваляе довад\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: нераспазнаны выбар `--%s'\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: недапушчальны выраб -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: выбар `-W %s' неадназначыны\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: выбар `-W %s' не дазваляе довад\n"
+
+#~ msgid "block size"
+#~ msgstr "памер кавалку"
+
+#, c-format
+#~ msgid "%s exists but is not a directory"
+#~ msgstr "%s існуе, але гэта ня тэчка"
+
+#, c-format
+#~ msgid "cannot change owner and/or group of %s"
+#~ msgstr "немагчыма зьмяніць уладальніка й/ці групу %s"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "немагчыма стварыць тэчку %s"
+
+#, c-format
+#~ msgid "cannot chdir to directory %s"
+#~ msgstr "немагчыма перайсьці да тэчкі %s"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "немагчыма зьмяніць правы %s"
+
+#, fuzzy
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "збой пры захаваньні правоў для %s"
+
+#, fuzzy
+#~ msgid "cannot create pipe"
+#~ msgstr "немагчыма стварыць лучыва %s"
+
+#~ msgid "`"
+#~ msgstr "`"
+
+#~ msgid "'"
+#~ msgstr "'"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[тТ]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[нН]"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "функцыя iconv непрыгодна для выкарыстаньня"
+
+#~ msgid "iconv function not available"
+#~ msgstr "недаступна функцыя iconv"
+
+#~ msgid "character out of range"
+#~ msgstr "знак па за дапушчальнымі межамі"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "немагчыма пераўтварыць U+%04X у мясцовы набор знакаў"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "немагчыма пераўтварыць U+%04X у мясцовы набор знакаў: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "нерэчаісны карыстальнік"
+
+#~ msgid "invalid group"
+#~ msgstr "нерэчаісная група"
+
+#~ msgid "cannot get the login group of a numeric UID"
+#~ msgstr "немагчыма атрымаць уліковую групу лічбавага UID"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Стваральнік %s.\n"
+
+#, fuzzy, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Стваральнік %s.\n"
+
+#, fuzzy, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Стваральнік %s.\n"
+
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr "Стваральнік %s.\n"
+
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr "Стваральнік %s.\n"
+
+#~ msgid "string comparison failed"
+#~ msgstr "памылка параўнаньня радку"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Усталюйце LC_ALL='C' каб працаваць без пытаньняў."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Радкі былі параўнаны тут %s і тут %s."
diff --git a/gl/po/bg.gmo b/gl/po/bg.gmo
new file mode 100644
index 0000000..7d76d53
--- /dev/null
+++ b/gl/po/bg.gmo
Binary files differ
diff --git a/gl/po/bg.po b/gl/po/bg.po
new file mode 100644
index 0000000..d388425
--- /dev/null
+++ b/gl/po/bg.po
@@ -0,0 +1,963 @@
+# Bulgarian translation of GNU gnulib po-file.
+# Copyright (C) 2019 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+# Alexander Shopov <ash@kambanaria.org>, 2019.
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 4.0.0.2567\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2020-03-10 09:45+0100\n"
+"Last-Translator: Alexander Shopov <ash@kambanaria.org>\n"
+"Language-Team: Bulgarian <dict@ludost.net>\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "„ARGP_HELP_FMT“: стойността %s е по-малка или равна на %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: параметърът „ARGP_HELP_FMT“ изисква стойност"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: непознат параметър „ARGP_HELP_FMT“"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Грешки в „ARGP_HELP_FMT“: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Аргументите, задължителните или незадължителни за дългите опции, са "
+"съответно задължителни или незадължителни и за кратките опции."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Използване:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " или: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [ОПЦИЯ…]"
+
+#: gl/lib/argp-help.c:1783
+#, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "За повече информация използвайте „%s --help“ или „%s --usage“.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr ""
+"Съобщавайте за програмни грешки на %s.\n"
+"За грешки в българския превод на <dict@fsa-bg.org>.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Неизвестна системна грешка"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "извеждане на тази справка"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "извеждане на кратко съобщение за използването"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "ИМЕ"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "задаване на името на програмата"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "СЕКУНДИ"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "спиране за толкова СЕКУНДИ (стандартно е 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "извеждане на версията на програмата"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(ДЕФЕКТ В ПРОГРАМАТА) Неизвестна версия!"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: Твърде много аргументи\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(ДЕФЕКТ В ПРОГРАМАТА) Опцията би трябвало да е била разпозната!"
+
+#: gl/lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: опцията „%s%s“ не е еднозначна\n"
+
+#: gl/lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: опцията „%s%s“ не е еднозначна. Възможности:"
+
+#: gl/lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: непозната опция „%s%s“\n"
+
+#: gl/lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: опцията „%s%s“ се използва без аргументи\n"
+
+#: gl/lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: опцията „%s%s“ изисква аргумент\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: неправилна опция — „%c“\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: опцията изисква аргумент — „%c“\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "текущата работна директория не може да се запише"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "не може да се върне към първоначалната работна директория"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Успех"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Няма съвпадения"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Неправилен регулярен израз"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Неправилен знак за подредба"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Неправилно име на клас знаци"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Самотна „\\“ накрая"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Неправилна препратка към съвпадение"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "„[“, „[^“, „[:“, „[.“ или „[=“ без еш"
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "„(“ или „\\(“ без еш"
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "„\\{“ без еш"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "Неправилно съдържание в „\\{\\}“"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Неправилен край на диапазон"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Паметта свърши"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Предхождащият регулярен израз е неправилен"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Ранен край на регулярен израз"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "Регулярният израз е прекалено голям"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr "„)“ или „\\)“ без еш"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Няма предхождащ регулярен израз"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "съобщението за грешка не може да се изведе"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "паметта е изчерпана"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr "стандартни файлови дескриптори"
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "аргументът „%s“ на опцията „%s“ е неправилен"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "аргументът „%s“ на опцията „%s“ не е еднозначен"
+
+#~ msgid "Valid arguments are:"
+#~ msgstr "Възможните аргументи са:"
+
+#, c-format
+#~ msgid "%u bitset_allocs, %u freed (%.2f%%).\n"
+#~ msgstr "%u побитови заделяния, освободени са %u (%.2f%%).\n"
+
+#, c-format
+#~ msgid "%u bitset_sets, %u cached (%.2f%%)\n"
+#~ msgstr "%u побитови задавания, кеширани са %u (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_resets, %u cached (%.2f%%)\n"
+#~ msgstr "%u побитови изчиствания, кеширани са %u (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_tests, %u cached (%.2f%%)\n"
+#~ msgstr "%u побитови проби, кеширани са %u (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_lists\n"
+#~ msgstr "%u побитови извеждания\n"
+
+#~ msgid "count log histogram\n"
+#~ msgstr "логаритмична хистограма по брой\n"
+
+#~ msgid "size log histogram\n"
+#~ msgstr "логаритмична хистограма по размер\n"
+
+#~ msgid "density histogram\n"
+#~ msgstr "хистограма по плътност\n"
+
+#, c-format
+#~ msgid ""
+#~ "Bitset statistics:\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Побитова статистика:\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Accumulated runs = %u\n"
+#~ msgstr "Натрупани изпълнения = %u\n"
+
+#~ msgid "cannot read stats file"
+#~ msgstr "файлът със статистиките не може да се прочете"
+
+#, c-format
+#~ msgid "bad stats file size\n"
+#~ msgstr "неправилен размер на файла със статистиките\n"
+
+#~ msgid "cannot write stats file"
+#~ msgstr "файлът със статистиките не може да се запише"
+
+#~ msgid "cannot open stats file for writing"
+#~ msgstr "файлът със статистиките не може да се отвори за запис"
+
+#~ msgid "program error"
+#~ msgstr "програмна грешка"
+
+#~ msgid "stack overflow"
+#~ msgstr "препълване на стека"
+
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr ""
+#~ "липсва временна директория, пробвайте да укажете такава в променливата "
+#~ "„TMPDIR“"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "не може да се създаде временна директория по шаблона „%s“"
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "временният файл „%s“ не може да се изтрие"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "временната директория „%s“ не може да се изтрие"
+
+#~ msgid "error closing file"
+#~ msgstr "грешка при затваряне на файл"
+
+#~ msgid "write error"
+#~ msgstr "грешка при запис"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "запазване на правата за „%s“"
+
+#, c-format
+#~ msgid "error while opening %s for reading"
+#~ msgstr "„%s“ не може да се отвори за четене"
+
+#, c-format
+#~ msgid "cannot open backup file %s for writing"
+#~ msgstr "резервният файл „%s“ не може да се отвори за запис"
+
+#, c-format
+#~ msgid "error reading %s"
+#~ msgstr "грешка при четене на „%s“"
+
+#, c-format
+#~ msgid "error writing %s"
+#~ msgstr "грешка при записа на „%s“"
+
+#, c-format
+#~ msgid "error after reading %s"
+#~ msgstr "грешка след четене на „%s“"
+
+#~ msgid "fdopen() failed"
+#~ msgstr "неуспешно отваряне с „fdopen()“"
+
+#~ msgid "C# compiler not found, try installing mono"
+#~ msgstr "Липсва компилатор за C#, инсталирайте „mono“"
+
+#~ msgid "C# virtual machine not found, try installing mono"
+#~ msgstr "Липсва виртуална машина за C#, инсталирайте „mono“"
+
+#~ msgid "unbalanced ["
+#~ msgstr "„[“ без еш"
+
+#~ msgid "invalid character class"
+#~ msgstr "неправилен клас знаци"
+
+#~ msgid "character class syntax is [[:space:]], not [:space:]"
+#~ msgstr "клас знаци се указва чрез „[[:ИМЕ:]]“, а не „[:ИМЕ:]“"
+
+#~ msgid "unfinished \\ escape"
+#~ msgstr "незавършена екранираща последователност чрез „\\“"
+
+#~ msgid "invalid content of \\{\\}"
+#~ msgstr "неправилно съдържание в „\\{\\}“"
+
+#~ msgid "regular expression too big"
+#~ msgstr "прекалено голям регулярен израз"
+
+#~ msgid "unbalanced ("
+#~ msgstr "„(“ без еш"
+
+#~ msgid "no syntax specified"
+#~ msgstr "не е зададен синтаксис"
+
+#~ msgid "unbalanced )"
+#~ msgstr "„)“ без еш"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "дъщерният процес „%s“ завърши неуспешно"
+
+#~ msgid "regular empty file"
+#~ msgstr "празен, обикновен файл"
+
+#~ msgid "regular file"
+#~ msgstr "обикновен файл"
+
+#~ msgid "directory"
+#~ msgstr "директория"
+
+#~ msgid "symbolic link"
+#~ msgstr "символна връзка"
+
+#~ msgid "message queue"
+#~ msgstr "опашка за съобщения"
+
+#~ msgid "semaphore"
+#~ msgstr "семафор"
+
+#~ msgid "shared memory object"
+#~ msgstr "споделен обект в паметта"
+
+#~ msgid "typed memory object"
+#~ msgstr "типов обект в паметта"
+
+#~ msgid "block special file"
+#~ msgstr "блоков специален файл"
+
+#~ msgid "character special file"
+#~ msgstr "знаков специален сайт"
+
+#~ msgid "contiguous data"
+#~ msgstr "последователни данни"
+
+#~ msgid "fifo"
+#~ msgstr "програмен канал"
+
+#~ msgid "door"
+#~ msgstr "порта"
+
+#~ msgid "multiplexed block special file"
+#~ msgstr "мултиплексиран блоков специален файл"
+
+#~ msgid "multiplexed character special file"
+#~ msgstr "мултиплексиран знаков специален файл"
+
+#~ msgid "multiplexed file"
+#~ msgstr "мултиплексиран файл"
+
+#~ msgid "named file"
+#~ msgstr "именован файл"
+
+#~ msgid "network special file"
+#~ msgstr "мрежов специален файл"
+
+#~ msgid "migrated file with data"
+#~ msgstr "мигриран файл с данни"
+
+#~ msgid "migrated file without data"
+#~ msgstr "мигриран файл без данни"
+
+#~ msgid "port"
+#~ msgstr "порт"
+
+#~ msgid "socket"
+#~ msgstr "гнездо"
+
+#~ msgid "whiteout"
+#~ msgstr "припокриващо изтриване"
+
+#~ msgid "weird file"
+#~ msgstr "странен файл"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Този вид адреси за името на хоста не се поддържат"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Временен проблем при намиране на IP-адреса на хост"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Неправилна стойност за „ai_flags“"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Окончателен неуспех при намиране на IP-адреса на хост"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "посочването на вид адреси („ai_family“) не се поддържа"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Неуспешно заделяне на памет"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "Няма IP-адрес с посоченото име на хост"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Името или услугата са непознати"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr ""
+#~ "Името на услугата не се поддържа за използвания вид гнездо („ai_socktype“)"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "посочването на вид гнездо („ai_socktype“) не се поддържа"
+
+#~ msgid "System error"
+#~ msgstr "Системна грешка"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "Буферът за аргументите е твърде малък"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Заявката е в процес на изпълнение"
+
+#~ msgid "Request canceled"
+#~ msgstr "Заявката е отменена"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Заявката не е отменена"
+
+#~ msgid "All requests done"
+#~ msgstr "Изпълнени са всички заявки"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Прекъснат със сигнал"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "Неправилно кодиран низ на аргумент"
+
+#~ msgid "Unknown error"
+#~ msgstr "Неизвестна грешка"
+
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr ""
+#~ "неправилен аргумент „source_version“ за версията на кода към командата "
+#~ "„compile_java_class“"
+
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr ""
+#~ "неправилен аргумент „target_version“ за версията на целта към командата "
+#~ "„compile_java_class“"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "„%s“ не може да се създаде"
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "грешка при записа на „%s“"
+
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr ""
+#~ "Липсва компилатор за Java, инсталирайте „gcj“ или задайте такъв с "
+#~ "променливата „JAVAC“"
+
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "Липсва виртуална машина за Java, инсталирайте „gcj“ или задайте такава с "
+#~ "променливата „JAVA“"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "%s: вх./изх. грешка в дъщерен процес"
+
+#, c-format
+#~ msgid "cannot stat %s"
+#~ msgstr "не може да се получи информация със „stat“ за „%s“"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "правата за достъп до „%s“ не може да се сменят"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "директорията „%s“ не може да се създаде"
+
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "„/dev/zero“ не може да се отвори за запис"
+
+#~ msgid "creation of reading thread failed"
+#~ msgstr "неуспешно създаване на четяща нишка"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "не може да се зададе вх./изх. без блокиране за подпроцеса „%s“"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "неуспешна комуникация с дъщерния процес „%s“"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "неуспешен запис към дъщерния процес „%s“"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "неуспешно четене от дъщерния процес „%s“"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "подпроцесът „%s“ завърши с код за състояние %d"
+
+#~ msgid "creation of threads failed"
+#~ msgstr "неуспешно създаване н нишки"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "подпроцесът на „%s“ завърши с код за състояние %d\""
+
+#~ msgid "`"
+#~ msgstr "„"
+
+#~ msgid "'"
+#~ msgstr "“"
+
+# RECHECK
+#~ msgid "^[yY]"
+#~ msgstr "^[yYдДщЩ]"
+
+# RECHECK
+#~ msgid "^[nN]"
+#~ msgstr "^[nNнНхХ]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "задаване на права на „%s“"
+
+#~ msgid "Hangup"
+#~ msgstr "Прекъсване на връзката"
+
+#~ msgid "Interrupt"
+#~ msgstr "Прекъсване"
+
+#~ msgid "Quit"
+#~ msgstr "Спиране"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "Неправилна инструкция"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Прекъсване за трасиране"
+
+#~ msgid "Aborted"
+#~ msgstr "Преустановяване"
+
+#~ msgid "Floating point exception"
+#~ msgstr "Изключение от плаваща запетая"
+
+#~ msgid "Killed"
+#~ msgstr "Убит"
+
+#~ msgid "Bus error"
+#~ msgstr "Грешка в шината"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "Грешка в разделянето"
+
+#~ msgid "Broken pipe"
+#~ msgstr "Прекъснат програмен канал"
+
+#~ msgid "Alarm clock"
+#~ msgstr "Аларма"
+
+#~ msgid "Terminated"
+#~ msgstr "Прекратен"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "Спешно вх./изх. състояние"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "Спрян (сигнал)"
+
+#~ msgid "Stopped"
+#~ msgstr "Спрян"
+
+#~ msgid "Continued"
+#~ msgstr "Продължен"
+
+#~ msgid "Child exited"
+#~ msgstr "Преустановен дъщерен процес"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Спиране (вход от tty)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Спиране (изход към tty)"
+
+#~ msgid "I/O possible"
+#~ msgstr "Възможен вх./изх."
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "Надвишаване на процесорното време"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "Надвишаване на размера на файл"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "Изтекъл виртуален таймер"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "Изтекъл профилиращ таймер"
+
+#~ msgid "Window changed"
+#~ msgstr "Преоразмерен прозорец"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "Потребителски сигнал 1"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Потребителски сигнал 2"
+
+#~ msgid "EMT trap"
+#~ msgstr "Емулирана инструкция"
+
+#~ msgid "Bad system call"
+#~ msgstr "Грешно системно извикване"
+
+#~ msgid "Stack fault"
+#~ msgstr "Грешка в разделянето"
+
+#~ msgid "Information request"
+#~ msgstr "Заявка за информация"
+
+#~ msgid "Power failure"
+#~ msgstr "Проблем в захранването"
+
+#~ msgid "Resource lost"
+#~ msgstr "Загубен ресурс"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "грешка при запис във вече затворен програмен канал или гнездо"
+
+#~ msgid "cannot create pipe"
+#~ msgstr "не може да се създаде програмен канал"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "Сигнал за реално време %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Непознат сигнал %d"
+
+#~ msgid "Execution times (seconds)"
+#~ msgstr "Време за изпълнение [секунди]"
+
+#~ msgid "CPU user"
+#~ msgstr "потребителско време"
+
+#~ msgid "CPU system"
+#~ msgstr "системно време"
+
+#~ msgid "wall clock"
+#~ msgstr "общо време"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "функцията „iconv“ е неизползваема"
+
+#~ msgid "iconv function not available"
+#~ msgstr "функцията „iconv“ е недостъпна"
+
+#~ msgid "character out of range"
+#~ msgstr "знак извън диапазона"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "„U+%04X“ не може да се конвертира в локалното кодиране"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "„U+%04X“ не може да се конвертира в локалното кодиране: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "несъществуващ потребител"
+
+#~ msgid "invalid group"
+#~ msgstr "несъществуваща група"
+
+#~ msgid "invalid spec"
+#~ msgstr "неправилна спецификация"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "Пакетирано от %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "Пакетирано от %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "©"
+
+#, c-format
+#~ msgid ""
+#~ "License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ msgstr ""
+#~ "Лиценз — Общ публичен лиценз на GNU (GNU GPL), както е публикуван от "
+#~ "Фондацията\n"
+#~ "за свободен софтуер — версия 3 на лиценза или (по ваше решение) по-късна "
+#~ "версия.\n"
+#~ "<%s>\n"
+#~ "Тази програма е свободен софтуер. Можете да я разпространявате и/или "
+#~ "променяте.\n"
+#~ "Тя се разпространява БЕЗ НИКАКВИ ГАРАНЦИИ доколкото е позволено от "
+#~ "закона.\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Създадено от %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Създадено от %s и %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Създадено от %s, %s и %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Създадено от %s, %s, %s\n"
+#~ "и %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Създадено от %s, %s, %s,\n"
+#~ "%s и %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Създадено от %s, %s, %s,\n"
+#~ "%s, %s и %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Създадено от %s, %s, %s,\n"
+#~ "%s, %s, %s и %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Създадено от %s, %s, %s,\n"
+#~ "%s, %s, %s, %s\n"
+#~ "и %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Създадено от %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s и %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Създадено от %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s и др.\n"
+
+#, c-format
+#~ msgid "Report bugs to: %s\n"
+#~ msgstr ""
+#~ "Докладвайте грешки в програмата на адрес: %s\n"
+#~ "Докладвайте грешки в превода на адрес: <dict@ludost.net>\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "Докладвайте грешки в „%s“ на адрес: %s\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "Уеб страница на „%s“: <%s>\n"
+
+#, c-format
+#~ msgid "General help using GNU software: <%s>\n"
+#~ msgstr "Обща помощ за програмите на GNU: <%s>\n"
+
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "неуспешно изпълнение на „_open_osfhandle“"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr ""
+#~ "файловият дескриптор %d не може да се възстанови: неуспешно изпълнение на "
+#~ "функцията „dup2“"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "дъщерен процес „%s“"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "дъщерният процес „%s“ получи фатален сигнал %d"
+
+#~ msgid "failed to set file descriptor text/binary mode"
+#~ msgstr "неуспешно задаване на вид на файла като текстов/двоичен"
+
+#~ msgid "stdin"
+#~ msgstr "стандартен вход"
+
+#~ msgid "stdout"
+#~ msgstr "стандартен изход"
+
+#~ msgid "stderr"
+#~ msgstr "стандартна грешка"
+
+#~ msgid "unknown stream"
+#~ msgstr "непознат поток"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "файлът „%s“ не може да се отвори наново с режим „%s“"
+
+#~ msgid "string comparison failed"
+#~ msgstr "неуспешно сравнение на низове"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Използвайте „LC_ALL='C'“, за да заобиколите този проблем."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Сравняваните низове бяха %s и %s."
+
+#~ msgid "cannot perform formatted output"
+#~ msgstr "невъзможно форматиране на изхода"
+
+#, c-format
+#~ msgid "invalid %s%s argument '%s'"
+#~ msgstr "неправилен аргумент „%3$s“ за опцията „%1$s%2$s“"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument '%s'"
+#~ msgstr "неправилен суфикс в аргумента „%3$s“ за опцията „%1$s%2$s“"
+
+#, c-format
+#~ msgid "%s%s argument '%s' too large"
+#~ msgstr "прекалено дълъг аргумент „%3$s“ за опцията „%1$s%2$s“"
diff --git a/gl/po/boldquot.sed b/gl/po/boldquot.sed
new file mode 100644
index 0000000..4b937aa
--- /dev/null
+++ b/gl/po/boldquot.sed
@@ -0,0 +1,10 @@
+s/"\([^"]*\)"/“\1”/g
+s/`\([^`']*\)'/‘\1’/g
+s/ '\([^`']*\)' / ‘\1’ /g
+s/ '\([^`']*\)'$/ ‘\1’/g
+s/^'\([^`']*\)' /‘\1’ /g
+s/“”/""/g
+s/“/“/g
+s/”/”/g
+s/‘/‘/g
+s/’/’/g
diff --git a/gl/po/ca.gmo b/gl/po/ca.gmo
new file mode 100644
index 0000000..5240ac9
--- /dev/null
+++ b/gl/po/ca.gmo
Binary files differ
diff --git a/gl/po/ca.po b/gl/po/ca.po
new file mode 100644
index 0000000..fd995d5
--- /dev/null
+++ b/gl/po/ca.po
@@ -0,0 +1,588 @@
+# GNU Mailutils Catalan translation.
+# Copyright © 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+# This file is distributed under the same license as the mailutils package.
+# Jordi Mallach <jordi@gnu.org>, 2002, 2003, 2004, 2005.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mailutils 0.6.90\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2005-05-21 04:10+0200\n"
+"Last-Translator: Jordi Mallach <jordi@gnu.org>\n"
+"Language-Team: Catalan <ca@dodds.net>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=n!=1;\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: El paràmetre ARGP_HELP_FMT requereix un valor"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: El paràmetre d'ARGP_HELP_FMT és desconegut"
+
+# pfft, escombraries... jm
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Hi ha escombraries en ARGP_HELP_FMT: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Els arguments necessaris o opcionals per a les opcions llargues també són "
+"necessaris o opcionals per a qualsevol opció curta corresponent."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Forma d'ús:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " ó: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [OPCIÓ...]"
+
+#: gl/lib/argp-help.c:1783
+#, fuzzy, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Proveu «%s --help» o «%s --usage» per a obtindre més informació.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "Informeu dels errors a %s.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "S'ha produït un error desconegut del sistema"
+
+#: gl/lib/argp-parse.c:91
+#, fuzzy
+msgid "give this help list"
+msgstr "Mostra aquesta llista d'ajuda"
+
+#: gl/lib/argp-parse.c:92
+#, fuzzy
+msgid "give a short usage message"
+msgstr "Mostra un curt missatge sobre l'ús"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "NOM"
+
+#: gl/lib/argp-parse.c:94
+#, fuzzy
+msgid "set the program name"
+msgstr "Estableix el nom del programa"
+
+#: gl/lib/argp-parse.c:95
+#, fuzzy
+msgid "SECS"
+msgstr "SEGONS"
+
+#: gl/lib/argp-parse.c:96
+#, fuzzy
+msgid "hang for SECS seconds (default 3600)"
+msgstr "Penja durant SEGS segons (per defecte 3600)"
+
+#: gl/lib/argp-parse.c:154
+#, fuzzy
+msgid "print program version"
+msgstr "Mostra la versió del programa"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(ERROR DEL PROGRAMA) Cap versió coneguda!?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: Massa arguments\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(ERROR DEL PROGRAMA) L'opció s'hauria d'haver reconegut!?"
+
+#: gl/lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: l'opció «%s» és ambigua\n"
+
+#: gl/lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: l'opció «%s» és ambigua\n"
+
+#: gl/lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: l'opció «%c%s» no es reconeix\n"
+
+#: gl/lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: l'opció «%c%s» no accepta arguments\n"
+
+#: gl/lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: l'opció «%s» requereix un argument\n"
+
+#: gl/lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: l'opció no és vàlida -- %c\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: l'opció requereix un argument -- %c\n"
+
+#: gl/lib/openat-die.c:38
+#, fuzzy, c-format
+msgid "unable to record current working directory"
+msgstr "openat: no s'ha pogut registrar el directori de treball actual"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "no s'ha pogut tornar al directori inicial de treball"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr ""
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr ""
+
+#: gl/lib/regcomp.c:128
+#, fuzzy
+msgid "Invalid regular expression"
+msgstr "%s: l'expressió regular no és vàlida: %s"
+
+#: gl/lib/regcomp.c:131
+#, fuzzy
+msgid "Invalid collation character"
+msgstr "la classe de caràcters «%s» no és vàlida"
+
+#: gl/lib/regcomp.c:134
+#, fuzzy
+msgid "Invalid character class name"
+msgstr "la classe de caràcters «%s» no és vàlida"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr ""
+
+#: gl/lib/regcomp.c:140
+#, fuzzy
+msgid "Invalid back reference"
+msgstr "El número no és vàlid"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr ""
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr ""
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr ""
+
+#: gl/lib/regcomp.c:152
+#, fuzzy
+msgid "Invalid content of \\{\\}"
+msgstr "L'opció no és vàlida -- %s"
+
+#: gl/lib/regcomp.c:155
+#, fuzzy
+msgid "Invalid range end"
+msgstr "el rang de pàgines no és vàlid: «%s»"
+
+#: gl/lib/regcomp.c:158
+#, fuzzy
+msgid "Memory exhausted"
+msgstr "la memòria s'ha exhaurit"
+
+#: gl/lib/regcomp.c:161
+#, fuzzy
+msgid "Invalid preceding regular expression"
+msgstr "%s: l'expressió regular no és vàlida: %s"
+
+#: gl/lib/regcomp.c:164
+#, fuzzy
+msgid "Premature end of regular expression"
+msgstr "error en la recerca de l'expressió regular"
+
+#: gl/lib/regcomp.c:167
+#, fuzzy
+msgid "Regular expression too big"
+msgstr "%s: l'expressió regular no és vàlida: %s"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ""
+
+#: gl/lib/regcomp.c:650
+#, fuzzy
+msgid "No previous regular expression"
+msgstr "error en la recerca de l'expressió regular"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "la memòria s'ha exhaurit"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
+
+# Usa quote() en els 2 args. ivb
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "l'argument %s no és vàlid per %s"
+
+# Usa quote() en els 2 args. ivb
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "l'argument %s és ambigu per %s"
+
+#, c-format
+#~ msgid "Valid arguments are:"
+#~ msgstr "Els arguments vàlids són:"
+
+#, fuzzy
+#~ msgid "program error"
+#~ msgstr "error de lectura"
+
+# "underflow", bonico el paraulo.. jm
+#, fuzzy
+#~ msgid "stack overflow"
+#~ msgstr "pila buida"
+
+#~ msgid "write error"
+#~ msgstr "error d'escriptura"
+
+# Usa quote(). ivb
+#, fuzzy, c-format
+#~ msgid "error while opening \"%s\" for reading"
+#~ msgstr "no s'ha pogut obrir %s per llegir"
+
+# Usa quote(). ivb
+#, fuzzy, c-format
+#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgstr "no s'ha pogut obrir %s per a escriure"
+
+# uniq no usa quote(). ivb
+#, fuzzy, c-format
+#~ msgid "error reading \"%s\""
+#~ msgstr "error en llegir %s"
+
+# uniq no usa quote(). ivb
+#, fuzzy, c-format
+#~ msgid "error writing \"%s\""
+#~ msgstr "error en escriure %s"
+
+# uniq no usa quote(). ivb
+#, fuzzy, c-format
+#~ msgid "error after reading \"%s\""
+#~ msgstr "error en llegir %s"
+
+#, fuzzy
+#~ msgid "fdopen() failed"
+#~ msgstr "no s'ha pogut obrir"
+
+#, fuzzy, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s: ha fallat el desplaçament"
+
+#~ msgid "regular empty file"
+#~ msgstr "fitxer ordinari buit"
+
+#~ msgid "regular file"
+#~ msgstr "fitxer ordinari"
+
+#~ msgid "directory"
+#~ msgstr "directori"
+
+#~ msgid "block special file"
+#~ msgstr "fitxer especial de blocs"
+
+#~ msgid "character special file"
+#~ msgstr "fitxer especial de caràcters"
+
+#~ msgid "fifo"
+#~ msgstr "cua FIFO"
+
+#~ msgid "symbolic link"
+#~ msgstr "enllaç simbòlic"
+
+#~ msgid "socket"
+#~ msgstr "connector"
+
+#~ msgid "message queue"
+#~ msgstr "cua de missatges"
+
+#~ msgid "semaphore"
+#~ msgstr "semàfor"
+
+#~ msgid "shared memory object"
+#~ msgstr "objecte de memòria compartida"
+
+#~ msgid "typed memory object"
+#~ msgstr "objecte de memòria amb tipus"
+
+#~ msgid "weird file"
+#~ msgstr "fitxer estrany"
+
+#, fuzzy
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "els fitxers FIFO no són suportats"
+
+#, fuzzy
+#~ msgid "ai_family not supported"
+#~ msgstr "els fitxers FIFO no són suportats"
+
+#, fuzzy
+#~ msgid "Memory allocation failure"
+#~ msgstr "L'operació ha fallat"
+
+#, fuzzy
+#~ msgid "ai_socktype not supported"
+#~ msgstr "els fitxers FIFO no són suportats"
+
+#, fuzzy
+#~ msgid "System error"
+#~ msgstr "error d'escriptura"
+
+#, fuzzy
+#~ msgid "Request not canceled"
+#~ msgstr "No es troba l'element sol·licitat"
+
+#, fuzzy
+#~ msgid "Unknown error"
+#~ msgstr "S'ha produït un error desconegut del sistema"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: l'opció «--%s» no accepta arguments\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: l'opció «--%s» no es reconeix\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: l'opció és il·legal -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: l'opció «-W %s» és ambigua\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: l'opció «-W %s» no accepta arguments\n"
+
+# FIXME: xmalloc.h: _STRTOL_ERROR lacks i18n. ivb
+# Açò quedarà com «invalid mida de bloc `MIDA'» mentre no ho facen. ivb
+#~ msgid "block size"
+#~ msgstr "mida de bloc"
+
+# Els 4 usen quote(). ivb
+#, c-format
+#~ msgid "%s exists but is not a directory"
+#~ msgstr "%s existeix però no és un directori"
+
+# Els 3 usen quote(). ivb
+#, c-format
+#~ msgid "cannot change owner and/or group of %s"
+#~ msgstr "no s'ha pogut canviar el propietari o grup de %s"
+
+# Els 3 usen quote(). ivb
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "no s'ha pogut crear el directori %s"
+
+# Usa quote(). ivb
+#, c-format
+#~ msgid "cannot chdir to directory %s"
+#~ msgstr "no s'ha pogut canviar al directori %s"
+
+# Els 2 usen quote(). ivb
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "no s'han pogut canviar els permisos de %s"
+
+#, fuzzy
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "%s: no s'ha pogut obrir per a escriure"
+
+#, fuzzy
+#~ msgid "cannot create pipe"
+#~ msgstr "No es pot crear la llista"
+
+#~ msgid "`"
+#~ msgstr "«"
+
+#~ msgid "'"
+#~ msgstr "»"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[sS]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "la funció iconv() no és útil"
+
+#~ msgid "iconv function not available"
+#~ msgstr "la funció iconv() no es troba disponible"
+
+#~ msgid "character out of range"
+#~ msgstr "el caràcter es troba fora del rang"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "no s'ha pogut convertir U+%04X al joc de caràcters local"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "no s'ha pogut convertir U+%04X al joc de caràcters local: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "l'usuari no és vàlid"
+
+#~ msgid "invalid group"
+#~ msgstr "el grup no és vàlid"
+
+#~ msgid "cannot get the login group of a numeric UID"
+#~ msgstr "no s'ha pogut obtenir el grup d'entrada d'un UID numèric"
+
+#, fuzzy
+#~ msgid ""
+#~ "\n"
+#~ "This is free software. You may redistribute copies of it under the terms "
+#~ "of\n"
+#~ "the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Aquest és programari lliure; podeu redistribuir-lo i/o modificar-lo sota "
+#~ "els\n"
+#~ "termes de la Llicència Pública General GNU tal i com ha estat publicada "
+#~ "per la\n"
+#~ "Free Software Foundation; bé sota la versió 2 de la Llicència o bé (si "
+#~ "ho\n"
+#~ "preferiu) sota qualsevol versió posterior.\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Escrit per %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Escrit per %s i %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Escrit per %s, %s i %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Escrit per %s, %s, %s\n"
+#~ "i %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Escrit per %s, %s, %s,\n"
+#~ "%s i %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Escrit per %s, %s, %s,\n"
+#~ "%s, %s i %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Escrit per %s, %s, %s,\n"
+#~ "%s, %s, %s i %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Escrit per %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "i %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Escrit per %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s i %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Escrit per %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s i d'altres.\n"
+
+#~ msgid "string comparison failed"
+#~ msgstr "ha fallat la comparació de cadenes"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Establiu la variable LC_ALL a «C» per evitar el problema."
+
+# Usa quote() en les 2. ivb
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Les cadenes comparades eren %s i %s."
diff --git a/gl/po/cs.gmo b/gl/po/cs.gmo
new file mode 100644
index 0000000..a2e40ec
--- /dev/null
+++ b/gl/po/cs.gmo
Binary files differ
diff --git a/gl/po/cs.po b/gl/po/cs.po
new file mode 100644
index 0000000..cb72210
--- /dev/null
+++ b/gl/po/cs.po
@@ -0,0 +1,866 @@
+# Czech translations for GNU textutils
+# This file is distributed under the same license as the gnulib package.
+# Copyright (C) 1996 Free Software Foundation, Inc.
+#
+# Vladimir Michl <Vladimir.Michl@seznam.cz>, 1996.
+# Marek Černocký <marek@manet.cz>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 3.0.0.6062.a6b16\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2011-12-04 08:50+0100\n"
+"Last-Translator: Marek Černocký <marek@manet.cz>\n"
+"Language-Team: Czech <translation-team-cs@lists.sourceforge.net>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: hodnota %s je menší nebo rovna %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: Parametr ARGP_HELP_FMT vyžaduje hodnotu"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: Neznámý parametr ARGP_HELP_FMT"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Nesmysly v ARGP_HELP_FMT: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Povinné či volitelné, argumenty pro dlouhé přepínače jsou povinné či "
+"volitelné, i pro případné odpovídající krátké přepínače."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Použití:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " nebo:"
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [PŘEPÍNAČ…]"
+
+#: gl/lib/argp-help.c:1783
+#, fuzzy, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Více informací získáte příkazem „%s --help“ nebo „%s --usage“.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "Chyby hlaste na %s.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Neznámá chyba systému"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "poskytne tuto přehledovou nápovědu"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "poskytne stručnou informaci o používání"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "NÁZEV"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "nastavit název programu"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "SEK"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "zastavit na SEK sekund (výchozí je 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "vypsat verzi programu"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(CHYBA PROGRAMU) Neznámá verze!?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: Příliš mnoho argumentů\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(CHYBA PROGRAMU) Měl by být rozpoznán přepínač!?"
+
+#: gl/lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: přepínač „-W %s“ není jednoznačný\n"
+
+#: gl/lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: přepínač „%s“ není jednoznačný; možnosti:"
+
+#: gl/lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: neznámý přepínač „%c%s“\n"
+
+#: gl/lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: přepínač „%c%s“ musí být zadán bez argumentu\n"
+
+#: gl/lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: přepínač „--%s“ vyžaduje argument\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: neplatný přepínač -- „%c“\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: přepínač vyžaduje argument -- „%c“\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "nelze zaznamenat aktuální pracovní složku"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "selhalo vrácení počáteční pracovní složky"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Úspěch"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Žádná shoda"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "neplatný regulární výraz"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "neplatný znak pro porovnávání"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "neplatný název třídy znaku"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Zpětné lomítko na konci"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Neplatný zpětný odkaz"
+
+#: gl/lib/regcomp.c:143
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Chybí odpovídající závorka k [ nebo [^"
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "Chybí odpovídající závorka k ( nebo \\("
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "Chybí odpovídající závorka k \\{"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "Neplatný obsah \\{\\}"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Neplatný konec rozsahu"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Paměť byla vyčerpána"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Neplatný předchozí regulární výraz"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Předčasný konec regulárního výrazu"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "Regulární výraz je příliš velký"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr "Chybí odpovídající závorka k ) nebo \\)"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Žádný předchozí regulární výraz"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "nelze zobrazit chybovou zprávu"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "paměť byla vyčerpána"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "argument %s je pro %s neplatný"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "argument %s je pro %s nejednoznačný"
+
+#, c-format
+#~ msgid "Valid arguments are:"
+#~ msgstr "Platné argumenty jsou:"
+
+#, c-format
+#~ msgid "%.*s: ARGP_HELP_FMT parameter must be positive"
+#~ msgstr "%.*s: Parametr ARGP_HELP_FMT musí být kladný"
+
+#~ msgid "program error"
+#~ msgstr "chyba programu"
+
+#~ msgid "stack overflow"
+#~ msgstr "přetečení zásobníku"
+
+#, c-format
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr "nelze najít dočasnou složku, zkusí se nastavit $TMPDIR"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "nelze vytvořit dočasnou složku pomocí šablony „%s“"
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "nelze odstranit dočasný soubor %s"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "nelze odstranit dočasnou složku %s"
+
+#~ msgid "error closing file"
+#~ msgstr "chyba při zavírání souboru"
+
+#~ msgid "write error"
+#~ msgstr "chyba při zápisu"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "zachování práv k souboru %s"
+
+#, c-format
+#~ msgid "error while opening \"%s\" for reading"
+#~ msgstr "chyba při otevírání souboru „%s“ pro čtení"
+
+#, c-format
+#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgstr "nelze otevřít záložní soubor „%s“ pro zápis"
+
+#, c-format
+#~ msgid "error reading \"%s\""
+#~ msgstr "chyba při čtení souboru „%s“"
+
+#, c-format
+#~ msgid "error writing \"%s\""
+#~ msgstr "chyba při zápisu do souboru „%s“"
+
+#, c-format
+#~ msgid "error after reading \"%s\""
+#~ msgstr "chyba po přečtení souboru „%s“"
+
+#, c-format
+#~ msgid "fdopen() failed"
+#~ msgstr "selhala funkce fdopen()"
+
+#, c-format
+#~ msgid "C# compiler not found, try installing pnet"
+#~ msgstr "Překladač C# nebyl nalezen, zkuste nainstalovat pnet"
+
+#, c-format
+#~ msgid "C# virtual machine not found, try installing pnet"
+#~ msgstr "Virtuální stroj C# nebyl nalezen, zkuste nainstalovat pnet"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "selhal podřízený proces %s"
+
+#~ msgid "regular empty file"
+#~ msgstr "prázdný běžný soubor"
+
+#~ msgid "regular file"
+#~ msgstr "běžný soubor"
+
+#~ msgid "directory"
+#~ msgstr "složka"
+
+#~ msgid "block special file"
+#~ msgstr "speciální soubor blokového zařízení"
+
+#~ msgid "character special file"
+#~ msgstr "speciální soubor znakového zařízení"
+
+#~ msgid "fifo"
+#~ msgstr "fronta fifo"
+
+#~ msgid "symbolic link"
+#~ msgstr "symbolický odkaz"
+
+#~ msgid "socket"
+#~ msgstr "soket"
+
+#~ msgid "message queue"
+#~ msgstr "fronta zpráv"
+
+#~ msgid "semaphore"
+#~ msgstr "semafor"
+
+#~ msgid "shared memory object"
+#~ msgstr "sdílený paměťový objekt"
+
+#~ msgid "typed memory object"
+#~ msgstr "typový paměťový objekt"
+
+#~ msgid "weird file"
+#~ msgstr "podivný soubor"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Pro název počítače není rodina adres podporována"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Dočasné selhání při překladu názvu"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Špatná hodnota pro příznaky ai_flags"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Nenapravitelné selhání při překladu názvu"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "ai_family není podporována"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Selhalo přidělení paměti"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "K názvu počítače není přiřazena žádná adresa"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Název nebo služba nejsou známy"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "Název služby není podporován pro ai_socktype"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "ai_socktype není podporován"
+
+#~ msgid "System error"
+#~ msgstr "Chyba systému"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "Vyrovnávací paměť argumentů je příliš malá"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Probíhá zpracování požadavku"
+
+#~ msgid "Request canceled"
+#~ msgstr "Požadavek byl zrušen"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Požadavek nebyl zrušen"
+
+#~ msgid "All requests done"
+#~ msgstr "Všechny požadavky dokončeny"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Přerušeno signálem"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "Řetězec s parametry není správně kódován"
+
+#~ msgid "Unknown error"
+#~ msgstr "Neznámá chyba"
+
+#, c-format
+#~ msgid "%s: option '--%s' doesn't allow an argument\n"
+#~ msgstr "%s: přepínač „--%s“ musí být zadán bez argumentu\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option '--%s'\n"
+#~ msgstr "%s: neznámý přepínač „--%s“\n"
+
+#, c-format
+#~ msgid "%s: option '-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: přepínač „-W %s“ musí být zadán bez argumentu\n"
+
+#, c-format
+#~ msgid "%s: option '-W %s' requires an argument\n"
+#~ msgstr "%s: přepínač „-W %s“ vyžaduje argument\n"
+
+#, c-format
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "neplatný argument source_version pro compile_java_class"
+
+#, c-format
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "neplatný argument target_version pro compile_java_class"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "selhalo vytvoření „%s“"
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "chyba při zápisu souboru „%s“"
+
+#, c-format
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr ""
+#~ "Překladač jazyka Java nebyl nalezen, zkuste nainstalovat gcj nebo "
+#~ "nastavit proměnnou $JAVAC"
+
+#, c-format
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "Virtuální stroj Java nebyl nalezen, zkuste nainstalovat gij nebo nastavit "
+#~ "proměnnou $JAVAC"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "V/V chyba podřízeného procesu %s"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "nelze změnit oprávnění k %s"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "nelze vytvořit složku %s"
+
+#, c-format
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Selhalo otevření /dev/zero pro čtení"
+
+#, c-format
+#~ msgid "creation of reading thread failed"
+#~ msgstr "vytvoření čtecího vlákna selhalo"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "nelze nastavit neblokující V/V pro podřízený proces %s"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "komunikace s podřízeným procesem %s selhala"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "zápis do podřízeného procesu %s selhal"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "čtení z podřízeného procesu %s selhalo"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "podřízený proces %s byl ukončen s návratovým kódem %d"
+
+#, c-format
+#~ msgid "creation of threads failed"
+#~ msgstr "vytvoření vlákna selhalo"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "podřízený proces %s byl ukončen s návratovým kódem %d"
+
+#~ msgid "Franc,ois Pinard"
+#~ msgstr "Franc, ois Pinard"
+
+#~ msgid "`"
+#~ msgstr "„"
+
+#~ msgid "'"
+#~ msgstr "“"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[aAyY]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "nastavení oprávnění k %s"
+
+#~ msgid "Hangup"
+#~ msgstr "Zavěsit"
+
+#~ msgid "Interrupt"
+#~ msgstr "Přerušení"
+
+#~ msgid "Quit"
+#~ msgstr "Ukončit"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "Neplatná instrukce"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Krokování/bod přerušení"
+
+#~ msgid "Aborted"
+#~ msgstr "Přerušen"
+
+#~ msgid "Floating point exception"
+#~ msgstr "Výjimka ve výpočtu s plovoucí čárkou"
+
+#~ msgid "Killed"
+#~ msgstr "Zabit"
+
+#~ msgid "Bus error"
+#~ msgstr "Chyba sběrnice"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "Porušení ochrany paměti"
+
+#~ msgid "Broken pipe"
+#~ msgstr "Porušená roura"
+
+#~ msgid "Alarm clock"
+#~ msgstr "Alarm od hodin"
+
+#~ msgid "Terminated"
+#~ msgstr "Ukončen"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "Urgentní stav V/V"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "Pozastavit (signál)"
+
+#~ msgid "Stopped"
+#~ msgstr "Pozastaven"
+
+#~ msgid "Continued"
+#~ msgstr "Pokračuje"
+
+#~ msgid "Child exited"
+#~ msgstr "Potomek skončil"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Pozastaven (vstup tty)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Pozastaven (výstup tty)"
+
+#~ msgid "I/O possible"
+#~ msgstr "Možný V/V"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "Překročeno časové omezení procesoru"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "Překročeno omezení velikosti souboru"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "Virtuální časovač doběhl"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "Profilovací časovač doběhl"
+
+#~ msgid "Window changed"
+#~ msgstr "Změnilo se okno"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "Uživatelsky definovaný signál 1"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Uživatelsky definovaný signál 2"
+
+#~ msgid "EMT trap"
+#~ msgstr "Krokování emulátoru (EMT)"
+
+#~ msgid "Bad system call"
+#~ msgstr "Chybné systémové volání"
+
+#~ msgid "Stack fault"
+#~ msgstr "Porušení zásobníku"
+
+#~ msgid "Information request"
+#~ msgstr "Žádost o informace"
+
+#~ msgid "Power failure"
+#~ msgstr "Selhalo napájení"
+
+#~ msgid "Resource lost"
+#~ msgstr "Prostředek přestal být k dispozici"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "chyba zápisu do zavřené roury nebo soketu"
+
+#, c-format
+#~ msgid "cannot create pipe"
+#~ msgstr "nelze vytvořit rouru"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "Signál reálného času %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Neznámý signál %d"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "funkce iconv není použitelná"
+
+#~ msgid "iconv function not available"
+#~ msgstr "funkce iconv není dostupná"
+
+#~ msgid "character out of range"
+#~ msgstr "znak je mimo rozsah"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "znak U+%04X nelze převést do místní znakové sady"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "znak U+%04X nelze převést do místní znakové sady: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "neplatný uživatel"
+
+#~ msgid "invalid group"
+#~ msgstr "neplatná skupina"
+
+#~ msgid "invalid spec"
+#~ msgstr "neplatné zadání"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "Zabalil %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "Zabalil %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "©"
+
+#~ msgid ""
+#~ "\n"
+#~ "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl."
+#~ "html>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Licence GPLv3+: GNU GPL verze 3 nebo novější <http://gnu.org/licenses/gpl."
+#~ "html>.\n"
+#~ "Jde o svobodný software: můžete jej volně měnit a šířit.\n"
+#~ "Nejsou poskytovány ŽÁDNÉ ZÁRUKY, mimo těch daných zákonem.\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Napsal %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Napsali %s a %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Napsali %s, %s a %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Napsali %s, %s, %s\n"
+#~ "a %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Napsali %s, %s, %s,\n"
+#~ "%s a %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Napsali %s, %s, %s,\n"
+#~ "%s, %s a %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Napsali %s, %s, %s,\n"
+#~ "%s, %s, %s a %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Napsali %s, %s, %s,\n"
+#~ "%s, %s, %s, %s\n"
+#~ "a %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Napsali %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s a %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Napsali %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s a další.\n"
+
+#, c-format
+#~ msgid ""
+#~ "\n"
+#~ "Report bugs to: %s\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Chyby hlaste na: %s\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "Chyby balíčku %s hlaste na: %s\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "Domovská stránka projektu %s: <%s>\n"
+
+#, c-format
+#~ msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+#~ msgstr "Domovská stránka projektu %s: <http://www.gnu.org/software/%s/>\n"
+
+#~ msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+#~ msgstr ""
+#~ "Obecná nápověda k používání softwaru GNU: <http://www.gnu.org/gethelp/>\n"
+
+#, c-format
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "selhala funkce _open_osfhandle"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "nelze obnovit fd %d: selhala funkce dup2"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "podřízený proces %s"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "podřízený proces %s obdržel kritický signál %d"
+
+#~ msgid "stdin"
+#~ msgstr "standardní vstup"
+
+#~ msgid "stdout"
+#~ msgstr "standardní výstup"
+
+#~ msgid "stderr"
+#~ msgstr "standardní chybový výstup"
+
+#~ msgid "unknown stream"
+#~ msgstr "neznámý proud"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "selhalo opětovné otevření %s v režimu %s"
+
+#, c-format
+#~ msgid "string comparison failed"
+#~ msgstr "selhalo porovnání řetězců"
+
+#, c-format
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Problém obejdete nastavením LC_ALL='C'."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Porovnávané řetězce byly %s a %s."
+
+#, c-format
+#~ msgid "cannot perform formatted output"
+#~ msgstr "nelze provést formátovaný výstup"
+
+#, c-format
+#~ msgid "invalid %s%s argument `%s'"
+#~ msgstr "neplatný argument „%3$s“ pro %1$s%2$s"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument `%s'"
+#~ msgstr "neplatná přípona v argumentu „%3$s“ pro %1$s%2$s"
+
+#, c-format
+#~ msgid "%s%s argument `%s' too large"
+#~ msgstr "argument „%3$s“ pro %1$s%2$s je příliš velký"
diff --git a/gl/po/da.gmo b/gl/po/da.gmo
new file mode 100644
index 0000000..0df3a30
--- /dev/null
+++ b/gl/po/da.gmo
Binary files differ
diff --git a/gl/po/da.po b/gl/po/da.po
new file mode 100644
index 0000000..2342412
--- /dev/null
+++ b/gl/po/da.po
@@ -0,0 +1,870 @@
+# Danish messages for gnulib.
+# Copyright 1997, 2002, 2003, 2004, 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+# Peter Antman <peter.antman@abc.se>, 1997.
+# Thomas Olsson <cid95tho@lustudat.student.lu.se>, 1997.
+# Daniel Resare <daniel@resare.com>, 1999, 2000.
+# Gran Uddeborg <goeran@uddeborg.se>, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009, 2010.
+# Keld Simonsen <keld@keldix.com>, 2011
+#
+# $Revision: 1.8 $
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 2.0.0.3462.e9796\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2011-01-20 22:11+0100\n"
+"Last-Translator: Keld Simonsen <keld@keldix.com>\n"
+"Language-Team: Danish <dansk@dansk-gruppen.dk>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: vrdien p %s er mindre end eller lig med %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: ARGP_HELP_FMT-parameteren krver en vrdi"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: Ukendt ARGP_HELP_FMT-parameter"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Snavs i ARGP_HELP_FMT: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Obligatoriske eller valgfrie argumenter til lange flag er ogs obligatoriske "
+"eller valgfrie for tilsvarende korte flag."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Brug:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " eller: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [FLAG...]"
+
+#: gl/lib/argp-help.c:1783
+#, fuzzy, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Forsg med '%s --help' eller '%s --usage' for mere information.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr ""
+"Rapportr fejl til %s.\n"
+"Send synspunkter p oversttelsen til <dansk@dansk-gruppen.dk>\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Ukendt systemfejl"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "giv denne hjlpeliste"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "giv en kort meddelelse om brug"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "NAVN"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "angiv progravnavnet"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "S"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "hng i S sekunder (som standard 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "udskriv programversion"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(PROGRAMFEJL) Ingen version kendt!?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: For mange argumenter\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(PROGRAMFEJL) Flaget burde vre blevet genkendt!?"
+
+#: gl/lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: flaget '%s' er flertydigt\n"
+
+#: gl/lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: flaget '%s' er flertydigt\n"
+
+#: gl/lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: ukendt flag '%c%s'\n"
+
+#: gl/lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: flaget '%c%s' tager intet argument\n"
+
+#: gl/lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: flaget '%s' krver et argument\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: ugyldig flag -- '%c'\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: flaget krver et argument -- '%c'\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "kan ikke notere aktuelt arbejdskatalog"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "kunne ikke g tilbage til det oprindelige arbejdskatalog"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Lykkedes"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Ingen trffer"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Fejlagtigt regulrt udtryk"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Ugyldigt sorteringstegn"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Ugyldigt tegnklassenavn"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Afsluttende baglns skrstreg"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Ugyldig bagudreference"
+
+#: gl/lib/regcomp.c:143
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Ensomt [ eller [^"
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "Ensomt ( eller \\("
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "Ensomt \\\\{"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "Ugyldigt indhold i \\{\\}"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Ugyldigt intervalslut"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Hukommelse opbrugt"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Fejlagtigt foregende regulrt udtryk"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "For tidlig afslutning af regulrt udtryk"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "For stort regulrt udtryk"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr "Ensomt ) eller \\)"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Intet foregende regulrt udtryk"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "kan ikke vise fejlmeddelelse"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "hukommelsen opbrugt"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "Ugyldigt argument %s til %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "flertydigt argument %s til %s"
+
+#, c-format
+#~ msgid "Valid arguments are:"
+#~ msgstr "gyldige argumenter er:"
+
+#, c-format
+#~ msgid "%.*s: ARGP_HELP_FMT parameter must be positive"
+#~ msgstr "%.*s: ARGP_HELP_FMT-parameteren skal vre positiv"
+
+#~ msgid "program error"
+#~ msgstr "programfejl"
+
+#~ msgid "stack overflow"
+#~ msgstr "stakoverlb"
+
+#, c-format
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr "kan ikke finde et temporrt katalog, forsg at stte $TMPDIR"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "kan ikke oprette et temporrt katalog ved brug af skabelonen '%s'"
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "kan ikke fjerne temporr fil %s"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "kan ikke fjerne temporrt katalog %s"
+
+#~ msgid "error closing file"
+#~ msgstr "fejl ved lukning af fil"
+
+#~ msgid "write error"
+#~ msgstr "skrivefejl"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "bevarer rettigheder p %s"
+
+#, c-format
+#~ msgid "error while opening \"%s\" for reading"
+#~ msgstr "fejl ved bning af '%s' for lsning"
+
+#, c-format
+#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgstr "kan ikke bne sikkerhedskopifil '%s' for skrivning"
+
+#, c-format
+#~ msgid "error reading \"%s\""
+#~ msgstr "fejl ved lsning af '%s'"
+
+#, c-format
+#~ msgid "error writing \"%s\""
+#~ msgstr "fejl ved skrivning af '%s'"
+
+#, c-format
+#~ msgid "error after reading \"%s\""
+#~ msgstr "fejl efter lsning af '%s'"
+
+#, c-format
+#~ msgid "fdopen() failed"
+#~ msgstr "fdopen() mislykkedes"
+
+#, c-format
+#~ msgid "C# compiler not found, try installing pnet"
+#~ msgstr "C#-overstter ikke fundet, forsg at installere pnet"
+
+#, c-format
+#~ msgid "C# virtual machine not found, try installing pnet"
+#~ msgstr "virtuel C#-maskine ikke fundet, forsg at installere pnet"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s-underproces mislykkedes"
+
+#~ msgid "regular empty file"
+#~ msgstr "tom normal fil"
+
+#~ msgid "regular file"
+#~ msgstr "normal fil"
+
+#~ msgid "directory"
+#~ msgstr "katalog"
+
+#~ msgid "block special file"
+#~ msgstr "blokspecialfil"
+
+#~ msgid "character special file"
+#~ msgstr "tegnspecialfil"
+
+#~ msgid "fifo"
+#~ msgstr "fifo"
+
+#~ msgid "symbolic link"
+#~ msgstr "symbolsk lnke"
+
+#~ msgid "socket"
+#~ msgstr "sokkel (socket)"
+
+#~ msgid "message queue"
+#~ msgstr "meddelelsek"
+
+#~ msgid "semaphore"
+#~ msgstr "semafor"
+
+#~ msgid "shared memory object"
+#~ msgstr "objekt af delt hukommelse"
+
+#~ msgid "typed memory object"
+#~ msgstr "objekt af typet hukommelse"
+
+#~ msgid "weird file"
+#~ msgstr "mrkelig fil"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Adressefamilien for vrtsnavnet understttes ikke"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Midlertidig fejl i navneopslag"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Fejlagtig vrdi for ai_flags"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Ureparrbar fejl i navneopslag"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "ai_family understttes ikke"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Hukommelsesallokeringsfejl"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "Ingen adresse associeret med vrtsnavnet"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Navn eller tjeneste ikke kendt"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "Servname understttes ikke for ai_socktype"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "ai_socktype understttes ikke"
+
+#~ msgid "System error"
+#~ msgstr "Systemfejl"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "Argumentbufferen for lille"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Bearbejder pgende anmodning"
+
+#~ msgid "Request canceled"
+#~ msgstr "Anmodning annuleret"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Anmodning ikke annuleret"
+
+#~ msgid "All requests done"
+#~ msgstr "Alle anmodninger udfrt"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Afbrudt af et signal"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "Parameterstreng ikke korrekt kodet"
+
+#~ msgid "Unknown error"
+#~ msgstr "Ukendt fejl"
+
+#, c-format
+#~ msgid "%s: option '--%s' doesn't allow an argument\n"
+#~ msgstr "%s: flaget '--%s' tager intet argument\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option '--%s'\n"
+#~ msgstr "%s: ukendt flag '--%s'\n"
+
+#, c-format
+#~ msgid "%s: option '-W %s' is ambiguous\n"
+#~ msgstr "%s: flaget '-W %s' er flertydigt\n"
+
+#, c-format
+#~ msgid "%s: option '-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: flaget '-W %s' tager intet argument\n"
+
+#, c-format
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "ugyldigt source_version-argument til compile_java_class"
+
+#, c-format
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "ugyldigt target_version-argument til compile_java_class"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "det gik ikke at oprette '%s'"
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "fejl ved skrivning af filen '%s'"
+
+#, c-format
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr ""
+#~ "Javaoverstter ikke fundet, forsg at installere gcj eller stte $JAVAC"
+
+#, c-format
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "Virtuel Javamaskine ikke fundet, forsg at installere gij eller stte "
+#~ "$JAVA"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "%s-underproces I/O-fejl"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "kan ikke ndre rettigheder p %s"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "kan ikke oprette kataloget %s"
+
+#, c-format
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Mislykkedes med at bne /dev/zero for lsning"
+
+#, c-format
+#~ msgid "creation of reading thread failed"
+#~ msgstr "oprettelse af lsetrd mislykkedes"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "kan ikke opstte ikke-blokerende I/O til %s-underproces"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "kommunikation med %s-underproces mislykkedes"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "skrivning til %s-underproces mislykkedes"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "lsning fra %s-underproces mislykkedes"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "underproces %s afsluttet med slutstatus %d"
+
+#, c-format
+#~ msgid "creation of threads failed"
+#~ msgstr "oprettelse af trde mislykkedes"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "%s-underproces afslutted med slutstatus %d"
+
+#, c-format
+#~ msgid "cannot create pipe"
+#~ msgstr "kan ikke oprette datakanal"
+
+#~ msgid "`"
+#~ msgstr "'"
+
+#~ msgid "'"
+#~ msgstr "'"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[yYjJ]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "ndrer rettigheder p %s"
+
+#~ msgid "Hangup"
+#~ msgstr "Lagt p"
+
+#~ msgid "Interrupt"
+#~ msgstr "Afbrudt"
+
+#~ msgid "Quit"
+#~ msgstr "Afslut"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "Utilladt instruktion"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Sporings-/afbrudspunktsflde"
+
+#~ msgid "Aborted"
+#~ msgstr "Afbrudt (abort)"
+
+#~ msgid "Floating point exception"
+#~ msgstr "Undtagelse ved flydende tal"
+
+#~ msgid "Killed"
+#~ msgstr "Drbt"
+
+#~ msgid "Bus error"
+#~ msgstr "Busfejl"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "Segmenteringsfejl"
+
+#~ msgid "Broken pipe"
+#~ msgstr "Brudt datakanal"
+
+#~ msgid "Alarm clock"
+#~ msgstr "Alarmklokke"
+
+#~ msgid "Terminated"
+#~ msgstr "Afsluttet"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "Hastende I/O-situation"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "Stoppet (signal)"
+
+#~ msgid "Stopped"
+#~ msgstr "Stoppet"
+
+#~ msgid "Continued"
+#~ msgstr "Genoptaget"
+
+#~ msgid "Child exited"
+#~ msgstr "Barn afsluttede"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Stoppet (terminallsning)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Stoppet (terminalskrivning)"
+
+#~ msgid "I/O possible"
+#~ msgstr "I/O muligt"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "Grnse p CPU-tid overskredet"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "Grnse p filstrrelse overskredet"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "Alarmklokke - virtuel tid - udlb"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "Profileringsklokke udlb"
+
+#~ msgid "Window changed"
+#~ msgstr "ndret vindue"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "Brugersignal 1"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Brugersignal 2"
+
+#~ msgid "EMT trap"
+#~ msgstr "Emulatorflde"
+
+#~ msgid "Bad system call"
+#~ msgstr "Fejlagtigt systemkald"
+
+#~ msgid "Stack fault"
+#~ msgstr "Stakfejl"
+
+#~ msgid "Information request"
+#~ msgstr "Informationsanmodning"
+
+#~ msgid "Power failure"
+#~ msgstr "Strmafbrud"
+
+#~ msgid "Resource lost"
+#~ msgstr "Tabt resurse"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "fejl ved skrivning til en lukket datakanal eller sokkel"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "Realtidsignal %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Ukendt signal %d"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "iconv-funktion ikke brugbar"
+
+#~ msgid "iconv function not available"
+#~ msgstr "iconv-funktion ikke tilgngelig"
+
+#~ msgid "character out of range"
+#~ msgstr "tegn udenfor interval"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "kan ikke konvertere U+%04X til lokalt tegnst"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "kan ikke konvertere U+%04X til lokalt tegnst: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "ugyldig bruger"
+
+#~ msgid "invalid group"
+#~ msgstr "ugyldig gruppe"
+
+#~ msgid "invalid spec"
+#~ msgstr "ugyldig specifikation"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "Pakket af %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "Pakket af %s\n"
+
+#~ msgid "(C)"
+#~ msgstr ""
+
+#~ msgid ""
+#~ "\n"
+#~ "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl."
+#~ "html>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Licens GPLv3+: GNU GPL version 3 eller senere <http://gnu.org/licenses/"
+#~ "gpl.html>.\n"
+#~ "Dette er frit programmel: du m ndre og videredistribuere det.\n"
+#~ "Der gives INGEN GARANTI, s vidt lov tillader.\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Skrevet af %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Skrevet af %s og %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Skrevet af %s, %s og %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Skrevet af %s, %s, %s\n"
+#~ "og %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Skrevet af %s, %s, %s,\n"
+#~ "%s og %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Skrevet af %s, %s, %s,\n"
+#~ "%s, %s og %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Skrevet af %s, %s, %s,\n"
+#~ "%s, %s, %s og %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Skrevet af %s, %s, %s,\n"
+#~ "%s, %s, %s, %s\n"
+#~ "og %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Skrevet af %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s og %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Skrevet af %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s med flere.\n"
+
+#, c-format
+#~ msgid ""
+#~ "\n"
+#~ "Report bugs to: %s\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Rapportr fejl til: %s\n"
+#~ "Sende synspunkter p oversttelsen til: tp-sv@listor.tp-sv.se\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "Rapportr %s-fejl til: %s\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "%s hjemmeside: <%s>\n"
+
+#, c-format
+#~ msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+#~ msgstr "%s hjemmeside: <http://www.gnu.org/software/%s/>\n"
+
+#~ msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+#~ msgstr ""
+#~ "Almindelig hjlp til at bruge GNU-programmer: <http://www.gnu.org/gethelp/"
+#~ ">\n"
+
+#, c-format
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "_open_osfhandle mislykkedes"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "kan ikke genskabe fb %d: dup2 mislykkedes"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "%s-underproces"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "%s-underproces fik delggende signal %d"
+
+#~ msgid "stdin"
+#~ msgstr "standard ind"
+
+#~ msgid "stdout"
+#~ msgstr "standard ud"
+
+#~ msgid "stderr"
+#~ msgstr "standard fejl"
+
+#~ msgid "unknown stream"
+#~ msgstr "ukendt strm"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "kunne ikke genbne %s i tilstand %s"
+
+#, c-format
+#~ msgid "string comparison failed"
+#~ msgstr "strengsammenligning mislykkedes"
+
+#, c-format
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "St LC_ALL='C' for at omg problemet."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "De sammenlignede strenge var %s og %s."
+
+#, c-format
+#~ msgid "cannot perform formatted output"
+#~ msgstr "kan ikke udfre formateret udskrift"
+
+#, c-format
+#~ msgid "invalid %s%s argument `%s'"
+#~ msgstr "fejlagtigt %s%s-argument '%s'"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument `%s'"
+#~ msgstr "fejlagtigt suffiks i %s%s-argument '%s'"
+
+#, c-format
+#~ msgid "%s%s argument `%s' too large"
+#~ msgstr "%s%s argument '%s' er for stort"
diff --git a/gl/po/de.gmo b/gl/po/de.gmo
new file mode 100644
index 0000000..18dabeb
--- /dev/null
+++ b/gl/po/de.gmo
Binary files differ
diff --git a/gl/po/de.po b/gl/po/de.po
new file mode 100644
index 0000000..80d01ab
--- /dev/null
+++ b/gl/po/de.po
@@ -0,0 +1,1027 @@
+# German translation of gnulib messages.
+# Copyright © 2011 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+# Karl Eichwalder <ke@suse.de>, 2001-2002.
+# Lutz Behnke <lutz.behnke@gmx.de>, 1996, 1997, 1998, 1999, 2000, 2001.
+# Michael Schmidt <michael@guug.de>, 1996, 1997, 1998, 1999, 2000.
+# Michael Piefel <piefel@informatik.hu-berlin.de>, 2001, 2002, 2003, 2009.
+# Kai Wasserbäch <debian@carbon-project.org>, 2009.
+# Arun Persaud <arun@nubati.net>, 2012.
+# Roland Illig <roland.illig@gmx.de>, 2019.
+#
+# TAB: spell it out („Tabulatoren“). -ke-
+# Don't use obscure abbreviations, please. -ke-
+# No hyphenation, please. -ke-
+#
+# space: Leerzeichen oder Leerschritt
+#
+# Check:
+# idle - untätig
+# idle: untätig, ruhig, „idle“, Leerlauf
+# user idle time: Untätigkeitszeit des Benutzers, Ruhezeit, Idle-Time,
+# Benutzer im Leerlauf
+# digit - Zahl, Ziffer, Nummer, Stelle
+# logged in - angemeldet, eingeloggt
+# requested - gewünscht?
+#
+# Some comments on translations used in oder to ensure persistence:
+#
+# symbolic links: symbolische Verknüpfungen
+# hard links: harte Verknüpfungen
+# backup: Sicherung
+# mount: einhängen
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU gnulib-4.0.0.2567\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2019-05-22 20:00+0200\n"
+"Last-Translator: Roland Illig <roland.illig@gmx.de>\n"
+"Language-Team: German <translation-team-de@lists.sourceforge.net>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Poedit 2.2.3\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: Der Wert %s ist kleiner oder gleich %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: ARGP_HELP_FMT Parameter benötigt einen Wert"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: Unbekannter Parameter für ARGP_HELP_FMT"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Müll in ARGP_HELP_FMT: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Erforderliche oder optionale Argumente für lange Optionen sind auch für "
+"kurze erforderlich bzw. optional."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Aufruf:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " oder: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [OPTION…]"
+
+#: gl/lib/argp-help.c:1783
+#, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "»%s --help« oder »%s --usage« liefert weitere Informationen.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "Melden Sie Fehler (auf Englisch, mit LC_ALL=C) an <%s>.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Unbekannter Systemfehler"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "diese Hilfeliste anzeigen"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "eine Kurzfassung des Aufrufs anzeigen"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "NAME"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "den Programmnamen festlegen"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "SEK"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "SEK Sekunden warten (Standardwert 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "Programmversion anzeigen"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(PROGRAMMFEHLER) Keine Version bekannt!?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: zu viele Argumente\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(PROGRAMMFEHLER) Option hätte erkannt werden müssen!?"
+
+#: gl/lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: Option »%s%s« ist mehrdeutig\n"
+
+#: gl/lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: Option »%s%s« ist mehrdeutig; Möglichkeiten:"
+
+#: gl/lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: unbekannte Option »%s%s«\n"
+
+#: gl/lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: Option »%s%s« erlaubt kein Argument\n"
+
+#: gl/lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: Option »%s%s« erfordert ein Argument\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: ungültige Option -- »%c«\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: Option erfordert ein Argument -- »%c«\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "aktuelles Arbeitsverzeichnis konnte nicht bestimmt werden"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+"es konnte nicht ins ursprüngliche Arbeitsverzeichnis zurückgekehrt werden"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Erfolg"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Keine Übereinstimmung"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Ungültiger regulärer Ausdruck"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Ungültiges Sortierungszeichen"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Ungültiger Name für Zeichenklasse"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Unerwarteter Backslash am Ende"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Ungültige Rückreferenz"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Gegenstück zu [, [^, [:, [. oder [= fehlt"
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "Gegenstück zu ( oder \\( fehlt"
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "Gegenstück zu \\{ fehlt"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "Ungültiger Inhalt in \\{\\}"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Ungültiges Bereichsende"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Zu wenig Speicher vorhanden"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Ungültiger vorhergehender regulärer Ausdruck"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Vorzeitiges Ende des regulären Ausdrucks"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "Der reguläre Ausdruck ist zu groß"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr "Gegenstück zu ) oder \\) fehlt"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Kein vorhergehender regulärer Ausdruck"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "Fehlermeldung konnte nicht angezeigt werden"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "Zu wenig Speicher vorhanden"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr "Standarddateideskriptoren"
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "ungültiges Argument %s für %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "mehrdeutiges Argument %s für %s"
+
+#~ msgid "Valid arguments are:"
+#~ msgstr "Gültige Argumente sind:"
+
+#, c-format
+#~ msgid "%u bitset_allocs, %u freed (%.2f%%).\n"
+#~ msgstr "%u bitset_allocs, %u freigegeben (%.2f%%).\n"
+
+#, c-format
+#~ msgid "%u bitset_sets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_sets, %u gecacht (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_resets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_resets, %u gecacht (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_tests, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_tests, %u gecacht (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_lists\n"
+#~ msgstr "%u bitset_lists\n"
+
+#~ msgid "count log histogram\n"
+#~ msgstr "logarithmisches Anzahlhistogramm\n"
+
+#~ msgid "size log histogram\n"
+#~ msgstr "logarithmisches Größenhistogramm\n"
+
+#~ msgid "density histogram\n"
+#~ msgstr "Dichtehistogramm\n"
+
+#, c-format
+#~ msgid ""
+#~ "Bitset statistics:\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Bitmengen-Statistik:\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Accumulated runs = %u\n"
+#~ msgstr "Aufsummierte Durchläufe = %u\n"
+
+#~ msgid "cannot read stats file"
+#~ msgstr "Statistikdatei konnte nicht gelesen werden"
+
+#, c-format
+#~ msgid "bad stats file size\n"
+#~ msgstr "Statistikdatei hat falsche Größe\n"
+
+#~ msgid "cannot write stats file"
+#~ msgstr "Statistikdatei konnte nicht angelegt werden"
+
+#~ msgid "cannot open stats file for writing"
+#~ msgstr "Statistikdatei konnte nicht zum Schreiben geöffnet werden"
+
+#~ msgid "program error"
+#~ msgstr "Programmfehler"
+
+#~ msgid "stack overflow"
+#~ msgstr "Stacküberlauf"
+
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr ""
+#~ "kein temporäres Verzeichnis gefunden, versuchen Sie, $TMPDIR zu setzen"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr ""
+#~ "temporäres Verzeichnis mit der Schablone »%s« konnte nicht angelegt werden"
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "temporäre Datei »%s« konnte nicht entfernt werden"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "temporäres Verzeichnis »%s« konnte nicht entfernt werden"
+
+#~ msgid "error closing file"
+#~ msgstr "Fehler beim Schließen der Datei"
+
+#~ msgid "write error"
+#~ msgstr "Fehler beim Schreiben der Datei"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "Zugriffsberechtigungen von »%s« werden beibehalten"
+
+#, c-format
+#~ msgid "error while opening %s for reading"
+#~ msgstr "die Datei »%s« konnte nicht zum Lesen geöffnet werden"
+
+#, c-format
+#~ msgid "cannot open backup file %s for writing"
+#~ msgstr "die Sicherungsdatei »%s« konnte nicht zum Schreiben geöffnet werden"
+
+#, c-format
+#~ msgid "error reading %s"
+#~ msgstr "Fehler beim Lesen von »%s«"
+
+#, c-format
+#~ msgid "error writing %s"
+#~ msgstr "Fehler beim Schreiben von »%s«"
+
+#, c-format
+#~ msgid "error after reading %s"
+#~ msgstr "Fehler nach dem Lesen von »%s«"
+
+#~ msgid "fdopen() failed"
+#~ msgstr "Fehler bei fdopen()"
+
+#~ msgid "C# compiler not found, try installing mono"
+#~ msgstr ""
+#~ "C#-Compiler nicht gefunden, versuchen Sie, das Paket »mono« zu "
+#~ "installieren"
+
+#~ msgid "C# virtual machine not found, try installing mono"
+#~ msgstr ""
+#~ "Virtuelle Maschine für C# nicht gefunden, versuchen Sie, das Paket »mono« "
+#~ "zu installieren"
+
+#~ msgid "unbalanced ["
+#~ msgstr "öffnende eckige Klammer »[« ohne Gegenstück"
+
+#~ msgid "invalid character class"
+#~ msgstr "ungültige Zeichenklasse"
+
+#~ msgid "character class syntax is [[:space:]], not [:space:]"
+#~ msgstr ""
+#~ "Die Schreibweise für Zeichenklassen ist [[:space:]], nicht [:space:]"
+
+#~ msgid "unfinished \\ escape"
+#~ msgstr "unvollendete \\-Escapesequenz"
+
+#~ msgid "invalid content of \\{\\}"
+#~ msgstr "Ungültiger Inhalt in \\{\\}"
+
+#~ msgid "regular expression too big"
+#~ msgstr "der reguläre Ausdruck ist zu groß"
+
+#~ msgid "unbalanced ("
+#~ msgstr "öffnende Klammer »(« ohne Gegenstück"
+
+#~ msgid "no syntax specified"
+#~ msgstr "keine Syntax angegeben"
+
+#~ msgid "unbalanced )"
+#~ msgstr "schließende Klammer »)« ohne Gegenstück"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s: Unterprozess fehlgeschlagen"
+
+#~ msgid "regular empty file"
+#~ msgstr "reguläre leere Datei"
+
+#~ msgid "regular file"
+#~ msgstr "reguläre Datei"
+
+#~ msgid "directory"
+#~ msgstr "Verzeichnis"
+
+#~ msgid "symbolic link"
+#~ msgstr "symbolische Verknüpfung"
+
+#~ msgid "message queue"
+#~ msgstr "Nachrichtenwarteschlange"
+
+#~ msgid "semaphore"
+#~ msgstr "Semaphor"
+
+#~ msgid "shared memory object"
+#~ msgstr "Objekt gemeinsamen Speichers"
+
+#~ msgid "typed memory object"
+#~ msgstr "Objekt getypten Speichers"
+
+#~ msgid "block special file"
+#~ msgstr "blockorientierte Spezialdatei"
+
+#~ msgid "character special file"
+#~ msgstr "zeichenorientierte Spezialdatei"
+
+#~ msgid "contiguous data"
+#~ msgstr "zusammenhängende Daten"
+
+#~ msgid "fifo"
+#~ msgstr "FIFO"
+
+#~ msgid "door"
+#~ msgstr "Tür"
+
+#~ msgid "multiplexed block special file"
+#~ msgstr "gemultiplexte blockorientierte Spezialdatei"
+
+#~ msgid "multiplexed character special file"
+#~ msgstr "gemultiplexte zeichenorientierte Spezialdatei"
+
+#~ msgid "multiplexed file"
+#~ msgstr "gemultiplexte Datei"
+
+#~ msgid "named file"
+#~ msgstr "benannte Datei"
+
+#~ msgid "network special file"
+#~ msgstr "netzwerkbezogene Spezialdatei"
+
+#~ msgid "migrated file with data"
+#~ msgstr "migrierte Datei mit Daten"
+
+#~ msgid "migrated file without data"
+#~ msgstr "migrierte Datei ohne Daten"
+
+#~ msgid "port"
+#~ msgstr "Anschluss"
+
+#~ msgid "socket"
+#~ msgstr "Socket"
+
+#~ msgid "whiteout"
+#~ msgstr "Überblendung"
+
+#~ msgid "weird file"
+#~ msgstr "merkwürdige Datei"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Adressfamilie für Hostnamen nicht unterstützt"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Temporäre Störung der Namensauflösung"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Ungültiger Wert für ai_flags"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Nicht zu umgehende Störung der Namensauflösung"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "ai_family nicht unterstützt"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Speicherallokationsfehler"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "Keine Adresse mit Hostnamen verbunden"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Name oder Service unbekannt"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "Servname nicht unterstützt für ai_socktype"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "ai_socktype nicht unterstützt"
+
+#~ msgid "System error"
+#~ msgstr "Systemfehler"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "Argumentpuffer zu klein"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Verarbeitungsanfrage in Bearbeitung"
+
+#~ msgid "Request canceled"
+#~ msgstr "Anfrage abgebrochen"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Anfrage nicht abgebrochen"
+
+#~ msgid "All requests done"
+#~ msgstr "Alle Anfragen erledigt"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Durch Signal unterbrochen"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "Parameterzeichenkette nicht korrekt kodiert"
+
+#~ msgid "Unknown error"
+#~ msgstr "Unbekannter Fehler"
+
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "ungültiges Argument »source_version« für »compile_java_class«"
+
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "ungültiges Argument »target_version« für »compile_java_class«"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "Datei »%s« konnte nicht erzeugt werden"
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "Fehler beim Schreiben der Datei »%s«"
+
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr ""
+#~ "Java-Compiler nicht gefunden, versuchen Sie, das Paket »gcj« zu "
+#~ "installieren oder setzen Sie $JAVAC"
+
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "Virtuelle Maschine für Java nicht gefunden, versuchen Sie, das Paket "
+#~ "»gij« zu installieren oder setzen Sie $JAVA"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "%s-Unterprozess-E/A-Fehler"
+
+#, c-format
+#~ msgid "cannot stat %s"
+#~ msgstr "Dateieigenschaften für »%s« konnten nicht bestimmt werden"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "Zugriffsrechte von »%s« konnten nicht geändert werden"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "Verzeichnis »%s« konnte nicht angelegt werden"
+
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Das Gerät »/dev/zero« konnte nicht zum Lesen geöffnet werden"
+
+#~ msgid "creation of reading thread failed"
+#~ msgstr "Erstellen des Lese-Threads fehlgeschlagen"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr ""
+#~ "Nicht-blockierendes I/O zu Teilprozess »%s« konnte nicht hergestellt "
+#~ "werden"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "Kommunikation mit Teilprozess »%s« fehlgeschlagen"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "Schreiben zu Teilprozess »%s« fehlgeschlagen"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "Lesen von Teilprozess »%s« fehlgeschlagen"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "Teilprozess »%s« beendet mit Code %d"
+
+#~ msgid "creation of threads failed"
+#~ msgstr "Erstellen von Threads fehlgeschlagen"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "Teilprozess »%s« wurde mit Code %d beendet"
+
+#~ msgid "`"
+#~ msgstr "»"
+
+#~ msgid "'"
+#~ msgstr "«"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[jJyY]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "Zugriffsberechtigungen von »%s« werden festgelegt"
+
+#~ msgid "Hangup"
+#~ msgstr "Aufhängen"
+
+#~ msgid "Interrupt"
+#~ msgstr "Unterbrechung"
+
+#~ msgid "Quit"
+#~ msgstr "Beendet"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "Ungültiger Maschinenbefehl"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Trace-/Breakpoint-Falle"
+
+#~ msgid "Aborted"
+#~ msgstr "Abgebrochen"
+
+#~ msgid "Floating point exception"
+#~ msgstr "Gleitkomma-Ausnahme"
+
+#~ msgid "Killed"
+#~ msgstr "Getötet"
+
+#~ msgid "Bus error"
+#~ msgstr "Busfehler"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "Speicherzugriffsfehler"
+
+#~ msgid "Broken pipe"
+#~ msgstr "Unterbrochene Weiterleitung"
+
+#~ msgid "Alarm clock"
+#~ msgstr "Wecker"
+
+#~ msgid "Terminated"
+#~ msgstr "Terminiert"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "Dringende I/O-Bedingung"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "Gestoppt (Signal)"
+
+#~ msgid "Stopped"
+#~ msgstr "Gestoppt"
+
+#~ msgid "Continued"
+#~ msgstr "Fortgesetzt"
+
+#~ msgid "Child exited"
+#~ msgstr "Kindprozess beendet"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Gestoppt (tty-Eingabe)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Gestoppt (tty-Ausgabe)"
+
+#~ msgid "I/O possible"
+#~ msgstr "I/O möglich"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "CPU-Zeitbegrenzung überschritten"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "Dateigrößenbegrenzung überschritten"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "Virtueller Zeitgeber abgelaufen"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "Zeitmesser zur Leistungsmessung abgelaufen"
+
+#~ msgid "Window changed"
+#~ msgstr "Fenster geändert"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "Benutzerdefiniertes Signal 1"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Benutzerdefiniertes Signal 2"
+
+#~ msgid "EMT trap"
+#~ msgstr "EMT-Falle"
+
+#~ msgid "Bad system call"
+#~ msgstr "Fehlerhafter Systemaufruf"
+
+#~ msgid "Stack fault"
+#~ msgstr "Stapelfehler"
+
+#~ msgid "Information request"
+#~ msgstr "Informationsanfrage"
+
+#~ msgid "Power failure"
+#~ msgstr "Stromausfall"
+
+#~ msgid "Resource lost"
+#~ msgstr "Ressource verloren"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "Fehler beim Schreiben in geschlossene Pipe oder Socket"
+
+#~ msgid "cannot create pipe"
+#~ msgstr "Pipe konnte nicht erzeugt werden"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "Echtzeitsignal %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Unbekanntes Signal %d"
+
+#~ msgid "Execution times (seconds)"
+#~ msgstr "Ausführungszeiten (in Sekunden)"
+
+#~ msgid "CPU user"
+#~ msgstr "CPU Anwendung"
+
+#~ msgid "CPU system"
+#~ msgstr "CPU System"
+
+#~ msgid "wall clock"
+#~ msgstr "Vergangene Zeit"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "iconv-Funktion nicht benutzbar"
+
+#~ msgid "iconv function not available"
+#~ msgstr "iconv-Funktion nicht verfügbar"
+
+#~ msgid "character out of range"
+#~ msgstr "Zeichen außerhalb erlaubter Grenzen"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr ""
+#~ "das Zeichen U+%04X konnte nicht in lokalen Zeichensatz konvertiert werden"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr ""
+#~ "das Zeichen U+%04X konnte nicht in lokalen Zeichensatz konvertiert "
+#~ "werden: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "ungültiger Benutzername"
+
+#~ msgid "invalid group"
+#~ msgstr "ungültiger Gruppenname"
+
+#~ msgid "invalid spec"
+#~ msgstr "ungültige Angabe"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "Paket erstellt von %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "Paket erstellt von %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "©"
+
+#, c-format
+#~ msgid ""
+#~ "License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ msgstr ""
+#~ "Lizenz GPLv3+: GNU GPL Version 3 oder höher <%s>.\n"
+#~ "Dies ist freie Software: Sie können sie ändern und weitergeben.\n"
+#~ "Es gibt keinerlei Garantien, soweit es das Gesetz erlaubt.\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Geschrieben von %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Geschrieben von %s und %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Geschrieben von %s, %s und %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Geschrieben von %s, %s, %s\n"
+#~ "und %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Geschrieben von %s, %s, %s,\n"
+#~ "%s und %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Geschrieben von %s, %s, %s,\n"
+#~ "%s, %s und %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Geschrieben von %s, %s, %s,\n"
+#~ "%s, %s, %s und %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Geschrieben von %s, %s, %s,\n"
+#~ "%s, %s, %s, %s\n"
+#~ "und %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Geschrieben von %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s und %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Geschrieben von %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s und anderen.\n"
+
+#, c-format
+#~ msgid "Report bugs to: %s\n"
+#~ msgstr ""
+#~ "Melden Sie Fehler im Programm (auf Englisch) an »%s«.\n"
+#~ "Melden Sie Fehler in der Übersetzung an <translation-team-de@lists."
+#~ "sourceforge.net>.\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "Melden Sie %s-Fehler an »%s«\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "%s-Homepage: %s\n"
+
+#, c-format
+#~ msgid "General help using GNU software: <%s>\n"
+#~ msgstr "Allgemeine Hilfe zur Benutzung von GNU-Software: %s\n"
+
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "_open_osfhandle fehlgeschlagen"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr ""
+#~ "Dateideskriptor %d konnte nicht wiederhergestellt werden: dup2 "
+#~ "fehlgeschlagen"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "%s-Unterprozess"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "%s-Unterprozess bekam tödliches Signal %d"
+
+#~ msgid "failed to set file descriptor text/binary mode"
+#~ msgstr ""
+#~ "Dateideskriptor konnte nicht zwischen Text und Binär umgeschaltet werden"
+
+#~ msgid "stdin"
+#~ msgstr "Standardeingabe (stdin)"
+
+#~ msgid "stdout"
+#~ msgstr "Standardausgabe (stdout)"
+
+#~ msgid "stderr"
+#~ msgstr "Standardfehlerausgabe (stderr)"
+
+#~ msgid "unknown stream"
+#~ msgstr "Unbekannter Datenstrom"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "Erneutes Öffnen von %s mit Modus %s fehlgeschlagen"
+
+#~ msgid "string comparison failed"
+#~ msgstr "Zeichenkettenvergleich fehlgeschlagen"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Setzen Sie »LC_ALL=C«, um das Problem zu umgehen."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Die verglichenen Zeichenketten waren »%s« und »%s«."
+
+#~ msgid "cannot perform formatted output"
+#~ msgstr "formatierte Ausgabe konnte nicht durchgeführt werden"
+
+#, c-format
+#~ msgid "invalid %s%s argument '%s'"
+#~ msgstr "ungültiges %s%s-Argument »%s«"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument '%s'"
+#~ msgstr "ungültige Endung in %s%s-Argument »%s«"
+
+#, c-format
+#~ msgid "%s%s argument '%s' too large"
+#~ msgstr "%s%s-Argument »%s« zu groß"
+
+#~ msgid "%.*s: ARGP_HELP_FMT parameter must be positive"
+#~ msgstr "%.*s: ARGP_HELP_FMT Parameter muss positiv sein"
+
+#~ msgid "%s: option '--%s' doesn't allow an argument\n"
+#~ msgstr "%s: Option »--%s« erlaubt kein Argument\n"
+
+#~ msgid "%s: unrecognized option '--%s'\n"
+#~ msgstr "%s: unbekannte Option »--%s«\n"
+
+#~ msgid "%s: option '-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: Option »-W %s« erlaubt kein Argument\n"
+
+#~ msgid "%s: option '-W %s' requires an argument\n"
+#~ msgstr "%s: Option »-W %s« erfordert ein Argument\n"
+
+#~ msgid "Franc,ois Pinard"
+#~ msgstr "François Pinard"
+
+#~ msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+#~ msgstr "Heimatseite von %s: <http://www.gnu.org/software/%s/>.\n"
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: ungültige Option -- %c\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Report bugs to <%s>.\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Melden Sie Fehler (auf Englisch, mit LC_ALL=C) an <%s>.\n"
+#~ "Melden Sie Übersetzungsfehler an <translation-team-de@lists.sourceforge."
+#~ "net>\n"
+
+#~ msgid "block size"
+#~ msgstr "Blockgröße"
diff --git a/gl/po/el.gmo b/gl/po/el.gmo
new file mode 100644
index 0000000..83fa8e3
--- /dev/null
+++ b/gl/po/el.gmo
Binary files differ
diff --git a/gl/po/el.po b/gl/po/el.po
new file mode 100644
index 0000000..3a6ffa5
--- /dev/null
+++ b/gl/po/el.po
@@ -0,0 +1,684 @@
+# Greek messages for gnulib
+# Copyright (C) 1999, 2000, 2001, 2002, 2012 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+# Simos Xenitellis <simos.lists@googlemail.com>, 1999, 2000, 2001, 2002, 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 3.0.0.6062.a6b16\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2012-03-11 11:25+0100\n"
+"Last-Translator: Simos Xenitellis <simos.lists@googlemail.com>\n"
+"Language-Team: Greek <team@lists.gnome.gr>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr ""
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr ""
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr ""
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr ""
+
+#
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [ΕΠΙΛΟΓΗ...]"
+
+#
+#: gl/lib/argp-help.c:1783
+#, fuzzy, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Δοκιμάστε `%s --help' για περισσότερη βοήθεια.\n"
+
+#
+#: gl/lib/argp-help.c:1811
+#, fuzzy, c-format
+msgid "Report bugs to %s.\n"
+msgstr ""
+"\n"
+"Αναφέρατε σφάλματα στο <%s>.\n"
+
+#
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Άγνωστο σφάλμα συστήματος"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr ""
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr ""
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr ""
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr ""
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr ""
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr ""
+
+#
+#: gl/lib/argp-parse.c:154
+#, fuzzy
+msgid "print program version"
+msgstr "σφάλμα προγράμματος"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr ""
+
+#
+#: gl/lib/argp-parse.c:624
+#, fuzzy, c-format
+msgid "%s: Too many arguments\n"
+msgstr "πάρα πολλά ορίσματα"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr ""
+
+#
+#: gl/lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: η επιλογή `-W %s' είναι ασαφής\n"
+
+#
+#: gl/lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: η επιλογή `%s' είναι ασαφής\n"
+
+#
+#: gl/lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: μη αναγνωρίσιμη επιλογή `%c%s'\n"
+
+#
+#: gl/lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: η επιλογή `%c%s' δεν επιτρέπει ορίσματα\n"
+
+#
+#: gl/lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: η επιλογή `-%s' απαιτεί ένα όρισμα\n"
+
+#
+#: gl/lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: μη έγκυρη επιλογή -- %c\n"
+
+#
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: η επιλογή απαιτεί ένα όρισμα -- %c\n"
+
+#
+#: gl/lib/openat-die.c:38
+#, fuzzy, c-format
+msgid "unable to record current working directory"
+msgstr "αδύνατη η δημιουργία καταλόγου `%s'"
+
+#
+#: gl/lib/openat-die.c:57
+#, fuzzy, c-format
+msgid "failed to return to initial working directory"
+msgstr "αδύνατη η δημιουργία καταλόγου `%s'"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr ""
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr ""
+
+#
+#: gl/lib/regcomp.c:128
+#, fuzzy
+msgid "Invalid regular expression"
+msgstr "%s: μη έγκυρη κανονική έκφραση: %s"
+
+#
+#: gl/lib/regcomp.c:131
+#, fuzzy
+msgid "Invalid collation character"
+msgstr "μη έγκυρη τάξη χαρακτήρων `%s'"
+
+#
+#: gl/lib/regcomp.c:134
+#, fuzzy
+msgid "Invalid character class name"
+msgstr "μη έγκυρη τάξη χαρακτήρων `%s'"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr ""
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr ""
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr ""
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr ""
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr ""
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr ""
+
+#
+#: gl/lib/regcomp.c:155
+#, fuzzy
+msgid "Invalid range end"
+msgstr "%s: μη έγκυρη κανονική έκφραση: %s"
+
+#
+#: gl/lib/regcomp.c:158
+#, fuzzy
+msgid "Memory exhausted"
+msgstr "η μνήμη εξαντλήθηκε"
+
+#
+#: gl/lib/regcomp.c:161
+#, fuzzy
+msgid "Invalid preceding regular expression"
+msgstr "%s: μη έγκυρη κανονική έκφραση: %s"
+
+#
+#: gl/lib/regcomp.c:164
+#, fuzzy
+msgid "Premature end of regular expression"
+msgstr "σφάλμα στην ανεύρεση μέσω κανονικής έκφρασης"
+
+#
+#: gl/lib/regcomp.c:167
+#, fuzzy
+msgid "Regular expression too big"
+msgstr "%s: μη έγκυρη κανονική έκφραση: %s"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ""
+
+#
+#: gl/lib/regcomp.c:650
+#, fuzzy
+msgid "No previous regular expression"
+msgstr "σφάλμα στην ανεύρεση μέσω κανονικής έκφρασης"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "η μνήμη εξαντλήθηκε"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
+
+#
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "μη έγκυρο όρισμα %s για %s"
+
+#
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "ασαφές όρισμα %s για %s"
+
+#
+#, c-format
+#~ msgid "Valid arguments are:"
+#~ msgstr "Έγκυρα ορίσματα είναι:"
+
+#
+#~ msgid "program error"
+#~ msgstr "σφάλμα προγράμματος"
+
+#
+#~ msgid "stack overflow"
+#~ msgstr "υπερχείλιση στοίβας"
+
+#
+#, fuzzy, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "αδύνατη η δημιουργία καταλόγου `%s'"
+
+#
+#, fuzzy, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "αδύνατη η δημιουργία καταλόγου `%s'"
+
+#
+#, fuzzy, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "αδύνατη η δημιουργία καταλόγου `%s'"
+
+#
+#~ msgid "write error"
+#~ msgstr "σφάλμα εγγραφής"
+
+#
+#, fuzzy, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "αδυναμία αλλαγής ιδιοκτησίας στο %s"
+
+#, fuzzy, c-format
+#~ msgid "error while opening \"%s\" for reading"
+#~ msgstr "αδυναμία μεταφοράς του `%s' στο `%s'"
+
+#, fuzzy, c-format
+#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgstr "αδυναμία μεταφοράς του `%s' στο `%s'"
+
+#
+#, fuzzy, c-format
+#~ msgid "error reading \"%s\""
+#~ msgstr "σφάλμα ανάγνωσης %s"
+
+#
+#, fuzzy, c-format
+#~ msgid "error writing \"%s\""
+#~ msgstr "σφάλμα εγγραφής %s"
+
+#
+#, fuzzy, c-format
+#~ msgid "error after reading \"%s\""
+#~ msgstr "σφάλμα ανάγνωσης %s"
+
+#
+#, fuzzy, c-format
+#~ msgid "fdopen() failed"
+#~ msgstr "αποτυχία ανοίγματος"
+
+#
+#, fuzzy, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s: μη έγκυρη μορφή"
+
+#
+#~ msgid "regular empty file"
+#~ msgstr "κανονικό κενό αρχείο"
+
+#
+#~ msgid "regular file"
+#~ msgstr "κανονικό αρχείο"
+
+#
+#~ msgid "directory"
+#~ msgstr "κατάλογος"
+
+#
+#~ msgid "block special file"
+#~ msgstr "ειδικό αρχείο μπλοκ"
+
+#
+#~ msgid "character special file"
+#~ msgstr "ειδικό αρχείο χαρακτήρων"
+
+#
+#~ msgid "fifo"
+#~ msgstr "φίφο"
+
+#
+#~ msgid "symbolic link"
+#~ msgstr "συμβολικός σύνδεσμος"
+
+#
+#~ msgid "socket"
+#~ msgstr "υποδοχέας"
+
+#
+#~ msgid "message queue"
+#~ msgstr "ουρά μηνυμάτων"
+
+#
+#~ msgid "semaphore"
+#~ msgstr "σημαφόρος"
+
+#
+#~ msgid "weird file"
+#~ msgstr "παράξενο αρχείο"
+
+#, fuzzy
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "αρχεία fifo δεν υποστηρίζονται"
+
+#, fuzzy
+#~ msgid "ai_family not supported"
+#~ msgstr "αρχεία fifo δεν υποστηρίζονται"
+
+#, fuzzy
+#~ msgid "ai_socktype not supported"
+#~ msgstr "αρχεία fifo δεν υποστηρίζονται"
+
+#
+#, fuzzy
+#~ msgid "System error"
+#~ msgstr "σφάλμα εγγραφής"
+
+#
+#, fuzzy
+#~ msgid "Unknown error"
+#~ msgstr "Άγνωστο σφάλμα συστήματος"
+
+#
+#, fuzzy, c-format
+#~ msgid "%s: option '--%s' doesn't allow an argument\n"
+#~ msgstr "%s: η επιλογή `--%s' δεν επιτρέπει ορίσματα\n"
+
+#
+#, fuzzy, c-format
+#~ msgid "%s: unrecognized option '--%s'\n"
+#~ msgstr "%s: μη αναγνωρίσιμη επιλογή `--%s'\n"
+
+#
+#, fuzzy, c-format
+#~ msgid "%s: option '-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: η επιλογή `-W %s' δεν επιτρέπει ορίσματα\n"
+
+#
+#, fuzzy, c-format
+#~ msgid "%s: option '-W %s' requires an argument\n"
+#~ msgstr "%s: η επιλογή `-%s' απαιτεί ένα όρισμα\n"
+
+#
+#, fuzzy, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "σφάλμα εγγραφής %s"
+
+#
+#, fuzzy, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "%s: μη έγκυρη μορφή"
+
+#
+#, fuzzy, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "αδυναμία αλλαγής ιδιοκτησίας στο %s"
+
+#
+#, fuzzy, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "αδύνατη η δημιουργία καταλόγου `%s'"
+
+#
+#, fuzzy, c-format
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "αδυναμία αλλαγής ιδιοκτησίας στο %s"
+
+#
+#, fuzzy, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "%s: μη έγκυρη μορφή"
+
+#
+#, fuzzy, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "%s: μη έγκυρη μορφή"
+
+#
+#, fuzzy, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "%s: μη έγκυρη μορφή"
+
+#
+#~ msgid "`"
+#~ msgstr "`"
+
+#
+#~ msgid "'"
+#~ msgstr "'"
+
+#
+#~ msgid "^[yY]"
+#~ msgstr "^[yYνΝ]"
+
+#
+#~ msgid "^[nN]"
+#~ msgstr "^[nNοΟ]"
+
+#
+#, fuzzy, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "αδυναμία αλλαγής ιδιοκτησίας στο %s"
+
+#
+#, fuzzy
+#~ msgid "Bus error"
+#~ msgstr "σφάλμα εγγραφής"
+
+#
+#, fuzzy, c-format
+#~ msgid "cannot create pipe"
+#~ msgstr "αδύνατη η δημιουργία καταλόγου `%s'"
+
+#
+#, fuzzy
+#~ msgid "character out of range"
+#~ msgstr "%s: αριθμός γραμμής έξω από τα όρια"
+
+#
+#~ msgid "invalid user"
+#~ msgstr "μη έγκυρος χρήστης"
+
+#
+#~ msgid "invalid group"
+#~ msgstr "μη έγκυρη ομάδα"
+
+#
+#, fuzzy
+#~ msgid "invalid spec"
+#~ msgstr "μη έγκυρος χρήστης"
+
+#
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Γραμμένο από τον/την %s.\n"
+
+#
+#, fuzzy, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Γραμμένο από τον/την %s.\n"
+
+#
+#, fuzzy, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Γραμμένο από τον/την %s.\n"
+
+#
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr "Γραμμένο από τον/την %s.\n"
+
+#
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr "Γραμμένο από τον/την %s.\n"
+
+#
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr "Γραμμένο από τον/την %s.\n"
+
+#
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr "Γραμμένο από τον/την %s.\n"
+
+#
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr "Γραμμένο από τον/την %s.\n"
+
+#
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr "Γραμμένο από τον/την %s.\n"
+
+#
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr "Γραμμένο από τον/την %s.\n"
+
+#
+#, fuzzy, c-format
+#~ msgid ""
+#~ "\n"
+#~ "Report bugs to: %s\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Αναφέρατε σφάλματα στο <%s>.\n"
+
+#
+#, fuzzy, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Αναφέρατε σφάλματα στο <%s>.\n"
+
+#
+#, fuzzy, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "%s: μη έγκυρη μορφή"
+
+#
+#, fuzzy, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "%s: μη έγκυρη μορφή"
+
+#
+#, fuzzy
+#~ msgid "unknown stream"
+#~ msgstr "Άγνωστο σφάλμα συστήματος"
+
+#
+#, fuzzy, c-format
+#~ msgid "string comparison failed"
+#~ msgstr "αποτυχία εγγραφής"
+
+#
+#, c-format
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Θέστε LC_ALL='C' για να παρακάμψετε το πρόβλημα."
+
+#, fuzzy, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "δεν είναι δυνατό να δημιουργηθεί το %s `%s' στο `%s'"
+
+#
+#, fuzzy, c-format
+#~ msgid "invalid %s%s argument `%s'"
+#~ msgstr "μη έγκυρο όρισμα %s για %s"
+
+#
+#, fuzzy, c-format
+#~ msgid "invalid suffix in %s%s argument `%s'"
+#~ msgstr "μη έγκυρο όρισμα %s για %s"
+
+#
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: μη αναγνωρίσιμη επιλογή -- %c\n"
+
+#
+#~ msgid "block size"
+#~ msgstr "μέγεθος μπλοκ"
+
+#
+#, fuzzy
+#~ msgid "%s exists but is not a directory"
+#~ msgstr "το `%s' υπάρχει ήδη άλλα δεν είναι κατάλογος"
+
+#
+#, fuzzy
+#~ msgid "cannot change owner and/or group of %s"
+#~ msgstr "δεν είναι δυνατό να παραληφθεί χρήστης και ομάδα"
+
+#
+#, fuzzy
+#~ msgid "cannot chdir to directory %s"
+#~ msgstr "αδύνατη η αλλαγή στο κατάλογο %s"
+
+#
+#~ msgid "cannot get the login group of a numeric UID"
+#~ msgstr ""
+#~ "αδύνατη η λήψη της ομάδας εισαγωγής στο σύστημα ενός αριθμητικού UID"
diff --git a/gl/po/en@boldquot.header b/gl/po/en@boldquot.header
new file mode 100644
index 0000000..fedb6a0
--- /dev/null
+++ b/gl/po/en@boldquot.header
@@ -0,0 +1,25 @@
+# All this catalog "translates" are quotation characters.
+# The msgids must be ASCII and therefore cannot contain real quotation
+# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
+# and double quote (0x22). These substitutes look strange; see
+# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
+#
+# This catalog translates grave accent (0x60) and apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019).
+# It also translates pairs of apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019)
+# and pairs of quotation mark (0x22) to
+# left double quotation mark (U+201C) and right double quotation mark (U+201D).
+#
+# When output to an UTF-8 terminal, the quotation characters appear perfectly.
+# When output to an ISO-8859-1 terminal, the single quotation marks are
+# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
+# grave/acute accent (by libiconv), and the double quotation marks are
+# transliterated to 0x22.
+# When output to an ASCII terminal, the single quotation marks are
+# transliterated to apostrophes, and the double quotation marks are
+# transliterated to 0x22.
+#
+# This catalog furthermore displays the text between the quotation marks in
+# bold face, assuming the VT100/XTerm escape sequences.
+#
diff --git a/gl/po/en@quot.header b/gl/po/en@quot.header
new file mode 100644
index 0000000..a9647fc
--- /dev/null
+++ b/gl/po/en@quot.header
@@ -0,0 +1,22 @@
+# All this catalog "translates" are quotation characters.
+# The msgids must be ASCII and therefore cannot contain real quotation
+# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
+# and double quote (0x22). These substitutes look strange; see
+# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
+#
+# This catalog translates grave accent (0x60) and apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019).
+# It also translates pairs of apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019)
+# and pairs of quotation mark (0x22) to
+# left double quotation mark (U+201C) and right double quotation mark (U+201D).
+#
+# When output to an UTF-8 terminal, the quotation characters appear perfectly.
+# When output to an ISO-8859-1 terminal, the single quotation marks are
+# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
+# grave/acute accent (by libiconv), and the double quotation marks are
+# transliterated to 0x22.
+# When output to an ASCII terminal, the single quotation marks are
+# transliterated to apostrophes, and the double quotation marks are
+# transliterated to 0x22.
+#
diff --git a/gl/po/eo.gmo b/gl/po/eo.gmo
new file mode 100644
index 0000000..72ac46b
--- /dev/null
+++ b/gl/po/eo.gmo
Binary files differ
diff --git a/gl/po/eo.po b/gl/po/eo.po
new file mode 100644
index 0000000..4668c9e
--- /dev/null
+++ b/gl/po/eo.po
@@ -0,0 +1,962 @@
+# translation of gnulib to Esperanto
+# Copyright (C) 2013, 2019 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+# Felipe Castro <fefcas@gmail.com>, 2013, 2019.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 4.0.0.2567\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2019-05-19 18:26-0300\n"
+"Last-Translator: Felipe Castro <fefcas@gmail.com>\n"
+"Language-Team: Esperanto <translation-team-eo@lists.sourceforge.net>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"X-Generator: Poedit 1.8.11\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: valoro de %s estas malpli aŭ egala al %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: parametro ARGP_HELP_FMT postulas valoron"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: Nekonata parametro ARGP_HELP_FMT"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Rubaĵo en ARGP_HELP_FMT: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Devigaj aŭ nedevigaj argumentoj por longaj modifiloj ankaŭ estas devigaj aŭ "
+"nedevigaj por iu ajn korespondanta mallonga modifilo."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Uzmaniero:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " aŭ: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [MODIFILO...]"
+
+#: gl/lib/argp-help.c:1783
+#, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Provu '%s --help' aŭ '%s --usage' por pli da informo.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "Raportu program-misojn al %s.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Nekonata sistem-eraro"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "montri tiun ĉi help-liston"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "montri mallongan mesaĝon pri la uzmaniero"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "NOMO"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "difini la program-nomon"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "SEK"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "halti dum SEK sekundoj (apriore 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "montri program-version"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(PROGRAM-ERARO) Neniu versio estas konata!?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: tro da argumentoj\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(PROGRAM-ERARO) Modifilo devus esti rekonita!?"
+
+#: gl/lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: la modifilo '%s%s' estas plursenca\n"
+
+#: gl/lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: la modifilo '%s%s' estas plursenca; eblecoj:"
+
+#: gl/lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: nerekonata modifilo '%s%s'\n"
+
+#: gl/lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: la modifilo '%s%s' ne permesas argumenton\n"
+
+#: gl/lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: la modifilo '%s%s' postulas argumenton\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: malvalida modifilo -- '%c'\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: la modifilo postulas argumenton -- '%c'\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "ne eblas registri la aktualan labordosierujon"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "ni fiaskis reveni al la komenca labordosierujo"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Sukceso"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Neniu kongruaĵo"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Malvalida regulesprimo"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Malvalida ordodifina signo"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Malvalida signa klasnomo"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Vosta retroklino"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Malvalida retroreferenco"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Senpara [, [^, [:, [., aŭ [="
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "Senpara ( aŭ \\("
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "Senpara \\{"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "Malvalida enhavo de \\{\\}"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Malvalida intervalofino"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Memoro estas plenigita"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Malvalida antaŭa regulesprimo"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Tro frua fino de regulesprimo"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "Regulesprimo tro grandas"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr "Senpara ) aŭ \\)"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Neniu antaŭa regulesprimo"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "ne eblas montri erarmesaĝon"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memoro estas plenigita"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr "laŭnormaj dosier-priaĵoj"
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "malvalida argumento %s por %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "plursenca argumento %s por %s"
+
+#~ msgid "Valid arguments are:"
+#~ msgstr "Validaj argumentoj estas:"
+
+#, c-format
+#~ msgid "%u bitset_allocs, %u freed (%.2f%%).\n"
+#~ msgstr "%u bitset_allocs, %u liberitaj (%.2f%%).\n"
+
+#, c-format
+#~ msgid "%u bitset_sets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_sets, %u kaŝmem (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_resets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_resets, %u kaŝmem (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_tests, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_tests, %u kaŝmem (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_lists\n"
+#~ msgstr "%u bitset_lists\n"
+
+#~ msgid "count log histogram\n"
+#~ msgstr "histogramo pri nombro-protokolado\n"
+
+#~ msgid "size log histogram\n"
+#~ msgstr "histogramo pri grando-protokolado\n"
+
+#~ msgid "density histogram\n"
+#~ msgstr "histogramo pri denso\n"
+
+#, c-format
+#~ msgid ""
+#~ "Bitset statistics:\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Bitset statistikoj:\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Accumulated runs = %u\n"
+#~ msgstr "Akumulitaj funkciadoj = %u\n"
+
+#~ msgid "cannot read stats file"
+#~ msgstr "ne eblas legi dosieron stats"
+
+#, c-format
+#~ msgid "bad stats file size\n"
+#~ msgstr "malĝusta dosier-grando de stats\n"
+
+#~ msgid "cannot write stats file"
+#~ msgstr "ne eblas skibi en dosiero stats"
+
+#~ msgid "cannot open stats file for writing"
+#~ msgstr "ne eblas malfermi dosieron stats por skribi"
+
+#~ msgid "program error"
+#~ msgstr "programeraro"
+
+#~ msgid "stack overflow"
+#~ msgstr "staka troigo"
+
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr "ne eblas trovi provizoran dosierujon, provu difini $TMPDIR"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "ne eblas krei provizoran dosierujon uzante la ŝablonon \"%s\""
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "ne eblas forigi la provizoran dosieron %s"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "ne eblas forigi la provizoran dosierujon %s"
+
+#~ msgid "error closing file"
+#~ msgstr "eraro dum fermo de dosiero"
+
+#~ msgid "write error"
+#~ msgstr "skrib-eraro"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "ni tenas la permesojn por %s"
+
+#, c-format
+#~ msgid "error while opening %s for reading"
+#~ msgstr "eraro dum malfermo de %s por legi"
+
+#, c-format
+#~ msgid "cannot open backup file %s for writing"
+#~ msgstr "ne eblas malfermi la savdosieron %s por skribi"
+
+#, c-format
+#~ msgid "error reading %s"
+#~ msgstr "eraro dum lego de %s"
+
+#, c-format
+#~ msgid "error writing %s"
+#~ msgstr "eraro dum skribo de %s"
+
+#, c-format
+#~ msgid "error after reading %s"
+#~ msgstr "eraro post legi %s"
+
+#~ msgid "fdopen() failed"
+#~ msgstr "fdopen() fiaskis"
+
+#~ msgid "C# compiler not found, try installing mono"
+#~ msgstr "Kompililo C# ne estis trovata, ni provas instali mono"
+
+#~ msgid "C# virtual machine not found, try installing mono"
+#~ msgstr "Virtuala maŝino C# ne estis trovata, ni provas instali mono"
+
+#~ msgid "unbalanced ["
+#~ msgstr "nekongruita ["
+
+#~ msgid "invalid character class"
+#~ msgstr "malvalida signa klaso"
+
+#~ msgid "character class syntax is [[:space:]], not [:space:]"
+#~ msgstr "sintakso de signa klaso estas [[:space:]], ne [:space:]"
+
+#~ msgid "unfinished \\ escape"
+#~ msgstr "nefinigita eskapo \\"
+
+#~ msgid "invalid content of \\{\\}"
+#~ msgstr "malvalida enhavo de \\{\\}"
+
+#~ msgid "regular expression too big"
+#~ msgstr "regulesprimo tro grandas"
+
+#~ msgid "unbalanced ("
+#~ msgstr "nekongruita ("
+
+#~ msgid "no syntax specified"
+#~ msgstr "neniu sintakso estas indikita"
+
+#~ msgid "unbalanced )"
+#~ msgstr "nekongruita )"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "subprocezo de %s fiaskis"
+
+#~ msgid "regular empty file"
+#~ msgstr "regula malplena dosiero"
+
+#~ msgid "regular file"
+#~ msgstr "regula dosiero"
+
+#~ msgid "directory"
+#~ msgstr "dosierujo"
+
+#~ msgid "symbolic link"
+#~ msgstr "simbola ligo"
+
+#~ msgid "message queue"
+#~ msgstr "mesaĝovico"
+
+#~ msgid "semaphore"
+#~ msgstr "semaforo"
+
+#~ msgid "shared memory object"
+#~ msgstr "komuna memorobjekto"
+
+#~ msgid "typed memory object"
+#~ msgstr "tipita memorbjekto"
+
+#~ msgid "block special file"
+#~ msgstr "bloka speciala dosiero"
+
+#~ msgid "character special file"
+#~ msgstr "bajta speciala dosiero"
+
+#~ msgid "contiguous data"
+#~ msgstr "kontinua datumaro"
+
+#~ msgid "fifo"
+#~ msgstr "fifo"
+
+#~ msgid "door"
+#~ msgstr "enirejo"
+
+#~ msgid "multiplexed block special file"
+#~ msgstr "multplektita bloka speciala dosiero"
+
+#~ msgid "multiplexed character special file"
+#~ msgstr "bajta multplektita speciala dosiero"
+
+#~ msgid "multiplexed file"
+#~ msgstr "multplektita dosiero"
+
+#~ msgid "named file"
+#~ msgstr "nomigita dosiero"
+
+#~ msgid "network special file"
+#~ msgstr "reta speciala dosiero"
+
+#~ msgid "migrated file with data"
+#~ msgstr "transmetis dosieron kun datumaro"
+
+#~ msgid "migrated file without data"
+#~ msgstr "transmetis dosieron sen datumaro"
+
+#~ msgid "port"
+#~ msgstr "pordo"
+
+#~ msgid "socket"
+#~ msgstr "konektingo"
+
+#~ msgid "whiteout"
+#~ msgstr "'whiteout'"
+
+#~ msgid "weird file"
+#~ msgstr "stranga dosiero"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Adresfamilio por komputilretnomo ne estas subtenata"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Provizora paneo en solvo de retnomo"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Malĝusta valoro por ai_flags"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Neriparebla paneo en solvo de retnomo"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "ai_family ne estas subtenata"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Rezervo de memoro fiaskis"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "Neniu adreso estas asociita kun komputilretnomo"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Nomo aŭ servo ne estas konata"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "Servname ne estas subtenata por ai_socktype"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "ai_socktype ne estas subtenata"
+
+#~ msgid "System error"
+#~ msgstr "Sistem-eraro"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "Bufro por argumentoj tro malgrandas"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Procezado de peto daŭras"
+
+#~ msgid "Request canceled"
+#~ msgstr "Peto estas nuligita"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Peto ne estas nuligita"
+
+#~ msgid "All requests done"
+#~ msgstr "Ĉiuj petoj estas plenumitaj"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Interrompita de signalo"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "Parametra ĉeno ne estas ĝuste enkodita"
+
+#~ msgid "Unknown error"
+#~ msgstr "Nekonata eraro"
+
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "malvalida argumento source_version por compile_java_class"
+
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "malvalida argumento target_version por compile_java_class"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "ni fiaskis krei \"%s\""
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "eraro dum skribo de dosiero \"%s\""
+
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr "Ĵava kompililo ne estis trovata, provu instali gcj aŭ difinu $JAVAC"
+
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "Ĵava virtuala maŝino ne estis trovata, provu instali gij aŭ difinu $JAVA"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "%s subproceza eraro de en/eligo"
+
+#, c-format
+#~ msgid "cannot stat %s"
+#~ msgstr "ne eblas stat %s"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "ne eblas ŝanĝi permesojn de %s"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "ne eblas krei la dosierujon %s"
+
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Ni fiaskis malfermi /dev/zero por legi"
+
+#~ msgid "creation of reading thread failed"
+#~ msgstr "kreo de leganta fadeno fiaskis"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "ne eblas difini neblokantan en/eligon al la subprocezo %s"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "komunikado kun la subprocezo %s fiaskis"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "skribo al la subprocezo %s fiaskis"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "lego el la subprocezo %s fiaskis"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "la subproceso %s ĉesis kun elira kodo %d"
+
+#~ msgid "creation of threads failed"
+#~ msgstr "kreo de fadenoj fiaskis"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "la subproceso %s ĉesis kun elira kodo %d"
+
+#~ msgid "`"
+#~ msgstr "‘"
+
+#~ msgid "'"
+#~ msgstr "’"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[jJyY]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "agordo de permesoj por %s"
+
+#~ msgid "Hangup"
+#~ msgstr "Malkonekto"
+
+#~ msgid "Interrupt"
+#~ msgstr "Interrompo"
+
+#~ msgid "Quit"
+#~ msgstr "Eliri"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "Malvalida instrukcio"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Spursekva/paŭzopunkta kaptilo"
+
+#~ msgid "Aborted"
+#~ msgstr "Ĉesigita"
+
+#~ msgid "Floating point exception"
+#~ msgstr "Glitkoma escepto"
+
+#~ msgid "Killed"
+#~ msgstr "Mortigita"
+
+#~ msgid "Bus error"
+#~ msgstr "Bus-eraro"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "Adres-eraro"
+
+#~ msgid "Broken pipe"
+#~ msgstr "Rompita dukto"
+
+#~ msgid "Alarm clock"
+#~ msgstr "Vekhorloĝo"
+
+#~ msgid "Terminated"
+#~ msgstr "Finigita"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "Urĝa en/eliga stato"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "Haltigita (signalo)"
+
+#~ msgid "Stopped"
+#~ msgstr "Haltigita"
+
+#~ msgid "Continued"
+#~ msgstr "Daŭrigita"
+
+#~ msgid "Child exited"
+#~ msgstr "Ido finis"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Haltigita (enigo tty)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Haltigita (eligo tty)"
+
+#~ msgid "I/O possible"
+#~ msgstr "En/eligo eblas"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "Procezila tempolimo estas atingita"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "Dosiergranda limo estas atingita"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "Virtuala horloĝo senvalidiĝis"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "Profilanta horloĝo senvalidiĝis"
+
+#~ msgid "Window changed"
+#~ msgstr "Fenestro ŝanĝis"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "Signalo 1 difinita de uzanto"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Signalo 2 difinita de uzanto"
+
+#~ msgid "EMT trap"
+#~ msgstr "EMT-kaptilo"
+
+#~ msgid "Bad system call"
+#~ msgstr "Malĝusta sistemvoko"
+
+#~ msgid "Stack fault"
+#~ msgstr "Stak-eraro"
+
+#~ msgid "Information request"
+#~ msgstr "Informo-peto"
+
+#~ msgid "Power failure"
+#~ msgstr "Elektra paneo"
+
+#~ msgid "Resource lost"
+#~ msgstr "Perdo de rimedo"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "eraro skribante al fermida dukto aŭ konektingo"
+
+#~ msgid "cannot create pipe"
+#~ msgstr "ne eblas krei dukton"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "Realtempa signalo %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Nekonata signalo %d"
+
+#~ msgid "Execution times (seconds)"
+#~ msgstr "Tempo de funkciado (sekundoj)"
+
+#~ msgid "CPU user"
+#~ msgstr "CPU uzanto"
+
+#~ msgid "CPU system"
+#~ msgstr "CPU sistemo"
+
+#~ msgid "wall clock"
+#~ msgstr "mur-horloĝo"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "funkcio iconv ne uzeblas"
+
+#~ msgid "iconv function not available"
+#~ msgstr "funkcio iconv ne disponeblas"
+
+#~ msgid "character out of range"
+#~ msgstr "signo estas for de intervalo"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "ne eblas konverti U+%04X al loka signaro"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "ne eblas konverti U+%04X al loka signaro: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "malvalida uzanto"
+
+#~ msgid "invalid group"
+#~ msgstr "malvalida grupo"
+
+#~ msgid "invalid spec"
+#~ msgstr "malvalida spec"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "Pakigita de %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "Pakigita de %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "©"
+
+#, c-format
+#~ msgid ""
+#~ "License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ msgstr ""
+#~ "Permeso GPLv3+: GNU GPL versio 3 aŭ posta <%s>.\n"
+#~ "Tio ĉi estas libera programaro: vi estas libera por ŝanĝi kaj redisdoni "
+#~ "ĝin.\n"
+#~ "Ekzistas NENIU GARANTIO, laŭ plej amplekse permesate de la leĝoj.\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Verkita de %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Verkita de %s kaj %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Verkita de %s, %s, kaj %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Verkita de %s, %s, %s,\n"
+#~ "kaj %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Verkita de %s, %s, %s,\n"
+#~ "%s, kaj %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Verkita de %s, %s, %s,\n"
+#~ "%s, %s, kaj %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Verkita de %s, %s, %s,\n"
+#~ "%s, %s, %s, kaj %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Verkita de %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "kaj %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Verkita de %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, kaj %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Verkita de %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, kaj aliaj.\n"
+
+#, c-format
+#~ msgid "Report bugs to: %s\n"
+#~ msgstr "Raportu program-misojn al: %s\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "Raportu %s misojn al: %s\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "%s hejm-paĝo: <%s>\n"
+
+#, c-format
+#~ msgid "General help using GNU software: <%s>\n"
+#~ msgstr "Ĝenerala helpo por uzi programaron GNU: <%s>\n"
+
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "_open_osfhandle fiaskis"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "ne eblas restarigi fd %d: dup2 fiaskis"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "subprocezo %s"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "subprocezo %s ricevis neripareblan signalon %d"
+
+#~ msgid "failed to set file descriptor text/binary mode"
+#~ msgstr "ni fiaskis difini la dosieran priaĵon teksta/cifereca reĝimo"
+
+#~ msgid "stdin"
+#~ msgstr "ĉefenigujo"
+
+#~ msgid "stdout"
+#~ msgstr "ĉefeligujo"
+
+#~ msgid "stderr"
+#~ msgstr "ĉeferarujo"
+
+#~ msgid "unknown stream"
+#~ msgstr "nekonata fluaĵo"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "ni fiaskis remalfermi %s kun reĝimo %s"
+
+#~ msgid "string comparison failed"
+#~ msgstr "ĉena komparo fiaskis"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Agordu LC_ALL='C' por ĉirkauiri la problemon."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "La komparitaj ĉenoj estis %s kaj %s."
+
+#~ msgid "cannot perform formatted output"
+#~ msgstr "ne eblas efektivigi formatitan eligon"
+
+#, c-format
+#~ msgid "invalid %s%s argument '%s'"
+#~ msgstr "malvalida %s%s-argumento '%s'"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument '%s'"
+#~ msgstr "malvalida sufikso en %s%s-argumento '%s'"
+
+#, c-format
+#~ msgid "%s%s argument '%s' too large"
+#~ msgstr "%s%s-argumento '%s' tro larĝas"
+
+#~ msgid "%s home page: <https://www.gnu.org/software/%s/>\n"
+#~ msgstr "%s hejm-paĝo: <https://www.gnu.org/software/%s/>\n"
+
+#~ msgid "%.*s: ARGP_HELP_FMT parameter must be positive"
+#~ msgstr "%.*s: parametro ARGP_HELP_FMT devas esti pozitiva"
+
+#~ msgid "%s: option '--%s' doesn't allow an argument\n"
+#~ msgstr "%s: la modifilo '--%s' ne permesas argumenton\n"
+
+#~ msgid "%s: unrecognized option '--%s'\n"
+#~ msgstr "%s: nerekonata modifilo '--%s'\n"
+
+#~ msgid "%s: option '-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: la modifilo '-W %s' ne permesas argumenton\n"
+
+#~ msgid "%s: option '-W %s' requires an argument\n"
+#~ msgstr "%s: la modifilo '-W %s' postulas argumenton\n"
+
+#~ msgid "Franc,ois Pinard"
+#~ msgstr "François Pinard"
diff --git a/gl/po/es.gmo b/gl/po/es.gmo
new file mode 100644
index 0000000..4117425
--- /dev/null
+++ b/gl/po/es.gmo
Binary files differ
diff --git a/gl/po/es.po b/gl/po/es.po
new file mode 100644
index 0000000..5995186
--- /dev/null
+++ b/gl/po/es.po
@@ -0,0 +1,1046 @@
+# Mensajes en español para gnulib 4.0.0.2567
+# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2022 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+# Cristian Othón Martínez Vera <cfuga@cfuga.mx>, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2022.
+#
+# Los mensajes iniciales de esta traducción provienen de la traducción
+# de mailutils.
+#
+# Un agradecimiento especial a Santiago Vila por sus atinados comentarios
+# sobre esta traducción.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 4.0.0.2567\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2022-04-06 18:22-0500\n"
+"Last-Translator: Cristian Othón Martínez Vera <cfuga@cfuga.mx>\n"
+"Language-Team: Spanish <es@tp.org.es>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: el valor %s es menor o igual a %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: El parámetro ARGP_HELP_FMT requiere de un valor"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: Parámetro de ARGP_HELP_FMT desconocido"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Basura en ARGP_HELP_FMT: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Los argumentos obligatorios u opcionales para las opciones largas también "
+"son obligatorios u opcionales para cualquier opción corta correspondiente."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Modo de empleo:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " o:"
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [OPCIÓN...]"
+
+#: gl/lib/argp-help.c:1783
+#, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Pruebe '%s --help' ó `%s --usage' para más información.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "Reporte bichos a %s.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Error desconocido de sistema"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "da esta lista de ayuda"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "da un mensaje corto de modo de empleo"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "NOMBRE"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "establece el nombre del programa"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "SEGUNDOS"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "espera por SECS segundos (3600 por defecto)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "muestra la versión del programa"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(ERROR DEL PROGRAMA) ¿¡Sin versión conocida!?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: Demasiados argumentos\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(ERROR DEL PROGRAMA) ¿¡La opción debería reconocerse!?"
+
+#: gl/lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: la opción '%s%s' es ambigua\n"
+
+#: gl/lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: la opción '%s%s' es ambigua; posibilidades:"
+
+#: gl/lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: no se reconoce la opción '%s%s'\n"
+
+#: gl/lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: la opción '%s%s' no admite un argumento\n"
+
+#: gl/lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: la opción '%s%s' requiere de un argumento\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: opción inválida -- '%c'\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: la opción requiere de un argumento -- '%c'\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "no se puede registrar el directorio de trabajo actual"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "no se puede volver al directorio de trabajo inicial"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Éxito"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Sin coincidencia"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Expresión regular inválida"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Carácter de ordenamiento inválido"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Nombre de clase de carácter inválido"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Barra invertida sobrante"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Referencia hacia atrás inválida"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[, [^, [:, [., o [= sin pareja"
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "( o \\( sin pareja"
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "\\{ sin pareja"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "Contenido inválido de \\{\\}"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Fin de rango inválido"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Memoria agotada"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Expresión regular precedente inválida"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Final prematuro de la expresión regular"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "Expresión regular demasiado grande"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ") o \\) sin pareja"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "No hay una expresión regular previa"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "no se puede mostrar el mensaje de error"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memoria agotada"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr "descriptores de fichero estándar"
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "argumento %s inválido para %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "argumento %s ambiguo para %s"
+
+#~ msgid "Valid arguments are:"
+#~ msgstr "Los argumentos válidos son:"
+
+#, c-format
+#~ msgid "%u bitset_allocs, %u freed (%.2f%%).\n"
+#~ msgstr "%u bitset_allocs, %u liberados (%.2f%%).\n"
+
+#, c-format
+#~ msgid "%u bitset_sets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_sets, %u en caché (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_resets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_resets, %u en caché (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_tests, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_tests, %u en caché (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_lists\n"
+#~ msgstr "%u bitset_lists\n"
+
+#~ msgid "count log histogram\n"
+#~ msgstr "histograma de registro de cuenta\n"
+
+#~ msgid "size log histogram\n"
+#~ msgstr "histograma de registro de tamaño\n"
+
+#~ msgid "density histogram\n"
+#~ msgstr "histograma de densidad\n"
+
+#, c-format
+#~ msgid ""
+#~ "Bitset statistics:\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Estadísticas de conjuntos de bits:\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Accumulated runs = %u\n"
+#~ msgstr "Ejecuciones acumuladas = %u\n"
+
+#~ msgid "cannot read stats file"
+#~ msgstr "no se puede leer el fichero de estadísticas"
+
+#, c-format
+#~ msgid "bad stats file size\n"
+#~ msgstr "tamaño erróneo de fichero de estadísticas\n"
+
+#~ msgid "cannot write stats file"
+#~ msgstr "no se puede escribir el fichero de estadísticas"
+
+#~ msgid "cannot open stats file for writing"
+#~ msgstr "no se puede abrir el fichero de estadísticas para escritura"
+
+#~ msgid "program error"
+#~ msgstr "error del programa"
+
+#~ msgid "stack overflow"
+#~ msgstr "desbordamiento de la pila"
+
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr ""
+#~ "no se puede encontrar un directorio temporal, pruebe definir $TMPDIR"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "no se puede crear un directorio temporal usando la plantilla \"%s\""
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "no se puede borrar el fichero temporal %s"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "no se puede borrar el directorio temporal %s"
+
+#~ msgid "error closing file"
+#~ msgstr "error al cerrar el fichero"
+
+#~ msgid "write error"
+#~ msgstr "error de escritura"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "se conservan los permisos de %s"
+
+#, c-format
+#~ msgid "error while opening %s for reading"
+#~ msgstr "error al abrir %s para lectura"
+
+#, c-format
+#~ msgid "cannot open backup file %s for writing"
+#~ msgstr "no se puede abrir el fichero de respaldo %s para escritura"
+
+#, c-format
+#~ msgid "error reading %s"
+#~ msgstr "error al leer %s"
+
+#, c-format
+#~ msgid "error writing %s"
+#~ msgstr "error al escribir en %s"
+
+#, c-format
+#~ msgid "error after reading %s"
+#~ msgstr "error después de leer %s"
+
+#~ msgid "fdopen() failed"
+#~ msgstr "falló fdopen()"
+
+#~ msgid "C# compiler not found, try installing mono"
+#~ msgstr "No se encontró un compilador de C#, pruebe instalando mono"
+
+#~ msgid "C# virtual machine not found, try installing mono"
+#~ msgstr "No se encontró una máquina virtual de C#, pruebe instalando mono"
+
+#~ msgid "unbalanced ["
+#~ msgstr "[ sin pareja"
+
+#~ msgid "invalid character class"
+#~ msgstr "clase de carácter inválida"
+
+#~ msgid "character class syntax is [[:space:]], not [:space:]"
+#~ msgstr "la sintaxis de clase de carácter es [[:space:]], no [:space:]"
+
+#~ msgid "unfinished \\ escape"
+#~ msgstr "escape \\ sin terminar"
+
+#~ msgid "invalid content of \\{\\}"
+#~ msgstr "contenido inválido de \\{\\}"
+
+#~ msgid "regular expression too big"
+#~ msgstr "expresión regular demasiado grande"
+
+#~ msgid "unbalanced ("
+#~ msgstr "( sin pareja"
+
+#~ msgid "no syntax specified"
+#~ msgstr "no se especificó la sintaxis"
+
+#~ msgid "unbalanced )"
+#~ msgstr ") sin pareja"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s: falló el subproceso"
+
+#~ msgid "regular empty file"
+#~ msgstr "fichero regular vacío"
+
+#~ msgid "regular file"
+#~ msgstr "fichero regular"
+
+#~ msgid "directory"
+#~ msgstr "directorio"
+
+#~ msgid "symbolic link"
+#~ msgstr "enlace simbólico"
+
+#~ msgid "message queue"
+#~ msgstr "cola de mensajes"
+
+#~ msgid "semaphore"
+#~ msgstr "semáforo"
+
+#~ msgid "shared memory object"
+#~ msgstr "objeto de memoria compartida"
+
+#~ msgid "typed memory object"
+#~ msgstr "objeto de memoria con tipo"
+
+#~ msgid "block special file"
+#~ msgstr "fichero especial de bloques"
+
+#~ msgid "character special file"
+#~ msgstr "fichero especial de caracteres"
+
+#~ msgid "contiguous data"
+#~ msgstr "datos contiguos"
+
+#~ msgid "fifo"
+#~ msgstr "`fifo'"
+
+#~ msgid "door"
+#~ msgstr "puerta"
+
+#~ msgid "multiplexed block special file"
+#~ msgstr "fichero especial de bloques multiplexado"
+
+#~ msgid "multiplexed character special file"
+#~ msgstr "fichero especial de caracteres multiplexado"
+
+#~ msgid "multiplexed file"
+#~ msgstr "fichero multiplexado"
+
+#~ msgid "named file"
+#~ msgstr "fichero nombrado"
+
+#~ msgid "network special file"
+#~ msgstr "fichero especial de red"
+
+#~ msgid "migrated file with data"
+#~ msgstr "fichero migrado con datos"
+
+#~ msgid "migrated file without data"
+#~ msgstr "fichero migrado sin datos"
+
+#~ msgid "port"
+#~ msgstr "puerto"
+
+#~ msgid "socket"
+#~ msgstr "`socket'"
+
+#~ msgid "whiteout"
+#~ msgstr "blanqueado"
+
+#~ msgid "weird file"
+#~ msgstr "fichero extraño"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "No se admiten las familias de direcciones para hostname"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Fallo temporal en la resolución del nombre"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Valor erróneo para ai_flags"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Falla irrecuperable en la resolución del nombre"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "no se admite ai_family"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Falló la llamada al sistema `malloc'"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "No existe una dirección asociada con el nombre de anfitrión"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Nombre o servicio desconocido"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "No se admite servname para ai_socktype"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "no se admite ai_socktype"
+
+#~ msgid "System error"
+#~ msgstr "Error del sistema"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "Almacenamiento temporal de argumentos demasiado pequeño"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Petición de procesamiento en progreso"
+
+#~ msgid "Request canceled"
+#~ msgstr "Se canceló la petición"
+
+#~ msgid "Request not canceled"
+#~ msgstr "No se canceló la petición"
+
+#~ msgid "All requests done"
+#~ msgstr "Se completaron todas las peticiones"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Interrupción por una señal"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "La cadena de parámetro no está codificada correctamente"
+
+#~ msgid "Unknown error"
+#~ msgstr "Error desconocido"
+
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "argumento source_version inválido para compile_java_class"
+
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "argumento target_version inválido para compile_java_class"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "no se puede crear \"%s\""
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "error al escribir el fichero \"%s\""
+
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr ""
+#~ "No se encontró un compilador de Java, pruebe instalando gcj o definiendo "
+#~ "$JAVAC"
+
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "No se encontró una máquina virtual de Java, pruebe instalando gij o "
+#~ "definiendo $JAVA"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "%s: error de E/S del subproceso"
+
+#, c-format
+#~ msgid "cannot stat %s"
+#~ msgstr "no se puede ejecutar stat sobre %s"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "no se pueden cambiar los permisos de %s"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "no se puede crear el directorio %s"
+
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Falló al abrir /dev/zero para lectura"
+
+#~ msgid "creation of reading thread failed"
+#~ msgstr "falló la creación del hilo de lectura"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "no se puede establecer E/S sin bloqueo para el subproceso %s"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "falló la comunicación con el subproceso %s"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "falló la escritura al subproceso %s"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "falló la lectura del subproceso %s"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "el subproceso %s terminó con el código de salida %d"
+
+#~ msgid "creation of threads failed"
+#~ msgstr "falló la creación de hilos"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "subproceso %s terminado con el código de salida %d"
+
+# Vamos a probar con el símbolo de cita tradicional en español,
+# a ver qué tal queda la cosa.
+#~ msgid "`"
+#~ msgstr "«"
+
+#~ msgid "'"
+#~ msgstr "»"
+
+# Esto es para responder "sí" cuando nos pregunte.
+#~ msgid "^[yY]"
+#~ msgstr "^[sS]"
+
+# Y esto es para responder "no" cuando nos pregunte.
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "se cambian los permisos de %s"
+
+#~ msgid "Hangup"
+#~ msgstr "Colgar"
+
+#~ msgid "Interrupt"
+#~ msgstr "Interrumpir"
+
+#~ msgid "Quit"
+#~ msgstr "Salir"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "Instrucción ilegal"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Captura de rastreo/punto de quiebre"
+
+#~ msgid "Aborted"
+#~ msgstr "Abortar"
+
+#~ msgid "Floating point exception"
+#~ msgstr "Excepción de coma flotante"
+
+#~ msgid "Killed"
+#~ msgstr "Matar"
+
+#~ msgid "Bus error"
+#~ msgstr "Error de bus"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "Falta de segmentación"
+
+#~ msgid "Broken pipe"
+#~ msgstr "Tubería rota"
+
+#~ msgid "Alarm clock"
+#~ msgstr "Reloj de alarma"
+
+#~ msgid "Terminated"
+#~ msgstr "Terminar"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "Condición de E/S urgente"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "Detener (señal)"
+
+#~ msgid "Stopped"
+#~ msgstr "Detener"
+
+#~ msgid "Continued"
+#~ msgstr "Continuar"
+
+#~ msgid "Child exited"
+#~ msgstr "Salió el hijo"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Detener (entrada de tty)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Detener (salida de tty)"
+
+#~ msgid "I/O possible"
+#~ msgstr "Posible E/S"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "Excede el límite de tiempo de CPU"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "Excede el límite de tamaño de fichero"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "Expira el temporizador virtual"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "Expira el temporizador de análisis de perfil"
+
+#~ msgid "Window changed"
+#~ msgstr "Cambio de ventana"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "Señal 1 definida por el usuario"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Señal 2 definida por el usuario"
+
+#~ msgid "EMT trap"
+#~ msgstr "Captura EMT"
+
+#~ msgid "Bad system call"
+#~ msgstr "Llamada al sistema errónea"
+
+#~ msgid "Stack fault"
+#~ msgstr "Falta en la pila"
+
+#~ msgid "Information request"
+#~ msgstr "Petición de información"
+
+#~ msgid "Power failure"
+#~ msgstr "Falla de energía"
+
+#~ msgid "Resource lost"
+#~ msgstr "Recurso perdido"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "error al escribir a una tubería o socket cerrados"
+
+#~ msgid "cannot create pipe"
+#~ msgstr "no se puede crear una tubería"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "Señal de tiempo real %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Señal %d desconocida"
+
+#~ msgid "Execution times (seconds)"
+#~ msgstr "Tiempos de ejecución (segundos)"
+
+#~ msgid "CPU user"
+#~ msgstr "CPU de usuario"
+
+#~ msgid "CPU system"
+#~ msgstr "CPU de sistema"
+
+#~ msgid "wall clock"
+#~ msgstr "reloj de pared"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "la función iconv no es utilizable"
+
+#~ msgid "iconv function not available"
+#~ msgstr "la función iconv no está disponible"
+
+#~ msgid "character out of range"
+#~ msgstr "carácter fuera de rango"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "no se puede convertir U+%04X al conjunto de caracteres local"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "no se puede convertir U+%04X al conjunto de caracteres local: %s"
+
+# Me niego a considerar "inválido" como palabra "políticamente incorrecta".
+# Si algún "impedido físico" lee este mensaje y se molesta por ello, entonces
+# es que además de impedido físico es tonto, pues todo el mundo sabe que,
+# *en el contexto informático*, inválido e ilegal significan
+# "no permitido por la causa que sea".
+# Luego, que unas veces sea inválido y otras ilegal, son matices que el
+# original tiene y creo necesario respetar en la traducción.
+#
+# [ Tomás Bautista sugiere "inexistente", y también para grupo ]
+#
+# FIXME:
+# Eso sí, un día tendré que preguntar a los de GNU en qué se diferencia
+# "invalid" de "not allowed" de "not recognized" y todo eso... sv
+#
+#~ msgid "invalid user"
+#~ msgstr "usuario inválido"
+
+#~ msgid "invalid group"
+#~ msgstr "grupo inválido"
+
+# Me niego a considerar "inválido" como palabra "políticamente incorrecta".
+# Si algún "impedido físico" lee este mensaje y se molesta por ello, entonces
+# es que además de impedido físico es tonto, pues todo el mundo sabe que,
+# *en el contexto informático*, inválido e ilegal significan
+# "no permitido por la causa que sea".
+# Luego, que unas veces sea inválido y otras ilegal, son matices que el
+# original tiene y creo necesario respetar en la traducción.
+#
+# [ Tomás Bautista sugiere "inexistente", y también para grupo ]
+#
+# FIXME:
+# Eso sí, un día tendré que preguntar a los de GNU en qué se diferencia
+# "invalid" de "not allowed" de "not recognized" y todo eso... sv
+#
+#~ msgid "invalid spec"
+#~ msgstr "especificación inválida"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "Empaquetado por %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "Empaquetado por %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "(C)"
+
+#, c-format
+#~ msgid ""
+#~ "License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ msgstr ""
+#~ "Licencia GPLv3+: GPL de GNU versión 3 o posterior <%s>.\n"
+#~ "Esto es software libre: tiene la libertad de cambiarlo y redistribuirlo.\n"
+#~ "No tiene GARANTÍA, en la extensión permitida por la ley.\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Escrito por %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Escrito por %s y %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Escrito por %s, %s, y %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "y %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, y %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, %s, y %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, %s, %s, y %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "y %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, y %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, y otros.\n"
+
+#, c-format
+#~ msgid "Report bugs to: %s\n"
+#~ msgstr "Reporte bichos a: %s.\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "Reporte bichos de %s a: %s\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "Página web de %s: <%s>\n"
+
+#, c-format
+#~ msgid "General help using GNU software: <%s>\n"
+#~ msgstr "Ayuda general para usar software de GNU: <%s>\n"
+
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "falló _open_osfhandle"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "no se puede restaurar el df %d: falló dup2"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "subproceso %s"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "el subproceso %s recibió la señal fatal %d"
+
+#~ msgid "failed to set file descriptor text/binary mode"
+#~ msgstr "falló al establecer el modo texto/binario del descriptor de fichero"
+
+#~ msgid "stdin"
+#~ msgstr "entrada estándard"
+
+#~ msgid "stdout"
+#~ msgstr "salida estándard"
+
+#~ msgid "stderr"
+#~ msgstr "salida de error estándard"
+
+#~ msgid "unknown stream"
+#~ msgstr "flujo desconocido"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "falló al reabrir %s con modo %s"
+
+#~ msgid "string comparison failed"
+#~ msgstr "la comparación de cadenas falló"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr ""
+#~ "Establezca LC_ALL='C' para solucionar este problema de forma temporal."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Las cadenas comparadas eran %s y %s."
+
+#~ msgid "cannot perform formatted output"
+#~ msgstr "no se puede mostrar la salida con formato"
+
+#, c-format
+#~ msgid "invalid %s%s argument '%s'"
+#~ msgstr "el argumento %s%s '%s' es inválido"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument '%s'"
+#~ msgstr "sufijo inválido en %s%s argumento '%s'"
+
+#, c-format
+#~ msgid "%s%s argument '%s' too large"
+#~ msgstr "el argumento %s%s '%s' es demasiado grande"
+
+#~ msgid "%.*s: ARGP_HELP_FMT parameter must be positive"
+#~ msgstr "%.*s: El parámetro ARGP_HELP_FMT debe ser positivo"
+
+#~ msgid "%s: option '--%s' doesn't allow an argument\n"
+#~ msgstr "%s: la opción '--%s' no admite un argumento\n"
+
+#~ msgid "%s: unrecognized option '--%s'\n"
+#~ msgstr "%s: no se reconoce la opción '--%s'\n"
+
+#~ msgid "%s: option '-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: la opción '-W %s' no admite un argumento\n"
+
+#~ msgid "%s: option '-W %s' requires an argument\n"
+#~ msgstr "%s: la opción '-W %s' requiere de un argumento\n"
+
+#~ msgid "Franc,ois Pinard"
+#~ msgstr "François Pinard"
+
+#~ msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+#~ msgstr "Página web de %s: <http://www.gnu.org/software/%s/>\n"
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: opción ilegal -- %c\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Report bugs to <%s>.\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Reporte bichos a <%s>.\n"
+
+#~ msgid "block size"
+#~ msgstr "tamaño del bloque"
+
+#~ msgid "%s exists but is not a directory"
+#~ msgstr "%s existe pero no es un directorio"
+
+#~ msgid "cannot change owner and/or group of %s"
+#~ msgstr "no se puede cambiar el propietario y/o el grupo de %s"
+
+#~ msgid "cannot chdir to directory %s"
+#~ msgstr "no se puede cambiar al directorio %s"
+
+#~ msgid "cannot get the login group of a numeric UID"
+#~ msgstr "no se puede obtener el grupo de login de un UID numérico"
+
+#~ msgid ""
+#~ "\n"
+#~ "This is free software. You may redistribute copies of it under the terms "
+#~ "of\n"
+#~ "the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Este programa es software libre; se pueden redistribuir copias del "
+#~ "mismo \n"
+#~ "bajo los términos de la Licencia Pública General de GNU\n"
+#~ "<http://www.gnu.org/licenses/gpl.html>.\n"
+#~ "NO HAY GARANTÍA, a la extensión permitida por la ley.\n"
+#~ "\n"
diff --git a/gl/po/et.gmo b/gl/po/et.gmo
new file mode 100644
index 0000000..e7ce218
--- /dev/null
+++ b/gl/po/et.gmo
Binary files differ
diff --git a/gl/po/et.po b/gl/po/et.po
new file mode 100644
index 0000000..508abe1
--- /dev/null
+++ b/gl/po/et.po
@@ -0,0 +1,713 @@
+# This file is distributed under the same license as the gnulib package.
+# Estonian translations for gnulib
+# Copyright (C) 2000 Free Software Foundation, Inc.
+# Toomas Soome <Toomas.Soome@microlink.ee>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 2.0.0.3462.e9796\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2011-05-19 15:10+0300\n"
+"Last-Translator: Toomas Soome <Toomas.Soome@microlink.ee>\n"
+"Language-Team: Estonian <linux-ee@lists.eenet.ee>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-15\n"
+"Content-Transfer-Encoding: 8-bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: %s vrtus on viksem vi vrdne kui %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: ARGP_HELP_FMT parameeter nuab vrtust"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: Tundmatu ARGP_HELP_FMT parameeter"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Prgi ARGP_HELP_FMT sees: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Kohustuslikud argumendid pikkadele vtmetele on kohustuslikud ka lhikestele."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Kasutamine:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " vi: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [VTI]..."
+
+#: gl/lib/argp-help.c:1783
+#, fuzzy, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Lisainfo saamiseks proovige `%s --help' vi `%s --usage'.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "Vigadest teatage palun aadressil %s.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Tundmatu ssteemne viga"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "anna see abiinfo"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "anna kasutamise lhikirjeldus"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "NIMI"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "sea programmi nimi"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "SEK"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "oota SEK sekundit (vaikimisi 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "vljasta programmi versioon"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(PROGRAMMI VIGA) Versioon ei ole teada!?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: Liiga palju argumente\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(PROGRAMMI VIGA) Vti pidanuks olema teada!?"
+
+#: gl/lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: vti '%s' on segane\n"
+
+#: gl/lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: vti '%s' on segane\n"
+
+#: gl/lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: tundmatu vti '%c%s'\n"
+
+#: gl/lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: vti '%c%s' ei luba kasutada argumenti\n"
+
+#: gl/lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: vti '%s' nuab argumenti\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: vigane vti -- '%c'\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: vti nuab argumenti -- '%c'\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "ei nnestu registreerida jooksvat tkataloogi"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "esialgsesse tkataloogi ei nnestu tagasi minna"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr ""
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr ""
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Vigane regulaaravaldis"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Vigane vrdlussmbol"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Vigane smbolite klassi nimi"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr ""
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Vigane tagasiviide"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr ""
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr ""
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr ""
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr ""
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Vigane vahemiku lpp"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Mlu on otsas"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Vigane eelnev regulaaravaldis"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Enneaegne regulaaravaldise lpp"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "Regulaaravaldis on liiga pikk"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ""
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Eelmist regulaaravaldist pole"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "mlu on otsas"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "vigane argument %s vtmel `%s'"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "segane argument %s vtmele `%s'"
+
+#, c-format
+#~ msgid "Valid arguments are:"
+#~ msgstr "Lubatud argumendid on:"
+
+#, c-format
+#~ msgid "%.*s: ARGP_HELP_FMT parameter must be positive"
+#~ msgstr "%.*s: ARGP_HELP_FMT parameeter peab olema positiivne"
+
+#~ msgid "program error"
+#~ msgstr "programmi viga"
+
+#~ msgid "stack overflow"
+#~ msgstr "pinu letitumine"
+
+#, c-format
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr "ei leia ajutist kataloogi, proovige seada $TMPDIR"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "vormiga \"%s\" ei saa ajutist kataloogi luua"
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "ajutist faili %s ei nnestu kustutada"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "ajutist kataloogi %s ei nnestu kustutada"
+
+#~ msgid "error closing file"
+#~ msgstr "viga faili sulgemisel"
+
+#~ msgid "write error"
+#~ msgstr "viga kirjutamisel"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "silitan %s iguseid"
+
+#, c-format
+#~ msgid "error while opening \"%s\" for reading"
+#~ msgstr "viga \"%s\" lugemiseks avamisel"
+
+#, c-format
+#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgstr "Varukoopia faili \"%s\" ei nnestu kirjutamiseks avada"
+
+#, c-format
+#~ msgid "error reading \"%s\""
+#~ msgstr "viga \"%s\" lugemisel"
+
+#, c-format
+#~ msgid "error writing \"%s\""
+#~ msgstr "viga \"%s\" kirjutamisel"
+
+#, c-format
+#~ msgid "error after reading \"%s\""
+#~ msgstr "viga peale \"%s\" lugemist"
+
+#, c-format
+#~ msgid "fdopen() failed"
+#~ msgstr "fdopen() ebannestus"
+
+#, c-format
+#~ msgid "C# compiler not found, try installing pnet"
+#~ msgstr "C# kompilaatorit pole, proovige paigaldada pnet"
+
+#, c-format
+#~ msgid "C# virtual machine not found, try installing pnet"
+#~ msgstr "C# virtuaalmasinat pole, proovige paigaldada pnet"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s: alamprotsess sai vea"
+
+#~ msgid "regular empty file"
+#~ msgstr "tavaline thi fail"
+
+#~ msgid "regular file"
+#~ msgstr "tavaline fail"
+
+#~ msgid "directory"
+#~ msgstr "Kataloog"
+
+#~ msgid "block special file"
+#~ msgstr "blokkseadme fail"
+
+#~ msgid "character special file"
+#~ msgstr "smbolseadme fail"
+
+#~ msgid "fifo"
+#~ msgstr "fifo"
+
+#~ msgid "symbolic link"
+#~ msgstr "nimeviide"
+
+#~ msgid "socket"
+#~ msgstr "sokkel"
+
+#~ msgid "message queue"
+#~ msgstr "teadete jrjekord"
+
+#~ msgid "semaphore"
+#~ msgstr "semafor"
+
+#~ msgid "shared memory object"
+#~ msgstr "jagatud mlu objekt"
+
+#~ msgid "typed memory object"
+#~ msgstr "tbitud mlu objekt"
+
+#~ msgid "weird file"
+#~ msgstr "veider fail"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Aadressiperekonda vi hostinime ei toetata"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Ajutine trge nime lahendamisel"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Vigane ai_flags vrtus"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "nime lahendamisl tekkis taastumatu trge"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "ai_family ei toetata"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Trge mlu haaramisel"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "Hosti nimega ei ole aadresse seostatud"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Nimi vi teenus on tundmatu"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "ai_socktype ei toeta teenuse nime"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "ai_socktype ei toetata"
+
+#~ msgid "System error"
+#~ msgstr "Ssteemne viga"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "Argumentide puhver on liiga vike"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Pringu ttlemine kib"
+
+#~ msgid "Request canceled"
+#~ msgstr "Pring katkestati"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Pringut ei katkestatud"
+
+#~ msgid "All requests done"
+#~ msgstr "Kik pringud tidetud"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Katkestatud signaaliga"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "Parameetersne ei ole korrektselt kodeeritud"
+
+#~ msgid "Unknown error"
+#~ msgstr "Tundmatu viga"
+
+#, c-format
+#~ msgid "%s: option '--%s' doesn't allow an argument\n"
+#~ msgstr "%s: vti '--%s' ei luba kasutada argumenti\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option '--%s'\n"
+#~ msgstr "%s: tundmatu vti '--%s'\n"
+
+#, c-format
+#~ msgid "%s: option '-W %s' is ambiguous\n"
+#~ msgstr "%s: vti '-W %s' on segane\n"
+
+#, c-format
+#~ msgid "%s: option '-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: vti '-W %s' ei luba kasutada argumenti\n"
+
+#, c-format
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "funktsiooni compile_java_class argument source_version on vigane"
+
+#, c-format
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "funktsiooni compile_java_class argument target_version on vigane"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "\"%s\" ei nnestu luua"
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "viga faili \"%s\" kirjutamisel"
+
+#, c-format
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr "Java kompilaatorit pole, proovige paigaldada gcj vi seada $JAVAC"
+
+#, c-format
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr "Java virtuaalmasinat pole, proovige paigaldada gcj vi seada $JAVAC"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "%s: alamprotsess sai S/V vea"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "ei nnestu muuta %s igusi"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "kataloogi `%s' ei nnestu luua"
+
+#, c-format
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Faili /dev/zero saa lugemiseks avada"
+
+#, c-format
+#~ msgid "creation of reading thread failed"
+#~ msgstr "lugemise lime loomine ebannestus"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "hendus %s alamprotsessiga ebannestus"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "kirjutamine %s alamprotsessi sai vea"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "lugemine %s alamprotsessist sai vea"
+
+#, c-format
+#~ msgid "creation of threads failed"
+#~ msgstr "limede loomine ebannestus"
+
+#, c-format
+#~ msgid "cannot create pipe"
+#~ msgstr "ei nnestu luua toru"
+
+#~ msgid "`"
+#~ msgstr "`"
+
+#~ msgid "'"
+#~ msgstr "'"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[jJ]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[eE]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "ei nnestu seada %s igusi"
+
+#~ msgid "Bus error"
+#~ msgstr "Siini viga"
+
+#~ msgid "Power failure"
+#~ msgstr "Toite viga"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "iconv funktsioon ei ole kasutatav"
+
+#~ msgid "iconv function not available"
+#~ msgstr "iconv funktsioon puudub"
+
+#~ msgid "character out of range"
+#~ msgstr "smbol on piirkonnast vljas"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "U+%04X ei saa lokaalsesse kooditabelisse teisendada"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "U+%04X ei saa lokaalsesse kooditabelisse teisendada: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "vigane kasutaja"
+
+#~ msgid "invalid group"
+#~ msgstr "vigane grupp"
+
+#~ msgid "invalid spec"
+#~ msgstr "vigane spetsifikatsioon"
+
+#~ msgid "(C)"
+#~ msgstr ""
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Kirjutanud %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Kirjutanud %s ja %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Kirjutanud %s, %s ja %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Kirjutanud %s, %s, %s\n"
+#~ "ja %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Kirjutanud %s, %s, %s,\n"
+#~ "%s ja %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Kirjutanud %s, %s, %s,\n"
+#~ "%s, %s ja %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Kirjutanud %s, %s, %s,\n"
+#~ "%s, %s, %s ja %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Kirjutanud %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "ja %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Kirjutanud %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s ja %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Kirjutanud %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s ja teised.\n"
+
+#, c-format
+#~ msgid ""
+#~ "\n"
+#~ "Report bugs to: %s\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Vigadest teatage palun aadressil: %s.\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "%s vigadest teatage palun aadressil: %s\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "%s koduleht: <%s>\n"
+
+#, c-format
+#~ msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+#~ msgstr "%s koduleht: <http://www.gnu.org/software/%s/>\n"
+
+#~ msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+#~ msgstr ""
+#~ "ldine abiinfo GNU tarkvara kasutamisest: <http://www.gnu.org/gethelp/>\n"
+
+#, c-format
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "_open_osfhandle ebannestus"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "failipidet %d ei nnestu taastada: dup2 ebannestus"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "%s alamprotsess"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "%s alamprotsess sai fataalse signaali %d"
+
+#~ msgid "stdin"
+#~ msgstr "standardsisend"
+
+#~ msgid "stdout"
+#~ msgstr "standardvljund"
+
+#~ msgid "stderr"
+#~ msgstr "standardvead"
+
+#~ msgid "unknown stream"
+#~ msgstr "undmatu voog"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "reopen %s moodiga %s ebannestus"
+
+#, c-format
+#~ msgid "string comparison failed"
+#~ msgstr "snede vrdlus ebannestus"
+
+#, c-format
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Probleemi lahendamiseks seadke LC_ALL=C."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Vrreldi snesid %s ja %s."
+
+#, c-format
+#~ msgid "cannot perform formatted output"
+#~ msgstr "ei nnestu luua vormindatud vljundit"
+
+#, c-format
+#~ msgid "invalid %s%s argument `%s'"
+#~ msgstr "vigane %s%s argument `%s'"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument `%s'"
+#~ msgstr "vigane sufiks %s%s argument `%s'"
+
+#, c-format
+#~ msgid "%s%s argument `%s' too large"
+#~ msgstr "%s%s argument `%s' on liiga suur"
diff --git a/gl/po/eu.gmo b/gl/po/eu.gmo
new file mode 100644
index 0000000..6faf866
--- /dev/null
+++ b/gl/po/eu.gmo
Binary files differ
diff --git a/gl/po/eu.po b/gl/po/eu.po
new file mode 100644
index 0000000..cdeb58e
--- /dev/null
+++ b/gl/po/eu.po
@@ -0,0 +1,535 @@
+# translation of coreutils-5.2.1.po to Euskara
+# Basque translation of 5.2.1.
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# This file is distributed under the same license as the Coreutils-5.2.1 package.
+# Mikel Olasagasti <hey_neken@mundurat.net>, 2004.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: coreutils-5.2.1\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2005-01-04 20:27+0100\n"
+"Last-Translator: Mikel Olasagasti <hey_neken@mundurat.net>\n"
+"Language-Team: Basque <translation-team-eu@lists.sourceforge.net>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr ""
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr ""
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:1374
+#, fuzzy
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Beharrezkoak diren argumentuak aukera luzeetan, beharrezkoak dira aukera "
+"txikietan ere.\n"
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr ""
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr ""
+
+#: gl/lib/argp-help.c:1756
+#, fuzzy
+msgid " [OPTION...]"
+msgstr "Erabilera: %s [AUKERA]...\n"
+
+#: gl/lib/argp-help.c:1783
+#, fuzzy, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Saiatu `%s --help' erabiltzen informazio gehiagorako.\n"
+
+#: gl/lib/argp-help.c:1811
+#, fuzzy, c-format
+msgid "Report bugs to %s.\n"
+msgstr ""
+"\n"
+"Programa-erroreen berri emateko idatzi hona: <%s>.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Sistema-errore ezezaguna"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr ""
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr ""
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "IZENA"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr ""
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr ""
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr ""
+
+#: gl/lib/argp-parse.c:154
+#, fuzzy
+msgid "print program version"
+msgstr "irakurketa errorea"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr ""
+
+#: gl/lib/argp-parse.c:624
+#, fuzzy, c-format
+msgid "%s: Too many arguments\n"
+msgstr "e"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr ""
+
+#: gl/lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: '%s' aukera anbiguoa da\n"
+
+#: gl/lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: '%s' aukera anbiguoa da\n"
+
+#: gl/lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: '%c%s' aukera ezezaguna\n"
+
+#: gl/lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: '%c%s' aukerak ez du argumenturik onartzen\n"
+
+#: gl/lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: '%s' aukerak argumentu bat behar du\n"
+
+#: gl/lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: -- %c aukera baliogabea\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: aukerak --%c argumentu bat behar du\n"
+
+#: gl/lib/openat-die.c:38
+#, fuzzy, c-format
+msgid "unable to record current working directory"
+msgstr "Inprimatu Fitxategi-izena - e e"
+
+#: gl/lib/openat-die.c:57
+#, fuzzy, c-format
+msgid "failed to return to initial working directory"
+msgstr "Inprimatu Fitxategi-izena - e e"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr ""
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr ""
+
+#: gl/lib/regcomp.c:128
+#, fuzzy
+msgid "Invalid regular expression"
+msgstr "baliogabea"
+
+#: gl/lib/regcomp.c:131
+#, fuzzy
+msgid "Invalid collation character"
+msgstr "baliogabea"
+
+#: gl/lib/regcomp.c:134
+#, fuzzy
+msgid "Invalid character class name"
+msgstr "baliogabea"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr ""
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr ""
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr ""
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr ""
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr ""
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr ""
+
+#: gl/lib/regcomp.c:155
+#, fuzzy
+msgid "Invalid range end"
+msgstr "baliogabea"
+
+#: gl/lib/regcomp.c:158
+#, fuzzy
+msgid "Memory exhausted"
+msgstr "memoria agortuta"
+
+#: gl/lib/regcomp.c:161
+#, fuzzy
+msgid "Invalid preceding regular expression"
+msgstr "baliogabea"
+
+#: gl/lib/regcomp.c:164
+#, fuzzy
+msgid "Premature end of regular expression"
+msgstr "in bilatu"
+
+#: gl/lib/regcomp.c:167
+#, fuzzy
+msgid "Regular expression too big"
+msgstr "baliogabea"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ""
+
+#: gl/lib/regcomp.c:650
+#, fuzzy
+msgid "No previous regular expression"
+msgstr "in bilatu"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memoria agortuta"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "%s baliogabeko argumentua da %s-(r)entzat"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "%s argumentu anbiguoa da %s-(r)entzat"
+
+#, c-format
+#~ msgid "Valid arguments are:"
+#~ msgstr "Baliozko argumentuak hauek dira:"
+
+#~ msgid "write error"
+#~ msgstr "idazketa errorea"
+
+#, fuzzy, c-format
+#~ msgid "error while opening \"%s\" for reading"
+#~ msgstr "errepikatu arte"
+
+#, fuzzy, c-format
+#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgstr "errepikatu arte"
+
+#, fuzzy, c-format
+#~ msgid "error reading \"%s\""
+#~ msgstr "errorea %s irakurtzen"
+
+#, fuzzy, c-format
+#~ msgid "error writing \"%s\""
+#~ msgstr "errorea %s idazten"
+
+#, fuzzy, c-format
+#~ msgid "error after reading \"%s\""
+#~ msgstr "errorea %s irakurtzen"
+
+#, fuzzy
+#~ msgid "fdopen() failed"
+#~ msgstr "irekitzeak huts egin du"
+
+#, fuzzy, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "baliogabea"
+
+#~ msgid "regular empty file"
+#~ msgstr "fitxategi erregular hutsa"
+
+#~ msgid "regular file"
+#~ msgstr "Espresio erregularra"
+
+#~ msgid "directory"
+#~ msgstr "direktorioa"
+
+#, fuzzy
+#~ msgid "block special file"
+#~ msgstr "bloke tamainua"
+
+#, fuzzy
+#~ msgid "character special file"
+#~ msgstr "offset karakterea zero da"
+
+#~ msgid "fifo"
+#~ msgstr "fifo"
+
+#~ msgid "symbolic link"
+#~ msgstr "esteka sinbolikoa"
+
+#~ msgid "socket"
+#~ msgstr "socket-a"
+
+#~ msgid "message queue"
+#~ msgstr "Bidali ilara"
+
+#~ msgid "semaphore"
+#~ msgstr "semaforoa"
+
+#~ msgid "shared memory object"
+#~ msgstr "memoria partekatuaren objektua"
+
+#, fuzzy
+#~ msgid "typed memory object"
+#~ msgstr "memoria partekatuaren objektua"
+
+#~ msgid "weird file"
+#~ msgstr "fitxategi arraroa"
+
+#, fuzzy
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "fifo fitxategiek ez dute euskarririk"
+
+#, fuzzy
+#~ msgid "ai_family not supported"
+#~ msgstr "fifo fitxategiek ez dute euskarririk"
+
+#, fuzzy
+#~ msgid "ai_socktype not supported"
+#~ msgstr "fifo fitxategiek ez dute euskarririk"
+
+#, fuzzy
+#~ msgid "System error"
+#~ msgstr "idazketa errorea"
+
+#, fuzzy
+#~ msgid "Unknown error"
+#~ msgstr "Sistema-errore ezezaguna"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: '--%s' aukerak ez du argumenturik onartzen\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: '--%s' aukera ezezaguna\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: -- %c aukera ilegala\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: '-W %s' aukera anbiguoa da\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: '-W.%s' aukerak ez du argumenturik onartzen\n"
+
+#~ msgid "block size"
+#~ msgstr "bloke tamainua"
+
+#, c-format
+#~ msgid "%s exists but is not a directory"
+#~ msgstr "%s badago baina ez da direktorio bat"
+
+#, c-format
+#~ msgid "cannot change owner and/or group of %s"
+#~ msgstr "ezin da %s-(r)en jabetza eta/edo taldea aldatu"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "ezin da %s direktorioa sortu"
+
+#, fuzzy, c-format
+#~ msgid "cannot chdir to directory %s"
+#~ msgstr "ezin da %s direktoriora aldatu"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "ezin da %s-(r)en baimenak aldatu"
+
+#, fuzzy
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "baimenak errepikatu arte"
+
+#, fuzzy
+#~ msgid "cannot create pipe"
+#~ msgstr "ezin da %s esteka sortu"
+
+#~ msgid "`"
+#~ msgstr "`"
+
+#~ msgid "'"
+#~ msgstr "'"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[bB]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[eE]"
+
+#~ msgid "character out of range"
+#~ msgstr "karakterea barrutitik kanpora"
+
+#~ msgid "invalid user"
+#~ msgstr "baliogabeko erabiltzailea"
+
+#~ msgid "invalid group"
+#~ msgstr "baliogabeko taldea"
+
+#~ msgid "cannot get the login group of a numeric UID"
+#~ msgstr "ezin da UID zenbaki baten saio taldea lortu"
+
+#, fuzzy
+#~ msgid ""
+#~ "\n"
+#~ "This is free software. You may redistribute copies of it under the terms "
+#~ "of\n"
+#~ "the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "programa da eta edo - Orokorra Publikoa Lizentzia bider Libre Softwarea "
+#~ "edo e e"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "%s-k idatzia.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "%s-k eta %s-k idatzia.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "%s, %s eta %s-k idatzia.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "%s, %s, %s,\n"
+#~ "eta %s-k idatzia.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "%s, %s, %s,\n"
+#~ "%s eta %s-k idatzia.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "%s, %s, %s,\n"
+#~ "%s, %s eta %s-k idatzia.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "%s, %s, %s,\n"
+#~ "%s, %s, %s, eta %s-k idatzia.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "%s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "eta %s-k idatzia.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "%s, %s, %s,\n"
+#~ "%s, %s, %s, %s,%s, eta %s-k idatzia.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "%s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s,eta beste batzuk idatzia.\n"
+
+#~ msgid "string comparison failed"
+#~ msgstr "kate konparaketak huts egin du"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Ezarri LC_ALL='C' arazo hau une batez konpontzeko"
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Alderatutako bi kateak %s eta %s izan dira."
diff --git a/gl/po/fi.gmo b/gl/po/fi.gmo
new file mode 100644
index 0000000..dca2ba0
--- /dev/null
+++ b/gl/po/fi.gmo
Binary files differ
diff --git a/gl/po/fi.po b/gl/po/fi.po
new file mode 100644
index 0000000..60588b2
--- /dev/null
+++ b/gl/po/fi.po
@@ -0,0 +1,946 @@
+# Finnish messages for gnulib.
+# Copyright © 2002, 2003, 2004, 2009, 2010, 2011, 2019 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+# Lauri Nurmi <lanurmi@iki.fi>, 2003, 2004, 2019.
+# Matti Koskimies <matti@apulanta.fi>, 2002.
+# Jorma Karvonen <karvonen.jorma@gmail.com>, 2009-2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 4.0.0.2567\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2019-12-26 12:28+0200\n"
+"Last-Translator: Lauri Nurmi <lanurmi@iki.fi>\n"
+"Language-Team: Finnish <translation-team-fi@lists.sourceforge.net>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural= ( n!=1) ;\n"
+"X-Generator: Poedit 2.2.4\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: %s-arvo on pienempi tai yhtäsuuri kuin %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: ARGP_HELP_FMT-parametri vaatii arvon"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: Tuntematon ARGP_HELP_FMT-parametri"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Roskaa ARGP_HELP_FMT:ssä: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Pitkien valitsinten pakolliset tai valinnaiset argumentit ovat pakollisia "
+"tai valinnaisia myös vastaaville lyhyille."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Käyttö:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " tai: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [VALITSIN...]"
+
+#: gl/lib/argp-help.c:1783
+#, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Lisätietoja komennolla ”%s --help” tai ”%s --usage”.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "Lähetä raportit ohjelmistovioista (englanniksi) osoitteeseen %s.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Tuntematon järjestelmävirhe"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "anna tämä opasteluettelo"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "anna lyhyt käyttöohje"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "NIMI"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "aseta ohjelman nimi"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "S"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "odota S sekuntia (oletus 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "tulosta ohjelman versio"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(OHJELMAVIRHE) Versiota ei tiedetä!?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: Liian monta argumenttia\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(OHJELMAVIRHE) Valitsin olisi pitänyt tunnistaa‽"
+
+#: gl/lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: valitsin ”%s%s” on moniselitteinen\n"
+
+#: gl/lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: valitsin ”%s%s” on moniselitteinen; vaihtoehdot:"
+
+#: gl/lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: tunnistamaton valitsin ”%s%s”\n"
+
+#: gl/lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: valitsin ”%s%s” ei salli argumenttia\n"
+
+#: gl/lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: valitsin ”%s%s” vaatii argumentin\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: virheellinen valitsin -- ”%c”\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: valitsin vaatii argumentin -- ”%c”\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "nykyisen työhakemiston kirjaaminen ei onnistu"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "palaaminen alkuperäiseen työhakemistoon epäonnistui"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Onnistui"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Ei täsmäävyyttä"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Virheellinen säännöllinen lauseke"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Virheellinen vertailumerkki"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Virheellinen merkkiluokan nimi"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Kenoviiva lopussa"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Virheellinen takaisinviittaus"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Pariton [, [^, [:, [. tai [="
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "Pariton ( tai \\("
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "Pariton \\{"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "Virheellinen \\{\\}:n sisältö"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Virheellinen välin loppu"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Muisti lopussa"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Virheellinen edeltävä säännöllinen lauseke"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Ennenaikainen säännöllisen lausekkeen loppu"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "Säännöllinen lauseke on liian suuri"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr "Pariton ) tai \\)"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Ei edellistä säännöllistä lauseketta"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "ei kyetä näyttämään virheilmoitusta"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "muisti loppui"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr "tavalliset tiedostokahvat"
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "virheellinen argumentti %s kontekstille %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "moniselitteinen argumentti %s kontekstille %s"
+
+#~ msgid "Valid arguments are:"
+#~ msgstr "Kelvolliset argumentit:"
+
+#, c-format
+#~ msgid "%u bitset_allocs, %u freed (%.2f%%).\n"
+#~ msgstr "%u bitset_allocs, %u vapautettu (%.2f%%).\n"
+
+#, c-format
+#~ msgid "%u bitset_sets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_sets, %u vapautettu (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_resets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_resets, %u välimuistitettu (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_tests, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_tests, %u välimuistitettu (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_lists\n"
+#~ msgstr "%u bitset_lists\n"
+
+#~ msgid "count log histogram\n"
+#~ msgstr "määrälokihistogrammi\n"
+
+#~ msgid "size log histogram\n"
+#~ msgstr "kokolokihistogrammi\n"
+
+#~ msgid "density histogram\n"
+#~ msgstr "tiheyshistogrammi\n"
+
+#, c-format
+#~ msgid ""
+#~ "Bitset statistics:\n"
+#~ "\n"
+#~ msgstr "Bitset-tilasto:\n"
+
+#, c-format
+#~ msgid "Accumulated runs = %u\n"
+#~ msgstr "Kertyneet ajot = %u\n"
+
+#~ msgid "cannot read stats file"
+#~ msgstr "ei voida lukea tilastotiedostoa"
+
+#, c-format
+#~ msgid "bad stats file size\n"
+#~ msgstr "virheellinen tilastotiedoston koko\n"
+
+#~ msgid "cannot write stats file"
+#~ msgstr "ei voida kirjoittaa tilastotiedostoa"
+
+#~ msgid "cannot open stats file for writing"
+#~ msgstr "ei voida avata tilastotiedostoa kirjoitettavaksi"
+
+#~ msgid "program error"
+#~ msgstr "ohjelmavirhe"
+
+#~ msgid "stack overflow"
+#~ msgstr "pinon ylivuoto"
+
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr ""
+#~ "tilapäisen hakemiston löytäminen epäonnistui, yritä asettaa $TMPDIR-"
+#~ "muuttuja"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "ei voida luoda tilapäishakemistoa mallin ”%s” pohjalta"
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "ei voida poistaa tilapäistiedostoa %s"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "ei voida poistaa tilapäishakemistoa %s"
+
+#~ msgid "error closing file"
+#~ msgstr "virhe tiedoston sulkemisessa"
+
+#~ msgid "write error"
+#~ msgstr "kirjoitusvirhe"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "säilytetään oikeudet kohteelle %s"
+
+#, c-format
+#~ msgid "error while opening %s for reading"
+#~ msgstr "virhe avattaessa tiedostoa %s luettavaksi"
+
+#, c-format
+#~ msgid "cannot open backup file %s for writing"
+#~ msgstr "ei voida avata varmuuskopiotiedostoa %s kirjoitettavaksi"
+
+#, c-format
+#~ msgid "error reading %s"
+#~ msgstr "virhe luettaessa tiedostoa %s"
+
+#, c-format
+#~ msgid "error writing %s"
+#~ msgstr "virhe kirjoitettaessa tiedostoa %s"
+
+#, c-format
+#~ msgid "error after reading %s"
+#~ msgstr "virhe tiedoston %s lukemisen jälkeen"
+
+#~ msgid "fdopen() failed"
+#~ msgstr "fdopen() epäonnistui"
+
+#~ msgid "C# compiler not found, try installing mono"
+#~ msgstr "C#-kääntäjää ei löytynyt, yritä asentaa mono"
+
+#~ msgid "C# virtual machine not found, try installing mono"
+#~ msgstr "C#-virtuaalikonetta ei löytynyt, yritä asentaa mono"
+
+#~ msgid "unbalanced ["
+#~ msgstr "pariton ["
+
+#~ msgid "invalid character class"
+#~ msgstr "virheellinen merkkiluokka"
+
+#~ msgid "character class syntax is [[:space:]], not [:space:]"
+#~ msgstr "merkkiluokkasyntaksi on [[:space:]], ei [:space:]"
+
+#~ msgid "unfinished \\ escape"
+#~ msgstr "keskeneräinen \\-ohjaussarja"
+
+#~ msgid "invalid content of \\{\\}"
+#~ msgstr "virheellinen \\{\\}:n sisältö"
+
+#~ msgid "regular expression too big"
+#~ msgstr "säännöllinen lauseke on liian suuri"
+
+#~ msgid "unbalanced ("
+#~ msgstr "pariton ("
+
+#~ msgid "no syntax specified"
+#~ msgstr "syntaksia ei ole määritelty"
+
+#~ msgid "unbalanced )"
+#~ msgstr "pariton )"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s-aliprosessi epäonnistui"
+
+#~ msgid "regular empty file"
+#~ msgstr "tavallinen tyhjä tiedosto"
+
+#~ msgid "regular file"
+#~ msgstr "tavallinen tiedosto"
+
+#~ msgid "directory"
+#~ msgstr "hakemisto"
+
+#~ msgid "symbolic link"
+#~ msgstr "symbolinen linkki"
+
+#~ msgid "message queue"
+#~ msgstr "viestijono"
+
+#~ msgid "semaphore"
+#~ msgstr "semafori"
+
+#~ msgid "shared memory object"
+#~ msgstr "jaetun muistin objekti"
+
+#~ msgid "typed memory object"
+#~ msgstr "tyypitetty muistiobjekti"
+
+#~ msgid "block special file"
+#~ msgstr "lohkoerikoistiedosto"
+
+#~ msgid "character special file"
+#~ msgstr "merkkierikoistiedosto"
+
+#~ msgid "contiguous data"
+#~ msgstr "yhtenäistä dataa"
+
+#~ msgid "fifo"
+#~ msgstr "putkitiedosto"
+
+#~ msgid "door"
+#~ msgstr "ovi"
+
+#~ msgid "multiplexed block special file"
+#~ msgstr "limitetty lohkoerikoistiedosto"
+
+#~ msgid "multiplexed character special file"
+#~ msgstr "limitetty merkkierikoistiedosto"
+
+#~ msgid "multiplexed file"
+#~ msgstr "limitetty tiedosto"
+
+#~ msgid "named file"
+#~ msgstr "nimetty tiedosto"
+
+#~ msgid "network special file"
+#~ msgstr "verkkoerikoistiedosto"
+
+#~ msgid "migrated file with data"
+#~ msgstr "datallinen siirretty tiedosto"
+
+#~ msgid "migrated file without data"
+#~ msgstr "dataton siirretty tiedosto"
+
+#~ msgid "port"
+#~ msgstr "portti"
+
+#~ msgid "socket"
+#~ msgstr "pistoke"
+
+#~ msgid "whiteout"
+#~ msgstr "himmeä"
+
+#~ msgid "weird file"
+#~ msgstr "outo tiedosto"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Konenimen osoiteperhe ei ole tuettu"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Väliaikainen häiriö nimenselvityksessä"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Virheellinen arvo ai_flags-kentälle"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Korjautumaton häiriö nimenselvityksessä"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "ai_family ei ole tuettu"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Muistinvarausvirhe"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "Konenimeen ei liity osoitetta"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Nimi tai palvelu on tuntematon"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "Servname ei ole tuettu kohteelle ai_socktype"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "ai_socktype ei ole tuettu"
+
+#~ msgid "System error"
+#~ msgstr "Järjestelmävirhe"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "Argumenttipuskuri on liian pieni"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Pyynnön käsittely käynnissä"
+
+#~ msgid "Request canceled"
+#~ msgstr "Pyyntö peruttu"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Pyyntöä ei peruttu"
+
+#~ msgid "All requests done"
+#~ msgstr "Kaikki pyynnöt suoritettu"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Signaalin keskeyttämä"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "Parametrimerkkijono on väärin koodattu"
+
+#~ msgid "Unknown error"
+#~ msgstr "Tuntematon virhe"
+
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "virheellinen source_version-argumentti kohteelle compile_java_class"
+
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "virheellinen target_version-argumentti kohteelle compile_java_class"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "tiedoston ”%s” luominen epäonnistui"
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "virhe kirjoitettaessa tiedostoa ”%s”"
+
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr "Java-kääntäjää ei löytynyt, yritä asentaa gcj tai aseta $JAVAC"
+
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "Java-virtuaalikonetta ei löytynyt, yritä asentaa gij tai aseta $JAVA"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "%s-aliprosessin siirräntävirhe"
+
+#, c-format
+#~ msgid "cannot stat %s"
+#~ msgstr "tiedoston %s tilaa ei voi lukea"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "tiedoston %s oikeuksien muuttaminen ei onnistu"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "hakemiston %s luominen ei onnistu"
+
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Tiedoston /dev/zero avaaminen lukemista varten epäonnistui"
+
+#~ msgid "creation of reading thread failed"
+#~ msgstr "lukemissäikeen luominen epäonnistui"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "ei-lukitsevan siirron asettaminen aliprosessiin %s epäonnistui"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "viestintä aliprosessin %s kanssa epäonnistui"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "kirjoittaminen aliprosessiin %s epäonnistui"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "lukeminen aliprosessista %s epäonnistui"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "aliprosessi %s päättyi paluuarvolla %d"
+
+#~ msgid "creation of threads failed"
+#~ msgstr "säikeiden luominen epäonnistui"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "%s-aliprosessi päättyi paluuarvolla %d"
+
+#~ msgid "`"
+#~ msgstr "”"
+
+#~ msgid "'"
+#~ msgstr "”"
+
+# Kaikkihan muistavat kääntää nämä ja vastaavat juuri näin. Ei pelkkä kK.
+#~ msgid "^[yY]"
+#~ msgstr "^[kKyY]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[eEnN]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "asetetaan oikeudet tiedostolle %s"
+
+#~ msgid "Hangup"
+#~ msgstr "Linjankatkaisu"
+
+#~ msgid "Interrupt"
+#~ msgstr "Keskeytys"
+
+#~ msgid "Quit"
+#~ msgstr "Lopetettu"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "Virheellinen käsky"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Jäljitys-/katkaisupisteansa"
+
+#~ msgid "Aborted"
+#~ msgstr "Keskeytetty"
+
+#~ msgid "Floating point exception"
+#~ msgstr "Liukulukupoikkeus"
+
+#~ msgid "Killed"
+#~ msgstr "Sammutettu"
+
+#~ msgid "Bus error"
+#~ msgstr "Väylävirhe"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "Muistialueen ylitys"
+
+#~ msgid "Broken pipe"
+#~ msgstr "Katkennut putki"
+
+#~ msgid "Alarm clock"
+#~ msgstr "Herätyskello"
+
+#~ msgid "Terminated"
+#~ msgstr "Päätetty"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "Kiireellinen I/O-ehto"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "Pysäytetty (signaali)"
+
+#~ msgid "Stopped"
+#~ msgstr "Pysäytetty"
+
+#~ msgid "Continued"
+#~ msgstr "Jatkettu"
+
+#~ msgid "Child exited"
+#~ msgstr "Lapsi lopetti"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Pysäytetty (tty-syöte)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Pysäytetty (tty-tuloste)"
+
+#~ msgid "I/O possible"
+#~ msgstr "I/O mahdollista"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "Suoritinaikaraja ylittynyt"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "Tiedoston kokoraja ylitetty"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "Virtuaaliajastin vanhentunut"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "Profilointiajastin vanhentunut"
+
+#~ msgid "Window changed"
+#~ msgstr "Ikkuna vaihtunut"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "Käyttäjän määrittelemä signaali 1"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Käyttäjän määrittelemä signaali 2"
+
+#~ msgid "EMT trap"
+#~ msgstr "EMT-ansa"
+
+#~ msgid "Bad system call"
+#~ msgstr "Virheellinen järjestelmäkutsu"
+
+#~ msgid "Stack fault"
+#~ msgstr "Pinovirhe"
+
+#~ msgid "Information request"
+#~ msgstr "Tietopyyntö"
+
+#~ msgid "Power failure"
+#~ msgstr "Sähkökatko"
+
+#~ msgid "Resource lost"
+#~ msgstr "Resurssi menetetty"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "virhe kirjoitettaessa suljettuun putkeen tai pistokkeeseen"
+
+#~ msgid "cannot create pipe"
+#~ msgstr "ei voida luoda putkea"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "Reaaliaikasignaali %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Tuntematon signaali %d"
+
+#~ msgid "Execution times (seconds)"
+#~ msgstr "Suoritusajat (sekuntia)"
+
+#~ msgid "CPU user"
+#~ msgstr "Suoritin (käyttäjä)"
+
+#~ msgid "CPU system"
+#~ msgstr "Suoritin (järjestelmä)"
+
+#~ msgid "wall clock"
+#~ msgstr "seinäkello"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "iconv-funktio ei ole käyttökelpoinen"
+
+#~ msgid "iconv function not available"
+#~ msgstr "iconv-funktio ei ole saatavilla"
+
+#~ msgid "character out of range"
+#~ msgstr "merkki sallitun välin ulkopuolella"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "merkin U+%04X muunnos paikalliseen merkistöön ei onnistu"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "merkin U+%04X muunnos paikalliseen merkistöön ei onnistu: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "virheellinen käyttäjä"
+
+#~ msgid "invalid group"
+#~ msgstr "virheellinen ryhmä"
+
+#~ msgid "invalid spec"
+#~ msgstr "virheellinen määrittely"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "Paketoinut %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "Paketoinut %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "©"
+
+#, c-format
+#~ msgid ""
+#~ "License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ msgstr ""
+#~ "Lisenssi GPLv3+: GNU GPL versio 3 tai myöhempi <%s>.\n"
+#~ "\"Tämä on vapaa ohjelmisto; sitä saa vapaasti muuttaa ja levittää\n"
+#~ "\"edelleen. Siinä määrin kuin laki sallii, TAKUUTA EI OLE.\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Kirjoittanut %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Kirjoittaneet %s ja %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Kirjoittaneet %s, %s ja %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Kirjoittaneet %s, %s,\n"
+#~ "%s ja %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Kirjoittaneet %s, %s,\n"
+#~ "%s, %s ja %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Kirjoittaneet %s, %s,\n"
+#~ "%s, %s, %s ja %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Kirjoittaneet %s, %s,\n"
+#~ "%s, %s, %s,\n"
+#~ "%s ja %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Kirjoittaneet %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s ja %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Kirjoittaneet %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s ja %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Kirjoittaneet %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, %s ja muut.\n"
+
+#, c-format
+#~ msgid "Report bugs to: %s\n"
+#~ msgstr ""
+#~ "Lähetä ilmoitukset ohjelmistovioista (englanniksi) osoitteeseen: %s\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "Ilmoita %s-vioista (englanniksi) osoitteeseen %s.\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "%s-kotisivu: <%s>\n"
+
+#, c-format
+#~ msgid "General help using GNU software: <%s>\n"
+#~ msgstr "Yleisohjeita GNU-ohjelmistojen käyttöön: <%s>\n"
+
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "_open_osfhandle epäonnistui"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "ei voi palauttaa tiedostokahvaa %d: dup2 epäonnistui"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "%s-aliprosessi"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "%s-aliprosessi vastaanotti fataalin signaalin %d"
+
+#~ msgid "failed to set file descriptor text/binary mode"
+#~ msgstr "tiedostokahvan teksti-/binääritilan asettaminen epäonnistui"
+
+#~ msgid "stdin"
+#~ msgstr "vakiosyöte"
+
+#~ msgid "stdout"
+#~ msgstr "vakiotuloste"
+
+#~ msgid "stderr"
+#~ msgstr "vakiovirhetuloste"
+
+#~ msgid "unknown stream"
+#~ msgstr "tuntematon virta"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "kohteen %s avaaminen uudelleen tilassa %s epäonnistui"
+
+#~ msgid "string comparison failed"
+#~ msgstr "merkkijonovertailu epäonnistui"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Aseta LC_ALL='C' ongelman kiertämiseksi."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Vertaillut merkkijonot olivat %s ja %s."
+
+#~ msgid "cannot perform formatted output"
+#~ msgstr "muotoiltua tulostusta ei voitu suorittaa"
+
+#, c-format
+#~ msgid "invalid %s%s argument '%s'"
+#~ msgstr "virheellinen %s%s-argumentti ”%s”"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument '%s'"
+#~ msgstr "virheellinen loppuliite %s%s-argumentissa ”%s”"
+
+#, c-format
+#~ msgid "%s%s argument '%s' too large"
+#~ msgstr "%s%s-argumentti ”%s” on liian suuri"
diff --git a/gl/po/fr.gmo b/gl/po/fr.gmo
new file mode 100644
index 0000000..009f10e
--- /dev/null
+++ b/gl/po/fr.gmo
Binary files differ
diff --git a/gl/po/fr.po b/gl/po/fr.po
new file mode 100644
index 0000000..637de76
--- /dev/null
+++ b/gl/po/fr.po
@@ -0,0 +1,960 @@
+# Messages français pour GNU concernant gnulib.
+# Copyright © 1996-, 2008, 2011 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+#
+# Michel Robitaille <robitail@IRO.UMontreal.CA>, 1996-.
+# Nicolas Provost <nprovost@quadriv.com>, 2008.
+# David Prévot <david@tilapin.org>, 2011.
+# Stéphane Aulery <lkppo@free.fr>, 2019.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib-4.0.0.2567\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2019-05-21 20:15+0200\n"
+"Last-Translator: Stéphane Aulery <lkppo@free.fr>\n"
+"Language-Team: French <traduc@traduc.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+"X-Generator: Lokalize 1.2\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT : la valeur %s est inférieure ou égale à %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s : le paramètre ARGP_HELP_FMT nécessite une valeur"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s : paramètre ARGP_HELP_FMT inconnu"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Problème dans ARGP_HELP_FMT : %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Les arguments obligatoires pour la forme longue des options le sont aussi "
+"pour les formes courtes associées."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Utilisation :"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " ou : "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [OPTION...]"
+
+#: gl/lib/argp-help.c:1783
+#, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr ""
+"Essayez « %s --help » ou « %s --usage » pour obtenir plus de "
+"renseignements.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "Signalez toute anomalie à %s.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Erreur système inconnue"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "affiche cette aide"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "donne un court message d'utilisation"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "NOM"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "définit le nom du programme"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "SECS"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "suspension pendant SECS secondes (par défaut 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "affiche la version du programme"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(Erreur du programme) pas de version connue !"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s : trop d'arguments\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(Erreur du programme) l'option aurait dû être reconnue !"
+
+#: gl/lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s : l'option « %s%s » est ambiguë\n"
+
+#: gl/lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s : l'option « %s%s » est ambiguë, possibilités :"
+
+#: gl/lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s : option « %s%s » non reconnue\n"
+
+#: gl/lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s : l'option « %s%s » ne prend pas d'argument\n"
+
+#: gl/lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s : l'option « %s%s » nécessite un argument\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s : option non valable -- « %c »\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s : l'option nécessite un argument -- « %c »\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "impossible de mémoriser le répertoire de travail courant"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "échec de retour au répertoire initial de travail"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Succès"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Pas de correspondance"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Expression rationnelle non valable"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Caractère d'assemblage non valable"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Nom de classe de caractères non valable"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Barre oblique inverse en fin de ligne"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Référence antérieure non valable"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[, [^, [:, [. ou [= non appairé"
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "( ou \\( non appairée"
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "\\{ non appairée"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "Le contenu de \\{\\} n'est pas valable"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Borne finale de l'intervalle non valable"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Mémoire épuisée"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Expression rationnelle précédente non valable"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Fin prématurée d'expression rationnelle"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "Expression rationnelle trop grande"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ") ou \\) non appairée"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Pas d'expression rationnelle précédente"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "impossible d'afficher le message d'erreur"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "mémoire épuisée"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr "descripteurs de fichier standards"
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "argument %s non valable pour %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "argument %s ambigu pour %s"
+
+#~ msgid "Valid arguments are:"
+#~ msgstr "Les arguments valables sont :"
+
+#, c-format
+#~ msgid "%u bitset_allocs, %u freed (%.2f%%).\n"
+#~ msgstr "%u bitset_allocs, %u libérés (%.2f%%).\n"
+
+#, c-format
+#~ msgid "%u bitset_sets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_sets, %u cachés (%.2f%%).\n"
+
+#, c-format
+#~ msgid "%u bitset_resets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_resets, %u cachés (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_tests, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_tests, %u cachés (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_lists\n"
+#~ msgstr "%u bitset_lists\n"
+
+#~ msgid "count log histogram\n"
+#~ msgstr "histogramme par comptage\n"
+
+#~ msgid "size log histogram\n"
+#~ msgstr "histogramme par taille\n"
+
+#~ msgid "density histogram\n"
+#~ msgstr "histogramme par densité\n"
+
+#, c-format
+#~ msgid ""
+#~ "Bitset statistics:\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Statistiques de bitset :\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Accumulated runs = %u\n"
+#~ msgstr "Lancement cumulés = %u\n"
+
+#~ msgid "cannot read stats file"
+#~ msgstr "impossible de lire les permissions du fichier"
+
+#, c-format
+#~ msgid "bad stats file size\n"
+#~ msgstr "taille du fichier de permission erroné\n"
+
+#~ msgid "cannot write stats file"
+#~ msgstr "impossible d'écrire les permissions du fichier"
+
+#~ msgid "cannot open stats file for writing"
+#~ msgstr "impossible d'ouvrir les permissions du fichier en écriture"
+
+#~ msgid "program error"
+#~ msgstr "erreur du programme"
+
+#~ msgid "stack overflow"
+#~ msgstr "dépassement de pile"
+
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr ""
+#~ "impossible de trouver un répertoire temporaire, essayez de définir $TMPDIR"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr ""
+#~ "impossible de créer un répertoire temporaire en utilisant le modèle "
+#~ "« %s »."
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "impossible de supprimer le ficher temporaire %s"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "impossible de supprimer le répertoire temporaire %s"
+
+#~ msgid "error closing file"
+#~ msgstr "erreur de fermeture de fichier"
+
+#~ msgid "write error"
+#~ msgstr "erreur d'écriture"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "conservation des permissions de %s"
+
+#, c-format
+#~ msgid "error while opening %s for reading"
+#~ msgstr "erreur à l'ouverture de %s en lecture"
+
+#, c-format
+#~ msgid "cannot open backup file %s for writing"
+#~ msgstr "impossible d'ouvrir le fichier de sauvegarde %s en écriture"
+
+#, c-format
+#~ msgid "error reading %s"
+#~ msgstr "erreur de lecture de %s"
+
+#, c-format
+#~ msgid "error writing %s"
+#~ msgstr "erreur d'écriture de %s"
+
+#, c-format
+#~ msgid "error after reading %s"
+#~ msgstr "erreur après la lecture de %s"
+
+#~ msgid "fdopen() failed"
+#~ msgstr "échec de fdopen()"
+
+#~ msgid "C# compiler not found, try installing mono"
+#~ msgstr "compilateur C# non trouvé, essayez d'installer mono"
+
+#~ msgid "C# virtual machine not found, try installing mono"
+#~ msgstr "machine virtuelle C# non trouvée, essayez d'installer mono"
+
+#~ msgid "unbalanced ["
+#~ msgstr "[ non appairée"
+
+#~ msgid "invalid character class"
+#~ msgstr "nom de classe de caractères non valable"
+
+#~ msgid "character class syntax is [[:space:]], not [:space:]"
+#~ msgstr ""
+#~ "la syntaxe de la classe de caractères est [[:space:]], et non [:space:]"
+
+#~ msgid "unfinished \\ escape"
+#~ msgstr "espace \\ non terminé"
+
+#~ msgid "invalid content of \\{\\}"
+#~ msgstr "le contenu de \\{\\} n'est pas valable"
+
+#~ msgid "regular expression too big"
+#~ msgstr "expression rationnelle trop grande"
+
+#~ msgid "unbalanced ("
+#~ msgstr "( non appairée"
+
+#~ msgid "no syntax specified"
+#~ msgstr "pas de syntaxe spécifiée"
+
+#~ msgid "unbalanced )"
+#~ msgstr ") non appairée"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "échec de sous-processus %s"
+
+#~ msgid "regular empty file"
+#~ msgstr "fichier régulier vide"
+
+#~ msgid "regular file"
+#~ msgstr "fichier régulier"
+
+#~ msgid "directory"
+#~ msgstr "répertoire"
+
+#~ msgid "symbolic link"
+#~ msgstr "lien symbolique"
+
+#~ msgid "message queue"
+#~ msgstr "file de messages"
+
+#~ msgid "semaphore"
+#~ msgstr "sémaphore"
+
+#~ msgid "shared memory object"
+#~ msgstr "objet de mémoire partagée"
+
+#~ msgid "typed memory object"
+#~ msgstr "objet mémoire typé"
+
+#~ msgid "block special file"
+#~ msgstr "fichier spécial de blocs"
+
+#~ msgid "character special file"
+#~ msgstr "fichier spécial de caractères"
+
+#~ msgid "contiguous data"
+#~ msgstr "données contiguës"
+
+#~ msgid "fifo"
+#~ msgstr "PEPS (FIFO)"
+
+#~ msgid "door"
+#~ msgstr "porte"
+
+#~ msgid "multiplexed block special file"
+#~ msgstr "fichier spécial de blocs multipléxé"
+
+#~ msgid "multiplexed character special file"
+#~ msgstr "fichier spécial de caractères mulipléxé"
+
+#~ msgid "multiplexed file"
+#~ msgstr "fichier multipléxé"
+
+#~ msgid "named file"
+#~ msgstr "fichier nommé"
+
+#~ msgid "network special file"
+#~ msgstr "fichier spécial de réseau"
+
+#~ msgid "migrated file with data"
+#~ msgstr "fichier migré avec ses données"
+
+#~ msgid "migrated file without data"
+#~ msgstr "fichier migré sans ses données"
+
+#~ msgid "port"
+#~ msgstr "port"
+
+#~ msgid "socket"
+#~ msgstr "socket"
+
+#~ msgid "whiteout"
+#~ msgstr "sans"
+
+#~ msgid "weird file"
+#~ msgstr "fichier bizarre"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Famille d'adresses du nom d'hôte non pris en charge"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Échec temporaire lors de la résolution de noms"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Mauvaise valeur pour ai_flags"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Échec définitif lors de la résolution de noms"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "ai_family non pris en charge"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Échec d'allocation mémoire"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "Aucune adresse associée au nom d'hôte"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Nom ou service inconnu"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "Nom de serveur non pris en charge pour ai_socktype"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "ai_socktype non pris en charge"
+
+#~ msgid "System error"
+#~ msgstr "Erreur système"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "Mémoire tampon d'argument trop petite"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Traitement de la requête en cours"
+
+#~ msgid "Request canceled"
+#~ msgstr "Requête annulée"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Requête non annulée"
+
+#~ msgid "All requests done"
+#~ msgstr "Requêtes toutes traitées"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Interruption par un signal"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "Chaîne de paramètre mal encodé"
+
+#~ msgid "Unknown error"
+#~ msgstr "Erreur inconnue"
+
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "argument source_version non valable pour compile_java_class"
+
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "argument target_version non valable pour compile_java_class"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "échec de création de « %s »"
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "erreur lors de l'écriture du fichier « %s »"
+
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr ""
+#~ "compilateur Java non trouvé, essayez d'installer gcj ou de définir $JAVAC"
+
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "machine virtuelle Java non trouvée, essayez d'installer gij ou de définir "
+#~ "$JAVAC"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "erreur d'entrée sortie du sous-processus %s"
+
+#, c-format
+#~ msgid "cannot stat %s"
+#~ msgstr "impossible de lire les permissions de %s"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "impossible de modifier les permissions de %s"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "impossible de créer le répertoire %s"
+
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Échec d'ouverture de /dev/zero en lecture"
+
+#~ msgid "creation of reading thread failed"
+#~ msgstr "échec de création du processus de lecture"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr ""
+#~ "impossible de configurer l'entrée sortie non bloquante au sous-processus "
+#~ "%s"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "échec de communication avec le sous-processus %s"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "échec d'écriture vers le sous-processus %s"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "échec de lecture depuis le sous-processus %s"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "le sous-processus %s s'est terminé avec le code de retour %d"
+
+#~ msgid "creation of threads failed"
+#~ msgstr "échec de création de processus"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "le sous-processus de %s s'est terminé avec le code de retour %d"
+
+#~ msgid "`"
+#~ msgstr "« "
+
+#~ msgid "'"
+#~ msgstr " »"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[oOyY].*"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN].*"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "impossible de définir les permissions de %s"
+
+#~ msgid "Hangup"
+#~ msgstr "Raccrocher"
+
+#~ msgid "Interrupt"
+#~ msgstr "Interrompre"
+
+#~ msgid "Quit"
+#~ msgstr "Quitter"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "Instruction illégale"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Piège de trace ou point de d'arrêt "
+
+#~ msgid "Aborted"
+#~ msgstr "Abandonné"
+
+#~ msgid "Floating point exception"
+#~ msgstr "Exception de virgule flottante"
+
+#~ msgid "Killed"
+#~ msgstr "Tué"
+
+#~ msgid "Bus error"
+#~ msgstr "Erreur de bus"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "Erreur de segmentation"
+
+#~ msgid "Broken pipe"
+#~ msgstr "Tube rompu"
+
+#~ msgid "Alarm clock"
+#~ msgstr "Réveil"
+
+#~ msgid "Terminated"
+#~ msgstr "Terminé"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "Condition d'entrée sortie urgente"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "Arrêté (signal)"
+
+#~ msgid "Stopped"
+#~ msgstr "Arrêté"
+
+#~ msgid "Continued"
+#~ msgstr "Continué"
+
+#~ msgid "Child exited"
+#~ msgstr "Fin du processus fils"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Arrêté (entrée de tty)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Arrêté (sortie de tty)"
+
+#~ msgid "I/O possible"
+#~ msgstr "Entrée sortie possible"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "Temps limite de processeur dépassé"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "Taille limite de fichier dépassée"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "Temporisation virtuelle dépassée"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "Temporisation de profilage dépassée"
+
+#~ msgid "Window changed"
+#~ msgstr "Fenêtre modifiée"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "Signal 1 défini par utilisateur"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Signal 2 défini par utilisateur"
+
+#~ msgid "EMT trap"
+#~ msgstr "Piège EMT"
+
+#~ msgid "Bad system call"
+#~ msgstr "Mauvais appel système"
+
+#~ msgid "Stack fault"
+#~ msgstr "Défaut de pile"
+
+#~ msgid "Information request"
+#~ msgstr "Demande de renseignements"
+
+#~ msgid "Power failure"
+#~ msgstr "Échec d'alimentation"
+
+#~ msgid "Resource lost"
+#~ msgstr "Ressource perdue"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "Erreur d'écriture vers un tube ou un socket fermé"
+
+#~ msgid "cannot create pipe"
+#~ msgstr "impossible de créer un tube (« pipe »)"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "Signal %d en temps réel"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Signal %d inconnu"
+
+#~ msgid "Execution times (seconds)"
+#~ msgstr "Temps d'exécution (s)"
+
+#~ msgid "CPU user"
+#~ msgstr "Temps utilisateur"
+
+#~ msgid "CPU system"
+#~ msgstr "Temps système"
+
+#~ msgid "wall clock"
+#~ msgstr "horloge murale"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "fonction iconv non utilisable"
+
+#~ msgid "iconv function not available"
+#~ msgstr "fonction iconv non disponible"
+
+#~ msgid "character out of range"
+#~ msgstr "caractère hors limites"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "impossible de convertir U+%04X dans le jeu de caractères local"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "impossible de convertir U+%04X dans le jeu de caractères local : %s"
+
+#~ msgid "invalid user"
+#~ msgstr "utilisateur non valable"
+
+#~ msgid "invalid group"
+#~ msgstr "groupe non valable"
+
+#~ msgid "invalid spec"
+#~ msgstr "spécification non valable"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "Empaqueté par %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "Empaqueté par %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "©"
+
+#, c-format
+#~ msgid ""
+#~ "License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ msgstr ""
+#~ "Licence GPLv3+ : GNU GPL version 3 ou ultérieure <%s>\n"
+#~ "Logiciel libre : vous êtes libre de le modifier ou de le redistribuer.\n"
+#~ "Il n'y a AUCUNE GARANTIE, dans les limites permises par la loi.\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Écrit par %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Écrit par %s et %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Écrit par %s, %s et %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Écrit par %s, %s, %s,\n"
+#~ "et %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Écrit par %s, %s, %s,\n"
+#~ "%s et %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Écrit par %s, %s, %s,\n"
+#~ "%s, %s, et %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Écrit par %s, %s, %s,\n"
+#~ "%s, %s, %s, et %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Écrit par %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "et %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Écrit par %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s et %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Écrit par %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s et d'autres.\n"
+
+#, c-format
+#~ msgid "Report bugs to: %s\n"
+#~ msgstr "Signalez toute anomalie à : %s\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "Signalez les anomalies de %s à : %s\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "page d'accueil de %s : <%s>\n"
+
+#, c-format
+#~ msgid "General help using GNU software: <%s>\n"
+#~ msgstr "Aide globale sur les logiciels GNU : <%s>\n"
+
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "échec de _open_osfhandle"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr ""
+#~ "impossible de restaurer le descripteur de fichier (fd) %d : échec de dup2"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "sous-processus %s"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "le sous-processus %s a reçu un signal fatal %d"
+
+#~ msgid "failed to set file descriptor text/binary mode"
+#~ msgstr ""
+#~ "impossible de définir le mode texte/binaire du descripteur de fichier"
+
+#~ msgid "stdin"
+#~ msgstr "entrée standard (stdin)"
+
+#~ msgid "stdout"
+#~ msgstr "sortie standard (stdout)"
+
+#~ msgid "stderr"
+#~ msgstr "sortie d'erreur (stderr)"
+
+#~ msgid "unknown stream"
+#~ msgstr "flux inconnu"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "impossible de rouvrir %s en mode %s"
+
+#~ msgid "string comparison failed"
+#~ msgstr "échec de comparaison de chaîne"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Définir LC_ALL='C' pour contourner le problème."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Les chaînes comparées étaient %s et %s."
+
+#~ msgid "cannot perform formatted output"
+#~ msgstr "impossible mettre en forme la sortie formatée"
+
+#, c-format
+#~ msgid "invalid %s%s argument '%s'"
+#~ msgstr "argument %s%s non valable « %s »"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument '%s'"
+#~ msgstr "suffixe non valable dans l'argument %s%s « %s »"
+
+#, c-format
+#~ msgid "%s%s argument '%s' too large"
+#~ msgstr "argument %s%s « %s » trop grand"
+
+#~ msgid "%s home page: <https://www.gnu.org/software/%s/>\n"
+#~ msgstr "page d'accueil de %s : <https://www.gnu.org/software/%s/>\n"
diff --git a/gl/po/ga.gmo b/gl/po/ga.gmo
new file mode 100644
index 0000000..af523a5
--- /dev/null
+++ b/gl/po/ga.gmo
Binary files differ
diff --git a/gl/po/ga.po b/gl/po/ga.po
new file mode 100644
index 0000000..9e23cec
--- /dev/null
+++ b/gl/po/ga.po
@@ -0,0 +1,711 @@
+# Irish translations for gnulib.
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+# Kevin Patrick Scannell <scannell@SLU.EDU>, 2005, 2007.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 1.1\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2007-07-20 12:24-0600\n"
+"Last-Translator: Kevin Scannell <kscanne@gmail.com>\n"
+"Language-Team: Irish <gaeilge-gnulinux@lists.sourceforge.net>\n"
+"Language: ga\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=5; plural=n==1 ? 0 : n==2 ? 1 : (n>2 && n<7) ? 2 :"
+"(n>6 && n<11) ? 3 : 4;\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: luach %s nos l n n cothrom le %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: luach de dhth ar pharaimadar ARGP_HELP_FMT"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: Paraimadar anaithnid ARGP_HELP_FMT"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Truflais i ARGP_HELP_FMT: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Is riachtanach/roghnach le rogha ghearr aon argint at riachtanach/roghnach "
+"leis an rogha fhada."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "sid:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " n: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [ROGHA...]"
+
+#: gl/lib/argp-help.c:1783
+#, fuzzy, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr ""
+"Bain triail as `%s --help' n `%s --usage' chun tuilleadh eolais a fhil.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "Seol tuairisc fabhtanna chuig %s.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Earrid chrais anaithnid"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "taispein an chabhair seo"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "tabhair teachtaireacht bheag side"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "AINM"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "socraigh ainm an chlir"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "SOIC"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "dan moill SOIC soicind (ramhshocr: 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "taispein leagan an chlir"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(EARRID CHLIR) Leagan anaithnid!?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: An iomarca argint\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(EARRID CHLIR) Ba chir an rogha a aithint!?"
+
+#: gl/lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: T an rogha `%s' dbhroch\n"
+
+#: gl/lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: T an rogha `%s' dbhroch\n"
+
+#: gl/lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: rogha anaithnid `%c%s'\n"
+
+#: gl/lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: n cheadatear argint i ndiaidh na rogha `%c%s'\n"
+
+#: gl/lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: t argint de dhth i ndiaidh na rogha `%s'\n"
+
+#: gl/lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: rogha neamhbhail -- %c\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: t argint de dhth i ndiaidh na rogha -- %c\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "n fidir an chomhadlann oibre a thaifead"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "nl aon fhil ar an chad chomhadlann oibre"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "D'irigh leis"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Gan mheaitseil"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Slonn ionadaochta neamhbhail"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Carachtar neamhbhail comhordaithe"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Ainm neamhbhail ar aicme charachtar"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Clslais chun deiridh"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Cltagairt neamhbhail"
+
+#: gl/lib/regcomp.c:143
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[ n [^ corr"
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "( n \\( corr"
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "\\{ corr"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "bhar neamhbhail idir \\{ agus \\}"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Deireadh raoin neamhbhail"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Cuimhne dithe"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Is neamhbhail an slonn ionadaochta roimhe seo"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Deireadh le slonn ionadaochta gan choinne"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "Slonn ionadaochta rmhr"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ") n \\) corr"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Nl aon slonn ionadaochta roimhe seo"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "cuimhne dithe"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "argint neamhbhail %s chun %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "argint dhbhroch %s chun %s"
+
+#, c-format
+#~ msgid "Valid arguments are:"
+#~ msgstr "Na hargint bail:"
+
+#, c-format
+#~ msgid "%.*s: ARGP_HELP_FMT parameter must be positive"
+#~ msgstr "%.*s: luach deimhneach de dhth ar pharaimadar ARGP_HELP_FMT"
+
+#~ msgid "program error"
+#~ msgstr "earrid chlir"
+
+#~ msgid "stack overflow"
+#~ msgstr "cruach thar maoil"
+
+#, fuzzy, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "n fidir comhadlann %s a chruth"
+
+#, fuzzy, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "n fidir comhadlann %s a chruth"
+
+#, fuzzy, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "n fidir comhadlann %s a chruth"
+
+#, fuzzy
+#~ msgid "error closing file"
+#~ msgstr "earrid agus comhad \"%s\" scrobh"
+
+#~ msgid "write error"
+#~ msgstr "earrid sa scrobh"
+
+#, c-format
+#~ msgid "error while opening \"%s\" for reading"
+#~ msgstr "earrid agus \"%s\" oscailt chun a lamh"
+
+#, c-format
+#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgstr "n fidir comhad cltaca \"%s\" a oscailt chun scrobh ann"
+
+#, c-format
+#~ msgid "error reading \"%s\""
+#~ msgstr "earrid agus \"%s\" lamh"
+
+#, c-format
+#~ msgid "error writing \"%s\""
+#~ msgstr "earrid agus \"%s\" scrobh"
+
+#, c-format
+#~ msgid "error after reading \"%s\""
+#~ msgstr "earrid tar is \"%s\" lamh"
+
+#, c-format
+#~ msgid "fdopen() failed"
+#~ msgstr "theip ar fdopen()"
+
+#, c-format
+#~ msgid "C# compiler not found, try installing pnet"
+#~ msgstr "Tiomsaitheoir C# gan aimsi, bain triail as pnet"
+
+#, c-format
+#~ msgid "C# virtual machine not found, try installing pnet"
+#~ msgstr "Meaisn foril C# gan aimsi, bain triail as pnet"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "theip ar fhophriseas %s"
+
+#~ msgid "regular empty file"
+#~ msgstr "gnthchomhad folamh"
+
+#~ msgid "regular file"
+#~ msgstr "gnthchomhad"
+
+#~ msgid "directory"
+#~ msgstr "comhadlann"
+
+#~ msgid "block special file"
+#~ msgstr "comhad speisialta den chinel `bloc'"
+
+#~ msgid "character special file"
+#~ msgstr "comhad speisialta den chinel `carachtar'"
+
+# `TITA' ?! -KPS
+#~ msgid "fifo"
+#~ msgstr "fifo"
+
+#~ msgid "symbolic link"
+#~ msgstr "nasc siombalach"
+
+#~ msgid "socket"
+#~ msgstr "soicad"
+
+#~ msgid "message queue"
+#~ msgstr "ci teachtaireachta"
+
+#~ msgid "semaphore"
+#~ msgstr "samafr"
+
+# FARF --KPS
+#~ msgid "shared memory object"
+#~ msgstr "comhad comhchuimhne"
+
+#~ msgid "typed memory object"
+#~ msgstr "comhad cuimhne le cinel"
+
+#~ msgid "weird file"
+#~ msgstr "comhad aisteach"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Aicme sheolta d'stainm gan tacaocht"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Teip shealadach ar riteach na n-ainmneacha"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Luach neamhbhail do 'ai_flags'"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Teip dhocheartaithe ar riteach na n-ainmneacha"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "n thacatear le 'ai_family'"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Theip ar dhil chuimhne"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "Nl seoladh ar bith ceangailte leis an stainm"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Ainm n seirbhs anaithnid"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "N thacatear le hainm freastalaithe do 'ai_socktype'"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "n thacatear le 'ai_socktype'"
+
+#~ msgid "System error"
+#~ msgstr "Earrid chrais"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "T an argint mhaolin rbheag"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Iarratas prisela ar sil"
+
+#~ msgid "Request canceled"
+#~ msgstr "Cealaodh an t-iarratas"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Nor cealaodh an t-iarratas"
+
+#~ msgid "All requests done"
+#~ msgstr "Cuireadh gach iarratas i gcrch"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Idirbhriste ag comhartha"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "Nl an teaghrn paraimadair ionchdaithe i gceart"
+
+#~ msgid "Unknown error"
+#~ msgstr "Earrid anaithnid"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: n cheadatear argint i ndiaidh na rogha `--%s'\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: rogha anaithnid `--%s'\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: rogha neamhcheadaithe -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: T an rogha `-W %s' dbhroch\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: n cheadatear argint i ndiaidh na rogha `-W %s'\n"
+
+#, fuzzy, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "fophriseas %s"
+
+#, c-format
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "argint neamhbhail \"source_version\" ar compile_java_class"
+
+#, c-format
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "argint neamhbhail \"target_version\" ar compile_java_class"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "theip ar chruth \"%s\""
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "earrid agus comhad \"%s\" scrobh"
+
+#, c-format
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr ""
+#~ "Tiomsaitheoir Java gan aimsi, bain triail as gcj, n socraigh $JAVAC"
+
+#, c-format
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "Meaisn foril Java gan aimsi, bain triail as gij, n socraigh $JAVA"
+
+#, c-format
+#~ msgid "cannot create pipe"
+#~ msgstr "n fidir popa a chruth"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "n fidir na ceadanna de %s a athr"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "n fidir comhadlann %s a chruth"
+
+#, c-format
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Theip ar oscailt /dev/zero chun a lamh"
+
+#~ msgid "`"
+#~ msgstr "`"
+
+#~ msgid "'"
+#~ msgstr "'"
+
+# #-#-#-#-# findutils-4.1.7.ga.po (findutils 4.1.7) #-#-#-#-#
+# allow yes, but also 'i' as in 'is sea' or 's' for 'sea' -- KPS
+# neither of these letters is near the 'N' on standard keyboard...
+# #-#-#-#-# sh-utils-2.0.15.ga.po (sh-utils 2.0.15) #-#-#-#-#
+# #-#-#-#-# findutils-4.1.7.ga.po (findutils 4.1.7) #-#-#-#-#
+# allow yes, but also 'i' as in 'is sea' or 's' for 'sea' -- KPS
+# neither of these letters is near the 'N' on standard keyboard...
+# #-#-#-#-# textutils-2.1.ga.po (textutils 2.1) #-#-#-#-#
+# #-#-#-#-# findutils-4.1.7.ga.po (findutils 4.1.7) #-#-#-#-#
+# allow yes, but also 'i' as in 'is sea' or 's' for 'sea' -- KPS
+# neither of these letters is near the 'N' on standard keyboard...
+#~ msgid "^[yY]"
+#~ msgstr "^[yYiIsS]"
+
+# #-#-#-#-# findutils-4.1.7.ga.po (findutils 4.1.7) #-#-#-#-#
+# fortunately, 'n' for 'no' or 'n hea' - KPS
+# #-#-#-#-# sh-utils-2.0.15.ga.po (sh-utils 2.0.15) #-#-#-#-#
+# #-#-#-#-# findutils-4.1.7.ga.po (findutils 4.1.7) #-#-#-#-#
+# fortunately, 'n' for 'no' or 'n hea' - KPS
+# #-#-#-#-# textutils-2.1.ga.po (textutils 2.1) #-#-#-#-#
+# #-#-#-#-# findutils-4.1.7.ga.po (findutils 4.1.7) #-#-#-#-#
+# fortunately, 'n' for 'no' or 'n hea' - KPS
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "n fidir an fheidhm iconv a sid"
+
+#~ msgid "iconv function not available"
+#~ msgstr "nl an fheidhm iconv ar fil"
+
+#~ msgid "character out of range"
+#~ msgstr "carachtar as raon"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "n fidir U+%04X a thiont chuig an fhoireann carachtar lognta"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "n fidir U+%04X a thiont chuig an fhoireann carachtar lognta: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "sideoir neamhbhail"
+
+#~ msgid "invalid group"
+#~ msgstr "grpa neamhbhail"
+
+#~ msgid "invalid spec"
+#~ msgstr "sonr neamhbhail"
+
+#, fuzzy, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "n fidir na ceadanna de %s a athr"
+
+#, c-format
+#~ msgid "string comparison failed"
+#~ msgstr "theip ar chomparid idir teaghrin"
+
+#, c-format
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Cuir LC_ALL='C' ionas gur fidir an fhadhb seo a sheachaint."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Rinneadh comparid idir na teaghrin %s agus %s."
+
+#~ msgid "(C)"
+#~ msgstr ""
+
+#, fuzzy
+#~ msgid ""
+#~ "\n"
+#~ "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl."
+#~ "html>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Ceadnas GPLv3+: GNU GPL leagan 3 n nos nua <http://gnu.org/licenses/"
+#~ "gpl.html>\n"
+#~ "Is saorbhogearra seo: ceadatear duit a athr agus a athdhileadh.\n"
+#~ "Nl barnta AR BITH ann, an oiread at ceadaithe de rir dl.\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Le %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Le %s agus %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Le %s, %s, agus %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Le %s, %s, %s,\n"
+#~ "agus %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Le %s, %s, %s,\n"
+#~ "%s, agus %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Le %s, %s, %s,\n"
+#~ "%s, %s, agus %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Le %s, %s, %s,\n"
+#~ "%s, %s, %s, agus %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Le %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "agus %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Le %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, agus %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Le %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, agus daoine eile nach iad.\n"
+
+#, fuzzy, c-format
+#~ msgid ""
+#~ "\n"
+#~ "Report bugs to <%s>.\n"
+#~ msgstr "Seol tuairisc fabhtanna chuig %s.\n"
+
+#, fuzzy, c-format
+#~ msgid "invalid %s%s argument `%s'"
+#~ msgstr "argint neamhbhail %s chun %s"
+
+#, fuzzy, c-format
+#~ msgid "invalid suffix in %s%s argument `%s'"
+#~ msgstr "argint neamhbhail %s chun %s"
+
+#, fuzzy, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "n fidir na ceadanna de %s a athr"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "fophriseas %s"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "fuair fophriseas %s comhartha marfach %d"
+
+#~ msgid "block size"
+#~ msgstr "mid bloc"
+
+#~ msgid "%s exists but is not a directory"
+#~ msgstr "T %s ann cheana, ach n comhadlann "
+
+#~ msgid "cannot change owner and/or group of %s"
+#~ msgstr "n fidir an t-inir agus/n an grpa de %s a athr"
+
+#~ msgid "cannot chdir to directory %s"
+#~ msgstr "n fidir chdir a dhanamh go dt an chomhadlann %s"
+
+#~ msgid "cannot get the login group of a numeric UID"
+#~ msgstr "nl aon fhil ar an ghrpa don UID uimhriil seo"
+
+#~ msgid ""
+#~ "\n"
+#~ "This is free software. You may redistribute copies of it under the terms "
+#~ "of\n"
+#~ "the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Is saorbhogearra seo. Is fidir leat cipeanna a scaipeadh de rir na\n"
+#~ "gcoinnollacha den GNU General Public License\n"
+#~ "<http://www.gnu.org/licenses/gpl.html>.\n"
+#~ "Nl barnta AR BITH ann, an oiread at ceadaithe de rir dl.\n"
+#~ "\n"
diff --git a/gl/po/gl.gmo b/gl/po/gl.gmo
new file mode 100644
index 0000000..3dd7798
--- /dev/null
+++ b/gl/po/gl.gmo
Binary files differ
diff --git a/gl/po/gl.po b/gl/po/gl.po
new file mode 100644
index 0000000..a8e9795
--- /dev/null
+++ b/gl/po/gl.po
@@ -0,0 +1,732 @@
+# Galician translation of gnulib.
+# This file is distributed under the same license as the gnulib package.
+# Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2012 Leandro Regueiro.
+#
+# Jacobo Tarrio <jtarrio@trasno.net>, 2000, 2001, 2002.
+# Leandro Regueiro <leandro.regueiro@gmail.com>, 2012.
+#
+# Proxecto Trasno - Adaptación do software libre á lingua galega: Se desexas
+# colaborar connosco, podes atopar máis información en http://www.trasno.net
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 3.0.0.6062.a6b16\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2012-11-11 13:26+0200\n"
+"Last-Translator: Leandro Regueiro <leandro.regueiro@gmail.com>\n"
+"Language-Team: Galician <proxecto@trasno.net>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr ""
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr ""
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Os argumentos obrigatorios ou opcionais das opcións longas son tamén "
+"obrigatorios ou opcionais para calquera opción curta que se corresponda."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Uso:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " ou: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [OPCIÓN...]"
+
+#: gl/lib/argp-help.c:1783
+#, fuzzy, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Execute «%s --help» ou «%s --usage» para obter máis información.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "Envíe os informes de fallo a %s.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Erro do sistema descoñecido"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "devolve esta lista de axuda"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "devolve unha mensaxe curta sobre o uso"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "NOME"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "define o nome do programa"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "SECS"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr ""
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "mostra a versión do programa"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr ""
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: Demasiados argumentos\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr ""
+
+#: gl/lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: a opción «-W %s» é ambigua\n"
+
+#: gl/lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: a opción «%s» é ambigua; as posibilidades son:"
+
+#: gl/lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: opción «%c%s» non recoñecida\n"
+
+#: gl/lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: a opción «%c%s» non permite ningún argumento\n"
+
+#: gl/lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: a opción «--%s» require un argumento\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: opción incorrecta -- «%c»\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: a opción require un argumento -- «%c»\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "non foi posíbel gravar o directorio de traballo actual"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "non foi posíbel volver ao directorio de traballo inicial"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Éxito"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Sen coincidencias"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Expresión regular non válida"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Carácter de ordenación incorrecto"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Nome da clase de caracteres incorrecto"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Barra invertida ao final"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr ""
+
+#: gl/lib/regcomp.c:143
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[ ou [^ sen parella"
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "( ou \\( sen parella"
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "\\{ sen parella"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "Contido de \\{\\} non válido"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Fin de intervalo non válido"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Memoria esgotada"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Expresión regular precedente non válida"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Fin prematura da expresión regular"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "Expresión regular grande de máis"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ") ou \\) sen parella"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Non hai ningunha expresión regular anterior"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "non é posíbel mostrar a mensaxe de erro"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memoria esgotada"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "argumento incorrecto %s para %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "argumento %s ambiguo para %s"
+
+#, c-format
+#~ msgid "Valid arguments are:"
+#~ msgstr "Os argumentos válidos son:"
+
+#~ msgid "program error"
+#~ msgstr "erro do programa"
+
+#~ msgid "stack overflow"
+#~ msgstr "desbordamento da pila"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "non é posíbel crear un directorio temporal empregando o patrón «%s»"
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "non é posíbel retirar o ficheiro temporal %s"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "non é posíbel retirar o directorio temporal %s"
+
+#~ msgid "error closing file"
+#~ msgstr "produciuse un erro ao pechar o ficheiro"
+
+#~ msgid "write error"
+#~ msgstr "erro de escritura"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "conservando os permisos para %s"
+
+#, c-format
+#~ msgid "error while opening \"%s\" for reading"
+#~ msgstr "produciuse un erro ao abrir «%s» para lectura"
+
+#, c-format
+#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgstr ""
+#~ "non é posíbel abrir o ficheiro de copia de seguridade «%s» para escribir"
+
+#, c-format
+#~ msgid "error reading \"%s\""
+#~ msgstr "produciuse un erro ao ler «%s»"
+
+#, c-format
+#~ msgid "error writing \"%s\""
+#~ msgstr "produciuse un erro ao escribir «%s»"
+
+#, c-format
+#~ msgid "error after reading \"%s\""
+#~ msgstr "produciuse un erro despois de ler «%s»"
+
+#, c-format
+#~ msgid "fdopen() failed"
+#~ msgstr "fdopen() fallou"
+
+#~ msgid "regular empty file"
+#~ msgstr "ficheiro normal baleiro"
+
+#~ msgid "regular file"
+#~ msgstr "ficheiro normal"
+
+#~ msgid "directory"
+#~ msgstr "directorio"
+
+#~ msgid "block special file"
+#~ msgstr "ficheiro especial de bloque"
+
+#~ msgid "character special file"
+#~ msgstr "ficheiro especial de carácter"
+
+#~ msgid "fifo"
+#~ msgstr "fifo"
+
+#~ msgid "symbolic link"
+#~ msgstr "ligazón simbólica"
+
+#~ msgid "message queue"
+#~ msgstr "cola de mensaxes"
+
+#~ msgid "semaphore"
+#~ msgstr "semáforo"
+
+#~ msgid "shared memory object"
+#~ msgstr "obxecto de memoria compartida"
+
+#~ msgid "weird file"
+#~ msgstr "ficheiro estraño"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "ai_family non admitido"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Nome ou servizo descoñecido"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "ai_socktype non admitido"
+
+#~ msgid "System error"
+#~ msgstr "Erro do sistema"
+
+#~ msgid "Request canceled"
+#~ msgstr "Solicitude cancelada"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Solicitude non cancelada"
+
+#~ msgid "Unknown error"
+#~ msgstr "Erro descoñecido"
+
+#, c-format
+#~ msgid "%s: option '--%s' doesn't allow an argument\n"
+#~ msgstr "%s: a opción «--%s» non permite ningún argumento\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option '--%s'\n"
+#~ msgstr "%s: opción «--%s» non recoñecida\n"
+
+#, c-format
+#~ msgid "%s: option '-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: a opción «-W %s» non permite ningún argumento\n"
+
+#, c-format
+#~ msgid "%s: option '-W %s' requires an argument\n"
+#~ msgstr "%s: a opción «-W %s» require un argumento\n"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "produciuse un erro ao crear «%s»"
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "produciuse un erro ao escribir o ficheiro «%s»"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "non foi posíbel cambiar os permisos de %s"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "non foi posíbel crear o directorio %s"
+
+#, c-format
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Produciuse un erro ao abrir /dev/zero para ler"
+
+#~ msgid "Franc,ois Pinard"
+#~ msgstr "François Pinard"
+
+#~ msgid "`"
+#~ msgstr "«"
+
+#~ msgid "'"
+#~ msgstr "»"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[sSyY]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "definindo os permisos para %s"
+
+#~ msgid "Quit"
+#~ msgstr "Saír"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "Instrución inaceptábel"
+
+#~ msgid "Aborted"
+#~ msgstr "Interrompido"
+
+#~ msgid "Floating point exception"
+#~ msgstr "Excepción de coma flotante"
+
+#~ msgid "Killed"
+#~ msgstr "Matado"
+
+#~ msgid "Bus error"
+#~ msgstr "Erro de bus"
+
+#~ msgid "Broken pipe"
+#~ msgstr "Canalización danada"
+
+#~ msgid "Alarm clock"
+#~ msgstr "Reloxo de alarma"
+
+#~ msgid "Terminated"
+#~ msgstr "Terminado"
+
+#~ msgid "Stopped"
+#~ msgstr "Detido"
+
+#~ msgid "Continued"
+#~ msgstr "Continuado"
+
+#~ msgid "Child exited"
+#~ msgstr "O proceso fillo saíu"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Detido (entrada pola terminal)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Detido (saída pola terminal)"
+
+#~ msgid "I/O possible"
+#~ msgstr "A E/S é posíbel"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "Excedeuse o límite de tempo de CPU"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "Excedeuse o límite de tamaño do ficheiro"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "Temporizador virtual esgotado"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "Sinal 1 definido polo usuario"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Sinal 2 definido polo usuario"
+
+#~ msgid "Bad system call"
+#~ msgstr "Chamada ao sistema errónea"
+
+#~ msgid "Stack fault"
+#~ msgstr "Fallo de pila"
+
+#~ msgid "Information request"
+#~ msgstr "Solicitude de información"
+
+#~ msgid "Power failure"
+#~ msgstr "Fallo de subministración eléctrica"
+
+#~ msgid "Resource lost"
+#~ msgstr "Recurso perdido"
+
+#, c-format
+#~ msgid "cannot create pipe"
+#~ msgstr "non é posíbel crear a canalización"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Sinal %d descoñecido"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "a función iconv non é utilizábel"
+
+#~ msgid "iconv function not available"
+#~ msgstr "a función iconv non está dispoñíbel"
+
+#~ msgid "character out of range"
+#~ msgstr "carácter fóra de intervalo"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "non é posíbel converter U+%04X ao xogo de caracteres local"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "non é posíbel converter U+%04X ao xogo de caracteres local: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "usuario incorrecto"
+
+#~ msgid "invalid group"
+#~ msgstr "grupo incorrecto"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "Empaquetado por %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "Empaquetado por %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "©"
+
+#~ msgid ""
+#~ "\n"
+#~ "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl."
+#~ "html>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Licenza GPL3v+: GNU GPL versión3 ou posterior <http://gnu.org/licenses/"
+#~ "gpl.html>\n"
+#~ "Isto é software libre: pode modificalo e redistribuílo.\n"
+#~ "Non hai NINGUNHA GARANTÍA, ata onde o permita a lei.\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Escrito por %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Escrito por %s e %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Escrito por %s, %s e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, %s, e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, %s, %s, e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, e outros.\n"
+
+#, c-format
+#~ msgid ""
+#~ "\n"
+#~ "Report bugs to: %s\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Envíe os informes de fallo a: %s\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "Envíe os informes de fallo en %s a %s.\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "Páxina web de %s: <%s>\n"
+
+#, c-format
+#~ msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+#~ msgstr "Páxina web de %s: <http://www.gnu.org/software/%s/>\n"
+
+#~ msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+#~ msgstr "Axuda xeral ao usar software GNU: <http://www.gnu.org/gethelp/>\n"
+
+#, c-format
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "_open_osfhandle fallou"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "non foi posíbel restaurar o fd %d: dup2 fallou"
+
+#~ msgid "stdin"
+#~ msgstr "stdin"
+
+#~ msgid "stdout"
+#~ msgstr "stdout"
+
+#~ msgid "stderr"
+#~ msgstr "stderr"
+
+#~ msgid "unknown stream"
+#~ msgstr "fluxo descoñecido"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "produciuse un erro ao volver abrir %s en modo %s"
+
+#, c-format
+#~ msgid "string comparison failed"
+#~ msgstr "produciuse un erro ao comparar as cadeas"
+
+#, c-format
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Defina LC_ALL='C' para paliar o problema."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "As cadeas que se compararon foron %s e %s."
+
+#, c-format
+#~ msgid "invalid %s%s argument `%s'"
+#~ msgstr "o argumento «%s» de %s%s é incorrecto"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument `%s'"
+#~ msgstr "sufixo incorrecto %s%s no argumento «%s»"
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: opción incorrecta -- %c\n"
+
+#~ msgid "block size"
+#~ msgstr "tamaño de bloque"
+
+#~ msgid "%s exists but is not a directory"
+#~ msgstr "%s existe pero non é un directorio"
+
+#~ msgid "cannot change owner and/or group of %s"
+#~ msgstr "non se pode cambia-lo propietario e/ou grupo de %s"
+
+#~ msgid "cannot chdir to directory %s"
+#~ msgstr "non se pode cambiar ao directorio %s"
+
+#~ msgid "cannot get the login group of a numeric UID"
+#~ msgstr "non se pode obte-lo grupo de login dun UID numérico"
+
+#, fuzzy
+#~ msgid ""
+#~ "\n"
+#~ "This is free software. You may redistribute copies of it under the terms "
+#~ "of\n"
+#~ "the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Este programa é software libre; pode redistribuílo e/ou modificalo baixo\n"
+#~ "os termos da Licencia Pública Xeral de GNU tal como a publicou a Free\n"
+#~ "Software Foundation; xa ben a versión 2 ou (á súa elección) calquera\n"
+#~ "versión posterior.\n"
+#~ "\n"
diff --git a/gl/po/hu.gmo b/gl/po/hu.gmo
new file mode 100644
index 0000000..7b1ee71
--- /dev/null
+++ b/gl/po/hu.gmo
Binary files differ
diff --git a/gl/po/hu.po b/gl/po/hu.po
new file mode 100644
index 0000000..f1a6e6b
--- /dev/null
+++ b/gl/po/hu.po
@@ -0,0 +1,872 @@
+# Hungarian translation for gnulib.
+# Copyright (C) 2002, 2003, 2004, 2010 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+#
+# Emese Kovacs <emese@instantweb.hu>, 2004.
+# Gabor Kelemen <kelemeng@gnome.hu>, 2010.
+# Balázs Úr <urbalazs@gmail.com>, 2014.
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 3.0.0.6062.a6b16\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2014-06-25 19:51+0200\n"
+"Last-Translator: Balázs Úr <urbalazs@gmail.com>\n"
+"Language-Team: Hungarian <translation-team-hu@lists.sourceforge.net>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Lokalize 1.5\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: %s értéke nem nagyobb, mint %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: Az ARGP_HELP_FMT paraméter értéket igényel"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: Ismeretlen ARGP_HELP_FMT paraméter"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Szemét az ARGP_HELP_FMT-ben: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Ha egy hosszú kapcsolóhoz kötelező vagy opcionális argumentumot megadni, "
+"akkor ez a megfelelő rövid kapcsolónál is kötelező vagy opcionális."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Használat:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " vagy: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [KAPCSOLÓ…]"
+
+#: gl/lib/argp-help.c:1783
+#, fuzzy, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr ""
+"További információkért lásd a(z) „%s --help” vagy „%s --usage” kimenetét.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "A hibák itt jelenthetők: %s.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Ismeretlen rendszerhiba"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "ezen súgószöveg megjelenítése"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "rövid használati utasítás megjelenítése"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "NÉV"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "a program nevének beállítása"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "MÁSODPERC"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "szünet MP másodpercre (alapértelmezetten 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "a programverzió kiírása"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(PROGRAMHIBA) A verzió nem ismert!"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: Túl sok argumentum\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(PROGRAMHIBA) A kapcsolót ismerni kellene?"
+
+#: gl/lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: a „-W %s” kapcsoló nem egyértelmű\n"
+
+#: gl/lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: a(z) „%s” kapcsoló nem egyértelmű; lehetőségek:"
+
+#: gl/lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: a(z) „%c%s” kapcsoló ismeretlen\n"
+
+#: gl/lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: a(z) „%c%s” kapcsoló nem enged meg argumentumot\n"
+
+#: gl/lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: a(z) „--%s” kapcsolóhoz egy argumentum szükséges\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: érvénytelen kapcsoló -- „%c”\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: a kapcsoló egy argumentumot igényel -- „%c”\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "az aktuális munkakönyvtár feljegyzése meghiúsult"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "a visszatérés meghiúsult a kiinduló munkakönyvtárba"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Sikerült"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Nincs találat"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Érvénytelen szabályos kifejezés"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Érvénytelen leválogatási karakter"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Érvénytelen karakterosztálynév"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Záró visszaper"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Érvénytelen visszahivatkozás"
+
+#: gl/lib/regcomp.c:143
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Pár nélküli [ vagy [^"
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "Pár nélküli ( vagy \\("
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "Pár nélküli \\{"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "A \\{\\} tartalma érvénytelen"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Érvénytelen tartományvég"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Elfogyott a memória"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Érvénytelen megelőző szabályos kifejezés"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "A szabályos kifejezés túl korán véget ért"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "A szabályos kifejezés túl nagy"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr "Pár nélküli ) vagy \\)"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Nincs megelőző szabályos kifejezés"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "nem jeleníthető meg hibaüzenet"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "elfogyott a memória"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "a(z) „%s” argumentum érvénytelen a következőhöz: %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "a(z) „%s” argumentum nem egyértelmű ehhez: „%s”"
+
+#, c-format
+#~ msgid "Valid arguments are:"
+#~ msgstr "Az érvényes argumentumok a következők:"
+
+#, c-format
+#~ msgid "%.*s: ARGP_HELP_FMT parameter must be positive"
+#~ msgstr "%.*s: Az ARGP_HELP_FMT paraméternek pozitívnak kell lennie"
+
+#~ msgid "program error"
+#~ msgstr "olvasási hiba"
+
+#~ msgid "stack overflow"
+#~ msgstr "veremtúlcsordulás"
+
+#, c-format
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr ""
+#~ "nem található átmeneti könyvtár, próbálja beállítani a $TMPDIR változót"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr ""
+#~ "nem lehet létrehozni átmeneti könyvtárat a(z) „%s” sablon használatával"
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "nem lehet eltávolítani a(z) %s átmeneti fájlt"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "nem lehet eltávolítani a(z) %s átmeneti könyvtárat"
+
+#~ msgid "error closing file"
+#~ msgstr "hiba a fájl lezárásakor"
+
+#~ msgid "write error"
+#~ msgstr "írási hiba"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "%s jogosultságainak megőrzése"
+
+#, c-format
+#~ msgid "error while opening \"%s\" for reading"
+#~ msgstr "hiba \"%s\" megnyitásakor olvasásra"
+
+#, c-format
+#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgstr "%s mentési fájl megnyitása írásra sikertelen"
+
+#, c-format
+#~ msgid "error reading \"%s\""
+#~ msgstr "hiba \"%s\" olvasásakor"
+
+#, c-format
+#~ msgid "error writing \"%s\""
+#~ msgstr "hiba \"%s\" írásakor"
+
+#, c-format
+#~ msgid "error after reading \"%s\""
+#~ msgstr "hiba \"%s\" olvasása után"
+
+#, c-format
+#~ msgid "fdopen() failed"
+#~ msgstr "az fdopen() sikertelen"
+
+#, c-format
+#~ msgid "C# compiler not found, try installing pnet"
+#~ msgstr "a C# fordító nem található, próbálja telepíteni a pnetet"
+
+#, c-format
+#~ msgid "C# virtual machine not found, try installing pnet"
+#~ msgstr "a C# virtuális gép nem található, próbálja telepíteni a pnetet"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s alfolyamat sikertelen"
+
+#~ msgid "regular empty file"
+#~ msgstr "szabályos üres fájl"
+
+#~ msgid "regular file"
+#~ msgstr "szabályos fájl"
+
+#~ msgid "directory"
+#~ msgstr "könyvtár"
+
+#~ msgid "block special file"
+#~ msgstr "speciális blokkfájl"
+
+#~ msgid "character special file"
+#~ msgstr "speciális karakterfájl"
+
+#~ msgid "fifo"
+#~ msgstr "fifo"
+
+#~ msgid "symbolic link"
+#~ msgstr "szimbolikus link"
+
+#~ msgid "socket"
+#~ msgstr "foglalat"
+
+#~ msgid "message queue"
+#~ msgstr "üzenetsor"
+
+#~ msgid "semaphore"
+#~ msgstr "szemafor"
+
+#~ msgid "shared memory object"
+#~ msgstr "megosztott memóriaobjektum"
+
+#~ msgid "typed memory object"
+#~ msgstr "típusos memóriaobjektum"
+
+#~ msgid "weird file"
+#~ msgstr "szokatlan fájl"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "A gépnév címcsaládja nem támogatott"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Átmeneti névfeloldási hiba"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Az ai_flags értéke hibás"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Helyrehozhatatlan névfeloldási hiba"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "Az ai_family nem támogatott"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Memóriafoglalási hiba"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "A gépnévhez nem tartozik cím"
+
+#~ msgid "Name or service not known"
+#~ msgstr "A név vagy szolgáltatás ismeretlen"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "A kiszolgálónév nem támogatott az ai_socktype-hoz"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "Az ai_socktype nem támogatott"
+
+#~ msgid "System error"
+#~ msgstr "Rendszerhiba"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "A paraméterpuffer túl kicsi"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Kérés feldolgozása folyamatban"
+
+#~ msgid "Request canceled"
+#~ msgstr "Kérés megszakítva"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Kérés nincs megszakítva"
+
+#~ msgid "All requests done"
+#~ msgstr "Minden kérés kész"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Szignál által megszakítva"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "A paraméter-karakterlánc nem megfelelő kódolású"
+
+#~ msgid "Unknown error"
+#~ msgstr "Ismeretlen hiba"
+
+#, c-format
+#~ msgid "%s: option '--%s' doesn't allow an argument\n"
+#~ msgstr "%s: a(z) „--%s” kapcsoló nem enged meg argumentumot\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option '--%s'\n"
+#~ msgstr "%s: a(z) „--%s” kapcsoló ismeretlen\n"
+
+#, c-format
+#~ msgid "%s: option '-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: a „-W %s” kapcsoló nem enged meg argumentumot\n"
+
+#, c-format
+#~ msgid "%s: option '-W %s' requires an argument\n"
+#~ msgstr "%s: a „-W %s” kapcsolóhoz egy argumentum szükséges\n"
+
+#, c-format
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "érvénytelen source_version argumentum ehhez: compile_java_class"
+
+#, c-format
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "érvénytelen target_version argumentum ehhez: compile_java_class"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "„%s” létrehozása sikertelen"
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "hiba a(z) „%s” fájl írásakor"
+
+#, c-format
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr ""
+#~ "Java fordító nem található, próbálja meg a gcj telepítését vagy a $JAVAC "
+#~ "beállítását"
+
+#, c-format
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "Java virtuális gép nem található, próbálja meg a gij telepítését vagy a "
+#~ "$JAVA beállítását"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "%s alfolyamat I/O hiba"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "nem lehet %s jogosultságait megváltoztatni"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "nem lehet létrehozni a(z) %s könyvtárat"
+
+#, c-format
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "A /dev/zero megnyitása olvasásra sikertelen"
+
+#, c-format
+#~ msgid "creation of reading thread failed"
+#~ msgstr "az olvasási szál létrehozása sikertelen"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "nem sikerült a nem blokkolható I/O beállítása a(z) %s alfolyamathoz"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "a(z) %s alfolyamattal történő kommunikáció sikertelen"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "a(z) %s alfolyamatba való írás sikertelen"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "a(z) %s alfolyamatból való olvasás sikertelen"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "a(z) %s alfolyamat ezzel a hibakóddal fejeződött be: %d"
+
+#, c-format
+#~ msgid "creation of threads failed"
+#~ msgstr "a szálak létrehozása sikertelen"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "a(z) %s alfolyamat ezzel a hibakóddal fejeződött be: %d"
+
+#~ msgid "Franc,ois Pinard"
+#~ msgstr "Franc,ois Pinard"
+
+#~ msgid "`"
+#~ msgstr "„"
+
+#~ msgid "'"
+#~ msgstr "”"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[iIyY]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "%s jogosultságainak beállítása"
+
+#~ msgid "Hangup"
+#~ msgstr "Felfüggesztés"
+
+#~ msgid "Interrupt"
+#~ msgstr "Megszakítás"
+
+#~ msgid "Quit"
+#~ msgstr "Kilépés"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "Illegális utasítás"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Nyomkövetési/töréspont csapda"
+
+#~ msgid "Aborted"
+#~ msgstr "Megszakítva"
+
+#~ msgid "Floating point exception"
+#~ msgstr "Lebegőpontos kivétel"
+
+#~ msgid "Killed"
+#~ msgstr "Kilőve"
+
+#~ msgid "Bus error"
+#~ msgstr "Buszhiba"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "Szegmentálási hiba"
+
+#~ msgid "Broken pipe"
+#~ msgstr "Megszakadt csővezeték"
+
+#~ msgid "Alarm clock"
+#~ msgstr "Ébresztőóra"
+
+#~ msgid "Terminated"
+#~ msgstr "Befejeződött"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "Sürgős I/O feltétel"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "Leállítva (szignál)"
+
+#~ msgid "Stopped"
+#~ msgstr "Leállítva"
+
+#~ msgid "Continued"
+#~ msgstr "Folytatva"
+
+#~ msgid "Child exited"
+#~ msgstr "Gyerekfolyamat kilépett"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Leállítva (tty bemenet)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Leállítva (tty kimenet)"
+
+#~ msgid "I/O possible"
+#~ msgstr "I/O lehetséges"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "CPU-időkorlát túllépve"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "Fájlméret korlátja túllépve"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "Virtuális időzítés lejárt"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "A profilozási időzítő lejárt"
+
+#~ msgid "Window changed"
+#~ msgstr "Ablakméret változott"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "Felhasználói szignál 1"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Felhasználói szignál 2"
+
+#~ msgid "EMT trap"
+#~ msgstr "EMT csapda"
+
+#~ msgid "Bad system call"
+#~ msgstr "Hibás rendszerhívás"
+
+#~ msgid "Stack fault"
+#~ msgstr "Veremhiba"
+
+#~ msgid "Information request"
+#~ msgstr "Információkérés"
+
+#~ msgid "Power failure"
+#~ msgstr "Tápfeszültség-kimaradás"
+
+#~ msgid "Resource lost"
+#~ msgstr "Erőforrás elveszítve"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "hiba egy lezárt cső vagy foglalat írásakor"
+
+#, c-format
+#~ msgid "cannot create pipe"
+#~ msgstr "nem hozható létre adatcsatorna"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "Valós idejű szignál %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Ismeretlen szignál %d"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "az iconv függvény nem használható"
+
+#~ msgid "iconv function not available"
+#~ msgstr "az iconv függvény nem elérhető"
+
+#~ msgid "character out of range"
+#~ msgstr "tartományon kívüli karakter"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "nem lehet helyi karakterkészletbe átalakítani a következőt: U+%04X"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "az U+%04X nem konvertálható a helyi karakterkészletbe: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "érvénytelen felhasználó"
+
+#~ msgid "invalid group"
+#~ msgstr "érvénytelen csoport"
+
+#~ msgid "invalid spec"
+#~ msgstr "érvénytelen specifikáció"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "Csomagolta: %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "Csomagolta: %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "©"
+
+#~ msgid ""
+#~ "\n"
+#~ "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl."
+#~ "html>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "\n"
+#~ "A licenc GPLv3+: a GNU GPL 3. vagy újabb változata <http://gnu.org/"
+#~ "licenses/gpl.html>\n"
+#~ "Ez egy szabad szoftver, terjesztheti és/vagy módosíthatja.\n"
+#~ "NINCS GARANCIA, a törvény által engedélyezett mértékig.\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Írta: %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Írta: %s és %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Írta: %s, %s és %s\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Írta: %s, %s, %s\n"
+#~ "és %s\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Írta: %s, %s, %s,\n"
+#~ "%s és %s\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Írta: %s, %s, %s,\n"
+#~ "%s, %s és %s\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Írta: %s, %s, %s,\n"
+#~ "%s, %s, %s és %s\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Írta: %s, %s, %s,\n"
+#~ "%s, %s, %s, %s\n"
+#~ "és %s\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Írta: %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s és %s\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Írta: %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s és mások\n"
+
+#, c-format
+#~ msgid ""
+#~ "\n"
+#~ "Report bugs to: %s\n"
+#~ msgstr ""
+#~ "\n"
+#~ "A hibák a(z) %s címen jelenthetők.\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "A(z) %s hibái a(z) %s címen jelenthetők.\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "A(z) %s honlapja: <%s>\n"
+
+#, c-format
+#~ msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+#~ msgstr "A(z) %s honlapja: <http://www.gnu.org/software/%s/>.\n"
+
+#~ msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+#~ msgstr ""
+#~ "Általános segítség a GNU szoftverek használatához: <http://www.gnu.org/"
+#~ "gethelp/>.\n"
+
+#, c-format
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "_open_osfhandle sikertelen"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "az fd %d visszaállítása nem sikerült: dup2 sikertelen"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "%s alfolyamat"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "%s alfolyamat végzetes %d szignált kapott"
+
+#~ msgid "stdin"
+#~ msgstr "szabványos bemenet"
+
+#~ msgid "stdout"
+#~ msgstr "szabványos kimenet"
+
+#~ msgid "stderr"
+#~ msgstr "szabványos hibakimenet"
+
+#~ msgid "unknown stream"
+#~ msgstr "ismeretlen adatfolyam"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "%s újranyitása %s móddal meghiúsult"
+
+#, c-format
+#~ msgid "string comparison failed"
+#~ msgstr "karakterlánc-összehasonlítás sikertelen"
+
+#, c-format
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr ""
+#~ "Állítsa be az LC_ALL='C' környezeti változót a probléma megkerüléséhez."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Az összehasonlított karakterláncok: %s és %s."
+
+#, c-format
+#~ msgid "cannot perform formatted output"
+#~ msgstr "nem lehet végrehajtani formázott kimenetet"
+
+#, c-format
+#~ msgid "invalid %s%s argument `%s'"
+#~ msgstr "érvénytelen %s%s argumentum: „%s”"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument `%s'"
+#~ msgstr "érvénytelen utótag a(z) %s%s argumentumban: „%s”"
+
+#, c-format
+#~ msgid "%s%s argument `%s' too large"
+#~ msgstr "%s%s: a(z) „%s” argumentum túl nagy"
diff --git a/gl/po/insert-header.sin b/gl/po/insert-header.sin
new file mode 100644
index 0000000..b26de01
--- /dev/null
+++ b/gl/po/insert-header.sin
@@ -0,0 +1,23 @@
+# Sed script that inserts the file called HEADER before the header entry.
+#
+# At each occurrence of a line starting with "msgid ", we execute the following
+# commands. At the first occurrence, insert the file. At the following
+# occurrences, do nothing. The distinction between the first and the following
+# occurrences is achieved by looking at the hold space.
+/^msgid /{
+x
+# Test if the hold space is empty.
+s/m/m/
+ta
+# Yes it was empty. First occurrence. Read the file.
+r HEADER
+# Output the file's contents by reading the next line. But don't lose the
+# current line while doing this.
+g
+N
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
diff --git a/gl/po/it.gmo b/gl/po/it.gmo
new file mode 100644
index 0000000..3fe7c74
--- /dev/null
+++ b/gl/po/it.gmo
Binary files differ
diff --git a/gl/po/it.po b/gl/po/it.po
new file mode 100644
index 0000000..fe5cc28
--- /dev/null
+++ b/gl/po/it.po
@@ -0,0 +1,1011 @@
+# Italian translation of gnulib
+# Copyright (C) 2008, 2009, 2010, 2011, 2019 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+# Marco d'Itri <md@linux.it>, 1998, 1999.
+# Giovanni Bortolozzo <borto@dei.unipd.it>, 1998.
+# Milo Casagrande <milo@milo.name>, 2008, 2009, 2010, 2011, 2019.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib-4.0.0.2567\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2019-05-21 14:07+0200\n"
+"Last-Translator: Milo Casagrande <milo@milo.name>\n"
+"Language-Team: Italian <tp@lists.linux.it>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Poedit 2.2.1\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: il valore %s è minore o uguale a %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: il parametro ARGP_HELP_FMT richiede un valore"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: parametro ARGP_HELP_FMT sconosciuto"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Spazzatura in ARGP_HELP_FMT: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Gli argomenti obbligatori o facoltativi per le opzioni estese lo sono anche "
+"per le corrispondenti opzioni brevi."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Uso:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " o: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [OPZIONE...]"
+
+#: gl/lib/argp-help.c:1783
+#, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Provare «%s --help» o «%s --usage» per ulteriori informazioni.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "Segnalare i bug a %s.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Errore di sistema sconosciuto"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "Mostra questo aiuto"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "Mostra un breve messaggio sull'uso"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "NOME"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "Imposta il nome del programma"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "SEC"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "Resta in attesa per SEC secondi (predefinito 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "Stampa la versione del programma"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(ERRORE DEL PROGRAMMA) Nessuna versione conosciuta."
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: troppi argomenti\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(ERRORE DEL PROGRAMMA) L'opzione dovrebbe essere stata riconosciuta."
+
+#: gl/lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: l'opzione «%s%s» è ambigua\n"
+
+#: gl/lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: l'opzione «%s%s» è ambigua. Possibilità:"
+
+#: gl/lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: opzione «%s%s» non riconosciuta\n"
+
+#: gl/lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: l'opzione «%s%s» non accetta un argomento\n"
+
+#: gl/lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: l'opzione «%s%s» richiede un argomento\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: opzione non valida -- %c\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: l'opzione richiede un argomento -- %c\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "impossibile registrare la directory di lavoro corrente"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "ritorno alla directory di lavoro iniziale non riuscito"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Successo"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Nessuna corrispondenza"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Espressione regolare non valida"
+
+# (ndt) http://en.wikipedia.org/wiki/Collation
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Carattere di collazione non valido"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Nome classe del carattere non valida"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Backslash finale"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Riferimento all'indietro non valido"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[, [^, [:, [. o [= senza corrispondenza"
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "( o \\( senza corrispondenza"
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "\\{ senza corrispondenza"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "Contenuto di \\{\\} non valido"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Fine dell'intervallo non valida"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Memoria esaurita"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Espressione regolare precedente non valida"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Fine prematura dell'espressione regolare"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "Espressione regolare troppo grande"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ") o \\) senza corrispondenza"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Nessuna espressione regolare precedente"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "impossibile visualizzare il messaggio di errore"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memoria esaurita"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr "descrittori file standard"
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "argomento %s non valido per %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "argomento %s ambiguo per %s"
+
+#~ msgid "Valid arguments are:"
+#~ msgstr "Sono argomenti validi:"
+
+#, c-format
+#~ msgid "%u bitset_allocs, %u freed (%.2f%%).\n"
+#~ msgstr "%u bitset_allocs, %u liberati (%.2f%%).\n"
+
+#, c-format
+#~ msgid "%u bitset_sets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_sets, %u nella cache (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_resets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_resets, %u nella cache (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_tests, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_tests, %u nella cache (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_lists\n"
+#~ msgstr "%u bitset_lists\n"
+
+#~ msgid "count log histogram\n"
+#~ msgstr "istogramma registro del conteggio\n"
+
+#~ msgid "size log histogram\n"
+#~ msgstr "istogramma registro delle dimensioni\n"
+
+#~ msgid "density histogram\n"
+#~ msgstr "istogramma densità\n"
+
+#, c-format
+#~ msgid ""
+#~ "Bitset statistics:\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Statistiche bitset:\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Accumulated runs = %u\n"
+#~ msgstr "Esecuzioni accumulate = %u\n"
+
+#~ msgid "cannot read stats file"
+#~ msgstr "impossibile leggere il file delle statistiche"
+
+#, c-format
+#~ msgid "bad stats file size\n"
+#~ msgstr "dimensione file delle statistiche errata\n"
+
+#~ msgid "cannot write stats file"
+#~ msgstr "impossibile scrivere il file delle statistiche"
+
+#~ msgid "cannot open stats file for writing"
+#~ msgstr "impossibile aprire il file delle statistiche in scrittura"
+
+#~ msgid "program error"
+#~ msgstr "errore del programma"
+
+#~ msgid "stack overflow"
+#~ msgstr "overflow dello stack"
+
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr ""
+#~ "impossibile trovare una directory temporanea, provare a impostare $TMPDIR"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "impossibile creare una directory temporanea usando il modello «%s»"
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "impossibile rimuovere il file temporaneo %s"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "impossibile rimuovere la directory temporanea %s"
+
+#~ msgid "error closing file"
+#~ msgstr "errore nel chiudere il file"
+
+#~ msgid "write error"
+#~ msgstr "errore di scrittura"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "preservazione dei permessi per %s"
+
+#, c-format
+#~ msgid "error while opening %s for reading"
+#~ msgstr "errore nell'aprire %s in lettura"
+
+#, c-format
+#~ msgid "cannot open backup file %s for writing"
+#~ msgstr "impossibile aprire il file di backup %s in scrittura"
+
+#, c-format
+#~ msgid "error reading %s"
+#~ msgstr "errore nel leggere %s"
+
+#, c-format
+#~ msgid "error writing %s"
+#~ msgstr "errore nello scrivere %s"
+
+#, c-format
+#~ msgid "error after reading %s"
+#~ msgstr "errore dopo la lettura di %s"
+
+#~ msgid "fdopen() failed"
+#~ msgstr "fdopen() non riuscita"
+
+#~ msgid "C# compiler not found, try installing mono"
+#~ msgstr "compilatore C# non trovato, provare a installare mono"
+
+#~ msgid "C# virtual machine not found, try installing mono"
+#~ msgstr "macchina virtuale C# non trovata, provare a installare mono"
+
+#~ msgid "unbalanced ["
+#~ msgstr "[ non bilanciata"
+
+#~ msgid "invalid character class"
+#~ msgstr "classe carattere non valida"
+
+#~ msgid "character class syntax is [[:space:]], not [:space:]"
+#~ msgstr "la sintassi per la classe carattere è [[:space:]], non [:space:]"
+
+#~ msgid "unfinished \\ escape"
+#~ msgstr "escape \\ incompleto"
+
+#~ msgid "invalid content of \\{\\}"
+#~ msgstr "contenuto di \\{\\} non valido"
+
+#~ msgid "regular expression too big"
+#~ msgstr "espressione regolare troppo grande"
+
+#~ msgid "unbalanced ("
+#~ msgstr "( non bilanciata"
+
+#~ msgid "no syntax specified"
+#~ msgstr "nessuna sintassi specificata"
+
+#~ msgid "unbalanced )"
+#~ msgstr ") non bilanciata"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s: sottoprocesso non riuscito"
+
+#~ msgid "regular empty file"
+#~ msgstr "file normale vuoto"
+
+#~ msgid "regular file"
+#~ msgstr "file normale"
+
+#~ msgid "directory"
+#~ msgstr "directory"
+
+#~ msgid "symbolic link"
+#~ msgstr "collegamento simbolico"
+
+#~ msgid "message queue"
+#~ msgstr "coda di messaggi"
+
+#~ msgid "semaphore"
+#~ msgstr "semaforo"
+
+#~ msgid "shared memory object"
+#~ msgstr "oggetto di memoria condivisa"
+
+# (ndt) sono accettati:
+# - suggerimenti
+# - collegamenti dove si spieghi cosa sia un 'typed memory object'
+# Ma dove si spieghi VERAMENTE e CONCRETAMENTE cos'è.
+#~ msgid "typed memory object"
+#~ msgstr "oggetto di memoria con nome"
+
+#~ msgid "block special file"
+#~ msgstr "file speciale a blocchi"
+
+#~ msgid "character special file"
+#~ msgstr "file speciale a caratteri"
+
+#~ msgid "contiguous data"
+#~ msgstr "dati contigui"
+
+#~ msgid "fifo"
+#~ msgstr "fifo"
+
+#~ msgid "door"
+#~ msgstr "door"
+
+#~ msgid "multiplexed block special file"
+#~ msgstr "file speciale a blocchi multiplex"
+
+#~ msgid "multiplexed character special file"
+#~ msgstr "file speciale a caratteri multiplex"
+
+#~ msgid "multiplexed file"
+#~ msgstr "file multiplex"
+
+#~ msgid "named file"
+#~ msgstr "file con nome"
+
+#~ msgid "network special file"
+#~ msgstr "file speciale di rete"
+
+#~ msgid "migrated file with data"
+#~ msgstr "file migrato con dati"
+
+#~ msgid "migrated file without data"
+#~ msgstr "file migrato senza dati"
+
+#~ msgid "port"
+#~ msgstr "porta"
+
+#~ msgid "socket"
+#~ msgstr "socket"
+
+#~ msgid "whiteout"
+#~ msgstr "whiteout"
+
+#~ msgid "weird file"
+#~ msgstr "file strano"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Famiglia di indirizzi per il nome host non supportata"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Errore temporaneo nella risoluzione del nome"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Valore per ai_flags errato"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Errore irreversibile nella risoluzione del nome"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "ai_family non supportato"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Allocazione memoria non riuscita"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "Nessun indirizzo associato col nome host"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Nome o servizio sconosciuto"
+
+# (ndt)
+#
+# define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "Nome servizio non supportato per ai_socktype"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "ai_socktype non supportato"
+
+#~ msgid "System error"
+#~ msgstr "Errore di sistema"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "Buffer argomento troppo piccolo"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Elaborazione richiesta in corso"
+
+#~ msgid "Request canceled"
+#~ msgstr "Richiesta annullata"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Richiesta non annullata"
+
+#~ msgid "All requests done"
+#~ msgstr "Tutte le richieste completate"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Interrotto da un segnale"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "Stringa del parametro non codificata correttamente"
+
+#~ msgid "Unknown error"
+#~ msgstr "Errore sconosciuto"
+
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "argomento source_version in compile_java_class non valido"
+
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "argomento target_version in compile_java_class non valido"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "creazione di \"%s\" non riuscita"
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "errore durante la scrittura del file \"%s\""
+
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr ""
+#~ "compilatore Java non trovato, provare a installare gcj o impostare $JAVAC"
+
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "macchina virtuale Java non trovato, provare a installare gij o impostare "
+#~ "$JAVA"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "errore di I/O nel sottoprocesso %s"
+
+#, c-format
+#~ msgid "cannot stat %s"
+#~ msgstr "impossibile eseguire stat di %s"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "impossibile cambiare i permessi di %s"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "impossibile creare la directory %s"
+
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Apertura di /dev/zero in lettura non riuscita"
+
+#~ msgid "creation of reading thread failed"
+#~ msgstr "creazione del thread di lettura non riuscita"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "impossibile impostare I/O non bloccante sul sottoprocesso di %s"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "comunicazione col sottoprocesso di %s non riuscita"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "scrittura sul sottoprocesso di %s non riuscita"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "lettura dal sottoprocesso di %s non riuscita"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "sottoprocesso %s terminato con codice d'uscita %d"
+
+#~ msgid "creation of threads failed"
+#~ msgstr "creazione dei thread non riuscita"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "sottoprocesso di %s terminato con codice d'uscita %d"
+
+#~ msgid "`"
+#~ msgstr "«"
+
+#~ msgid "'"
+#~ msgstr "»"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[sSyY]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "impostazione dei permessi per %s"
+
+# (ndt) ho preferito mettere tra parentesi il vero nome della costante del segnale, sono cose abbastanza tecniche e forse con un riferimento reale più comprensibili
+#
+# http://en.wikipedia.org/wiki/SIGHUP
+#~ msgid "Hangup"
+#~ msgstr "Chiusura"
+
+# http://en.wikipedia.org/wiki/SIGINT_(POSIX)
+#~ msgid "Interrupt"
+#~ msgstr "Interruzione"
+
+# http://en.wikipedia.org/wiki/SIGQUIT
+#~ msgid "Quit"
+#~ msgstr "Uscita (con core dump)"
+
+# http://en.wikipedia.org/wiki/SIGILL
+#~ msgid "Illegal instruction"
+#~ msgstr "Istruzione non consentita"
+
+# http://en.wikipedia.org/wiki/Trap_(computing)
+# http://en.wikipedia.org/wiki/SIGTRAP
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Rilevato trace/breakpoint"
+
+# http://en.wikipedia.org/wiki/SIGABRT
+#~ msgid "Aborted"
+#~ msgstr "Annullato"
+
+# http://en.wikipedia.org/wiki/SIGFPE
+#~ msgid "Floating point exception"
+#~ msgstr "Eccezione in virgola mobile"
+
+#~ msgid "Killed"
+#~ msgstr "Ucciso"
+
+# http://en.wikipedia.org/wiki/Bus_error
+# http://en.wikipedia.org/wiki/SIGBUS
+#~ msgid "Bus error"
+#~ msgstr "Errore di bus"
+
+# http://en.wikipedia.org/wiki/Segmentation_fault
+# http://en.wikipedia.org/wiki/SIGSEGV
+#~ msgid "Segmentation fault"
+#~ msgstr "Errore di segmentazione"
+
+# http://en.wikipedia.org/wiki/SIGPIPE
+#~ msgid "Broken pipe"
+#~ msgstr "Pipe interrotta"
+
+# (ndt) non so se convenga lasciarlo invariato... ma forse anche le altre...
+# http://en.wikipedia.org/wiki/SIGALRM
+#~ msgid "Alarm clock"
+#~ msgstr "Sveglia"
+
+# http://en.wikipedia.org/wiki/SIGTERM
+#~ msgid "Terminated"
+#~ msgstr "Terminato"
+
+# http://en.wikipedia.org/wiki/SIGURG
+#~ msgid "Urgent I/O condition"
+#~ msgstr "Condizione di I/O urgente"
+
+# http://en.wikipedia.org/wiki/SIGSTOP
+#~ msgid "Stopped (signal)"
+#~ msgstr "Fermato"
+
+# http://en.wikipedia.org/wiki/SIGTSTP
+#~ msgid "Stopped"
+#~ msgstr "Fermato (da terminale)"
+
+# http://en.wikipedia.org/wiki/SIGCONT
+#~ msgid "Continued"
+#~ msgstr "Continuato"
+
+# http://en.wikipedia.org/wiki/SIGCHLD
+#~ msgid "Child exited"
+#~ msgstr "Processo figlio uscito"
+
+# http://en.wikipedia.org/wiki/SIGTTIN
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Fermato per input tty"
+
+# http://en.wikipedia.org/wiki/SIGTTOU
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Fermato per output tty"
+
+# (ndt) questa pare non sia posix, wikipedia riporta la stessa di SIGABRT
+#~ msgid "I/O possible"
+#~ msgstr "I/O consentito"
+
+# http://en.wikipedia.org/wiki/SIGXCPU
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "Superato il limite di tempo CPU"
+
+# http://en.wikipedia.org/wiki/SIGXFSZ
+#~ msgid "File size limit exceeded"
+#~ msgstr "Superato il limite di dimensione file"
+
+# http://en.wikipedia.org/wiki/SIGVTALRM
+#~ msgid "Virtual timer expired"
+#~ msgstr "Timer virtuale terminato"
+
+# http://en.wikipedia.org/wiki/SIGPROF
+#~ msgid "Profiling timer expired"
+#~ msgstr "Timer di profiling terminato"
+
+# http://en.wikipedia.org/wiki/SIGWINCH
+#~ msgid "Window changed"
+#~ msgstr "Finestra modificata"
+
+# http://en.wikipedia.org/wiki/SIGUSR1
+#~ msgid "User defined signal 1"
+#~ msgstr "Segnale 1 definito dall'utente"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Segnale 2 definito dall'utente"
+
+# http://en.wikipedia.org/wiki/SIGEMT
+#~ msgid "EMT trap"
+#~ msgstr "Rilevato EMT"
+
+# http://en.wikipedia.org/wiki/SIGSYS
+#~ msgid "Bad system call"
+#~ msgstr "Chiamata di sistema errata"
+
+# http://en.wikipedia.org/wiki/SIGSTKFLT
+#~ msgid "Stack fault"
+#~ msgstr "Errore sullo stack"
+
+# http://en.wikipedia.org/wiki/SIGINFO
+#~ msgid "Information request"
+#~ msgstr "Richiesta informazioni"
+
+# http://en.wikipedia.org/wiki/SIGPWR
+#~ msgid "Power failure"
+#~ msgstr "Mancanza alimentazione elettrica"
+
+# http://en.wikipedia.org/wiki/SIGLOST
+#~ msgid "Resource lost"
+#~ msgstr "Risorsa persa"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "errore nello scrivere su una pipe o un socket chiusi"
+
+#~ msgid "cannot create pipe"
+#~ msgstr "impossibile creare la pipe"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "Segnale real-time %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Segnale %d sconosciuto"
+
+#~ msgid "Execution times (seconds)"
+#~ msgstr "Tempi di esecuzione (secondi)"
+
+#~ msgid "CPU user"
+#~ msgstr "CPU utente"
+
+#~ msgid "CPU system"
+#~ msgstr "CPU sistema"
+
+#~ msgid "wall clock"
+#~ msgstr "tempo reale"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "funzione iconv non utilizzabile"
+
+#~ msgid "iconv function not available"
+#~ msgstr "funzione iconv non disponibile"
+
+#~ msgid "character out of range"
+#~ msgstr "carattere fuori dall'intervallo"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "impossibile convertire U+%04X nel set di caratteri locale"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "impossibile convertire U+%04X nel set di caratteri locale: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "utente non valido"
+
+#~ msgid "invalid group"
+#~ msgstr "gruppo non valido"
+
+# (ndt) evinta da un commento al codice:
+#
+# /* Set U and G to nonzero length strings corresponding to user and
+# group specifiers or to NULL. If U is not NULL, it is a newly
+# allocated string. */
+#
+#~ msgid "invalid spec"
+#~ msgstr "specificatore non valido"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "Pacchetto creato da %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "Pacchetto creato da %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "©"
+
+#, c-format
+#~ msgid ""
+#~ "License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ msgstr ""
+#~ "Licenza GPLv3+: GNU GPL versione 3 o successiva <%s>.\n"
+#~ "Questo programma è software libero: siete liberi di modificarlo e "
+#~ "ridistribuirlo.\n"
+#~ "Non c'è ALCUNA GARANZIA, per quanto consentito dalle vigenti normative.\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Scritto da %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Scritto da %s e %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Scritto da %s, %s e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Scritto da %s, %s, %s\n"
+#~ "e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Scritto da %s, %s, %s,\n"
+#~ "%s e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Scritto da %s, %s, %s,\n"
+#~ "%s, %s e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Scritto da %s, %s, %s,\n"
+#~ "%s, %s, %s e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Scritto da %s, %s, %s,\n"
+#~ "%s, %s, %s, %s\n"
+#~ "e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Scritto da %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Scritto da %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s e altri.\n"
+
+#, c-format
+#~ msgid "Report bugs to: %s\n"
+#~ msgstr ""
+#~ "Segnalare i bug a: %s\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "Segnalare i bug di %s a: %s.\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "Sito web di %s: <%s>\n"
+
+#, c-format
+#~ msgid "General help using GNU software: <%s>\n"
+#~ msgstr "Aiuto per l'utilizzo di software GNU: <%s>\n"
+
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "_open_osfhandle non riuscita"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "impossibile ripristinare fd %d: dup2 non riuscita"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "sottoprocesso %s"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "il sottoprocesso %s ha ricevuto un segnale %d fatale"
+
+#~ msgid "failed to set file descriptor text/binary mode"
+#~ msgstr ""
+#~ "impostazione del descrittore file in modalità testo/binario non riuscita"
+
+#~ msgid "stdin"
+#~ msgstr "stdin"
+
+#~ msgid "stdout"
+#~ msgstr "stdout"
+
+#~ msgid "stderr"
+#~ msgstr "stderr"
+
+#~ msgid "unknown stream"
+#~ msgstr "stream sconosciuto"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "riapertura di %s in modalità %s non riuscita"
+
+#~ msgid "string comparison failed"
+#~ msgstr "confronto delle stringhe non riuscito"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Impostare LC_ALL='C' per aggirare il problema."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Le stringhe confrontate erano %s e %s."
+
+#~ msgid "cannot perform formatted output"
+#~ msgstr "impossibile mostrare l'output formattato"
+
+# (ndt)
+# quello che viene sostituito pare sia:
+# * il primo, hypens (con valore '--')
+# * il secondo, option
+# * il terzo, arg
+# quindi qualche cosa del genere:
+# invalid --option argument 'arg'
+#
+# (altre idee sono benvenute!)
+#, c-format
+#~ msgid "invalid %s%s argument '%s'"
+#~ msgstr "l'argomento «%3$s» di %1$s%2$s non è valido"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument '%s'"
+#~ msgstr "il suffisso nell'argomento «%3$s» di %1$s%2$s non è valido"
+
+#, c-format
+#~ msgid "%s%s argument '%s' too large"
+#~ msgstr "l'argomento «%3$s» di %1$s%2$s è troppo grande"
diff --git a/gl/po/ja.gmo b/gl/po/ja.gmo
new file mode 100644
index 0000000..aa9b893
--- /dev/null
+++ b/gl/po/ja.gmo
Binary files differ
diff --git a/gl/po/ja.po b/gl/po/ja.po
new file mode 100644
index 0000000..04ae2c8
--- /dev/null
+++ b/gl/po/ja.po
@@ -0,0 +1,906 @@
+# Japanese gnulib messages
+# Copyright (C) 2000, 2010 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+# Masahito Yamaga <yamaga@ipc.chiba-u.ac.jp>, 2002.
+# GOTO Masanori <gotom@debian.or.jp>, 2006.
+# derived from the version by Yasuyuki Furukawa <yasu@on.cs.keio.ac.jp> 1998.
+# Jun Nishii <jun@flatout.org> 1999.
+# Daisuke Yamashita <yamad@mb.infoweb.ne.jp> 1999.
+# Yasuaki Taniguchi <yasuakit@gmail.com>, 2010, 2011.
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 3.0.0.6062.a6b16\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2011-09-02 18:39+0900\n"
+"Last-Translator: Yasuaki Taniguchi <yasuakit@gmail.com>\n"
+"Language-Team: Japanese <translation-team-ja@lists.sourceforge.net>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: %s の値は %s の値以下です"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: ARGP_HELP_FMT パラメータには値が必要です"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: 不明な ARGP_HELP_FMT パラメータ"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "ARGP_HELP_FMT 中にごみがあります: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"長い形式のオプションで必須または任意の引数は、それに対応する短い形式のオプ"
+"ションでも同様に必須または任意です。"
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "使用法:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr "または: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [OPTION...]"
+
+#: gl/lib/argp-help.c:1783
+#, fuzzy, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "詳細は `%s --help' または `%s --usage' を実行して下さい。\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr ""
+"バグを発見したら <%s> に報告して下さい。\n"
+"翻訳に関するバグは<translation-team-ja@lists.sourceforge.net>に報告してくださ"
+"い。\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "不明なシステムエラー"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "このヘルプを表示する"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "短い使用方法を表示する"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "名前"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "プログラム名を設定する"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "SECS"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "SECS 秒でハング (デフォルト 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "プログラムのバージョンを表示する"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(プログラムエラー) 不明なバージョン!?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: 引数が多すぎます\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(プログラムエラー) オプションは認識されているべきです!?"
+
+#: gl/lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: オプション '-W %s' は曖昧です\n"
+
+#: gl/lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: オプション '%s' は曖昧です:次のものが可能です:"
+
+#: gl/lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: オプション '%c%s' を認識できません\n"
+
+#: gl/lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: オプション '%c%s' は引数を取ることができません\n"
+
+#: gl/lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: オプション '--%s' は引数が必要です\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: 無効なオプション -- '%c'\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: オプションには引数が必要です -- '%c'\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "現在の作業ディレクトリを記録することができません"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "初期作業ディレクトリに戻るのに失敗しました"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "成功です"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "一致しません"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "無効な正規表現です"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "無効な照合文字です"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "無効な文字クラス名です"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "終端のバックスラッシュ"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "無効な前方参照です"
+
+#: gl/lib/regcomp.c:143
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[ または [^ が不一致です"
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "( または \\( が不一致です"
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "\\{ が不一致です"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "\\{\\} の中身が無効です"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "無効な範囲終了です"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "メモリを使い果たしました"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "無効な前方正規表現です"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "正規表現が途中で終了しました"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "正規表現が大きすぎます"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ") または \\) が不一致です"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "以前に正規表現がありません"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "エラーメッセージを表示できません"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "メモリを使い果たしました"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "%2$s に対する引数 %1$s が間違っています"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "%2$s に対する引数 %1$s が曖昧です"
+
+#, c-format
+#~ msgid "Valid arguments are:"
+#~ msgstr "有効な引数:"
+
+#, c-format
+#~ msgid "%.*s: ARGP_HELP_FMT parameter must be positive"
+#~ msgstr "%.*s: ARGP_HELP_FMT パラメータは正の値でなければいけません"
+
+#~ msgid "program error"
+#~ msgstr "プログラムエラー"
+
+#~ msgid "stack overflow"
+#~ msgstr "スタックオーバーフロー"
+
+#, c-format
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr "一時ディレクトリを作成できません。 $TMPDIR を設定してみてください"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "テンプレート \"%s\" を使用した一時ディレクトリを作成できません"
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "一時ファイル %s を削除できません"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "一時ディレクトリ %s を削除できません"
+
+#~ msgid "error closing file"
+#~ msgstr "ファイルクローズエラー"
+
+#~ msgid "write error"
+#~ msgstr "書き込みエラー"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "%s のパーミッションを保存しています"
+
+#, c-format
+#~ msgid "error while opening \"%s\" for reading"
+#~ msgstr "\"%s\"を読込むため開いている際にエラーが発生しました"
+
+#, c-format
+#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgstr "書込み用バックアップファイル\"%s\"を開くことができません"
+
+#, c-format
+#~ msgid "error reading \"%s\""
+#~ msgstr "\"%s\"の読込み中にエラーが発生しました"
+
+#, c-format
+#~ msgid "error writing \"%s\""
+#~ msgstr "\"%s\"の書込み中にエラーが発生しました"
+
+#, c-format
+#~ msgid "error after reading \"%s\""
+#~ msgstr "\"%s\"の読込み後にエラーが発生しました"
+
+#, c-format
+#~ msgid "fdopen() failed"
+#~ msgstr "fdopen()に失敗しました"
+
+#, c-format
+#~ msgid "C# compiler not found, try installing pnet"
+#~ msgstr "C# コンパイラが見つりません。pnet をインストールしてみてください"
+
+#, c-format
+#~ msgid "C# virtual machine not found, try installing pnet"
+#~ msgstr "C# 仮想マシンが見つかりません。pnet をインストールしてみてください"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s サブプロセスが失敗しました"
+
+#~ msgid "regular empty file"
+#~ msgstr "通常の空ファイル"
+
+#~ msgid "regular file"
+#~ msgstr "通常ファイル"
+
+#~ msgid "directory"
+#~ msgstr "ディレクトリ"
+
+#~ msgid "block special file"
+#~ msgstr "ブロックスペシャルファイル"
+
+#~ msgid "character special file"
+#~ msgstr "キャラクタスペシャルファイル"
+
+#~ msgid "fifo"
+#~ msgstr "fifo"
+
+#~ msgid "symbolic link"
+#~ msgstr "シンボリックリンク"
+
+#~ msgid "socket"
+#~ msgstr "ソケット"
+
+#~ msgid "message queue"
+#~ msgstr "メッセージキュー"
+
+#~ msgid "semaphore"
+#~ msgstr "セマフォ"
+
+#~ msgid "shared memory object"
+#~ msgstr "共有メモリオブジェクト"
+
+#~ msgid "typed memory object"
+#~ msgstr "型付メモリオブジェクト"
+
+#~ msgid "weird file"
+#~ msgstr "不明なファイル"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "ホスト名に対する Address family がサポートされていません"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "名前解決に一時的に失敗しました"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "ai_flags に対する誤った値です"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "名前解決でリカバリできない失敗が発生しました"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "ai_family はサポートされていません"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "メモリ配置に失敗しました"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "ホスト名にアドレスが割り当てられていません"
+
+#~ msgid "Name or service not known"
+#~ msgstr "名前またはサービスが不明です"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "ai_socktype に対して Servname がサポートされていません"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "ai_socktype はサポートされていません"
+
+#~ msgid "System error"
+#~ msgstr "システムエラー"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "引数バッファが小さすぎます"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "要求された処理は実行中です"
+
+#~ msgid "Request canceled"
+#~ msgstr "要求がキャンセルされました"
+
+#~ msgid "Request not canceled"
+#~ msgstr "要求がキャンセルされませんでした"
+
+#~ msgid "All requests done"
+#~ msgstr "すべての要求が完了しました"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "シグナル割り込みが発生しました"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "パラメーター文字列が正しくエンコードされていません"
+
+#~ msgid "Unknown error"
+#~ msgstr "不明なエラー"
+
+#, c-format
+#~ msgid "%s: option '--%s' doesn't allow an argument\n"
+#~ msgstr "%s: オプション '--%s' は引数を取ることができません\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option '--%s'\n"
+#~ msgstr "%s: オプション '--%s' を認識できません\n"
+
+#, c-format
+#~ msgid "%s: option '-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: オプション '-W %s' は引数を取ることができません\n"
+
+#, c-format
+#~ msgid "%s: option '-W %s' requires an argument\n"
+#~ msgstr "%s: オプション '-W %s' は引数が必要です\n"
+
+#, c-format
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "compile_java_class への source_version 引数が無効です"
+
+#, c-format
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "compile_java_class への target_version 引数が無効です"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "\"%s\" の作成に失敗しました"
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "\"%s\" ファイルの書き込み中にエラーが発生しました"
+
+#, c-format
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr ""
+#~ "Java コンパイラが見つかりません。 gcj をインストールするか、または $JAVAC "
+#~ "を設定してみてください"
+
+#, c-format
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "Java 仮想マシンが見つかりません。 gij をインストールするか、または $JAVA "
+#~ "を設定してみてください"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "%s サブプロセス I/O エラー"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "%s のパーミッションを変更できません"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "ディレクトリ %s を作成できません"
+
+#, c-format
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "/dev/zeroを読込み用に開けません"
+
+#, c-format
+#~ msgid "creation of reading thread failed"
+#~ msgstr "読み込みスレッドの作成に失敗しました"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "%s 子プロセスへ非ブロック I/O を設定できません"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "%s 子プロセスとの通信に失敗しました"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "%s 子プロセスへの書き込みに失敗しました"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "%s 子プロセスからの読み込みに失敗しました"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "子プロセス %s が終了コード %d で終了しました"
+
+#, c-format
+#~ msgid "creation of threads failed"
+#~ msgstr "スレッドの作成に失敗しました"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "%s 子プロセスが終了コード %d で終了しました"
+
+#~ msgid "Franc,ois Pinard"
+#~ msgstr "Franc,ois Pinard"
+
+#~ msgid "`"
+#~ msgstr "`"
+
+#~ msgid "'"
+#~ msgstr "'"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[yY]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "%s のパーミッションを設定します"
+
+#~ msgid "Hangup"
+#~ msgstr "Hangup"
+
+#~ msgid "Interrupt"
+#~ msgstr "割り込み"
+
+#~ msgid "Quit"
+#~ msgstr "終了"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "Illegal instruction"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Trace/breakpoint trap"
+
+#~ msgid "Aborted"
+#~ msgstr "中止"
+
+#~ msgid "Floating point exception"
+#~ msgstr "浮動小数点例外"
+
+#~ msgid "Killed"
+#~ msgstr "強制終了"
+
+#~ msgid "Bus error"
+#~ msgstr "バスエラー"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "Segmentation fault"
+
+#~ msgid "Broken pipe"
+#~ msgstr "Broken pipe"
+
+#~ msgid "Alarm clock"
+#~ msgstr "Alarm clock"
+
+#~ msgid "Terminated"
+#~ msgstr "Terminated"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "緊急 I/O 状態"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "停止 (シグナル)"
+
+#~ msgid "Stopped"
+#~ msgstr "停止"
+
+#~ msgid "Continued"
+#~ msgstr "継続"
+
+#~ msgid "Child exited"
+#~ msgstr "子プロセス終了"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "停止 (tty 入力)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "停止 (tty 出力)"
+
+#~ msgid "I/O possible"
+#~ msgstr "I/O 可能"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "CPU時間制限を超過しました"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "ファイルサイズ制限を超過しました"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "仮想タイマーが終了しました"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "プロファイリングタイマーが終了しました"
+
+#~ msgid "Window changed"
+#~ msgstr "Window が変更されました"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "ユーザー定義シグナル1"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "ユーザー定義シグナル2"
+
+#~ msgid "EMT trap"
+#~ msgstr "EMT トラップ"
+
+#~ msgid "Bad system call"
+#~ msgstr "間違ったシステムコール"
+
+#~ msgid "Stack fault"
+#~ msgstr "スタックエラー"
+
+#~ msgid "Information request"
+#~ msgstr "情報要求"
+
+#~ msgid "Power failure"
+#~ msgstr "電源エラー"
+
+#~ msgid "Resource lost"
+#~ msgstr "リソースが無くなりました"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "閉じたパイプまたはソケットへの書き込みでエラーが発生しました"
+
+#, c-format
+#~ msgid "cannot create pipe"
+#~ msgstr "パイプを作成できません"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "リアルタイムシグナル %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "不明なシグナル %d"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "iconv 関数が使えません"
+
+#~ msgid "iconv function not available"
+#~ msgstr "iconv 関数が有効ではありません"
+
+#~ msgid "character out of range"
+#~ msgstr "範囲外の文字"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "U+%04X をローカル文字セットに変換できません"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "U+%04X をローカル文字セットに変換できません: %s "
+
+#~ msgid "invalid user"
+#~ msgstr "無効なユーザ"
+
+#~ msgid "invalid group"
+#~ msgstr "無効なグループ"
+
+#~ msgid "invalid spec"
+#~ msgstr "無効な指定"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "パッケージ作成者: %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "パッケージ作成者: %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "(C)"
+
+#~ msgid ""
+#~ "\n"
+#~ "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl."
+#~ "html>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "\n"
+#~ "ライセンス GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/"
+#~ "gpl.html>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "作者 %s。\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "作者 %s および %s。\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "作者 %s、 %s、および %s。\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "作者 %s、 %s、 %s、\n"
+#~ "および %s。\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "作者 %s、 %s、 %s、\n"
+#~ "%s、および %s。\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "作者 %s、 %s、 %s、\n"
+#~ "%s、 %s、および %s。\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "作者 %s、 %s、 %s、\n"
+#~ "%s、 %s、 %s、および %s。\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "作者 %s、 %s、 %s、\n"
+#~ "%s、 %s、 %s、 %s、\n"
+#~ "および %s。\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "作者 %s、 %s、 %s、\n"
+#~ "%s、 %s、 %s、 %s、\n"
+#~ "%s、および %s。\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "作者 %s、 %s、 %s、\n"
+#~ "%s、 %s、 %s、 %s、\n"
+#~ "%s、 %s、 および他の方々。\n"
+
+#, c-format
+#~ msgid ""
+#~ "\n"
+#~ "Report bugs to: %s\n"
+#~ msgstr ""
+#~ "\n"
+#~ "バグを発見したら <%s> に報告して下さい。\n"
+#~ "翻訳に関するバグは<translation-team-ja@lists.sourceforge.net>に報告してく"
+#~ "ださい。\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "%s のバグは <%s> に報告してください。\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "%s のホームページ: <%s>\n"
+
+#, c-format
+#~ msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+#~ msgstr "%s のホームページ: <http://www.gnu.org/software/%s/>\n"
+
+#~ msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+#~ msgstr ""
+#~ "GNU ソフトウェアを使用する際の一般的なヘルプ: <http://www.gnu.org/gethelp/"
+#~ ">\n"
+
+#, c-format
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "_open_osfhandle に失敗しました"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "ファイル記述子 (fd) %d をリストアできません: dup2 に失敗しました"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "%s 子プロセス"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "%s 子プロセスが致命的なシグナル %d を受信しました"
+
+#~ msgid "stdin"
+#~ msgstr "標準入力"
+
+#~ msgid "stdout"
+#~ msgstr "標準出力"
+
+#~ msgid "stderr"
+#~ msgstr "標準エラー出力"
+
+#~ msgid "unknown stream"
+#~ msgstr "不明なストリーム"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "%s をモード %s で再度開くことに失敗しました"
+
+#, c-format
+#~ msgid "string comparison failed"
+#~ msgstr "文字列の比較に失敗しました"
+
+#, c-format
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "問題を回避するために LC_ALL='C' を指定してください."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "比較した文字列は %s と %s です."
+
+#, c-format
+#~ msgid "cannot perform formatted output"
+#~ msgstr "書式設定を行った出力を実行することができません"
+
+#, c-format
+#~ msgid "invalid %s%s argument `%s'"
+#~ msgstr "引数 `%3$s' に対して %1$s%2$s が無効です"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument `%s'"
+#~ msgstr "引数 `%3$s' に対して無効な接尾辞 %1$s%2$s です"
+
+#, c-format
+#~ msgid "%s%s argument `%s' too large"
+#~ msgstr "引数 `%3$s' に対する %1$s%2$s が大きすぎます"
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: 不正なオプション -- %c\n"
+
+#~ msgid "block size"
+#~ msgstr "ブロックサイズ"
+
+#~ msgid "%s exists but is not a directory"
+#~ msgstr "%s は存在しますがディレクトリではありません"
+
+#~ msgid "cannot change owner and/or group of %s"
+#~ msgstr "%s のオーナーとグループを変更できません"
+
+#~ msgid "cannot chdir to directory %s"
+#~ msgstr "ディレクトリ %s に移動できません"
+
+#~ msgid "cannot get the login group of a numeric UID"
+#~ msgstr "数字のUIDのログイングループを取得できません"
+
+#~ msgid ""
+#~ "\n"
+#~ "This is free software. You may redistribute copies of it under the terms "
+#~ "of\n"
+#~ "the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "\n"
+#~ "本プログラムはフリーソフトウェアです. GNU一般公有使用許諾\n"
+#~ "<http://www.gnu.org/licenses/gpl.html> で定められた条項の下で本プログラ\n"
+#~ "ムのコピーを再配布できます. 適切な法が認る限りにおいて全くの無保証です.\n"
+#~ "\n"
diff --git a/gl/po/ka.gmo b/gl/po/ka.gmo
new file mode 100644
index 0000000..c2fb4d9
--- /dev/null
+++ b/gl/po/ka.gmo
Binary files differ
diff --git a/gl/po/ka.po b/gl/po/ka.po
new file mode 100644
index 0000000..7cdb92d
--- /dev/null
+++ b/gl/po/ka.po
@@ -0,0 +1,808 @@
+# Georgian translation for gnulib.
+# Copyright (C) 2022 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+# Temuri Doghonadze <temuri.doghonadze@gmail.com>, 2022.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 4.0.0.2567\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2022-12-23 14:32+0100\n"
+"Last-Translator: Temuri Doghonadze <temuri.doghonadze@gmail.com>\n"
+"Language-Team: Georgian <(nothing)>\n"
+"Language: ka\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Poedit 3.2.2\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: %s-ის მნიშვნელობა %s-ზე ნაკლები ან ტოლია"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: ARGP_HELP_FMT საჭიროა პარამეტრის მნიშვნელობა"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: ARGP_HELP_FMT-ის უცნობი პარამეტრი"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "ნაგავი ARGP_HELP_FMT-ში: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"გრძელი პარამეტრების აუცილებელი ან არასავალდებულო არგუმენტები ასევე "
+"აუცილებელი ან არასავალდებულოა მათი მოკლე ვარიანტებისთვისაც."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "გამოყენება:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " ან: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [პარამეტრი..]"
+
+#: gl/lib/argp-help.c:1783
+#, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "მეტი ინფორმაციისთვის სცადეთ '%s --help' ან '%s --usage'.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "შეცდომების შესახებ მიწერეთ: %s\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "სისტემის უცნობი შეცდომა"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "ამ დახმარების სიის მიღება"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "გამოყენების მოკლე შეტყობინების მიღება"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "სახელი"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "პროგრამის სახელის დაყენება"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "წამი"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr ""
+"დაეკიდება მითითებული წამების რაოდენობის განმავლობაში (ნაგულისხმები: 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "პროგრამის ვერსიის დაბეჭდვა"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(PROGRAM ERROR) ვერსია უცნობია!?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: მეტისმეტად ბევრი არგუმენტი\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(PROGRAM ERROR) პარამეტრი ნაცნობი უნდა ყოფილიყო!?"
+
+#: gl/lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: პარამეტრი '%s%s' გაურკვეველია\n"
+
+#: gl/lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: პარამეტრი '%s%s' გაურკვეველია; შესაძლო ვარიანტები:"
+
+#: gl/lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: უცნობი პარამეტრი '%s%s'\n"
+
+#: gl/lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: პარამეტრს \"%s%s' არგუმენტი არ სჭირდება\n"
+
+#: gl/lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: პარამეტრს \"%s%s\" არგუმენტი ესაჭიროება\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: არასწორი პარამეტრი -- '%c'\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: პარამეტრს ესაჭიროება არგუმენტი -- '%c'\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "მიმდინარე საქაღალდის ჩაწერა შეუძლებელია"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "საწყისი საქაღალდის დაბრუნების შეცდომა"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "წარმატება"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "არ ემთხვევა"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "არასწორი რეგულარული გამოსახულება"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "კოლაციის არასწორი სიმბოლო"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "სიმბოლოების არასწორი კლასი"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "ბოლო Backslash"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "არასწორი უკუბმა"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "არ ემთხვევა [, [^, [:, [., ან [="
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "არ ემთხვევა ( ან \\("
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "არ ემთხვევა \\{"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "\\{\\}-ის არასწორი შემცელობა"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "დიაპაზონის არასწორი დასასრული"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "მეხსიერება გადავსებულია"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "რეგულარული გამოსახულების არასწორი საწყისი"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "რეგულარული გამოსახულების მოულოდნელი დასასრული"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "რეგულარული გამოსახულება ძალიან დიდია"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr "არ ემთხვევა ) ან \\)"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "წინა რეგულარული გამოსახულება არ არსებობს"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "შეტყობინების გამოტანა შეუძლებელია"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "მეხსიერება გადავსებულია"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr "ფაილის სტანდარტული დესკტრიპტორები"
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "%s არასწორი არგუმენტია %s-თვის"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "%s გაურკვეველი არგუმენტია %s-თვის"
+
+#~ msgid "Valid arguments are:"
+#~ msgstr "სწორი არგუმენტებია:"
+
+#, c-format
+#~ msgid "%u bitset_allocs, %u freed (%.2f%%).\n"
+#~ msgstr "%u bitset_allocs, %u freed (%.2f%%).\n"
+
+#, c-format
+#~ msgid "%u bitset_sets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_sets, %u cached (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_resets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_resets, %u cached (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_tests, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_tests, %u cached (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_lists\n"
+#~ msgstr "%u bitset_lists\n"
+
+#~ msgid "program error"
+#~ msgstr "პროგრამის შეცდომა"
+
+#~ msgid "stack overflow"
+#~ msgstr "სტეკის გადავსება"
+
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr "დროებითი საქაღალდე ვერ ვიპოვე. სცადეთ $TMPDIR-ის დაყენება"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "შაბლონის გამოყენებით დროებითი საქაღალდის შექმნის შეცდომა: %s"
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "დროებითი ფაილის წაშლის შეცდომა: %s"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "დროებითი საქაღალდის წაშლის შეცდომა: %s"
+
+#~ msgid "error closing file"
+#~ msgstr "ფაილის დახურვის შეცდომა"
+
+#~ msgid "write error"
+#~ msgstr "ჩაწერის შეცდომა"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "%s-ის წვდომების შენახვა"
+
+#, c-format
+#~ msgid "error reading %s"
+#~ msgstr "შეცდომა '%s'-ის კითხვისას"
+
+#, c-format
+#~ msgid "error writing %s"
+#~ msgstr "შეცდომა '%s'-ის ჩაწერისას"
+
+#~ msgid "unbalanced ["
+#~ msgstr "დაუბალანსებელი ["
+
+#~ msgid "invalid character class"
+#~ msgstr "სიმბოლოების არასწორი კლასი"
+
+#~ msgid "character class syntax is [[:space:]], not [:space:]"
+#~ msgstr "სიმბოლოების კლასის სწორი სინტაქსია [[:space:]] და არა [:space:]"
+
+#~ msgid "unfinished \\ escape"
+#~ msgstr "დაუსრულებელი დასრულების სიმბოლო \\"
+
+#~ msgid "invalid content of \\{\\}"
+#~ msgstr "\\{\\}-ის არასწორი შემცველობა"
+
+#~ msgid "regular expression too big"
+#~ msgstr "რეგულარული გამოსახულება ძალიან დიდია"
+
+#~ msgid "unbalanced ("
+#~ msgstr "დაუბალანსებელი ("
+
+#~ msgid "no syntax specified"
+#~ msgstr "სინტაქსი მითითებული არაა"
+
+#~ msgid "unbalanced )"
+#~ msgstr "დაუბალანსებელი )"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s ქვეპროცესის შეცდომა"
+
+#~ msgid "regular empty file"
+#~ msgstr "ჩვეულებრივი ცარიელი ფაილი"
+
+#~ msgid "regular file"
+#~ msgstr "ჩვეულებრივი ფაილი"
+
+#~ msgid "directory"
+#~ msgstr "საქაღალდე"
+
+#~ msgid "symbolic link"
+#~ msgstr "სიმბმული"
+
+#~ msgid "message queue"
+#~ msgstr "შეტყობინებების რიგი"
+
+#~ msgid "semaphore"
+#~ msgstr "სემაფორა"
+
+#~ msgid "shared memory object"
+#~ msgstr "მეხსიერების გაზიარებული ობიექტი"
+
+#~ msgid "typed memory object"
+#~ msgstr "ტიპიზირებული მეხსიერების ობიექტი"
+
+#~ msgid "block special file"
+#~ msgstr "ბლოკური სპეციალური ფაილი"
+
+#~ msgid "character special file"
+#~ msgstr "სიმბოლური სპეციალური ფაილი"
+
+#~ msgid "contiguous data"
+#~ msgstr "განგრძობადი მონაცემები"
+
+#~ msgid "fifo"
+#~ msgstr "fifo"
+
+#~ msgid "door"
+#~ msgstr "კარი"
+
+#~ msgid "multiplexed block special file"
+#~ msgstr "მულტიპლექსირებული ბლოკური სპეციალური ფაილი"
+
+#~ msgid "multiplexed character special file"
+#~ msgstr "მულტიპლექსირებული სიმბოლური სპეციალური ფაილი"
+
+#~ msgid "multiplexed file"
+#~ msgstr "მულტიპლექსლური ფაილი"
+
+#~ msgid "named file"
+#~ msgstr "სახელიანი ფაილი"
+
+#~ msgid "network special file"
+#~ msgstr "ქსელური სპეციალური ფაილი"
+
+#~ msgid "migrated file with data"
+#~ msgstr "მიგრირებული ფაილი მონაცემებით"
+
+#~ msgid "migrated file without data"
+#~ msgstr "მიგრირებული ფაილი მონაცემების გარეშე"
+
+#~ msgid "port"
+#~ msgstr "პორტი"
+
+#~ msgid "socket"
+#~ msgstr "სოკეტი"
+
+#~ msgid "whiteout"
+#~ msgstr "სიცარიელე"
+
+#~ msgid "weird file"
+#~ msgstr "უცნაური ფაილი"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "ამ ჰოსტის მისამართის ტიპი მხარდაუჭერელია"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "სახელის გადაწყვეტის დროებითი შეცდომა"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "არასწორი მნიშვნელობა: ai_flags"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "სახელის გადაწყვეტის აღუდგენელი შეცდომა"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "ai_family მხარდაუჭერელია"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "მეხსიერების გამოყოფის შეცდომა"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "ჰოსტის სახელზე მიბმული არაა"
+
+#~ msgid "Name or service not known"
+#~ msgstr "სახელი ან სერვისი უცნობია"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "Ai_socktype-ის სერვერის სახელი მხარდაუჭერელია"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "ai_socket-ი მხარდაუჭერელია"
+
+#~ msgid "System error"
+#~ msgstr "სისტემური შეცდომა"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "არგუმენტის ბუფერი მეტისმეტად პატარაა"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "მიმდინარეობს მოთხოვნის დამუშავება"
+
+#~ msgid "Request canceled"
+#~ msgstr "მოთხოვნა გაუქმებულია"
+
+#~ msgid "Request not canceled"
+#~ msgstr "მოთხოვნა არ გაუქმებულა"
+
+#~ msgid "All requests done"
+#~ msgstr "ყველა მოთხოვნა მზადაა"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "შეწყვეტილია სიგნალის მიერ"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "პარამეტრის სტრიქონი არასწორადაა კოდირებული"
+
+#~ msgid "Unknown error"
+#~ msgstr "უცნობი შეცდომა"
+
+#, c-format
+#~ msgid "cannot stat %s"
+#~ msgstr "%s-ის აღმოჩენის შეცდომა"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "%s-ის წვდომების შეცვლის შეცდომა"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "საქაღალდის შექმნის შეცდომა: %s"
+
+#~ msgid "`"
+#~ msgstr "`"
+
+#~ msgid "'"
+#~ msgstr "'"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[yY]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "%s-ის წვდომების დაყენება"
+
+#~ msgid "Hangup"
+#~ msgstr "დაკიდება"
+
+#~ msgid "Interrupt"
+#~ msgstr "შეწყვეტა"
+
+#~ msgid "Quit"
+#~ msgstr "გასვლა"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "არასწორი ინსტრუქცია"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "გამართვის წერტილები"
+
+#~ msgid "Aborted"
+#~ msgstr "შეწყვეტილია"
+
+#~ msgid "Floating point exception"
+#~ msgstr "წილადი რიცხვების ანგარიშის შეცდომა"
+
+#~ msgid "Killed"
+#~ msgstr "მოკვტა"
+
+#~ msgid "Bus error"
+#~ msgstr "მატარებლის შეცდომა"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "სეგმენტაციის შეცდომა"
+
+#~ msgid "Broken pipe"
+#~ msgstr "გაფუჭებული მილი"
+
+#~ msgid "Alarm clock"
+#~ msgstr "მაღვიძარა"
+
+#~ msgid "Terminated"
+#~ msgstr "დასრულებულია"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "სასწრაფო I/O პირობა"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "შეჩერებულია (სიგნალით)"
+
+#~ msgid "Stopped"
+#~ msgstr "შეჩერებულია"
+
+#~ msgid "Continued"
+#~ msgstr "გაგრძელებულია"
+
+#~ msgid "Child exited"
+#~ msgstr "შვილი პროცესი უცაბედად გაითიშა"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "გაჩერებულია (tty-ით შეყვანით)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "გაჩერებულია (tty-ით გამოტანით)"
+
+#~ msgid "I/O possible"
+#~ msgstr "შესაძლებელი I/O"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "CPU-ის დროის ლიმიტი გადაჭარბებულია"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "ფაილის ზომის ლიმიტი გადაჭარბებულია"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "ვირტუალური ტაიმერის ვადა გავიდა"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "პროფილირების ტაიმერის ვადა გავიდა"
+
+#~ msgid "Window changed"
+#~ msgstr "ფანჯარა შეიცვალა"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "მომხმარებლის მიერ განსაზღვრული სიგნალი 1"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "მომხმარებლის მიერ განსაზღვრული სიგნალი 2"
+
+#~ msgid "EMT trap"
+#~ msgstr "EMT-ის ხაფანგი"
+
+#~ msgid "Bad system call"
+#~ msgstr "ცუდი სისტემური გამოძახება"
+
+#~ msgid "Stack fault"
+#~ msgstr "სტეკის შეცდომა"
+
+#~ msgid "Information request"
+#~ msgstr "ინფორმაციის მოთხოვნა"
+
+#~ msgid "Power failure"
+#~ msgstr "კვების ჩავარდნა"
+
+#~ msgid "Resource lost"
+#~ msgstr "რესურსი დაკარგულია"
+
+#~ msgid "cannot create pipe"
+#~ msgstr "ფაიფის შექმნის შეცდომა"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "რეალური-დროის სიგნალი %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "უცნობი სიგნალი %d"
+
+#~ msgid "CPU user"
+#~ msgstr "CPU მომხმარებელი"
+
+#~ msgid "CPU system"
+#~ msgstr "CPU სისტემა"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "ფუნქცია iconv-ის გამოყენება შეუძლებელია"
+
+#~ msgid "iconv function not available"
+#~ msgstr "ფუნქცია iconv-ი მიუწვდომელია"
+
+#~ msgid "character out of range"
+#~ msgstr "სიმბოლო დიაპაზონს გარეთაა"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "u+%04X-ის ლოკალურ სიმბოლოებში გარდაქმნა შეუძლებელია"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "u+%04X-ის ლოკალურ სიმბოლოებში გარდაქმნა შეუძლებელია: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "არასწორი მომხმარებელი"
+
+#~ msgid "invalid group"
+#~ msgstr "არასწორი ჯგუფი"
+
+#~ msgid "invalid spec"
+#~ msgstr "არასწორი სპეფიციკაცია"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "აწყობილია %s-ის მიერ (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "აწყობილია %s-ის მიერ\n"
+
+#~ msgid "(C)"
+#~ msgstr "(C)"
+
+#, c-format
+#~ msgid ""
+#~ "License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ msgstr ""
+#~ "License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "ავტორი: %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "ავტორები: %s და %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "ავტორები: %s, %s და %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "ავტორები: %s, %s, %s\n"
+#~ "და %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "ავტორები: %s, %s, %s,\n"
+#~ "%s და %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "ავტორები: %s, %s, %s,\n"
+#~ "%s, %s და %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "ავტორები: %s, %s, %s,\n"
+#~ "%s, %s, %s და %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "ავტორები: %s, %s, %s,\n"
+#~ "%s, %s, %s, %s\n"
+#~ "და %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "ავტორები: %s, %s, %s,\n"
+#~ "%s, %s, %s, %s\n"
+#~ "%s და %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "ავტორები: %s, %s, %s,\n"
+#~ "%s, %s, %s, %s\n"
+#~ "%s, %s და სხვ.\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "%s-ის შეცდომების შესახებ მისაწერი ელფოსტა: %s\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "%s-ის საწყისი გვერდია: <%s>\n"
+
+#, c-format
+#~ msgid "General help using GNU software: <%s>\n"
+#~ msgstr "GNU-ის პროგრამული უზრუნველყოფის საერთო დახმარება: <%s >\n"
+
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "_open_osfhandle -ის შეცდომა"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "%s ქვეპროცესი"
+
+#~ msgid "failed to set file descriptor text/binary mode"
+#~ msgstr "ფაილის დესკრიპტორის ტექსტური/ბინარული რეჟიმის დაყენების შეცდომა"
+
+#~ msgid "stdin"
+#~ msgstr "stdin"
+
+#~ msgid "stdout"
+#~ msgstr "stdout"
+
+#~ msgid "stderr"
+#~ msgstr "stderr"
+
+#~ msgid "unknown stream"
+#~ msgstr "უცნობი ნაკადი"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "%s-ის %s რეჟიმში ხელახალი გახსნიშ ეცდომა"
+
+#~ msgid "string comparison failed"
+#~ msgstr "სტრიქონების შედარება შეუძლებელია"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "პრობლემის მოსაცილებლად დააყენეთ LC_ALL='C'."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "შედარებული სტრიქონებია %s და %s."
+
+#~ msgid "cannot perform formatted output"
+#~ msgstr "ფორმატირებული გამოტანის შესრულება შეუძლებელია"
+
+#, c-format
+#~ msgid "invalid %s%s argument '%s'"
+#~ msgstr "არასწორი %s%s-ის არგუმენტი: '%s'"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument '%s'"
+#~ msgstr "%s%s-ის არგუმენტის, '%s'-ის არასწორი სუფიქსი"
+
+#, c-format
+#~ msgid "%s%s argument '%s' too large"
+#~ msgstr "%s%s-ის არგუმენტი %s ძალიან დიდია"
diff --git a/gl/po/ko.gmo b/gl/po/ko.gmo
new file mode 100644
index 0000000..75f0dab
--- /dev/null
+++ b/gl/po/ko.gmo
Binary files differ
diff --git a/gl/po/ko.po b/gl/po/ko.po
new file mode 100644
index 0000000..e2000b7
--- /dev/null
+++ b/gl/po/ko.po
@@ -0,0 +1,504 @@
+# Korean messages for GNU textutils
+# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc.
+# Bang Jun-Young <bangjy@nownuri.nowcom.co.kr>, 1996-1997.
+# Changwoo Ryu <cwryu@debian.org>, 2001-2002.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU textutils 2.0.22\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2002-07-22 20:02+0900\n"
+"Last-Translator: Changwoo Ryu <cwryu@debian.org>\n"
+"Language-Team: Korean <translation-team-ko@lists.sourceforge.net>\n"
+"Language: ko\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=EUC-KR\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr ""
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr ""
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:1374
+#, fuzzy
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr " ɼǿ ʿ μ ª ɼǿ ʿմϴ.\n"
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr ""
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr ""
+
+#: gl/lib/argp-help.c:1756
+#, fuzzy
+msgid " [OPTION...]"
+msgstr ": %s [<ɼ>] [<>]...\n"
+
+#: gl/lib/argp-help.c:1783
+#, fuzzy, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr " `%s --help' Ͻʽÿ.\n"
+
+#: gl/lib/argp-help.c:1811
+#, fuzzy, c-format
+msgid "Report bugs to %s.\n"
+msgstr ""
+"\n"
+"<%s>() ׸ ˷ ֽʽÿ.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr " ý "
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr ""
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr ""
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr ""
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr ""
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr ""
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr ""
+
+#: gl/lib/argp-parse.c:154
+#, fuzzy
+msgid "print program version"
+msgstr "α׷ "
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr ""
+
+#: gl/lib/argp-parse.c:624
+#, fuzzy, c-format
+msgid "%s: Too many arguments\n"
+msgstr "μ ʹ "
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr ""
+
+#: gl/lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: `%s'() ȣ ɼԴϴ\n"
+
+#: gl/lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: `%s'() ȣ ɼԴϴ\n"
+
+#: gl/lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: ν ɼ `%c%s'\n"
+
+#: gl/lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: `%c%s' ɼ μ ʽϴ\n"
+
+#: gl/lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: `%s' ɼ μ ʿմϴ\n"
+
+#: gl/lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: ɼ -- %c\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: ɼ μ ʿմϴ -- %c\n"
+
+#: gl/lib/openat-die.c:38
+#, fuzzy, c-format
+msgid "unable to record current working directory"
+msgstr "%s 丮 ϴ"
+
+#: gl/lib/openat-die.c:57
+#, fuzzy, c-format
+msgid "failed to return to initial working directory"
+msgstr "%s 丮 ϴ"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr ""
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr ""
+
+#: gl/lib/regcomp.c:128
+#, fuzzy
+msgid "Invalid regular expression"
+msgstr "%s: Խ: %s"
+
+#: gl/lib/regcomp.c:131
+#, fuzzy
+msgid "Invalid collation character"
+msgstr " Ŭ `%s'"
+
+#: gl/lib/regcomp.c:134
+#, fuzzy
+msgid "Invalid character class name"
+msgstr " Ŭ `%s'"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr ""
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr ""
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr ""
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr ""
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr ""
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr ""
+
+#: gl/lib/regcomp.c:155
+#, fuzzy
+msgid "Invalid range end"
+msgstr "%s: Խ: %s"
+
+#: gl/lib/regcomp.c:158
+#, fuzzy
+msgid "Memory exhausted"
+msgstr "޸𸮰 ٴڳ"
+
+#: gl/lib/regcomp.c:161
+#, fuzzy
+msgid "Invalid preceding regular expression"
+msgstr "%s: Խ: %s"
+
+#: gl/lib/regcomp.c:164
+#, fuzzy
+msgid "Premature end of regular expression"
+msgstr "Խ Ž ߻"
+
+#: gl/lib/regcomp.c:167
+#, fuzzy
+msgid "Regular expression too big"
+msgstr "%s: Խ: %s"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ""
+
+#: gl/lib/regcomp.c:650
+#, fuzzy
+msgid "No previous regular expression"
+msgstr "Խ Ž ߻"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "޸𸮰 ٴڳ"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "%2$s %1$s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "%2$s ָ %1$s"
+
+#, c-format
+#~ msgid "Valid arguments are:"
+#~ msgstr "ùٸ ڴ:"
+
+#~ msgid "program error"
+#~ msgstr "α׷ "
+
+#~ msgid "stack overflow"
+#~ msgstr " ÷ο"
+
+#~ msgid "write error"
+#~ msgstr " "
+
+#, fuzzy, c-format
+#~ msgid "error while opening \"%s\" for reading"
+#~ msgstr "`%s' `%s' ̵ ϴ"
+
+#, fuzzy, c-format
+#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgstr "`%s' `%s' ̵ ϴ"
+
+#, fuzzy, c-format
+#~ msgid "error reading \"%s\""
+#~ msgstr "%s() д ߻"
+
+#, fuzzy, c-format
+#~ msgid "error writing \"%s\""
+#~ msgstr "%s ߻"
+
+#, fuzzy, c-format
+#~ msgid "error after reading \"%s\""
+#~ msgstr "%s() д ߻"
+
+#, fuzzy
+#~ msgid "fdopen() failed"
+#~ msgstr " "
+
+#, fuzzy, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s: "
+
+#~ msgid "regular empty file"
+#~ msgstr "Ϲ "
+
+#~ msgid "regular file"
+#~ msgstr "Ϲ "
+
+#~ msgid "directory"
+#~ msgstr "丮"
+
+#~ msgid "block special file"
+#~ msgstr " Ư "
+
+#~ msgid "character special file"
+#~ msgstr " Ư "
+
+#~ msgid "fifo"
+#~ msgstr "FIFO"
+
+#~ msgid "symbolic link"
+#~ msgstr "ɺ ũ"
+
+#~ msgid "socket"
+#~ msgstr ""
+
+#~ msgid "message queue"
+#~ msgstr "޼ ť"
+
+#~ msgid "semaphore"
+#~ msgstr ""
+
+#~ msgid "shared memory object"
+#~ msgstr " ޸ Ʈ"
+
+#, fuzzy
+#~ msgid "typed memory object"
+#~ msgstr " ޸ Ʈ"
+
+#~ msgid "weird file"
+#~ msgstr " "
+
+#, fuzzy
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "fifo ʽϴ"
+
+#, fuzzy
+#~ msgid "ai_family not supported"
+#~ msgstr "fifo ʽϴ"
+
+#, fuzzy
+#~ msgid "ai_socktype not supported"
+#~ msgstr "fifo ʽϴ"
+
+#, fuzzy
+#~ msgid "System error"
+#~ msgstr " "
+
+#, fuzzy
+#~ msgid "Unknown error"
+#~ msgstr " ý "
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: `--%s' ɼ μ ʽϴ\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: ν ɼ `--%s'\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: ߸ ɼ -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: `-W %s'() ȣ ɼԴϴ\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: `-W %s' ɼ μ ʽϴ\n"
+
+#~ msgid "block size"
+#~ msgstr " ũ"
+
+#, c-format
+#~ msgid "%s exists but is not a directory"
+#~ msgstr "%s() 丮 ƴմϴ"
+
+#, c-format
+#~ msgid "cannot change owner and/or group of %s"
+#~ msgstr "%s ׸/Ȥ ׷ ٲ ϴ"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "%s 丮 ϴ"
+
+#, c-format
+#~ msgid "cannot chdir to directory %s"
+#~ msgstr "%s 丮 chdir ϴ"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "%s 㰡 ٲ ϴ"
+
+#, fuzzy
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "%s 㰡 ٲ ϴ"
+
+#, fuzzy
+#~ msgid "cannot create pipe"
+#~ msgstr "%s 丮 ϴ"
+
+#~ msgid "`"
+#~ msgstr "`"
+
+#~ msgid "'"
+#~ msgstr "'"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[yY]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "iconv Լ ϴ"
+
+# not usable not available ̴?
+#~ msgid "iconv function not available"
+#~ msgstr "iconv Լ ϴ"
+
+#~ msgid "character out of range"
+#~ msgstr "  "
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "U+%04X() Į ڼ ȯ ϴ"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "U+%04X() Į ڼ ȯ ϴ: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "߸ "
+
+#~ msgid "invalid group"
+#~ msgstr "߸ ׷"
+
+#~ msgid "cannot get the login group of a numeric UID"
+#~ msgstr "UID α ׷ ˾ ϴ"
+
+#, fuzzy
+#~ msgid ""
+#~ "\n"
+#~ "This is free software. You may redistribute copies of it under the terms "
+#~ "of\n"
+#~ "the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ " α׷ ƮԴϴ. Ʈ Ǿ絵ڴ \n"
+#~ "Ʈ ǥ GNU General Public License 2 (Ǵ \n"
+#~ " Ƿ ؼ), α׷ ϰų \n"
+#~ " ֽϴ.\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "%s() ϴ.\n"
+
+#, fuzzy, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "%s() ϴ.\n"
+
+#, fuzzy, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "%s() ϴ.\n"
+
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr "%s() ϴ.\n"
+
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr "%s() ϴ.\n"
+
+#~ msgid "string comparison failed"
+#~ msgstr "ڿ 񱳰 ߽ϴ"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr " LC_ALL='C'Ͻʽÿ."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr " ڿ %s() %sԴϴ."
diff --git a/gl/po/man-db-gnulib.pot b/gl/po/man-db-gnulib.pot
new file mode 100644
index 0000000..3516e6a
--- /dev/null
+++ b/gl/po/man-db-gnulib.pot
@@ -0,0 +1,242 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# This file is distributed under the same license as the man-db package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: man-db 2.11.2\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr ""
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr ""
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr ""
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr ""
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr ""
+
+#: gl/lib/argp-help.c:1783
+#, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr ""
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr ""
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr ""
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr ""
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr ""
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr ""
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr ""
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr ""
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr ""
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr ""
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr ""
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr ""
+
+#: gl/lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr ""
+
+#: gl/lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr ""
+
+#: gl/lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr ""
+
+#: gl/lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr ""
+
+#: gl/lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr ""
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr ""
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr ""
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr ""
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr ""
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr ""
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr ""
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr ""
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr ""
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr ""
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr ""
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr ""
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr ""
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr ""
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr ""
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr ""
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr ""
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr ""
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr ""
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ""
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr ""
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr ""
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
diff --git a/gl/po/ms.gmo b/gl/po/ms.gmo
new file mode 100644
index 0000000..8cc8d3a
--- /dev/null
+++ b/gl/po/ms.gmo
Binary files differ
diff --git a/gl/po/ms.po b/gl/po/ms.po
new file mode 100644
index 0000000..1ba8b2c
--- /dev/null
+++ b/gl/po/ms.po
@@ -0,0 +1,480 @@
+# Terjemahan coreutils untuk Bahasa Melayu.
+# Copyright (C) 2001 Free Software Foundation, Inc.
+# Hasbullah Bin Pit <sebol@ikhlas.com>, 2003.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: coreutils 5.0.90\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2003-08-10 16:00+0800\n"
+"Last-Translator: Hasbullah Bin Pit <sebol@ikhlas.com>\n"
+"Language-Team: Malay <translation-team-ms@lists.sourceforge.net>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr ""
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr ""
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:1374
+#, fuzzy
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Hujah mandatori kepada opsyen panjang andalah mandatori bagi opsyen pendek "
+"juga.\n"
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr ""
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr ""
+
+#: gl/lib/argp-help.c:1756
+#, fuzzy
+msgid " [OPTION...]"
+msgstr "Pengunaan: %s [OPSYEN]...\n"
+
+#: gl/lib/argp-help.c:1783
+#, fuzzy, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Cuba `%s --help' untuk maklumat lanjut .\n"
+
+#: gl/lib/argp-help.c:1811
+#, fuzzy, c-format
+msgid "Report bugs to %s.\n"
+msgstr ""
+"\n"
+"Lapor pepijat ke <%s>.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Ralat sistem yang tidak diketahui"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr ""
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr ""
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "NAMA"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr ""
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr ""
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr ""
+
+#: gl/lib/argp-parse.c:154
+#, fuzzy
+msgid "print program version"
+msgstr "ralat membaca"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr ""
+
+#: gl/lib/argp-parse.c:624
+#, fuzzy, c-format
+msgid "%s: Too many arguments\n"
+msgstr "terlalu banyak hujah"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr ""
+
+#: gl/lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: opsyen `%s' adalah ambiguous\n"
+
+#: gl/lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: opsyen `%s' adalah ambiguous\n"
+
+#: gl/lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: opensyen tidak dikenali `%c%s'\n"
+
+#: gl/lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: opsyen `%c%s' tidak mengizinkan hujah\n"
+
+#: gl/lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: opsyen `%s' memerlukan hujah\n"
+
+#: gl/lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: opsyen tidak sah -- %c\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: opsyen memerlukan hujah -- %c\n"
+
+#: gl/lib/openat-die.c:38
+#, fuzzy, c-format
+msgid "unable to record current working directory"
+msgstr "gagal untuk kembali ke direktori kerja pemulaan"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "gagal untuk kembali ke direktori kerja pemulaan"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr ""
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr ""
+
+#: gl/lib/regcomp.c:128
+#, fuzzy
+msgid "Invalid regular expression"
+msgstr "%s: ungkapan biasa (regexp) tidak sah: %s"
+
+#: gl/lib/regcomp.c:131
+#, fuzzy
+msgid "Invalid collation character"
+msgstr "aksara tidak sah pada %s pada rentetan mod %s"
+
+#: gl/lib/regcomp.c:134
+#, fuzzy
+msgid "Invalid character class name"
+msgstr "aksara tidak sah pada %s pada rentetan mod %s"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr ""
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr ""
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr ""
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr ""
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr ""
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr ""
+
+#: gl/lib/regcomp.c:155
+#, fuzzy
+msgid "Invalid range end"
+msgstr "%s: ungkapan biasa (regexp) tidak sah: %s"
+
+#: gl/lib/regcomp.c:158
+#, fuzzy
+msgid "Memory exhausted"
+msgstr "memori keletihan"
+
+#: gl/lib/regcomp.c:161
+#, fuzzy
+msgid "Invalid preceding regular expression"
+msgstr "%s: ungkapan biasa (regexp) tidak sah: %s"
+
+#: gl/lib/regcomp.c:164
+#, fuzzy
+msgid "Premature end of regular expression"
+msgstr "ralat pada carian ungkapan biasa (regexp)"
+
+#: gl/lib/regcomp.c:167
+#, fuzzy
+msgid "Regular expression too big"
+msgstr "%s: ungkapan biasa (regexp) tidak sah: %s"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ""
+
+#: gl/lib/regcomp.c:650
+#, fuzzy
+msgid "No previous regular expression"
+msgstr "ralat pada carian ungkapan biasa (regexp)"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memori keletihan"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "hujah tidak sah %s bagi %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "hujah ambiguous %s bagi %s"
+
+#, c-format
+#~ msgid "Valid arguments are:"
+#~ msgstr "Hujah sah adalah:"
+
+#~ msgid "write error"
+#~ msgstr "ralat menulis"
+
+#, fuzzy, c-format
+#~ msgid "error while opening \"%s\" for reading"
+#~ msgstr "tak dapat buka %s untuk dibaca"
+
+#, fuzzy, c-format
+#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgstr "tak dapat buka %s untuk dibaca"
+
+#, fuzzy, c-format
+#~ msgid "error reading \"%s\""
+#~ msgstr "membaca %s"
+
+#, fuzzy, c-format
+#~ msgid "error writing \"%s\""
+#~ msgstr "menulis %s"
+
+#, fuzzy, c-format
+#~ msgid "error after reading \"%s\""
+#~ msgstr "membaca %s"
+
+#, fuzzy
+#~ msgid "fdopen() failed"
+#~ msgstr "pembukaan gagal"
+
+#, fuzzy, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "fail istimewa blok"
+
+#~ msgid "regular empty file"
+#~ msgstr "fail kosong biasa"
+
+#~ msgid "regular file"
+#~ msgstr "fail biasa"
+
+#~ msgid "directory"
+#~ msgstr "direktori"
+
+#~ msgid "block special file"
+#~ msgstr "fail istimewa blok"
+
+#~ msgid "character special file"
+#~ msgstr "fail istimewa aksara"
+
+#~ msgid "fifo"
+#~ msgstr "fifo"
+
+#~ msgid "symbolic link"
+#~ msgstr "pautan simbolik"
+
+#~ msgid "socket"
+#~ msgstr "soket"
+
+#~ msgid "message queue"
+#~ msgstr "giliran mesej"
+
+#~ msgid "shared memory object"
+#~ msgstr "objek memori terkongsi"
+
+#, fuzzy
+#~ msgid "typed memory object"
+#~ msgstr "objek memori terkongsi"
+
+#~ msgid "weird file"
+#~ msgstr "fail pelik"
+
+#, fuzzy
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "fail fifo tidak disokong"
+
+#, fuzzy
+#~ msgid "ai_family not supported"
+#~ msgstr "fail fifo tidak disokong"
+
+#, fuzzy
+#~ msgid "ai_socktype not supported"
+#~ msgstr "fail fifo tidak disokong"
+
+#, fuzzy
+#~ msgid "System error"
+#~ msgstr "ralat menulis"
+
+#, fuzzy
+#~ msgid "Unknown error"
+#~ msgstr "Ralat sistem yang tidak diketahui"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: opsyen `--%s' tidak mengizinkan hujah\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: opensyen tidak dikenali `--%s'\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: opsyen tidak dibenarkan -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: opsyen `-W %s' adalah ambiguous\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: opsyen `-W %s' tidak mengizinkan hujan\n"
+
+#~ msgid "block size"
+#~ msgstr "saiz blok"
+
+#, c-format
+#~ msgid "%s exists but is not a directory"
+#~ msgstr "%s wujud tapi ianya bukan direktori"
+
+#, c-format
+#~ msgid "cannot change owner and/or group of %s"
+#~ msgstr "tak dapat menukar hakmilik dan/atau kumpulan %s"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "tak dapat mencipta direktori %s"
+
+#, c-format
+#~ msgid "cannot chdir to directory %s"
+#~ msgstr "tak dapat chdir ke direktori %s"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "tak dapat menukar keizinan %s"
+
+#, fuzzy
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "gagal mengekalkan keizinan bagi %s"
+
+#, fuzzy
+#~ msgid "cannot create pipe"
+#~ msgstr "tak boleh mencipta pautan %s"
+
+#~ msgid "`"
+#~ msgstr "`"
+
+#~ msgid "'"
+#~ msgstr "`"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[yY]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[tT]"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "fungsi iconv tak boleh digunakan"
+
+#~ msgid "iconv function not available"
+#~ msgstr "fungsi iconv tidak ada"
+
+#~ msgid "character out of range"
+#~ msgstr "aksara di luar julat"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "tak dapat menukar U+%04X ke set aksara lokal"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "tak dapat menukar U+%04X ke set aksara lokal: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "pengguna tidak sah"
+
+#~ msgid "invalid group"
+#~ msgstr "kumpulan tidak sah"
+
+#~ msgid "cannot get the login group of a numeric UID"
+#~ msgstr "tak boleh mendapatkan kumpulan logmasuk untuk UID numerik"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Ditulis oleh %s.\n"
+
+#, fuzzy, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Ditulis oleh %s.\n"
+
+#, fuzzy, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Ditulis oleh %s.\n"
+
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr "Ditulis oleh %s.\n"
+
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr "Ditulis oleh %s.\n"
+
+#~ msgid "string comparison failed"
+#~ msgstr "perbandingan rentetan gagal"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Tetapkan LC_ALL='C' untuk mengatasi masalah."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Rentetan dibandingkan adalah %s dan %s."
diff --git a/gl/po/nb.gmo b/gl/po/nb.gmo
new file mode 100644
index 0000000..b383d52
--- /dev/null
+++ b/gl/po/nb.gmo
Binary files differ
diff --git a/gl/po/nb.po b/gl/po/nb.po
new file mode 100644
index 0000000..dd12616
--- /dev/null
+++ b/gl/po/nb.po
@@ -0,0 +1,481 @@
+# Norwegian messages for GNU textutils (bokml dialect)
+# Copyright (C) 1996 Free Software Foundation, Inc.
+# Eivind Tagseth <eivindt@multinet.no>, 1996, 1997, 1999.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU textutils 2.0.20\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2002-01-27 21:35+0100\n"
+"Last-Translator: Eivind Tagseth <eivindt@multinet.no>\n"
+"Language-Team: Norwegian <i18n-nb@lister.ping.uio.no>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8-bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr ""
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr ""
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:1374
+#, fuzzy
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Obligatoriske argmenter til lange flagg er obligatoriske ogs for korte.\n"
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr ""
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr ""
+
+#: gl/lib/argp-help.c:1756
+#, fuzzy
+msgid " [OPTION...]"
+msgstr "Bruk: %s [FLAGG] [FIL]...\n"
+
+#: gl/lib/argp-help.c:1783
+#, fuzzy, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Prv med %s --help for mer informasjon.\n"
+
+#: gl/lib/argp-help.c:1811
+#, fuzzy, c-format
+msgid "Report bugs to %s.\n"
+msgstr ""
+"\n"
+"Rapportr feil til <bug-textutils@gnu.org>."
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Ukjent systemfeil"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr ""
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr ""
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr ""
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr ""
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr ""
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr ""
+
+#: gl/lib/argp-parse.c:154
+#, fuzzy
+msgid "print program version"
+msgstr "lesefeil"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr ""
+
+#: gl/lib/argp-parse.c:624
+#, fuzzy, c-format
+msgid "%s: Too many arguments\n"
+msgstr "for mange argumenter"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr ""
+
+#: gl/lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: flagget %s er flertydig\n"
+
+#: gl/lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: flagget %s er flertydig\n"
+
+#: gl/lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: ukjent flagg %c%s\n"
+
+#: gl/lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: flagget %c%s trenger et argument\n"
+
+#: gl/lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: flagget %s trenger et argument\n"
+
+#: gl/lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: ukjent flagg -- %c\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: flagget trenger et argument -- %c\n"
+
+#: gl/lib/openat-die.c:38
+#, fuzzy, c-format
+msgid "unable to record current working directory"
+msgstr "kan ikke opprette katalog %s"
+
+#: gl/lib/openat-die.c:57
+#, fuzzy, c-format
+msgid "failed to return to initial working directory"
+msgstr "kan ikke opprette katalog %s"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr ""
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr ""
+
+#: gl/lib/regcomp.c:128
+#, fuzzy
+msgid "Invalid regular expression"
+msgstr "%s: ugyldig regulrt uttrykk: %s"
+
+#: gl/lib/regcomp.c:131
+#, fuzzy
+msgid "Invalid collation character"
+msgstr "ugyldig tegn-klasse %s"
+
+#: gl/lib/regcomp.c:134
+#, fuzzy
+msgid "Invalid character class name"
+msgstr "ugyldig tegn-klasse %s"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr ""
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr ""
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr ""
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr ""
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr ""
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr ""
+
+#: gl/lib/regcomp.c:155
+#, fuzzy
+msgid "Invalid range end"
+msgstr "%s: ugyldig regulrt uttrykk: %s"
+
+#: gl/lib/regcomp.c:158
+#, fuzzy
+msgid "Memory exhausted"
+msgstr "virtuelt minne oppbrukt"
+
+#: gl/lib/regcomp.c:161
+#, fuzzy
+msgid "Invalid preceding regular expression"
+msgstr "%s: ugyldig regulrt uttrykk: %s"
+
+#: gl/lib/regcomp.c:164
+#, fuzzy
+msgid "Premature end of regular expression"
+msgstr "feil i sk med regulrt uttrykk"
+
+#: gl/lib/regcomp.c:167
+#, fuzzy
+msgid "Regular expression too big"
+msgstr "%s: ugyldig regulrt uttrykk: %s"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ""
+
+#: gl/lib/regcomp.c:650
+#, fuzzy
+msgid "No previous regular expression"
+msgstr "feil i sk med regulrt uttrykk"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "virtuelt minne oppbrukt"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "ugyldig argument %s for %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "flertydig argument %s for %s"
+
+#, c-format
+#~ msgid "Valid arguments are:"
+#~ msgstr "Gyldige argument er:"
+
+#, fuzzy
+#~ msgid "program error"
+#~ msgstr "lesefeil"
+
+#~ msgid "write error"
+#~ msgstr "feil ved skriving"
+
+#, fuzzy, c-format
+#~ msgid "error reading \"%s\""
+#~ msgstr "feil ved lesing av %s"
+
+#, fuzzy, c-format
+#~ msgid "error writing \"%s\""
+#~ msgstr "feil ved skriving til %s"
+
+#, fuzzy, c-format
+#~ msgid "error after reading \"%s\""
+#~ msgstr "feil ved lesing av %s"
+
+#, fuzzy
+#~ msgid "fdopen() failed"
+#~ msgstr "pning av fil feilet"
+
+#, fuzzy, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s: ugyldig mnster"
+
+#, fuzzy
+#~ msgid "regular empty file"
+#~ msgstr "feil ved lesing"
+
+#, fuzzy
+#~ msgid "regular file"
+#~ msgstr "feil ved lesing"
+
+#, fuzzy
+#~ msgid "directory"
+#~ msgstr "%s eksisterer men er ikke en katalog"
+
+#, fuzzy
+#~ msgid "block special file"
+#~ msgstr "blokkstrrelse"
+
+#, fuzzy
+#~ msgid "character special file"
+#~ msgstr "tegn-posisjon er null"
+
+#, fuzzy
+#~ msgid "symbolic link"
+#~ msgstr "kan ikke utfre ioctl p %s"
+
+#, fuzzy
+#~ msgid "weird file"
+#~ msgstr "feil ved lesing"
+
+#, fuzzy
+#~ msgid "ai_family not supported"
+#~ msgstr "blokkstrrelse"
+
+#, fuzzy
+#~ msgid "ai_socktype not supported"
+#~ msgstr "blokkstrrelse"
+
+#, fuzzy
+#~ msgid "System error"
+#~ msgstr "feil ved skriving"
+
+#, fuzzy
+#~ msgid "Unknown error"
+#~ msgstr "Ukjent systemfeil"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: flagget --%s trenger et argument\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: ukjent flagg --%s\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: ukjent flagg -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: flagget -W %s er flertydig\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: flagget -W %s tillater ikke et argument\n"
+
+#~ msgid "block size"
+#~ msgstr "blokkstrrelse"
+
+#, c-format
+#~ msgid "%s exists but is not a directory"
+#~ msgstr "%s eksisterer men er ikke en katalog"
+
+#, c-format
+#~ msgid "cannot change owner and/or group of %s"
+#~ msgstr "kan ikke endre eier og/eller gruppe for %s"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "kan ikke opprette katalog %s"
+
+#, fuzzy, c-format
+#~ msgid "cannot chdir to directory %s"
+#~ msgstr "kan ikke skifte til katalog, %s"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "kan ikke endre rettigheter til %s"
+
+#, fuzzy
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "kan ikke endre rettigheter til %s"
+
+#, fuzzy
+#~ msgid "cannot create pipe"
+#~ msgstr "kan ikke opprette katalog %s"
+
+#~ msgid "`"
+#~ msgstr ""
+
+#~ msgid "'"
+#~ msgstr ""
+
+#, fuzzy
+#~ msgid "^[yY]"
+#~ msgstr "^[jJ]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#, fuzzy
+#~ msgid "iconv function not usable"
+#~ msgstr "kan ikke skrive ut U+%04X: iconv-funksjonen er ikke brukbar"
+
+#, fuzzy
+#~ msgid "iconv function not available"
+#~ msgstr "kan ikke skrive ut U+%04X: iconv-funksjon er ikke tilgjengelig"
+
+#, fuzzy
+#~ msgid "character out of range"
+#~ msgstr "U+%04X: tegn utenfor tillatte verdier"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "kan ikke konvertere U+%04X til lokalt tegnsett"
+
+#, fuzzy, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "kan ikke konvertere U+%04X til lokalt tegnsett"
+
+#~ msgid "invalid user"
+#~ msgstr "ugyldig bruker"
+
+#~ msgid "invalid group"
+#~ msgstr "ugyldig gruppe"
+
+#~ msgid "cannot get the login group of a numeric UID"
+#~ msgstr "kan ikke finne login-gruppen til en numerisk bruker-ID"
+
+#, fuzzy
+#~ msgid ""
+#~ "\n"
+#~ "This is free software. You may redistribute copies of it under the terms "
+#~ "of\n"
+#~ "the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Dette programmet er fri programvare. Du kan redistribueret det og/eller\n"
+#~ "modifisere det under betingelsene gitt av GNU General Public License som\n"
+#~ "distribuert av Free Software Foundation; enten versjon 2, eller (om du "
+#~ "vil)\n"
+#~ "en hvilken som helst senere versjon.\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Skrevet av %s.\n"
+
+#, fuzzy, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Skrevet av %s.\n"
+
+#, fuzzy, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Skrevet av %s.\n"
+
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr "Skrevet av %s.\n"
+
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr "Skrevet av %s.\n"
+
+#~ msgid "string comparison failed"
+#~ msgstr "strengsammenligning feilet"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Sett LC_ALL='C' for omg problemet."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Strengene som ble sammenlignet var %s og %s."
diff --git a/gl/po/nl.gmo b/gl/po/nl.gmo
new file mode 100644
index 0000000..bd209eb
--- /dev/null
+++ b/gl/po/nl.gmo
Binary files differ
diff --git a/gl/po/nl.po b/gl/po/nl.po
new file mode 100644
index 0000000..a5be355
--- /dev/null
+++ b/gl/po/nl.po
@@ -0,0 +1,978 @@
+# Dutch translations for gnulib.
+# Copyright (C) 2019 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+#
+# Erick Branderhorst <branderh@debian.org>, 1996.
+# Ivo Timmermans <ivo@o2w.nl>, 2000.
+# Freek de Kruijf <f.de.kruijf@hetnet.nl>, 2004, 2005.
+# Erwin Poeze <erwin.poeze@gmail.com>, 2009, 2010.
+# Benno Schulenberg <benno@vertaalt.nl>, 2007, 2008, 2010, 2011, 2019.
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib-4.0.0.2567\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2019-05-29 13:31+0200\n"
+"Last-Translator: Benno Schulenberg <vertaling@coevern.nl>\n"
+"Language-Team: Dutch <vertaling@vrijschrift.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: waarde voor '%s' is kleiner of gelijk aan %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: Parameter in ARGP_HELP_FMT vereist een waarde"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: Onbekende parameter in ARGP_HELP_FMT"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Rommel in ARGP_HELP_FMT: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Een argument dat verplicht of optioneel is voor een lange optie, is dat\n"
+"ook voor de overeenkomstige korte optie."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Gebruik: "
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " of: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [OPTIE...]"
+
+#: gl/lib/argp-help.c:1783
+#, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Typ '%s --help' of '%s --usage' voor meer informatie.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr ""
+"Rapporteer gebreken in het programma aan %s;\n"
+"meld fouten in de vertaling aan <vertaling@vrijschrift.org>.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Onbekende systeemfout"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "deze hulptekst tonen"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "een korte gebruikssamenvatting tonen"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "NAAM"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "de programmanaam instellen"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "SECONDEN"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "dit aantal seconden pauzeren (standaard 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "programmaversie tonen"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "**Interne programmafout**: geen versie bekend!?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: Te veel argumenten\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "**Interne programmafout**: optie had herkend moeten worden!?"
+
+#: gl/lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: optie '%s%s' is niet eenduidig\n"
+
+#: gl/lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: optie '%s%s' is niet eenduidig; mogelijkheden zijn:"
+
+#: gl/lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: onbekende optie '%s%s'\n"
+
+#: gl/lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: optie '%s%s' staat geen argument toe\n"
+
+#: gl/lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: optie '%s%s' vereist een argument\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: ongeldige optie -- '%c'\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: optie vereist een argument -- '%c'\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "kan de huidige werkmap niet vastleggen"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "kan niet terugkeren naar de oorspronkelijke werkmap"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Gelukt"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Geen overeenkomsten"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Ongeldige reguliere expressie"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Ongeldig samengesteld teken"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Ongeldige tekenklassenaam"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Backslash aan het eind"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Ongeldige terugverwijzing"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Ongepaarde [, [^, [:, [., of [="
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "Ongepaarde ( of \\("
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "Ongepaarde \\{"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "Ongeldige inhoud van \\{\\}"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Ongeldig bereikeinde"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Onvoldoende geheugen beschikbaar"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Ongeldige voorafgaande reguliere expressie"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Voortijdig einde van reguliere expressie"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "Reguliere expressie is te groot"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr "Ongepaarde ) of \\)"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Geen eerdere reguliere expressie"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "kan foutmelding niet tonen"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "onvoldoende geheugen beschikbaar"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr "standaard bestandsdescriptors"
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "ongeldig argument %s van %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "argument %s van %s is niet eenduidig"
+
+#~ msgid "Valid arguments are:"
+#~ msgstr "Geldige argumenten zijn:"
+
+#, c-format
+#~ msgid "%u bitset_allocs, %u freed (%.2f%%).\n"
+#~ msgstr "%u bitset_allocs, %u vrijgegeven (%.2f%%).\n"
+
+#, c-format
+#~ msgid "%u bitset_sets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_sets, %u gecached (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_resets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_resets, %u gecached (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_tests, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_tests, %u gecached (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_lists\n"
+#~ msgstr "%u bitset_lists\n"
+
+#~ msgid "count log histogram\n"
+#~ msgstr "histogram van aantal gezette bits\n"
+
+#~ msgid "size log histogram\n"
+#~ msgstr "histogram van bitset-groottes\n"
+
+#~ msgid "density histogram\n"
+#~ msgstr "histogram van dichtheid aan gezette bits\n"
+
+#, c-format
+#~ msgid ""
+#~ "Bitset statistics:\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Bitset-statistieken:\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Accumulated runs = %u\n"
+#~ msgstr "Aantal uitvoeringen = %u\n"
+
+#~ msgid "cannot read stats file"
+#~ msgstr "kan statistiekenbestand niet lezen"
+
+#, c-format
+#~ msgid "bad stats file size\n"
+#~ msgstr "statistiekenbestand heeft een verkeerde grootte\n"
+
+#~ msgid "cannot write stats file"
+#~ msgstr "kan statistiekenbestand niet schrijven"
+
+#~ msgid "cannot open stats file for writing"
+#~ msgstr "kan statistiekenbestand niet openen voor schrijven"
+
+#~ msgid "program error"
+#~ msgstr "programmafout"
+
+#~ msgid "stack overflow"
+#~ msgstr "stack-overloop"
+
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr "kan geen tijdelijke map vinden; zet $TMPDIR"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "kan met sjabloon '%s' geen tijdelijke map aanmaken"
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "kan tijdelijk bestand '%s' niet verwijderen"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "kan tijdelijke map '%s' niet verwijderen"
+
+#~ msgid "error closing file"
+#~ msgstr "fout bij sluiten van bestand"
+
+#~ msgid "write error"
+#~ msgstr "schrijffout"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "toegangsrechten van '%s' worden behouden"
+
+#, c-format
+#~ msgid "error while opening %s for reading"
+#~ msgstr "fout bij openen van %s voor lezen"
+
+#, c-format
+#~ msgid "cannot open backup file %s for writing"
+#~ msgstr "kan reservekopiebestand %s niet openen voor schrijven"
+
+#, c-format
+#~ msgid "error reading %s"
+#~ msgstr "fout bij lezen van %s"
+
+#, c-format
+#~ msgid "error writing %s"
+#~ msgstr "fout bij schrijven van %s"
+
+#, c-format
+#~ msgid "error after reading %s"
+#~ msgstr "fout na lezen van %s"
+
+#~ msgid "fdopen() failed"
+#~ msgstr "fdopen() is mislukt"
+
+#~ msgid "C# compiler not found, try installing mono"
+#~ msgstr "C#-compiler is niet gevonden; installeer 'mono'"
+
+#~ msgid "C# virtual machine not found, try installing mono"
+#~ msgstr "virtuele C#-machine is niet gevonden; installeer 'mono'"
+
+#~ msgid "unbalanced ["
+#~ msgstr "ongepaarde ["
+
+#~ msgid "invalid character class"
+#~ msgstr "ongeldige tekenklasse"
+
+#~ msgid "character class syntax is [[:space:]], not [:space:]"
+#~ msgstr "syntax van tekenklasse is [[:space:]], niet [:space:]"
+
+#~ msgid "unfinished \\ escape"
+#~ msgstr "onafgemaakte \\-stuurcode"
+
+#~ msgid "invalid content of \\{\\}"
+#~ msgstr "ongeldige inhoud van \\{\\}"
+
+#~ msgid "regular expression too big"
+#~ msgstr "reguliere expressie is te groot"
+
+#~ msgid "unbalanced ("
+#~ msgstr "ongepaarde ("
+
+#~ msgid "no syntax specified"
+#~ msgstr "geen syntax opgegeven"
+
+#~ msgid "unbalanced )"
+#~ msgstr "ongepaarde )"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "subproces %s is mislukt"
+
+#~ msgid "regular empty file"
+#~ msgstr "leeg normaal bestand"
+
+#~ msgid "regular file"
+#~ msgstr "normaal bestand"
+
+#~ msgid "directory"
+#~ msgstr "map"
+
+#~ msgid "symbolic link"
+#~ msgstr "symbolische koppeling"
+
+#~ msgid "message queue"
+#~ msgstr "berichtenwachtrij"
+
+#~ msgid "semaphore"
+#~ msgstr "semafoor"
+
+#~ msgid "shared memory object"
+#~ msgstr "gedeeld geheugenobject"
+
+#~ msgid "typed memory object"
+#~ msgstr "zelfstandig geheugenobject"
+
+#~ msgid "block special file"
+#~ msgstr "blok-apparaat"
+
+#~ msgid "character special file"
+#~ msgstr "byte-apparaat"
+
+#~ msgid "contiguous data"
+#~ msgstr "aaneengesloten gegevens"
+
+#~ msgid "fifo"
+#~ msgstr "fifo"
+
+#~ msgid "door"
+#~ msgstr "door"
+
+#~ msgid "multiplexed block special file"
+#~ msgstr "gemultiplexed blok-apparaat"
+
+#~ msgid "multiplexed character special file"
+#~ msgstr "gemultiplexed byte-apparaat"
+
+#~ msgid "multiplexed file"
+#~ msgstr "gemultiplexed bestand"
+
+#~ msgid "named file"
+#~ msgstr "benoemd bestand"
+
+#~ msgid "network special file"
+#~ msgstr "netwerkapparaat"
+
+#~ msgid "migrated file with data"
+#~ msgstr "gemigreerd bestand met gegevens"
+
+#~ msgid "migrated file without data"
+#~ msgstr "gemigreerd bestand zonder gegevens"
+
+#~ msgid "port"
+#~ msgstr "poort"
+
+#~ msgid "socket"
+#~ msgstr "socket"
+
+#~ msgid "whiteout"
+#~ msgstr "whiteout"
+
+#~ msgid "weird file"
+#~ msgstr "merkwaardig bestand"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Adresfamilie voor hostnaam wordt niet ondersteund"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Tijdelijk probleem in naamsherleiding"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Ongeldige waarde voor 'ai_flags'"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Onherstelbaar probleem in naamsherleiding"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "'ai_family' wordt niet ondersteund"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Onvoldoende geheugen beschikbaar"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "Aan hostnaam is geen adres verbonden"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Naam of dienst is niet bekend"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "Servicenaam wordt niet ondersteund voor 'ai_socktype'"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "'ai_socktype' wordt niet ondersteund"
+
+#~ msgid "System error"
+#~ msgstr "Systeemfout"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "Argumentenbuffer is te klein"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Bezig met verwerken van verzoek"
+
+#~ msgid "Request canceled"
+#~ msgstr "Verzoek is geannuleerd"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Verzoek is niet geannuleerd"
+
+#~ msgid "All requests done"
+#~ msgstr "Alle verzoeken zijn gedaan"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Onderbroken door een signaal"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "Parametertekst is niet juist gecodeerd"
+
+#~ msgid "Unknown error"
+#~ msgstr "Onbekende fout"
+
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "ongeldige waarde voor 'source_version' in compile_java_class()"
+
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "ongeldige waarde voor 'target_version' in compile_java_class()"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "aanmaken van '%s' is mislukt"
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "fout bij schrijven van bestand '%s'"
+
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr "Java-compiler is niet gevonden; installeer 'gcj' of zet $JAVAC"
+
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "Virtuele Java-machine is niet gevonden; installeer 'gcj' of zet $JAVA"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "In-/uitvoerfout in subproces %s"
+
+#, c-format
+#~ msgid "cannot stat %s"
+#~ msgstr "kan status van '%s' niet opvragen"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "kan de toegangsrechten van %s niet veranderen"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "kan map %s niet aanmaken"
+
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Openen van /dev/zero voor lezen is mislukt"
+
+#~ msgid "creation of reading thread failed"
+#~ msgstr "Het aanmaken van een lees-thread is mislukt"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "kan geen niet-blokkerende in-/uitvoer instellen naar subproces %s"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "communicatie met subproces %s is mislukt"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "schrijven naar subproces %s is mislukt"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "lezen uit subproces %s is mislukt"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "subproces %s is geëindigd met afsluitwaarde %d"
+
+#~ msgid "creation of threads failed"
+#~ msgstr "aanmaken van threads is mislukt"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "subproces %s is geëindigd met afsluitwaarde %d"
+
+#~ msgid "`"
+#~ msgstr "‘"
+
+#~ msgid "'"
+#~ msgstr "’"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[jJyY]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "toegangsrechten van %s worden ingesteld"
+
+# Vroeger ging dit over het afsluiten van een modemverbinding,
+# tegenwoordig over het afsluiten van een pseudoterminal.
+#~ msgid "Hangup"
+#~ msgstr "Opgehangen"
+
+#~ msgid "Interrupt"
+#~ msgstr "Onderbroken"
+
+# Verleden tijd, "Afgesloten", net als de andere actiesignaalnamen.
+#~ msgid "Quit"
+#~ msgstr "Afgesloten"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "Ongeldige instructie"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Traceer/breekpunt-instructie"
+
+#~ msgid "Aborted"
+#~ msgstr "Afgebroken"
+
+#~ msgid "Floating point exception"
+#~ msgstr "Drijvendekomma-berekeningsfout"
+
+#~ msgid "Killed"
+#~ msgstr "Geëlimineerd"
+
+#~ msgid "Bus error"
+#~ msgstr "Busfout"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "Segmentatiefout"
+
+#~ msgid "Broken pipe"
+#~ msgstr "Gebroken pijp"
+
+#~ msgid "Alarm clock"
+#~ msgstr "Wekker"
+
+#~ msgid "Terminated"
+#~ msgstr "Beëindigd"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "Urgente in-/uitvoertoestand"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "Gepauzeerd (signaal)"
+
+#~ msgid "Stopped"
+#~ msgstr "Gepauzeerd"
+
+#~ msgid "Continued"
+#~ msgstr "Doorgegaan"
+
+#~ msgid "Child exited"
+#~ msgstr "Dochter is afgesloten"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Gepauzeerd (terminalinvoer)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Gepauzeerd (terminaluitvoer)"
+
+#~ msgid "I/O possible"
+#~ msgstr "In-/uitvoer is mogelijk"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "Limiet op processortijd is overschreden"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "Limiet op bestandsgrootte is overschreden"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "Virtuele tijdopnemer is verlopen"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "Tijdopnemer voor analyse is verlopen"
+
+#~ msgid "Window changed"
+#~ msgstr "Venster is veranderd"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "Gebruikergedefinieerd signaal 1"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Gebruikergedefinieerd signaal 2"
+
+#~ msgid "EMT trap"
+#~ msgstr "EMT-instructie"
+
+#~ msgid "Bad system call"
+#~ msgstr "Onjuiste systeemaanroep"
+
+#~ msgid "Stack fault"
+#~ msgstr "Stack-fout"
+
+#~ msgid "Information request"
+#~ msgstr "Verzoek om informatie"
+
+#~ msgid "Power failure"
+#~ msgstr "Stroomstoring"
+
+#~ msgid "Resource lost"
+#~ msgstr "Hulpbron verloren"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "fouten bij het schrijven naar een afgesloten 'pipe' of 'socket'"
+
+#~ msgid "cannot create pipe"
+#~ msgstr "kan geen pijp aanmaken"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "Realtime-signaal %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Onbekend signaal %d"
+
+#~ msgid "Execution times (seconds)"
+#~ msgstr "Uitvoeringstijden (in seconden)"
+
+#~ msgid "CPU user"
+#~ msgstr "CPU (gebruiker)"
+
+#~ msgid "CPU system"
+#~ msgstr "CPU (systeem)"
+
+#~ msgid "wall clock"
+#~ msgstr "kloktijd"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "de functie iconv() is onbruikbaar"
+
+#~ msgid "iconv function not available"
+#~ msgstr "de functie iconv() is niet beschikbaar"
+
+#~ msgid "character out of range"
+#~ msgstr "teken ligt buiten het toegestane bereik"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "kan U+%04X niet converteren naar de lokale tekenset"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "kan U+%04X niet converteren naar de lokale tekenset: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "ongeldige gebruiker"
+
+#~ msgid "invalid group"
+#~ msgstr "ongeldige groep"
+
+#~ msgid "invalid spec"
+#~ msgstr "ongeldige aanduiding"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "In pakketvorm gebracht door %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "In pakketvorm gebracht door %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "©"
+
+#, c-format
+#~ msgid ""
+#~ "License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ msgstr ""
+#~ "Dit is vrije software: u mag het vrijelijk wijzigen en verder "
+#~ "verspreiden.\n"
+#~ "De precieze licentie is GPL-3+: GNU General Public License versie 3 of "
+#~ "later.\n"
+#~ "Zie <%s> voor de volledige (Engelse) tekst.\n"
+#~ "Deze software kent GEEN GARANTIE, voor zover de wet dit toestaat.\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Geschreven door %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Geschreven door %s en %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Geschreven door %s, %s en %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Geschreven door %s, %s, %s\n"
+#~ "en %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Geschreven door %s, %s, %s,\n"
+#~ "%s en %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Geschreven door %s, %s, %s,\n"
+#~ "%s, %s en %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Geschreven door %s, %s, %s,\n"
+#~ "%s, %s, %s en %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Geschreven door %s, %s, %s,\n"
+#~ "%s, %s, %s, %s\n"
+#~ "en %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Geschreven door %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s en %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Geschreven door %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s en anderen.\n"
+
+#, c-format
+#~ msgid "Report bugs to: %s\n"
+#~ msgstr ""
+#~ "Rapporteer gebreken in het programma aan <%s>;\n"
+#~ "meld fouten in de vertaling aan <vertaling@vrijschrift.org>.\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr ""
+#~ "Rapporteer gebreken in het programma '%s' aan <%s>;\n"
+#~ "meld fouten in de vertaling aan <vertaling@vrijschrift.org>.\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "Webpagina van %s: <%s>\n"
+
+#, c-format
+#~ msgid "General help using GNU software: <%s>\n"
+#~ msgstr "Algemene hulp bij gebruik van GNU-software: <%s>\n"
+
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "_open_osfhandle() is mislukt"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "kan bestandsdescriptor %d niet herstellen: dup2() is mislukt"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "subproces %s"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "subproces %s ontving het fatale signaal %d"
+
+#~ msgid "failed to set file descriptor text/binary mode"
+#~ msgstr "kan modus van bestandsdescriptor niet instellen op tekst of binair"
+
+#~ msgid "stdin"
+#~ msgstr "standaardinvoer"
+
+#~ msgid "stdout"
+#~ msgstr "standaarduitvoer"
+
+#~ msgid "stderr"
+#~ msgstr "standaardfoutuitvoer"
+
+#~ msgid "unknown stream"
+#~ msgstr "onbekende gegevensstroom"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "opnieuw openen van '%s' met modus %s is mislukt"
+
+#~ msgid "string comparison failed"
+#~ msgstr "vergelijking van tekenreeksen is mislukt"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Zet LC_ALL='C' om het probleem te omzeilen."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "De te vergelijken tekenreeksen waren %s en %s."
+
+#~ msgid "cannot perform formatted output"
+#~ msgstr "kan geen opgemaakte uitvoer aanmaken"
+
+#, c-format
+#~ msgid "invalid %s%s argument '%s'"
+#~ msgstr "ongeldig argument '%3$s' van %1$s%2$s"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument '%s'"
+#~ msgstr "ongeldig achtervoegsel in argument '%3$s' van %1$s%2$s"
+
+#, c-format
+#~ msgid "%s%s argument '%s' too large"
+#~ msgstr "argument '%3$s' van %1$s%2$s is te groot"
+
+#~ msgid "%.*s: ARGP_HELP_FMT parameter must be positive"
+#~ msgstr "%.*s: Parameter in ARGP_HELP_FMT moet positief zijn"
+
+#~ msgid "%s: option '--%s' doesn't allow an argument\n"
+#~ msgstr "%s: optie '--%s' staat geen argument toe\n"
+
+#~ msgid "%s: unrecognized option '--%s'\n"
+#~ msgstr "%s: onbekende optie '--%s'\n"
+
+#~ msgid "%s: option '-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: optie '-W %s' staat geen argument toe\n"
+
+#~ msgid "%s: option '-W %s' requires an argument\n"
+#~ msgstr "%s: optie '-W %s' vereist een argument\n"
+
+#~ msgid "Franc,ois Pinard"
+#~ msgstr "François Pinard"
+
+#~ msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+#~ msgstr "Webpagina van %s: <http://www.gnu.org/software/%s/>\n"
diff --git a/gl/po/pl.gmo b/gl/po/pl.gmo
new file mode 100644
index 0000000..44c0814
--- /dev/null
+++ b/gl/po/pl.gmo
Binary files differ
diff --git a/gl/po/pl.po b/gl/po/pl.po
new file mode 100644
index 0000000..3388896
--- /dev/null
+++ b/gl/po/pl.po
@@ -0,0 +1,956 @@
+# Polish messages for gnulib
+# Copyright (C) 2005, 2007, 2009, 2010, 2011, 2019 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+#
+# Jakub Bogusz <qboosh@pld-linux.org>, 2007-2019.
+# based on translation for GNU Mailutils by:
+# Sergey Poznyakoff <gray@gnu.org>, 2003,2004,2005.
+# corrections: Wojciech Polak <polak@gnu.org>, 2003
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 4.0.0.2567\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2019-05-19 20:02+0200\n"
+"Last-Translator: Jakub Bogusz <qboosh@pld-linux.org>\n"
+"Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
+"|| n%100>=20) ? 1 : 2;\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: wartość %s jest mniejsza lub równa %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: Parametr ARGP_HELP_FMT wymaga podania wartości"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: Nieznany parametr ARGP_HELP_FMT"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Błędne dane w ARGP_HELP_FMT: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Argumenty obowiązkowe lub opcjonalne dla długich opcji są również "
+"obowiązkowe lub opcjonalne dla odpowiednich krótkich opcji."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Składnia:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " lub: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [OPCJA...]"
+
+#: gl/lib/argp-help.c:1783
+#, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr ""
+"Polecenie '%s --help' lub '%s --usage' pozwoli uzyskać więcej informacji.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "Prosimy zgłaszać błędy na adres %s.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Nieznany błąd systemowy"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "wyświetlenie tego tekstu pomocy"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "wyświetlenie krótkiej informacji o składni polecenia"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "NAZWA"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "określenie nazwy programu"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "SEK"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "zatrzymanie na SEK sekund (domyślnie 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "wyświetlenie wersji programu"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(BŁĄD PROGRAMU) Nieznana wersja!?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: Za dużo argumentów\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(BŁĄD PROGRAMU) Opcja powinna zostać rozpoznana!?"
+
+#: gl/lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: opcja '%s%s' jest niejednoznaczna\n"
+
+#: gl/lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: opcja '%s%s' jest niejednoznaczna; możliwości:"
+
+#: gl/lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: nieznana opcja '%s%s'\n"
+
+#: gl/lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: opcja '%s%s' nie może mieć argumentów\n"
+
+#: gl/lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: opcja '%s%s' musi mieć argument\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: błędna opcja -- '%c'\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: opcja musi mieć argument -- '%c'\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "nie udało się zapisać bieżącego katalogu roboczego"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "nie udało się wrócić do początkowego katalogu roboczego"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Sukces"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Nic nie pasuje"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Błędne wyrażenie regularne"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Błędny znak sortowany"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Błędna nazwa klasy znaków"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Kończący znak `\\'"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Błędne odniesienie wstecz"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Niesparowane [, [^, [:, [. lub [="
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "Niesparowane ( lub \\("
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "Niesparowane \\{"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "Błędna zawartość \\{\\}"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Błędny koniec zakresu"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Pamięć wyczerpana"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Błędne poprzedzające wyrażenie regularne"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Przedwczesny koniec wyrażenia regularnego"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "Wyrażenie regularne zbyt duże"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr "Niesparowane ) lub \\)"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Brak poprzedniego wyrażenia regularnego"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "nie można wyświetlić komunikatu błędu"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "pamięć wyczerpana"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr "standardowe deskryptory plików"
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "błędny argument %s opcji %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "niejednoznaczny argument %s opcji %s"
+
+#~ msgid "Valid arguments are:"
+#~ msgstr "Prawidłowe argumenty to:"
+
+#, c-format
+#~ msgid "%u bitset_allocs, %u freed (%.2f%%).\n"
+#~ msgstr "%u bitset_allocs, %u zwolniono (%.2f%%).\n"
+
+#, c-format
+#~ msgid "%u bitset_sets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_sets, %u w pamięci podręcznej (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_resets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_resets, %u w pamięci podręcznej (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_tests, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_tests, %u w pamięci podręcznej (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_lists\n"
+#~ msgstr "%u bitset_lists\n"
+
+#~ msgid "count log histogram\n"
+#~ msgstr "histogram liczników\n"
+
+#~ msgid "size log histogram\n"
+#~ msgstr "histogram rozmiarów\n"
+
+#~ msgid "density histogram\n"
+#~ msgstr "histogram gęstości\n"
+
+#, c-format
+#~ msgid ""
+#~ "Bitset statistics:\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Statystyki operacji bitset:\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Accumulated runs = %u\n"
+#~ msgstr "Uruchomień łącznie = %u\n"
+
+#~ msgid "cannot read stats file"
+#~ msgstr "nie można odczytać pliku statystyk"
+
+#, c-format
+#~ msgid "bad stats file size\n"
+#~ msgstr "błędny rozmiar pliku statystyk\n"
+
+#~ msgid "cannot write stats file"
+#~ msgstr "nie można zapisać pliku statystyk"
+
+#~ msgid "cannot open stats file for writing"
+#~ msgstr "nie można otworzyć pliku statystyk do zapisu"
+
+#~ msgid "program error"
+#~ msgstr "błąd programu"
+
+#~ msgid "stack overflow"
+#~ msgstr "przepełnienie stosu"
+
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr ""
+#~ "nie można odnaleźć katalogu tymczasowego, można spróbować ustawić $TMPDIR"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "nie można utworzyć katalogu typczasowego z użyciem szablonu \"%s\""
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "nie można usunąć pliku tymczasowego %s"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "nie można usunąć katalogu tymczasowego %s"
+
+#~ msgid "error closing file"
+#~ msgstr "błąd podczas zamykania pliku"
+
+#~ msgid "write error"
+#~ msgstr "błąd zapisu"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "zachowywanie uprawnień do %s"
+
+#, c-format
+#~ msgid "error while opening %s for reading"
+#~ msgstr "błąd podczas otwierania %s do odczytu"
+
+#, c-format
+#~ msgid "cannot open backup file %s for writing"
+#~ msgstr "nie można otworzyć pliku zapasowego %s do zapisu"
+
+#, c-format
+#~ msgid "error reading %s"
+#~ msgstr "błąd odczytu %s"
+
+#, c-format
+#~ msgid "error writing %s"
+#~ msgstr "błąd zapisu %s"
+
+#, c-format
+#~ msgid "error after reading %s"
+#~ msgstr "błąd po odczycie %s"
+
+#~ msgid "fdopen() failed"
+#~ msgstr "fdopen() nie powiodło się"
+
+#~ msgid "C# compiler not found, try installing mono"
+#~ msgstr "Nie znaleziono kompilatora C#, proszę spróbować zainstalować mono"
+
+#~ msgid "C# virtual machine not found, try installing mono"
+#~ msgstr ""
+#~ "Nie znaleziono maszyny wirtualnej C#, proszę spróbować zainstalować mono"
+
+#~ msgid "unbalanced ["
+#~ msgstr "niesparowany ["
+
+#~ msgid "invalid character class"
+#~ msgstr "błędna klasa znaków"
+
+#~ msgid "character class syntax is [[:space:]], not [:space:]"
+#~ msgstr "składnia klasy znaków to [[:space:]], nie [:space:]"
+
+#~ msgid "unfinished \\ escape"
+#~ msgstr "niedokończona sekwencja \\"
+
+#~ msgid "invalid content of \\{\\}"
+#~ msgstr "błędna zawartość \\{\\}"
+
+#~ msgid "regular expression too big"
+#~ msgstr "wyrażenie regularne zbyt duże"
+
+#~ msgid "unbalanced ("
+#~ msgstr "niesparowany ("
+
+#~ msgid "no syntax specified"
+#~ msgstr "nie określono składni"
+
+#~ msgid "unbalanced )"
+#~ msgstr "niesparowany )"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "podproces %s zawiódł"
+
+#~ msgid "regular empty file"
+#~ msgstr "pusty zwykły plik"
+
+#~ msgid "regular file"
+#~ msgstr "zwykły plik"
+
+#~ msgid "directory"
+#~ msgstr "katalog"
+
+#~ msgid "symbolic link"
+#~ msgstr "dowiązanie symboliczne"
+
+#~ msgid "message queue"
+#~ msgstr "kolejka komunikatów"
+
+#~ msgid "semaphore"
+#~ msgstr "semafor"
+
+#~ msgid "shared memory object"
+#~ msgstr "obiekt w pamięci współdzielonej"
+
+#~ msgid "typed memory object"
+#~ msgstr "obiekt z typem w pamięci"
+
+#~ msgid "block special file"
+#~ msgstr "blokowy plik specjalny"
+
+#~ msgid "character special file"
+#~ msgstr "znakowy plik specjalny"
+
+#~ msgid "contiguous data"
+#~ msgstr "dane ciągłe"
+
+#~ msgid "fifo"
+#~ msgstr "potok"
+
+#~ msgid "door"
+#~ msgstr "plik door"
+
+#~ msgid "multiplexed block special file"
+#~ msgstr "multipleksowany blokowy plik specjalny"
+
+#~ msgid "multiplexed character special file"
+#~ msgstr "multipleksowany znakowy plik specjalny"
+
+#~ msgid "multiplexed file"
+#~ msgstr "plik multipleksowany"
+
+#~ msgid "named file"
+#~ msgstr "plik nazwany"
+
+#~ msgid "network special file"
+#~ msgstr "sieciowy plik specjalny"
+
+#~ msgid "migrated file with data"
+#~ msgstr "zmigrowany plik z danymi"
+
+#~ msgid "migrated file without data"
+#~ msgstr "zmigrowany plik bez danych"
+
+#~ msgid "port"
+#~ msgstr "port"
+
+#~ msgid "socket"
+#~ msgstr "gniazdo"
+
+#~ msgid "whiteout"
+#~ msgstr "plik whiteout"
+
+#~ msgid "weird file"
+#~ msgstr "dziwny plik"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Rodzina adresów dla podanej nazwy hosta nie jest obsługiwana"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Tymczasowy błąd rozwiązywania nazw"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Błędna wartość ai_flags"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Nienaprawialny błąd w rozwiązywaniu nazw"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "ai_family zawiera nie obsługiwaną rodzinę protokołów"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Błąd przydzielania pamięci"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "Brak adresu związanego z nazwą hosta"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Nieznana nazwa lub usługa"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "Usługa nie obsługiwana dla danego ai_socktype"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "ai_socktype zawiera nie obsługiwany typ gniazda"
+
+#~ msgid "System error"
+#~ msgstr "Błąd systemowy"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "Bufor argumentu zbyt mały"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Przetwarzanie żądania jest w toku"
+
+#~ msgid "Request canceled"
+#~ msgstr "Żądanie anulowane"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Żądanie nie anulowane"
+
+#~ msgid "All requests done"
+#~ msgstr "Wszystkie żądania wykonane"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Przerwane przez sygnał"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "Łańcuch parametru niepoprawnie zakodowany"
+
+#~ msgid "Unknown error"
+#~ msgstr "Nieznany błąd"
+
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "błędny argument source_version dla compile_java_class"
+
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "błędny argument target_version dla compile_java_class"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "nie udało się utworzyć \"%s\""
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "błąd podczas zapisu pliku \"%s\""
+
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr ""
+#~ "Nie znaleziono kompilatora Javy, proszę spróbować zainstalować gcj lub "
+#~ "ustawić $JAVAC"
+
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "Nie znaleziono maszyny wirtualnej Javy, proszę spróbować zainstalować gij "
+#~ "lub ustawić $JAVA"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "błąd we/wy podprocesu %s"
+
+#, c-format
+#~ msgid "cannot stat %s"
+#~ msgstr "nie można wykonać stat na %s"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "nie można zmienić uprawnień do %s"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "nie można utworzyć katalogu %s"
+
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Nie udało się otworzyć /dev/zero do odczytu"
+
+#~ msgid "creation of reading thread failed"
+#~ msgstr "tworzenie wątku czytającego nie powiodło sie"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "nie można ustawić nieblokującego we/wy dla podprocesu %s"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "komunikacja z podprocesem %s nie powiodła się"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "zapis do podprocesu %s nie powiódł się"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "odczyt z podprocesu %s nie powiódł się"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "podproces %s zakończył się z kodem wyjścia %d"
+
+#~ msgid "creation of threads failed"
+#~ msgstr "tworzenie wątków nie powiodło się"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "podproces %s zakończył się kodem wyjścia %d"
+
+#~ msgid "`"
+#~ msgstr "`"
+
+#~ msgid "'"
+#~ msgstr "'"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[yYtT]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "ustawianie uprawnień %s"
+
+#~ msgid "Hangup"
+#~ msgstr "Rozłączenie"
+
+#~ msgid "Interrupt"
+#~ msgstr "Przerwanie"
+
+#~ msgid "Quit"
+#~ msgstr "Wyjście"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "Niedozwolona instrukcja"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Pułapka debuggera/breakpoint"
+
+#~ msgid "Aborted"
+#~ msgstr "Przerwano"
+
+#~ msgid "Floating point exception"
+#~ msgstr "Błąd w obliczeniach zmiennoprzecinkowych"
+
+#~ msgid "Killed"
+#~ msgstr "Unicestwiono"
+
+#~ msgid "Bus error"
+#~ msgstr "Błąd szyny"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "Naruszenie ochrony pamięci"
+
+#~ msgid "Broken pipe"
+#~ msgstr "Przerwany potok"
+
+#~ msgid "Alarm clock"
+#~ msgstr "Budzik"
+
+#~ msgid "Terminated"
+#~ msgstr "Zakończono"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "Nagły stan we/wy"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "Zatrzymano (sygnał)"
+
+#~ msgid "Stopped"
+#~ msgstr "Zatrzymano"
+
+#~ msgid "Continued"
+#~ msgstr "Kontynuacja"
+
+#~ msgid "Child exited"
+#~ msgstr "Zakończenie procesu potomnego"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Zatrzymano (wejście z tty)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Zatrzymano (wyjście na tty)"
+
+#~ msgid "I/O possible"
+#~ msgstr "Możliwa operacja we/wy"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "Przekroczony limit czasu procesora"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "Przekroczony limit rozmiaru pliku"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "Upłynął czas stopera wirtualnego"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "Upłynął czas stopera profilującego"
+
+#~ msgid "Window changed"
+#~ msgstr "Okno zmienione"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "Sygnał użytkownika 1"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Sygnał użytkownika 2"
+
+#~ msgid "EMT trap"
+#~ msgstr "Pułapka EMT"
+
+#~ msgid "Bad system call"
+#~ msgstr "Błędne wywołanie systemowe"
+
+#~ msgid "Stack fault"
+#~ msgstr "Błąd stosu"
+
+#~ msgid "Information request"
+#~ msgstr "Żądanie informacji"
+
+#~ msgid "Power failure"
+#~ msgstr "Awaria zasilania"
+
+#~ msgid "Resource lost"
+#~ msgstr "Utrata zasobów"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "błąd zapisu do zamkniętego potoku lub gniazda"
+
+#~ msgid "cannot create pipe"
+#~ msgstr "nie można utworzyć potoku"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "Sygnał czasu rzeczywistego %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Nieznany sygnał %d"
+
+#~ msgid "Execution times (seconds)"
+#~ msgstr "Czasy wykonywania (w sekundach)"
+
+#~ msgid "CPU user"
+#~ msgstr "CPU użytkownika"
+
+#~ msgid "CPU system"
+#~ msgstr "CPU systemu"
+
+#~ msgid "wall clock"
+#~ msgstr "zegarowo"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "nie można użyć funkcji iconv"
+
+#~ msgid "iconv function not available"
+#~ msgstr "funkcja iconv nie jest dostępna"
+
+#~ msgid "character out of range"
+#~ msgstr "znak spoza zakresu"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "nie można przekształcić U+%04X do lokalnego zestawu znaków"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "nie można przekształcić U+%04X do lokalnego zestawu znaków: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "błędny użytkownik"
+
+#~ msgid "invalid group"
+#~ msgstr "błędna grupa"
+
+#~ msgid "invalid spec"
+#~ msgstr "błędna specyfikacja"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "Pakietujący: %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "Pakietujący: %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "(C)"
+
+#, c-format
+#~ msgid ""
+#~ "License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ msgstr ""
+#~ "Licencja GPLv3+: GNU GPL wersja 3 lub późniejsza:\n"
+#~ "<%s>.\n"
+#~ "To jest oprogramowanie wolnodostępne: można je modyfikować i "
+#~ "rozpowszechniać.\n"
+#~ "Nie ma ŻADNEJ GWARANCJI w zakresie dopuszczalnym przez prawo.\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Autor: %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Autorzy: %s i %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Autorzy: %s, %s i %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Autorzy: %s, %s, %s\n"
+#~ "i %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Autorzy: %s, %s, %s,\n"
+#~ "%s i %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Autorzy: %s, %s, %s,\n"
+#~ "%s, %s i %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Autorzy: %s, %s, %s,\n"
+#~ "%s, %s, %s i %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Autorzy: %s, %s, %s,\n"
+#~ "%s, %s, %s, %s\n"
+#~ "i %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Autorzy: %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s i %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Autorzy: %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s i inni.\n"
+
+#, c-format
+#~ msgid "Report bugs to: %s\n"
+#~ msgstr ""
+#~ "Prosimy zgłaszać błędy na adres <%s>.\n"
+#~ "Błędy w tłumaczeniu prosimy zgłaszać na adres <translation-team-pl@lists."
+#~ "sourceforge.net>.\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "Błędy pakietującego (%s) prosimy zgłaszać na adres <%s>.\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "Strona domowa pakietu %s: <%s>\n"
+
+#, c-format
+#~ msgid "General help using GNU software: <%s>\n"
+#~ msgstr "Ogólna pomoc przy używaniu oprogramowania GNU: <%s>.\n"
+
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "_open_osfhandle nie powiodło się"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "nie można odtworzyć fd %d: dup2 nie powiodło się"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "podproces %s"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "podproces %s dostał krytyczny sygnał %d"
+
+#~ msgid "failed to set file descriptor text/binary mode"
+#~ msgstr "nie udało się ustawić deskryptora pliku w tryb tekstowy/binarny"
+
+#~ msgid "stdin"
+#~ msgstr "standardowego wejścia"
+
+#~ msgid "stdout"
+#~ msgstr "standardowego wyjścia"
+
+#~ msgid "stderr"
+#~ msgstr "standardowego wyjścia diagnostycznego"
+
+#~ msgid "unknown stream"
+#~ msgstr "nieznanego strumienia"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "nie udało się ponownie otworzyć %s w trybie %s"
+
+#~ msgid "string comparison failed"
+#~ msgstr "nie udało się porównanie łańcuchów znaków"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Ustaw LC_ALL='C' żeby obejść problem"
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Porównywane łańcuchy znaków do %s i %s."
+
+#~ msgid "cannot perform formatted output"
+#~ msgstr "nie można sformatować wyjścia"
+
+#, c-format
+#~ msgid "invalid %s%s argument '%s'"
+#~ msgstr "błędny argument opcji %s%s '%s'"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument '%s'"
+#~ msgstr "błędny przyrostek argumentu opcji %s%s '%s'"
+
+#, c-format
+#~ msgid "%s%s argument '%s' too large"
+#~ msgstr "argument opcji %s%s '%s' zbyt duży"
diff --git a/gl/po/pt.gmo b/gl/po/pt.gmo
new file mode 100644
index 0000000..3225c96
--- /dev/null
+++ b/gl/po/pt.gmo
Binary files differ
diff --git a/gl/po/pt.po b/gl/po/pt.po
new file mode 100644
index 0000000..666c79c
--- /dev/null
+++ b/gl/po/pt.po
@@ -0,0 +1,941 @@
+# Portuguese (Portugal) Translation for the gnulib Package.
+# Copyright (C) 2019 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+# Pedro Albuquerque <palbuquerque73@gmail.com>, 2019.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 4.0.0.2567\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2019-05-26 10:40+0100\n"
+"Last-Translator: Pedro Albuquerque <palbuquerque73@gmail.com>\n"
+"Language-Team: Portuguese <translation-team-pt@lists.sourceforge.net>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Gtranslator 2.91.7\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: valor %s é menor ou igual que %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: o parâmetro ARGP_HELP_FMT requer um valor"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: parâmetro ARGP_HELP_FMT desconhecido"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Lixo em ARGP_HELP_FMT: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Argumentos obrigatórios ou opcionais para opções longas são igualmente "
+"obrigatórios ou opcionais para opções curtas correspondentes."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Uso:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " ou: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [OPÇÃO...]"
+
+#: gl/lib/argp-help.c:1783
+#, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Tente \"%s --help\" ou \"%s --usage\" para mais informação.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "Reportar erros a %s.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Erro de sistema desconhecido"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "mostra esta lista de ajuda"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "mostrar mensagem curta de uso"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "NOME"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "define o nome do programa"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "SEGS"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "espera SEGS segundos (predefinição 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "mostra versão do programa"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(ERRO DO PROGRAMA) Sem versão conhecida!?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: demasiados argumentos\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(ERRO DO PROGRAMA) A opção devia ter sido reconhecida!?"
+
+#: gl/lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: a opção \"%s%s\" é ambígua\n"
+
+#: gl/lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: a opção \"%s%s\" é ambígua; possibilidades:"
+
+#: gl/lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: opção não reconhecida \"%s%s\"\n"
+
+#: gl/lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: a opção \"%s%s\" não permite um argumento\n"
+
+#: gl/lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "\"%s: a opção \"%s%s\" requer um argumento\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: opção inválida -- \"%c\"\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: a opção requer um argumento -- \"%c\"\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "impossível gravar a pasta de trabalho actual"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "falha ao voltar à pasta de trabalho inicial"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Sucesso"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Sem correspondência"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Expressão regular inválida"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Carácter de agrupamento inválido"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Nome de classe de carácter inválido"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Barra invertida final"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Referência de recuo inválida"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[, [^, [:, [., ou [= sem par"
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "( ou \\( sem par"
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "\\{ sem par"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "Conteúdo de \\{\\} inválido"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Fim de intervalo inválido"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Memória esgotada"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Expressão regular precedente inválida"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Fim prematuro de expressão regular"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "Expressão regular muito grande"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ") ou \\) sem par"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Sem expressão regular anterior"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "impossível mostrar mensagem de erro"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memória esgotada"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr "descritores de ficheiro padrão"
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "argumento %s inválido para %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "argumento %s ambíguo para %s"
+
+#~ msgid "Valid arguments are:"
+#~ msgstr "Os argumentos válidos são:"
+
+#, c-format
+#~ msgid "%u bitset_allocs, %u freed (%.2f%%).\n"
+#~ msgstr "%u bitset_allocs, %u libertados (%.2f%%).\n"
+
+#, c-format
+#~ msgid "%u bitset_sets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_sets, %u em cache (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_resets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_resets, %u em cache (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_tests, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_tests, %u em cache (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_lists\n"
+#~ msgstr "%u bitset_lists\n"
+
+#~ msgid "count log histogram\n"
+#~ msgstr "histograma de diário total\n"
+
+#~ msgid "size log histogram\n"
+#~ msgstr "histograma de diário de tamanho\n"
+
+#~ msgid "density histogram\n"
+#~ msgstr "histograma de densidade\n"
+
+#, c-format
+#~ msgid ""
+#~ "Bitset statistics:\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Estatísticas de bitset:\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Accumulated runs = %u\n"
+#~ msgstr "Execuções acumuladas = %u\n"
+
+#~ msgid "cannot read stats file"
+#~ msgstr "impossível ler ficheiro de estatísticas"
+
+#, c-format
+#~ msgid "bad stats file size\n"
+#~ msgstr "mau tamanho de ficheiro de estatísticas\n"
+
+#~ msgid "cannot write stats file"
+#~ msgstr "impossível escrever ficheiro de estatísticas"
+
+#~ msgid "cannot open stats file for writing"
+#~ msgstr "impossível abrir ficheiro de estatísticas para escrita"
+
+#~ msgid "program error"
+#~ msgstr "erro de programa"
+
+#~ msgid "stack overflow"
+#~ msgstr "transporte da pilha"
+
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr "impossível encontrar uma pasta temporária, tente definir $TMPDIR"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "impossível criar uma pasta temporária usando o modelo \"%s\""
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "impossível remover o ficheiro temporário %s"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "impossível remover a pasta temporária %s"
+
+#~ msgid "error closing file"
+#~ msgstr "erro ao fechar o ficheiro"
+
+#~ msgid "write error"
+#~ msgstr "erro de escrita"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "preservar permissões para %s"
+
+#, c-format
+#~ msgid "error while opening %s for reading"
+#~ msgstr "erro ao abrir %s para leitura"
+
+#, c-format
+#~ msgid "cannot open backup file %s for writing"
+#~ msgstr "impossível abrir a segurança %s para escrita"
+
+#, c-format
+#~ msgid "error reading %s"
+#~ msgstr "erro ao ler %s"
+
+#, c-format
+#~ msgid "error writing %s"
+#~ msgstr "erro ao escrever %s"
+
+#, c-format
+#~ msgid "error after reading %s"
+#~ msgstr "erro após ler %s"
+
+#~ msgid "fdopen() failed"
+#~ msgstr "fdopen() falhou"
+
+#~ msgid "C# compiler not found, try installing mono"
+#~ msgstr "Compilador C# não encontrado, tente instalar mono"
+
+#~ msgid "C# virtual machine not found, try installing mono"
+#~ msgstr "Máquina virtual C# não encontrada, tente instalar mono"
+
+#~ msgid "unbalanced ["
+#~ msgstr "[ sem par"
+
+#~ msgid "invalid character class"
+#~ msgstr "classe de carácter inválida"
+
+#~ msgid "character class syntax is [[:space:]], not [:space:]"
+#~ msgstr "a sintaxe da classe de carácter é [[:espaço:]], não [:espaço:]"
+
+#~ msgid "unfinished \\ escape"
+#~ msgstr "escape \\ não terminado"
+
+#~ msgid "invalid content of \\{\\}"
+#~ msgstr "Conteúdo de \\{\\} inválido"
+
+#~ msgid "regular expression too big"
+#~ msgstr "expressão regular muito grande"
+
+#~ msgid "unbalanced ("
+#~ msgstr "( sem par"
+
+#~ msgid "no syntax specified"
+#~ msgstr "sem sintaxe especificada"
+
+#~ msgid "unbalanced )"
+#~ msgstr ") sem par"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "sub-processo %s falhou"
+
+#~ msgid "regular empty file"
+#~ msgstr "ficheiro normal vazio"
+
+#~ msgid "regular file"
+#~ msgstr "ficheiro normal"
+
+#~ msgid "directory"
+#~ msgstr "pasta"
+
+#~ msgid "symbolic link"
+#~ msgstr "ligação simbólica"
+
+#~ msgid "message queue"
+#~ msgstr "fila de mensagens"
+
+#~ msgid "semaphore"
+#~ msgstr "semáforo"
+
+#~ msgid "shared memory object"
+#~ msgstr "objecto de memória partilhado"
+
+#~ msgid "typed memory object"
+#~ msgstr "objecto de memória tipificado"
+
+#~ msgid "block special file"
+#~ msgstr "ficheiro especial de blocos"
+
+#~ msgid "character special file"
+#~ msgstr "ficheiro especial de caracteres"
+
+#~ msgid "contiguous data"
+#~ msgstr "dados contíguos"
+
+#~ msgid "fifo"
+#~ msgstr "fifo"
+
+#~ msgid "door"
+#~ msgstr "porta"
+
+#~ msgid "multiplexed block special file"
+#~ msgstr "ficheiro especial de blocos multiplexado"
+
+#~ msgid "multiplexed character special file"
+#~ msgstr "ficheiro especial de caracteres multiplexado"
+
+#~ msgid "multiplexed file"
+#~ msgstr "ficheiro multiplexado"
+
+#~ msgid "named file"
+#~ msgstr "ficheiro com nome"
+
+#~ msgid "network special file"
+#~ msgstr "ficheiro especial de rede"
+
+#~ msgid "migrated file with data"
+#~ msgstr "ficheiro migrado com dados"
+
+#~ msgid "migrated file without data"
+#~ msgstr "ficheiro migrado sem dados"
+
+#~ msgid "port"
+#~ msgstr "porta"
+
+#~ msgid "socket"
+#~ msgstr "socket"
+
+#~ msgid "whiteout"
+#~ msgstr "whiteout"
+
+#~ msgid "weird file"
+#~ msgstr "ficheiro estranho"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Família de endereço para nome de servidor não suportado"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Falha temporária na resolução de nome"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Valor errado para ai_flags"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Falha irrecuperável na resolução de nome"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "ai_family não suportada"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Falha de alocação de memória"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "Sem endereço associado ao nome de anfitrião"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Nome ou serviço desconhecido"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "Nome de servidor não suportado para ai_socktype"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "ai_socktype não suportado"
+
+#~ msgid "System error"
+#~ msgstr "Erro de sistema"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "Buffer de argumentos muito pequeno"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "A processar pedido em curso"
+
+#~ msgid "Request canceled"
+#~ msgstr "Pedido cancelado"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Pedido não cancelado"
+
+#~ msgid "All requests done"
+#~ msgstr "Todos os pedidos feitos"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Interrompido por um sinal"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "Cadeia de parâmetros incorrectamente codificada"
+
+#~ msgid "Unknown error"
+#~ msgstr "Erro desconhecido"
+
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "argumento source_version inválido para compile_java_class"
+
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "argumento target_version inválido para compile_java_class"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "falha ao criar \"%s\""
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "erro ao escrever o ficheiro \"%s\""
+
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr "Compilador Java não encontrado, tente instalar gcj ou defina $JAVAC"
+
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "Máquina virtual Java não encontrada, tente instalar gij ou defina $JAVA"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "erro E/S no sub-processo %s"
+
+#, c-format
+#~ msgid "cannot stat %s"
+#~ msgstr "impossível obter informação para %s"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "impossível alterar as permissões de %s"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "impossível criar a pasta %s"
+
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Falha ao abrir /dev/zero para leitura"
+
+#~ msgid "creation of reading thread failed"
+#~ msgstr "falha ao criar tópico de leitura"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "impossível configurar E/S não-bloqueadora para sub-pocesso %s"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "falha ao comunicar com o sub-processo %s"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "falha ao escrever no sub-processo %s"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "falha ao ler do sub-processo %s"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "sub-processo %s terminou com código de saída %d"
+
+#~ msgid "creation of threads failed"
+#~ msgstr "falha ao criar tópicos"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "sub-processo %s terminou com código de saída %d"
+
+#~ msgid "`"
+#~ msgstr "\""
+
+#~ msgid "'"
+#~ msgstr "\""
+
+#~ msgid "^[yY]"
+#~ msgstr "^[Ss]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "a definir permissões para %s"
+
+#~ msgid "Hangup"
+#~ msgstr "Desligar"
+
+#~ msgid "Interrupt"
+#~ msgstr "Interromper"
+
+#~ msgid "Quit"
+#~ msgstr "Sair"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "Instrução ilegal"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Armadilha de rastreio/ponto de quebra"
+
+#~ msgid "Aborted"
+#~ msgstr "Abortado"
+
+#~ msgid "Floating point exception"
+#~ msgstr "Excepção de vírgula flutuante"
+
+#~ msgid "Killed"
+#~ msgstr "Morto"
+
+#~ msgid "Bus error"
+#~ msgstr "Erro de bus"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "Falha de segmentação"
+
+#~ msgid "Broken pipe"
+#~ msgstr "Túnel quebrado"
+
+#~ msgid "Alarm clock"
+#~ msgstr "Alarme"
+
+#~ msgid "Terminated"
+#~ msgstr "Terminado"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "Condição E/S urgente"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "Parado (sinal)"
+
+#~ msgid "Stopped"
+#~ msgstr "Parado"
+
+#~ msgid "Continued"
+#~ msgstr "Continuado"
+
+#~ msgid "Child exited"
+#~ msgstr "Filho saiu"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Parado (entrada tty)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Parado (saída tty)"
+
+#~ msgid "I/O possible"
+#~ msgstr "Possível E/S"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "Excedido limite de tempo da CPU"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "Excedido limite de tamanho do ficheiro"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "Temporizador virtual expirado"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "Temporizador de perfil expirado"
+
+#~ msgid "Window changed"
+#~ msgstr "Janela alterada"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "Sinal 1 definido pelo utilizador"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Sinal 2 definido pelo utilizador"
+
+#~ msgid "EMT trap"
+#~ msgstr "Armadilha EMT"
+
+#~ msgid "Bad system call"
+#~ msgstr "Má chamada de sistema"
+
+#~ msgid "Stack fault"
+#~ msgstr "Falha de pilha"
+
+#~ msgid "Information request"
+#~ msgstr "Pedido de informação"
+
+#~ msgid "Power failure"
+#~ msgstr "Falha de energia"
+
+#~ msgid "Resource lost"
+#~ msgstr "Recurso perdido"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "Erro ao escrever num túnel ou socket fechado"
+
+#~ msgid "cannot create pipe"
+#~ msgstr "impossível criar túnel"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "Sinal %d de tempo real"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Sinal %d desconhecido"
+
+#~ msgid "Execution times (seconds)"
+#~ msgstr "Tempos de execução (segundos)"
+
+#~ msgid "CPU user"
+#~ msgstr "utilizador de CPU"
+
+#~ msgid "CPU system"
+#~ msgstr "Sistema de CPU"
+
+#~ msgid "wall clock"
+#~ msgstr "relógio de parede"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "função iconv inutilizável"
+
+#~ msgid "iconv function not available"
+#~ msgstr "função iconv indisponível"
+
+#~ msgid "character out of range"
+#~ msgstr "carácter fora do intervalo"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "impossível converter U+%04X para conjunto de caracteres local"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "impossível converter U+%04X para conjunto de caracteres local: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "utilizador inválido"
+
+#~ msgid "invalid group"
+#~ msgstr "grupo inválido"
+
+#~ msgid "invalid spec"
+#~ msgstr "especificação inválida"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "Empacotado por %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "Empacotado por %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "(©)"
+
+#, c-format
+#~ msgid ""
+#~ "License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ msgstr ""
+#~ "Licença GPLv3+: GNU GPL versão 3 ou posterior <%s>\n"
+#~ "Este é um programa grátis: pode alterá-lo e redistribuí-lo.\n"
+#~ "Não há QUALQUER GARANTIA, até ao limite da Lei.\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Escrito por %s\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Escrito por %s e %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Escrito por %s, %s e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s\n"
+#~ "e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, %s e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, %s, %s e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, %s, %s, %s\n"
+#~ "e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s e outros.\n"
+
+#, c-format
+#~ msgid "Report bugs to: %s\n"
+#~ msgstr "Reportar erros a: %s\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "Reportar erros %s a: %s\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "Página inicial %s: <%s>\n"
+
+#, c-format
+#~ msgid "General help using GNU software: <%s>\n"
+#~ msgstr "Ajuda geral para utilizar programas GNU: <%s>\n"
+
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "_open_osfhandle falhou"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "impossível restaurar fd %d: dup2 falhou"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "sub-processo %s"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "sub-processo %s obteve sinal fatal %d"
+
+#~ msgid "failed to set file descriptor text/binary mode"
+#~ msgstr "falha ao definir modo texto/binário do descritor de ficheiro"
+
+#~ msgid "stdin"
+#~ msgstr "stdin"
+
+#~ msgid "stdout"
+#~ msgstr "stdout"
+
+#~ msgid "stderr"
+#~ msgstr "stderr"
+
+#~ msgid "unknown stream"
+#~ msgstr "fluxo desconhecido"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "falha ao reabrir %s com modo %s"
+
+#~ msgid "string comparison failed"
+#~ msgstr "erro na comparação da cadeia"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Defina LC_ALL=\"C\" para contornar o problema."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "As cadeias comparadas foram %s e %s."
+
+#~ msgid "cannot perform formatted output"
+#~ msgstr "impossível formatar o resultado de saída"
+
+#, c-format
+#~ msgid "invalid %s%s argument '%s'"
+#~ msgstr "argumento %s%s \"%s\" inválido"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument '%s'"
+#~ msgstr "sufixo inválido em %s%s, argumento \"%s\""
+
+#, c-format
+#~ msgid "%s%s argument '%s' too large"
+#~ msgstr "argumento %s%s \"%s\" muito grande"
diff --git a/gl/po/pt_BR.gmo b/gl/po/pt_BR.gmo
new file mode 100644
index 0000000..798c0a0
--- /dev/null
+++ b/gl/po/pt_BR.gmo
Binary files differ
diff --git a/gl/po/pt_BR.po b/gl/po/pt_BR.po
new file mode 100644
index 0000000..9a8cce2
--- /dev/null
+++ b/gl/po/pt_BR.po
@@ -0,0 +1,1090 @@
+# Brazilian Portuguese translations for gnulib package
+# Traduções em português brasileiro para o pacote gnulib
+# Copyright (C) 2019 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+# Cyro Mendes De Moraes Neto <neto@conectiva.com.br>, 1998.
+# Rodrigo Stulzer Lopes <rodrigo@conectiva.com.br>, 2001.
+# Juan Carlos Castro y Castro <jcastro@vialink.com.br>, 2003.
+# Rafael Fontenelle <rafaelff@gnome.org>, 2013, 2017, 2019.
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 4.0.0.2567\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2019-08-28 15:29-0300\n"
+"Last-Translator: Rafael Fontenelle <rafaelff@gnome.org>\n"
+"Language-Team: Brazilian Portuguese <ldpbr-translation@lists.sourceforge."
+"net>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+"X-Generator: Virtaal 1.0.0-beta1\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: O valor %s é menor do que ou igual a %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: O parâmetro ARGP_HELP_FMT exige um valor"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: Parâmetro ARGP_HELP_FMT desconhecido"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Lixo em ARGP_HELP_FMT: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Argumentos obrigatórios ou opcionais para opções longas também o são para "
+"quaisquer opções curtas correspondentes."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Uso:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " ou: "
+
+# , c-format
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [OPÇÃO...]"
+
+# , c-format
+#: gl/lib/argp-help.c:1783
+#, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Tente \"%s --help\" ou \"%s --usage\" para mais informação.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "Relate erros para %s.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Erro desconhecido de sistema"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "fornece esta lista de ajuda"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "fornece uma mensagem de uso curta"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "NOME"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "define o nome do programa"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "SEGS"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "segura por SEGS segundos (padrão 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "mostra a versão do programa"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(ERRO NO PROGRAMA) Nenhuma versão conhecida!?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: Número excessivo de argumentos\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(ERRO NO PROGRAMA) A opção deveria ter sido reconhecida!?"
+
+#: gl/lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: a opção \"%s%s\" é ambígua\n"
+
+#: gl/lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: a opção \"%s%s\" é ambígua; possibilidades:"
+
+# , c-format
+#: gl/lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: opção desconhecida \"%s%s\"\n"
+
+#: gl/lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: a opção \"%s%s\" não permite um argumento\n"
+
+#: gl/lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: a opção \"%s%s\" exige um argumento\n"
+
+# , c-format
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: opção inválida -- \"%c\"\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: a opção exige um argumento -- \"%c\"\n"
+
+# , c-format
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "não foi possível registrar o diretório de trabalho atual"
+
+# , c-format
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "falha em retornar ao diretório de trabalho inicial"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Sucesso"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Nenhuma ocorrência do padrão"
+
+# , c-format
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Expressão regular inválida"
+
+# , c-format
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Caractere de combinação inválido"
+
+# , c-format
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Nome inválido de classe de caracteres"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Barra invertida no final"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Retrorreferência inválida"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[, [^, [:, [., ou [= sem correspondente"
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "( ou \\( sem correspondente"
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "\\{ sem correspondente"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "Conteúdo inválido de \\{\\}"
+
+# , c-format
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Fim de intervalo inválido"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Memória esgotada"
+
+# , c-format
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "A expressão regular precedente é inválida"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Fim prematuro da expressão regular"
+
+# , c-format
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "Expressão regular grande demais"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ") ou \\) sem correspondente"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Nenhuma expressão regular anterior"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "não foi possível exibir a mensagem de erro"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memória esgotada"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr "descritores de arquivo padrão"
+
+# , c-format
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "argumento inválido %s para %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "argumento ambíguo %s para %s"
+
+#~ msgid "Valid arguments are:"
+#~ msgstr "Argumentos válidos são:"
+
+#, c-format
+#~ msgid "%u bitset_allocs, %u freed (%.2f%%).\n"
+#~ msgstr "%u bitset_allocs, %u liberados (%.2f%%).\n"
+
+#, c-format
+#~ msgid "%u bitset_sets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_sets, %u em cache (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_resets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_resets, %u em cache (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_tests, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_tests, %u em cache (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_lists\n"
+#~ msgstr "%u bitset_lists\n"
+
+#~ msgid "count log histogram\n"
+#~ msgstr "histograma de log de contagem\n"
+
+#~ msgid "size log histogram\n"
+#~ msgstr "histograma de log de tamanho\n"
+
+#~ msgid "density histogram\n"
+#~ msgstr "histograma de densidade\n"
+
+#, c-format
+#~ msgid ""
+#~ "Bitset statistics:\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Estatística de bitset:\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Accumulated runs = %u\n"
+#~ msgstr "Execuções acumuladas = %u\n"
+
+# , c-format
+#~ msgid "cannot read stats file"
+#~ msgstr "não foi possível ler o arquivo de estado"
+
+#, c-format
+#~ msgid "bad stats file size\n"
+#~ msgstr "tamanho inválido de arquivo de estado\n"
+
+# , c-format
+#~ msgid "cannot write stats file"
+#~ msgstr "não foi possível escrever o arquivo de estado"
+
+#~ msgid "cannot open stats file for writing"
+#~ msgstr "não foi possível abrir o arquivo de estado para escrita"
+
+#~ msgid "program error"
+#~ msgstr "erro do programa"
+
+#~ msgid "stack overflow"
+#~ msgstr "estouro de pilha"
+
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr ""
+#~ "não foi possível localizar um diretório temporário, tente definir $TMPDIR"
+
+# , c-format
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr ""
+#~ "não foi possível criar um diretório temporário usando o modelo \"%s\""
+
+# , c-format
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "não foi possível remover o arquivo temporário %s"
+
+# , c-format
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "não foi possível remover o diretório temporário %s"
+
+#~ msgid "error closing file"
+#~ msgstr "erro ao fechar o arquivo"
+
+#~ msgid "write error"
+#~ msgstr "erro de escrita"
+
+# , c-format
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "preservando permissões de %s"
+
+#, c-format
+#~ msgid "error while opening %s for reading"
+#~ msgstr "erro ao abrir %s para leitura"
+
+#, c-format
+#~ msgid "cannot open backup file %s for writing"
+#~ msgstr "não foi possível abrir o arquivo backup %s para escrita"
+
+# , c-format
+#, c-format
+#~ msgid "error reading %s"
+#~ msgstr "erro ao ler %s"
+
+# , c-format
+#, c-format
+#~ msgid "error writing %s"
+#~ msgstr "erro ao escrever %s"
+
+# , c-format
+#, c-format
+#~ msgid "error after reading %s"
+#~ msgstr "erro após leitura de %s"
+
+#~ msgid "fdopen() failed"
+#~ msgstr "fdopen() falhou"
+
+#~ msgid "C# compiler not found, try installing mono"
+#~ msgstr "O compilador C# não foi localizado, tente instalar mono"
+
+#~ msgid "C# virtual machine not found, try installing mono"
+#~ msgstr "A máquina virtual C# não foi localizada, tente instalar mono"
+
+#~ msgid "unbalanced ["
+#~ msgstr "[ não balanceado"
+
+# , c-format
+#~ msgid "invalid character class"
+#~ msgstr "classe de caracteres inválida"
+
+#~ msgid "character class syntax is [[:space:]], not [:space:]"
+#~ msgstr "a sintaxe da classe de caracteres é [[:space:]], não [:space:]"
+
+#~ msgid "unfinished \\ escape"
+#~ msgstr "escape \\ não finalizado"
+
+#~ msgid "invalid content of \\{\\}"
+#~ msgstr "conteúdo inválido de \\{\\}"
+
+# , c-format
+#~ msgid "regular expression too big"
+#~ msgstr "expressão regular grande demais"
+
+#~ msgid "unbalanced ("
+#~ msgstr "( não balanceado"
+
+#~ msgid "no syntax specified"
+#~ msgstr "nenhuma sintaxe especificada"
+
+#~ msgid "unbalanced )"
+#~ msgstr ") não balanceado"
+
+# , c-format
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "subprocesso %s falhou"
+
+#~ msgid "regular empty file"
+#~ msgstr "arquivo comum vazio"
+
+#~ msgid "regular file"
+#~ msgstr "arquivo comum"
+
+#~ msgid "directory"
+#~ msgstr "diretório"
+
+#~ msgid "symbolic link"
+#~ msgstr "link simbólico"
+
+#~ msgid "message queue"
+#~ msgstr "fila de mensagem"
+
+#~ msgid "semaphore"
+#~ msgstr "semáforo"
+
+#~ msgid "shared memory object"
+#~ msgstr "objeto de memória compartilhada"
+
+#~ msgid "typed memory object"
+#~ msgstr "objeto de memória tipificada"
+
+#~ msgid "block special file"
+#~ msgstr "arquivo especial de bloco"
+
+#~ msgid "character special file"
+#~ msgstr "arquivo especial de caractere"
+
+#~ msgid "contiguous data"
+#~ msgstr "dados contíguos"
+
+# first-in, first-out; abreviação muito usada no meio computacional em português -- Rafael
+#~ msgid "fifo"
+#~ msgstr "fifo"
+
+# https://en.wikipedia.org/wiki/Unix_file_types#Door
+# Não traduzir para porta para evitar confusão com "port"
+#~ msgid "door"
+#~ msgstr "door"
+
+#~ msgid "multiplexed block special file"
+#~ msgstr "arquivo multiplexado especial de bloco"
+
+#~ msgid "multiplexed character special file"
+#~ msgstr "arquivo multiplexado especial de caractere"
+
+#~ msgid "multiplexed file"
+#~ msgstr "arquivo multiplexado"
+
+#~ msgid "named file"
+#~ msgstr "arquivo nomeado"
+
+#~ msgid "network special file"
+#~ msgstr "arquivo especial de rede"
+
+#~ msgid "migrated file with data"
+#~ msgstr "arquivo migrado com dados"
+
+#~ msgid "migrated file without data"
+#~ msgstr "arquivo migrado sem dados"
+
+#~ msgid "port"
+#~ msgstr "porta"
+
+#~ msgid "socket"
+#~ msgstr "soquete"
+
+#~ msgid "whiteout"
+#~ msgstr "whiteout"
+
+#~ msgid "weird file"
+#~ msgstr "arquivo estranho"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Não há suporte para família de endereços para nome de máquina"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Falha temporária na resolução de nome"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Valor inválido para ai_flags"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Falha irrecuperável na resolução de nome"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "Não há suporte a ai_family"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Falha na alocação de memória"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "Nenhum endereço associado ao nome de máquina"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Nome ou serviço desconhecido"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "Sem suporte ao nome de serviço pelo ai_socktype"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "Não há suporte a ai_socktype"
+
+#~ msgid "System error"
+#~ msgstr "Erro de sistema"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "Buffer de argumentos é pequeno demais"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Processamento de requisição em andamento"
+
+#~ msgid "Request canceled"
+#~ msgstr "Requisição cancelada"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Requisição não cancelada"
+
+#~ msgid "All requests done"
+#~ msgstr "Todas as requisições foram atendidas"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Interrompido por um sinal"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "Texto do parâmetro codificado incorretamente"
+
+#~ msgid "Unknown error"
+#~ msgstr "Erro desconhecido"
+
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "argumento source_version inválido para compile_java_class"
+
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "argumento target_version inválido para compile_java_class"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "falha ao criar \"%s\""
+
+# , c-format
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "erro ao escrever o arquivo \"%s\""
+
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr ""
+#~ "O compilador de Java não foi localizado, tente instalar gcj ou definir "
+#~ "$JAVAC"
+
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "A máquina virtual de Java não foi localizada, tente instalar gij ou "
+#~ "definir $JAVA"
+
+# , c-format
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "erro de E/S no subprocesso %s"
+
+# , c-format
+#, c-format
+#~ msgid "cannot stat %s"
+#~ msgstr "não foi possível obter estado de %s"
+
+# , c-format
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "não foi possível mudar permissões de %s"
+
+# , c-format
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "não foi possível criar o diretório %s"
+
+# , c-format
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Falha ao abrir /dev/zero para leitura"
+
+#~ msgid "creation of reading thread failed"
+#~ msgstr "a criação da thread de leitura falhou"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "não foi possível configurar E/S sem bloqueio para o subprocesso %s"
+
+# , c-format
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "a comunicação com o subprocesso %s falhou"
+
+# , c-format
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "escrita no subprocesso %s falhou"
+
+# , c-format
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "leitura do subprocesso %s falhou"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "o subprocesso %s terminou com o código de saída %d"
+
+#~ msgid "creation of threads failed"
+#~ msgstr "a criação das threads falhou"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "subprocesso %s terminado com código de saída %d"
+
+#~ msgid "`"
+#~ msgstr "“"
+
+#~ msgid "'"
+#~ msgstr "”"
+
+# Valor exato de 'yesexpr', conforme mensagem do desenvolvedor -- Rafael
+#~ msgid "^[yY]"
+#~ msgstr "^[+1SsyY]"
+
+# Valor exato de 'noexpr', conforme mensagem do desenvolvedor -- Rafael
+#~ msgid "^[nN]"
+#~ msgstr "^[-0nN]"
+
+# , c-format
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "definindo permissões de %s"
+
+# Sinal SIGHUP
+#~ msgid "Hangup"
+#~ msgstr "Desconexão"
+
+# Sinal SIGINT
+#~ msgid "Interrupt"
+#~ msgstr "Interrupção"
+
+# Sinal SIGQUIT
+#~ msgid "Quit"
+#~ msgstr "Desistência"
+
+# Sinal SIGILL
+#~ msgid "Illegal instruction"
+#~ msgstr "Instrução ilegal"
+
+# AFAIK, o termo em inglês muito utilizado. Aceito sugestões -- Rafael
+# Sinal SIGTRAP
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Trap de trace/breakpoint"
+
+# Sinal SIGABRT
+#~ msgid "Aborted"
+#~ msgstr "Abortado"
+
+# Sinal SIGFPE
+#~ msgid "Floating point exception"
+#~ msgstr "Exceção de ponto flutuante"
+
+# Sinal SIGKILL
+#~ msgid "Killed"
+#~ msgstr "Morto"
+
+# Sinal SIGBUS
+#~ msgid "Bus error"
+#~ msgstr "Erro de barramento"
+
+# Sinal SIGSEGV
+#~ msgid "Segmentation fault"
+#~ msgstr "Falha de segmentação"
+
+# Sinal SIGPIPE
+#~ msgid "Broken pipe"
+#~ msgstr "Conexão interrompida"
+
+# Sinal SIGALRM
+#~ msgid "Alarm clock"
+#~ msgstr "Despertador"
+
+# Sinal SIGTERM
+#~ msgid "Terminated"
+#~ msgstr "Terminado"
+
+# Sinal SIGURG
+#~ msgid "Urgent I/O condition"
+#~ msgstr "Condição urgente de E/S"
+
+# Sinal SIGSTP
+#~ msgid "Stopped (signal)"
+#~ msgstr "Suspenso (sinal)"
+
+# Sinal SIGTSTP
+#~ msgid "Stopped"
+#~ msgstr "Suspenso"
+
+# Sinal SIGCONT
+#~ msgid "Continued"
+#~ msgstr "Continuado"
+
+# Sinal SIGCHLD
+#~ msgid "Child exited"
+#~ msgstr "Processo filho saiu"
+
+# Sinal SIGTTIN
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Suspenso (entrada tty)"
+
+# Sinal SIGTTOU
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Suspenso (saída tty)"
+
+# Sinal SIGIO
+#~ msgid "I/O possible"
+#~ msgstr "E/S possível"
+
+# Sinal SIGXCPU
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "Tempo na CPU excedido"
+
+# Sinal SIGXFSZ
+#~ msgid "File size limit exceeded"
+#~ msgstr "Tamanho de arquivo excedido"
+
+# Sinal SIGVTALRM
+#~ msgid "Virtual timer expired"
+#~ msgstr "Temporizador virtual expirou"
+
+# Sinal SIGPROF
+#~ msgid "Profiling timer expired"
+#~ msgstr "Temporizador de perfil expirou"
+
+#~ msgid "Window changed"
+#~ msgstr "Janela alterada"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "Sinal 1 definido pelo usuário"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Sinal 2 definido pelo usuário"
+
+#~ msgid "EMT trap"
+#~ msgstr "Trap de EMT"
+
+#~ msgid "Bad system call"
+#~ msgstr "Chamada de sistema inválida"
+
+#~ msgid "Stack fault"
+#~ msgstr "Falha na pilha"
+
+#~ msgid "Information request"
+#~ msgstr "Requisição de informação"
+
+#~ msgid "Power failure"
+#~ msgstr "Falha de energia"
+
+#~ msgid "Resource lost"
+#~ msgstr "Recurso perdido"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "erro de escrita para um redirecionamento (pipe) ou soquete fechado"
+
+# , c-format
+#~ msgid "cannot create pipe"
+#~ msgstr "não foi possível criar redirecionamento"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "Sinal de tempo real %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Sinal desconhecido %d"
+
+#~ msgid "Execution times (seconds)"
+#~ msgstr "Tempos de execução (segundos)"
+
+#~ msgid "CPU user"
+#~ msgstr "CPU usuário"
+
+#~ msgid "CPU system"
+#~ msgstr "CPU sistema"
+
+# Sinal SIGALRM
+#~ msgid "wall clock"
+#~ msgstr "relógio de parede"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "função iconv não utilizável"
+
+#~ msgid "iconv function not available"
+#~ msgstr "função iconv não disponível"
+
+# , c-format
+#~ msgid "character out of range"
+#~ msgstr "caractere fora do intervalo"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr ""
+#~ "não foi possível converter U+%04X para o conjunto de caracteres local"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr ""
+#~ "não foi possível converter U+%04X para o conjunto de caracteres local: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "usuário inválido"
+
+#~ msgid "invalid group"
+#~ msgstr "grupo inválido"
+
+#~ msgid "invalid spec"
+#~ msgstr "especificação inválida"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "Empacotado por %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "Empacotado por %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "(C)"
+
+#, c-format
+#~ msgid ""
+#~ "License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ msgstr ""
+#~ "Licença GPLv3+: GNU GPL versão 3 ou posterior <%s>\n"
+#~ "Este é um software livre: você é livre para alterá-lo e redistribuí-lo.\n"
+#~ "NÃO HÁ QUALQUER GARANTIA, na máxima extensão permitida em lei.\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Escrito por %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Escrito por %s e %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Escrito por %s, %s e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s\n"
+#~ "e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, %s e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, %s, %s e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, %s, %s, %s\n"
+#~ "e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s e %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Escrito por %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s e outros.\n"
+
+# Adicionado endereço de email da equipe, conforme solicitação do desenvolvedor -- Rafael
+#, c-format
+#~ msgid "Report bugs to: %s\n"
+#~ msgstr ""
+#~ "Relate erros para: %s\n"
+#~ "Relate erros de tradução para <https://translationproject.org/team/pt_BR."
+#~ "html>\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "Relate erros do %s para: %s\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "Página do %s: <%s>\n"
+
+#, c-format
+#~ msgid "General help using GNU software: <%s>\n"
+#~ msgstr "Ajuda para uso de softwares GNU: <%s>\n"
+
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "_open_osfhandle falhou"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "não foi possível restaurar descritor de arquivo %d: dup2 falhou"
+
+# , c-format
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "subprocesso %s"
+
+# , c-format
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "o subprocesso %s recebeu sinal fatal %d"
+
+#~ msgid "failed to set file descriptor text/binary mode"
+#~ msgstr "falha ao definir modo texto/binário do descritor de arquivo"
+
+#~ msgid "stdin"
+#~ msgstr "entrada padrão (stdin)"
+
+#~ msgid "stdout"
+#~ msgstr "saída padrão (stdout)"
+
+#~ msgid "stderr"
+#~ msgstr "erro padrão (stderr)"
+
+#~ msgid "unknown stream"
+#~ msgstr "fluxo desconhecido"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "falha ao reabrir %s com modo %s"
+
+#~ msgid "string comparison failed"
+#~ msgstr "a comparação de textos falhou"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Defina LC_ALL='C' para contornar o problema."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Os textos comparados foram %s e %s."
+
+#~ msgid "cannot perform formatted output"
+#~ msgstr "não foi possível fazer a saída formatada"
+
+# %s%s é hífen e opção, `%s' é o argumento da opção
+# , c-format
+#, c-format
+#~ msgid "invalid %s%s argument '%s'"
+#~ msgstr "argumento inválido para %s%s: \"%s\""
+
+# %s%s é hífen e opção, `%s' é o argumento da opção
+# , c-format
+#, c-format
+#~ msgid "invalid suffix in %s%s argument '%s'"
+#~ msgstr "sufixo inválido no argumento para %s%s \"%s\""
+
+# %s%s é hífen e opção, `%s' é o argumento da opção
+#, c-format
+#~ msgid "%s%s argument '%s' too large"
+#~ msgstr "argumento para %s%s \"%s\" é grande demais"
+
+#~ msgid "%s home page: <https://www.gnu.org/software/%s/>\n"
+#~ msgstr "Página do %s: <https://www.gnu.org/software/%s/>\n"
+
+#~ msgid "%.*s: ARGP_HELP_FMT parameter must be positive"
+#~ msgstr "%.*s: O parâmetro ARGP_HELP_FMT deve ser positivo"
+
+#~ msgid "%s: option '--%s' doesn't allow an argument\n"
+#~ msgstr "%s: a opção \"--%s\" não permite um argumento\n"
+
+# , c-format
+#~ msgid "%s: unrecognized option '--%s'\n"
+#~ msgstr "%s: opção desconhecida \"--%s\"\n"
+
+#~ msgid "%s: option '-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: a opção \"-W %s\" não permite um argumento\n"
+
+#~ msgid "%s: option '-W %s' requires an argument\n"
+#~ msgstr "%s: a opção \"-W %s\" exige um argumento\n"
+
+#~ msgid "Franc,ois Pinard"
+#~ msgstr "François Pinard"
+
+# , c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: opção inválida -- %c\n"
+
+#~ msgid "block size"
+#~ msgstr "tamanho do bloco"
+
+#~ msgid "%s exists but is not a directory"
+#~ msgstr "%s existe, mas não é um diretório"
+
+#~ msgid "cannot change owner and/or group of %s"
+#~ msgstr "não pode substituir dono e/ou grupo de %s"
+
+# , c-format
+#~ msgid "cannot chdir to directory %s"
+#~ msgstr "impossível mudar para diretório %s"
+
+#~ msgid "cannot get the login group of a numeric UID"
+#~ msgstr "nao foi possivel obter um grupo e login de um UID numerico "
+
+#, fuzzy
+#~ msgid ""
+#~ "\n"
+#~ "This is free software. You may redistribute copies of it under the terms "
+#~ "of\n"
+#~ "the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Este programa é um software livre, você pode redistribuí-lo e/ou modificá-"
+#~ "lo\n"
+#~ "sobre os termos da licença pública geral GNU (GPL - General Public "
+#~ "License)\n"
+#~ "publicada pela Free Software Foundation, versão 2 ou posteriores.\n"
+#~ "\n"
diff --git a/gl/po/quot.sed b/gl/po/quot.sed
new file mode 100644
index 0000000..0122c46
--- /dev/null
+++ b/gl/po/quot.sed
@@ -0,0 +1,6 @@
+s/"\([^"]*\)"/“\1”/g
+s/`\([^`']*\)'/‘\1’/g
+s/ '\([^`']*\)' / ‘\1’ /g
+s/ '\([^`']*\)'$/ ‘\1’/g
+s/^'\([^`']*\)' /‘\1’ /g
+s/“”/""/g
diff --git a/gl/po/remove-potcdate.sin b/gl/po/remove-potcdate.sin
new file mode 100644
index 0000000..2436c49
--- /dev/null
+++ b/gl/po/remove-potcdate.sin
@@ -0,0 +1,19 @@
+# Sed script that remove the POT-Creation-Date line in the header entry
+# from a POT file.
+#
+# The distinction between the first and the following occurrences of the
+# pattern is achieved by looking at the hold space.
+/^"POT-Creation-Date: .*"$/{
+x
+# Test if the hold space is empty.
+s/P/P/
+ta
+# Yes it was empty. First occurrence. Remove the line.
+g
+d
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
diff --git a/gl/po/ro.gmo b/gl/po/ro.gmo
new file mode 100644
index 0000000..adb7fb5
--- /dev/null
+++ b/gl/po/ro.gmo
Binary files differ
diff --git a/gl/po/ro.po b/gl/po/ro.po
new file mode 100644
index 0000000..20bc842
--- /dev/null
+++ b/gl/po/ro.po
@@ -0,0 +1,1063 @@
+# Mesajele în limba română pentru pachetul mailutils.
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+#
+# Eugen Hoanca <eugenh@urban-grafx.ro>, 2003.
+# Traducere făcută de EH, pentru versiunea mailutis 0.4/coreutils 5.2.1.
+# Notă, R-GC: se pare că în perioada 2000-2005 a făcut parte din suita altor
+# pachete, înainte de-a deveni un pachet de sine stătător.
+# Actualizare a mesajelor, de la fișierul „gnulib-4.0.0.2567.pot”.
+# Actualizare a codării caracteror, la codarea de caractere UTF-8.
+# Actualizare a diacriticelor de la „cu sedilă” la „cu virgulă”.
+# Actualizare a algoritmului formelor de plural (de la „două” la „trei”).
+# NU și a mesajelor traduse (acestea au rămas neschimbate).
+# Eliminare a mesajelor ce-au dispărut în ultima versiune.
+# Actualizări realizate de Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>, 15.01.2022.
+# Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>, 2022.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib-4.0.0.2567\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2022-02-19 23:11+0100\n"
+"Last-Translator: Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>\n"
+"Language-Team: Romanian <translation-team-ro@lists.sourceforge.net>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < "
+"20)) ? 1 : 2);\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"X-Generator: Poedit 3.0.1\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: valoarea %s este mai mică sau egală cu %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: parametrul ARGP_HELP_FMT necesită o valoare"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: Parametru ARGP_HELP_FMT necunoscut"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Gunoi(garbage) în ARGP_HELP_FMT: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Argumentele obligatorii sau opționale pentru opțiunile lungi sunt de "
+"asemenea, obligatorii sau opționale pentru oricare dintre opțiunile scurte "
+"corespunzătoare."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Utilizare:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " sau: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [OPȚIUNE...]"
+
+#: gl/lib/argp-help.c:1783
+#, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Încercați «%s --help» sau «%s --usage» pentru mai multe informații.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "Raportați erorile la %s.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Eroare de sistem necunoscută"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "afișează această listă de ajutor"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "afișează un mesaj scurt de utlizare"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "NUME"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "stabilește numele programului"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "SECUNDE"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "întrerupe(hang) pentru acest număr de secunde (implicit 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "imprimă versiunea programului"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(EROARE DE PROGRAM) Nici o versiune cunoscută!?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: Prea multe argumente\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(EROARE DE PROGRAM) Opțiunea ar fi trebuit recunoscută!?"
+
+#: gl/lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: opțiunea „%s%s” este ambiguă\n"
+
+#: gl/lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: opțiunea „%s%s” este ambiguă; posibilități:"
+
+#: gl/lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: opțiune nerecunoscută „%s%s”\n"
+
+#: gl/lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: opțiunea „%s%s” nu permite un argument\n"
+
+#: gl/lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: opțiunea „%s%s” necesită un argument\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: opțiune nevalidă -- „%c”\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: opțiunea necesită un argument -- „%c”\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "nu s-a putut înregistra directorul de lucru curent"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "întoarcerea la directorul de lucru inițial a eșuat"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Succes"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Nicio potrivire"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Expresie regulată nevalidă"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Caracter de colaționare nevalid"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Nume de clasă de caracter nevalid"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Bară oblică inversă la sfârșit"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Referință anterioară nevalidă"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[, [^, [:, [., sau [= fără pereche"
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "( sau \\( fără pereche"
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "\\{ fără pereche"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "Conținut nevalid al \\{\\}"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Sfârșit de interval nevalid"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Memorie epuizată"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Expresie regulată precedentă nevalidă"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Terminare prematură a expresiei regulate"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "Expresie regulată prea lungă"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ") sau \\) fără pereche"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Nu există o expresie regulată precedentă"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "imposibil de afișat mesajul de eroare"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memorie epuizată"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr "descriptoare de fișier standard"
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "argument nevalid %s pentru %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "argument ambiguu %s pentru %s"
+
+#~ msgid "Valid arguments are:"
+#~ msgstr "Argumentele valide sunt:"
+
+#, c-format
+#~ msgid "%u bitset_allocs, %u freed (%.2f%%).\n"
+#~ msgstr "%u bitset_allocs, %u eliberat (%.2f%%).\n"
+
+#, c-format
+#~ msgid "%u bitset_sets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_sets, %u în memoria tampon (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_resets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_resets, %u în memoria tampon (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_tests, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_tests, %u în memoria tampon (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_lists\n"
+#~ msgstr "%u bitset_lists\n"
+
+# R-GC, scrie:
+# ținînd cont de referința acestui mesaj, și a
+# următoarelor două
+# mesaje(lib/bitset/stats.c),
+# am considerat că traducerea mot-a-mot a
+# mesajelor(tentantă), nu este cea corectă,
+# am început să investighez printre
+# traducerile celorlalte echipe, și cred că am
+# aflat „dezlegarea misterului”, în traducerea
+# făcută de Benno Schulenberg din echipa
+# olandeză:
+# „histogram van aantal gezette bits”
+#~ msgid "count log histogram\n"
+#~ msgstr "histograma numărului seturilor de biți»bitset«\n"
+
+#~ msgid "size log histogram\n"
+#~ msgstr "histograma dimensiunilor seturilor de biți»bitset«\n"
+
+#~ msgid "density histogram\n"
+#~ msgstr "histograma densității seturilor de biți»bitset«\n"
+
+#, c-format
+#~ msgid ""
+#~ "Bitset statistics:\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Statistici set de biți»bitset«:\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Accumulated runs = %u\n"
+#~ msgstr "Cantitatea de execuții = %u\n"
+
+#~ msgid "cannot read stats file"
+#~ msgstr "nu se poate citi fișierul cu statistici"
+
+#, c-format
+#~ msgid "bad stats file size\n"
+#~ msgstr "dimensiunea fișierului cu statistici, este necorespunzătoare\n"
+
+#~ msgid "cannot write stats file"
+#~ msgstr "nu se poate scrie fișierul cu statistici"
+
+#~ msgid "cannot open stats file for writing"
+#~ msgstr "nu se poate deschide fișierul cu statistici pentru scriere"
+
+#~ msgid "program error"
+#~ msgstr "eroare de program"
+
+#~ msgid "stack overflow"
+#~ msgstr "debordare de stivă"
+
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr ""
+#~ "nu se poate găsi un director temporar, încercați să stabiliți variabila "
+#~ "$TMPDIR"
+
+# R-GC, scrie:
+# după ce-a revizat fișierul, DȘ îmi spune:
+# «→ aici parcă lipsește un „se”, și ar deveni „nu se poate crea...”»
+# îmi pare rău, mi se făcuse foame de cuvinte..
+# :)
+# - corectare aplicată!
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "nu se poate crea un director temporar utilizând șablonul „%s”"
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "nu se poate elimina fișierul temporar %s"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "nu se poate elimina directorul temporar %s"
+
+#~ msgid "error closing file"
+#~ msgstr "eroare la închiderea fișierului"
+
+#~ msgid "write error"
+#~ msgstr "eroare de scriere"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "se păstrează permisiunile pentru %s"
+
+#, c-format
+#~ msgid "error while opening %s for reading"
+#~ msgstr "eroare la deschiderea lui %s pentru citire"
+
+#, c-format
+#~ msgid "cannot open backup file %s for writing"
+#~ msgstr "nu se poate deschide fișierul de copie de rezervă %s pentru scriere"
+
+#, c-format
+#~ msgid "error reading %s"
+#~ msgstr "eroare la citirea din %s"
+
+#, c-format
+#~ msgid "error writing %s"
+#~ msgstr "eroare la scrierea în %s"
+
+#, c-format
+#~ msgid "error after reading %s"
+#~ msgstr "eroare după citirea %s"
+
+#~ msgid "fdopen() failed"
+#~ msgstr "fdopen() a eșuat"
+
+#~ msgid "C# compiler not found, try installing mono"
+#~ msgstr "Nu a fost găsit compilatorul C#, încercați să instalați mono"
+
+#~ msgid "C# virtual machine not found, try installing mono"
+#~ msgstr "Nu a fost găsită mașina virtuală C#, încercați să instalați mono"
+
+#~ msgid "unbalanced ["
+#~ msgstr "„[” fără pereche"
+
+#~ msgid "invalid character class"
+#~ msgstr "clasă de caractere nevalidă"
+
+#~ msgid "character class syntax is [[:space:]], not [:space:]"
+#~ msgstr "sintaxa de clasă de caractere este [[:spațiu:]], nu [:spațiu]"
+
+#~ msgid "unfinished \\ escape"
+#~ msgstr "eludare » \\ « neterminată"
+
+#~ msgid "invalid content of \\{\\}"
+#~ msgstr "conținut nevalid al \\{\\}"
+
+#~ msgid "regular expression too big"
+#~ msgstr "expresia regulată este prea lungă"
+
+#~ msgid "unbalanced ("
+#~ msgstr "„(” fără pereche"
+
+#~ msgid "no syntax specified"
+#~ msgstr "nu s-a specificat nicio sintaxă"
+
+#~ msgid "unbalanced )"
+#~ msgstr "„)” fără pereche"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "subprocesul %s a eșuat"
+
+#~ msgid "regular empty file"
+#~ msgstr "fișier gol obișnuit"
+
+#~ msgid "regular file"
+#~ msgstr "fișier obișnuit"
+
+#~ msgid "directory"
+#~ msgstr "director"
+
+#~ msgid "symbolic link"
+#~ msgstr "legătură simbolică"
+
+#~ msgid "message queue"
+#~ msgstr "coada de mesaje"
+
+#~ msgid "semaphore"
+#~ msgstr "semafor"
+
+#~ msgid "shared memory object"
+#~ msgstr "obiect de memorie partajată"
+
+# R-GC, scrie:
+# investigînd prin:
+# - http://www.opengroup.org/onlinepubs/000095399/functions/mmap.html
+# și
+# - http://www.opengroup.org/austin/papers/posix_faq.html
+# am ajuns la această traducere; cu o
+# posibilă variantă:
+# „obiect de memorie standardizat”
+# *********
+# Ideile sunt binevenite...!
+#~ msgid "typed memory object"
+#~ msgstr "obiect de memorie tipizat"
+
+#~ msgid "block special file"
+#~ msgstr "fișier special de blocuri"
+
+#~ msgid "character special file"
+#~ msgstr "fișier special de caractere"
+
+#~ msgid "contiguous data"
+#~ msgstr "date contigue"
+
+#~ msgid "fifo"
+#~ msgstr "primul intrat, primul ieșit(fifo)"
+
+# R-GC, scrie:
+# informații culese de la:
+# https://en.wikipedia.org/wiki/Unix_file_types#Door (adresă obținută din
+# comentariul făcut de Rafael Fontenelle, din
+# echipa braziliană, în fișierul «gnulib-*.pt_BR.po»)
+# și de la:
+# https://en.wikipedia.org/wiki/Doors_(computing) (adresă obținută prin
+# amabilitatea lui Jim Meyering, unul din
+# „băieții” din spatele proiectului «diffutils»)
+#~ msgid "door"
+#~ msgstr "poartă(de comunicare)"
+
+#~ msgid "multiplexed block special file"
+#~ msgstr "fișier special de blocuri, multiplexat"
+
+#~ msgid "multiplexed character special file"
+#~ msgstr "fișier special de caractere, multiplexat"
+
+#~ msgid "multiplexed file"
+#~ msgstr "fișier multiplexat"
+
+#~ msgid "named file"
+#~ msgstr "fișier numit"
+
+#~ msgid "network special file"
+#~ msgstr "fișier special de rețea"
+
+#~ msgid "migrated file with data"
+#~ msgstr "fișier migrat cu date"
+
+#~ msgid "migrated file without data"
+#~ msgstr "fișier migrat fără date"
+
+#~ msgid "port"
+#~ msgstr "port"
+
+#~ msgid "socket"
+#~ msgstr "soclu"
+
+# R-GC, scrie:
+# am găsit aici:
+# https://en.wikipedia.org/wiki/Union_mount
+# date despre «whiteout», folosit de UnionFS
+#~ msgid "whiteout"
+#~ msgstr "whiteout"
+
+#~ msgid "weird file"
+#~ msgstr "fișier ciudat"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Familia de adrese pentru numele de gazdă nu este suportată"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Eșec temporar în rezolvarea numelui"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Valoare greșită pentru ai_flags"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Eșec nerecuperabil în rezolvarea numelui"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "ai_family nu este suportat"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Eșec la alocarea memoriei"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "Nicio adresă asociată cu numele gazdei"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Nume sau serviciu necunoscut"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "Nume de server nesuportat pentru ai_socktype"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "ai_socktype nu este suportat"
+
+#~ msgid "System error"
+#~ msgstr "Eroare de sistem"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "Memoria tampon pentru argumente este prea mică"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Procesarea cererii este în curs"
+
+#~ msgid "Request canceled"
+#~ msgstr "Cerere anulată"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Cerere neanulată"
+
+#~ msgid "All requests done"
+#~ msgstr "Toate cererile au fost procesate"
+
+# R-GC, scrie:
+# o altă variantă, ar fi:
+# „Întrerupt printr-un semnal”
+# bănuiesc că se referă la un proces sau
+# un program.
+# Idei ?
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Întrerupt de un semnal"
+
+# R-GC, scrie:
+# după ce-a revizat fișierul, DȘ îmi spune:
+# «→ ar fi de evitat folosirea lui „e” în loc de „este”»
+# corecție aplicată!; încă o dată, foamea :) ,
+# de data asta, de litere
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "Șirul parametrului este codificat greșit"
+
+#~ msgid "Unknown error"
+#~ msgstr "Eroare necunoscută"
+
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "argumentul source_version nu este valid pentru compile_java_class"
+
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "argumentul target_version nu este valid pentru compile_java_class"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "nu s-a putut crea \"%s\""
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "eroare în timpul scrierii fișierului „%s”"
+
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr ""
+#~ "Nu a fost găsit compilatorul Java, încercați să instalați gcj sau "
+#~ "stabiliți variabila $JAVAC"
+
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "Nu a fost găsită mașina virtuală Java, încercați să instalați gij sau "
+#~ "stabiliți variabila $JAVA"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "eroare de In/Ieș a subprocesului %s"
+
+#, c-format
+#~ msgid "cannot stat %s"
+#~ msgstr "nu se poate obține starea lui „%s”"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "nu se pot schimba permisiunile pentru %s"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "nu se poate crea directorul %s"
+
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Nu s-a putut deschide „/dev/zero” pentru citire"
+
+#~ msgid "creation of reading thread failed"
+#~ msgstr "crearea firului de citire a eșuat"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "nu se poate configura In/Ieș neblocante la subprocesul %s"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "comunicarea cu subprocesul %s a eșuat"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "scrierea în subprocesul %s a eșuat"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "citirea din subprocesul %s a eșuat"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "subprocesul %s a terminat cu codul de ieșire %d"
+
+#~ msgid "creation of threads failed"
+#~ msgstr "crearea firelor a eșuat"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "subprocesul %s a terminat cu codul de ieșire %d"
+
+#~ msgid "`"
+#~ msgstr "„"
+
+#~ msgid "'"
+#~ msgstr "”"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[dDyY]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "se stabilesc permisiunile pentru %s"
+
+# R-GC, scrie:
+# - http://en.wikipedia.org/wiki/SIGHUP
+# aici, la sfîrșitul articolului, explicația/moti-
+# vația pentru traducerea aleasă.
+#~ msgid "Hangup"
+#~ msgstr "Terminare anormală(Hangup)"
+
+#~ msgid "Interrupt"
+#~ msgstr "Întrerupe"
+
+#~ msgid "Quit"
+#~ msgstr "Termină"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "Instrucțiune ilegală"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Capturare punct de întrerupere/traseul(execuției)"
+
+#~ msgid "Aborted"
+#~ msgstr "Renuțare"
+
+#~ msgid "Floating point exception"
+#~ msgstr "Excepție de virgulă mobilă"
+
+#~ msgid "Killed"
+#~ msgstr "Omorît"
+
+#~ msgid "Bus error"
+#~ msgstr "Eroare de magistrală de date(bus)"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "Eroare de segmentare"
+
+# R-GC, scrie:
+# mi s-a părut cea mai bună descriere a
+# termenilor din mesaj.
+# - Idei?
+#~ msgid "Broken pipe"
+#~ msgstr "Linie de conectare întreruptă"
+
+#~ msgid "Alarm clock"
+#~ msgstr "Ceas cu alarmă"
+
+#~ msgid "Terminated"
+#~ msgstr "Terminat"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "Condiție In/Ieș urgentă"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "Oprit (semnal)"
+
+#~ msgid "Stopped"
+#~ msgstr "Oprit"
+
+#~ msgid "Continued"
+#~ msgstr "Continuare"
+
+#~ msgid "Child exited"
+#~ msgstr "Procesul copil a terminat"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Oprit (intrare tty)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Oprit (ieșire tty)"
+
+#~ msgid "I/O possible"
+#~ msgstr "In/Ieș posibilă"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "S-a depășit limita de timp CPU"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "S-a depășit limita de dimensiune a fișierului"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "Cronometrul virtual a expirat"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "Cronometrul de creare a profilului a expirat"
+
+#~ msgid "Window changed"
+#~ msgstr "Fereastra s-a schimbat"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "Semnalul »1« definit de utilizator"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Semnalul »2« definit de utilizator"
+
+# R-GC, scrie:
+# Traducere „copiată” de la italieni, cu
+# explicația aferentă:
+# http://en.wikipedia.org/wiki/SIGEMT
+#~ msgid "EMT trap"
+#~ msgstr "Detectare EMT"
+
+#~ msgid "Bad system call"
+#~ msgstr "Apel de sistem greșit"
+
+#~ msgid "Stack fault"
+#~ msgstr "Eroare de stivă"
+
+#~ msgid "Information request"
+#~ msgstr "Cerere de informații"
+
+#~ msgid "Power failure"
+#~ msgstr "Pană de curent"
+
+#~ msgid "Resource lost"
+#~ msgstr "Resursă pierdută"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr ""
+#~ "eroare de scriere într-o linie de conectare închisă sau într-un soclu "
+#~ "închis"
+
+#~ msgid "cannot create pipe"
+#~ msgstr "nu se poate crea linia de conectare"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "Semnal în timp real %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Semnal necunoscut %d"
+
+#~ msgid "Execution times (seconds)"
+#~ msgstr "Timpi de execuție (secunde)"
+
+#~ msgid "CPU user"
+#~ msgstr "CPU utilizator"
+
+#~ msgid "CPU system"
+#~ msgstr "CPU sistem"
+
+# R-GC, scrie:
+# traducere inspirată în munca echipelor
+# italiene și olandeze; traducerea mot-a-mot:
+# „ceas de perete”, nu mă convingea, Acum,
+# realizez că intenția autorului era de:
+# ceas etalon(aproximativ ca GMT).
+#~ msgid "wall clock"
+#~ msgstr "timpul real"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "funcție «iconv» inutilizabilă"
+
+#~ msgid "iconv function not available"
+#~ msgstr "funcție «iconv» indisponibilă"
+
+#~ msgid "character out of range"
+#~ msgstr "caracter în afara intervalului"
+
+# R-GC, scrie:
+# varianta inițială, a traducerii acestui mesaj,
+# era:
+# „"U+%04X nu poate fi convertit în setul de caractere local”
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "nu se poate converti U+%04X în setul de caractere local"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "nu se poate converti U+%04X în setul de caractere local: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "utilizator nevalid"
+
+#~ msgid "invalid group"
+#~ msgstr "grup nevalid"
+
+#~ msgid "invalid spec"
+#~ msgstr "specificație nevalidă"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "Împachetat de %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "Împachetat de %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "©"
+
+#, c-format
+#~ msgid ""
+#~ "License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ msgstr ""
+#~ "Licența GPLv3+: GNU GPL versiunea 3 sau mai mare <%s>.\n"
+#~ "Acesta este software liber: sunteți liber să îl modificați și să îl "
+#~ "redistribuiți.\n"
+#~ "NU există NICIO GARANȚIE, în măsura permisă de lege.\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Scris de %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Scris de %s și %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Scris de %s, %s și %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Scris de %s, %s, %s\n"
+#~ "și %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Scris de %s, %s, %s,\n"
+#~ "%s, și %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Scris de %s, %s, %s,\n"
+#~ "%s, %s, și %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Scris de %s, %s, %s,\n"
+#~ "%s, %s, %s, și %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Scris de %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "și %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Scris de %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, și %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Scris de %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, și alții.\n"
+
+#, c-format
+#~ msgid "Report bugs to: %s\n"
+#~ msgstr "Raportați erorile la %s.\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "Raportați erorile %s la: %s\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "%s pagina principală: <%s>\n"
+
+#, c-format
+#~ msgid "General help using GNU software: <%s>\n"
+#~ msgstr "Ajutor general utilizând software GNU: <%s>\n"
+
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "_open_osfhandle a eșuat"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "nu se poate restaura fd %d: dup2 a eșuat"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "subprocesul %s"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "subprocesul %s a primit semnalul fatal %d"
+
+# R_GC, scrie:
+# altă posibilă traducere a mesajului, ar fi:
+# „nu s-a putut stabili modul de text/binar al descriptorului de fișier”
+# Opinii/Idei ?
+# ===========================
+# La sugestia făcută de DȘ, după revizarea
+# fișierului, a rămas mesaj valabil, traducerea
+# inițială a mesajului:
+# „nu s-a putut stabili descriptorul de fișier în modul text/binar”
+#~ msgid "failed to set file descriptor text/binary mode"
+#~ msgstr "nu s-a putut stabili descriptorul de fișier în modul text/binar"
+
+#~ msgid "stdin"
+#~ msgstr "stdin»intrarea standard«"
+
+#~ msgid "stdout"
+#~ msgstr "stdout»ieșirea standard«"
+
+#~ msgid "stderr"
+#~ msgstr "stderr»ieșirea standard de erori«"
+
+#~ msgid "unknown stream"
+#~ msgstr "flux necunoscut"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "nu s-a putut redeschide %s în modul %s"
+
+#~ msgid "string comparison failed"
+#~ msgstr "compararea șirurilor a eșuat"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Stabiliți LC_ALL='C' pentru a rezolva problema."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Șirurile comparate au fost %s și %s."
+
+#~ msgid "cannot perform formatted output"
+#~ msgstr "nu se poate afișa ieșirea formatată"
+
+# R-GC, scrie:
+# traducerea acestui mesaj, și a celor două
+# mesaje următoare, a fost inspirată de
+# traducerile făcute de echipa italiană și cea
+# spaniolă.
+# Colegul de TP al echipei italiene, motivează
+# astfel traducerea făcută:
+# =========================
+# „(ndt)»italian«
+# quello che viene sostituito pare sia:
+# * il primo, hypens (con valore '--')
+# * il secondo, option
+# * il terzo, arg
+# quindi qualche cosa del genere:
+# invalid --option argument 'arg'
+# #
+# (altre idee sono benvenute!)”
+#, c-format
+#~ msgid "invalid %s%s argument '%s'"
+#~ msgstr "argumentul „%3$s” al %1$s%2$s nu este valid"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument '%s'"
+#~ msgstr "sufixul din argumentul „%3$s” al %1$s%2$s nu este valid"
+
+#, c-format
+#~ msgid "%s%s argument '%s' too large"
+#~ msgstr "argumentul „%3$s” al %1$s%2$s este prea lung"
diff --git a/gl/po/ru.gmo b/gl/po/ru.gmo
new file mode 100644
index 0000000..dd6c32b
--- /dev/null
+++ b/gl/po/ru.gmo
Binary files differ
diff --git a/gl/po/ru.po b/gl/po/ru.po
new file mode 100644
index 0000000..fd22067
--- /dev/null
+++ b/gl/po/ru.po
@@ -0,0 +1,969 @@
+# translation of gnulib-2.0.0.3462.e9796.ru.po to Russian
+# Copyright (C) 2005, 2010 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+#
+# Sergey Poznyakoff <gray@gnu.org>, 2003,2004,2005.
+# Yuri Kozlov <yuray@komyakino.ru>, 2010, 2011, 2019.
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 4.0.0.2567\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2019-05-21 18:46+0300\n"
+"Last-Translator: Yuri Kozlov <yuray@komyakino.ru>\n"
+"Language-Team: Russian <gnu@d07.ru>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
+"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"X-Generator: Lokalize 2.0\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: значение %s меньше или равно %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: параметр ARGP_HELP_FMT требует значения"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: неизвестный параметр ARGP_HELP_FMT"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Мусор в ARGP_HELP_FMT: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Обязательные или необязательные аргументы к длинным именам параметров "
+"остаются таковыми и к соответствующим коротким параметрам."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Использование:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " или: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [ПАРАМЕТР...]"
+
+#: gl/lib/argp-help.c:1783
+#, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr ""
+"Попробуйте «%s --help» или «%s --usage» для получения более подробного "
+"описания.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "Об ошибках сообщай по адресу %s.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Неизвестная системная ошибка"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "показать эту справку"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "показать короткую справку по использованию"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "ИМЯ"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "задать имя программы"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "СЕКУНД"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "остановиться на заданное число СЕКУНД (по умолчанию 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "показать номер версии программы"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(ОШИБКА ПРОГРАММЫ) Версия неизвестна!?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: слишком много аргументов\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(ОШИБКА ПРОГРАММЫ) Параметр должен был быть распознан!?"
+
+#: gl/lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: двусмысленный параметр «%s%s»\n"
+
+#: gl/lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: двусмысленный параметр «%s%s»; возможные варианты:"
+
+#: gl/lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: нераспознанный параметр «%s%s»\n"
+
+#: gl/lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: для параметра «%s%s» нельзя использовать аргумент\n"
+
+#: gl/lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: для параметра «%s%s» требуется аргумент\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: неправильный параметр -- «%c»\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: для параметра требуется аргумент -- «%c»\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "не удалось запомнить текущий рабочий каталог"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "не удалось вернуться в первоначальный рабочий каталог"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Успешно"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Нет совпадений"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Неверное регулярное выражение"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Неверный символ сравнения"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Неверное имя класса символов"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Конечная обратная косая черта"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Неверная обратная ссылка"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Непарная [, [^, [:, [. или [="
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "Непарная ( или \\("
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "Непарная \\{"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "Недопустимое содержимое в \\{\\}"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Неверный конец диапазона"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Закончилась память"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Недопустимое предшествующее регулярное выражение"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Преждевременное завершение регулярного выражения"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "Слишком большое регулярное выражение"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr "Непарная ) или \\)"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Отсутствует предыдущее регулярное выражение"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "невозможно показать сообщение об ошибке"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "закончилась память"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr "стандартные файловые дескрипторы"
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "неверный аргумент %s для %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "неоднозначный аргумент %s для %s"
+
+#~ msgid "Valid arguments are:"
+#~ msgstr "Верные аргументы:"
+
+#, c-format
+#~ msgid "%u bitset_allocs, %u freed (%.2f%%).\n"
+#~ msgstr "%u bitset_allocs, %u освобождено (%.2f%%).\n"
+
+#, c-format
+#~ msgid "%u bitset_sets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_sets, %u кэшировано (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_resets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_resets, %u кэшировано (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_tests, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_tests, %u кэшировано (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_lists\n"
+#~ msgstr "%u bitset_lists\n"
+
+#~ msgid "count log histogram\n"
+#~ msgstr "количественная логарифмическая гистограмма\n"
+
+#~ msgid "size log histogram\n"
+#~ msgstr "размерная логарифмическая гистограмма\n"
+
+#~ msgid "density histogram\n"
+#~ msgstr "гистограмма плотности\n"
+
+#, c-format
+#~ msgid ""
+#~ "Bitset statistics:\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Статистика bitset:\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Accumulated runs = %u\n"
+#~ msgstr "Накопленных запусков = %u\n"
+
+#~ msgid "cannot read stats file"
+#~ msgstr "невозможно прочитать файл stats"
+
+#, c-format
+#~ msgid "bad stats file size\n"
+#~ msgstr "некорректный размер файла stats\n"
+
+#~ msgid "cannot write stats file"
+#~ msgstr "невозможно записать файл stats"
+
+#~ msgid "cannot open stats file for writing"
+#~ msgstr "невозможно открыть файл stats для записи"
+
+#~ msgid "program error"
+#~ msgstr "программная ошибка"
+
+#~ msgid "stack overflow"
+#~ msgstr "переполнение стека"
+
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr "не удалось найти временный каталог, попробуйте задать $TMPDIR"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "не удалось создать временный каталог с помощью шаблона «%s»"
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "не удалось удалить временный файл %s"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "не удалось удалить временный каталог %s"
+
+#~ msgid "error closing file"
+#~ msgstr "ошибка закрытия файла"
+
+#~ msgid "write error"
+#~ msgstr "ошибка записи"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "сохраняются права доступа для %s"
+
+#, c-format
+#~ msgid "error while opening %s for reading"
+#~ msgstr "ошибка при открытии файла %s для чтения"
+
+#, c-format
+#~ msgid "cannot open backup file %s for writing"
+#~ msgstr "не удалось открыть файл резервной копии %s для записи"
+
+#, c-format
+#~ msgid "error reading %s"
+#~ msgstr "ошибка чтения %s"
+
+#, c-format
+#~ msgid "error writing %s"
+#~ msgstr "ошибка записи %s"
+
+#, c-format
+#~ msgid "error after reading %s"
+#~ msgstr "ошибка после чтения %s"
+
+#~ msgid "fdopen() failed"
+#~ msgstr "ошибка при выполнении fdopen()"
+
+#~ msgid "C# compiler not found, try installing mono"
+#~ msgstr "Не найден компилятор C#, попробуйте установить mono"
+
+#~ msgid "C# virtual machine not found, try installing mono"
+#~ msgstr "Не найдена виртуальная машина C#, попробуйте установить mono"
+
+#~ msgid "unbalanced ["
+#~ msgstr "несбалансированная ["
+
+#~ msgid "invalid character class"
+#~ msgstr "неправильный класс символов"
+
+#~ msgid "character class syntax is [[:space:]], not [:space:]"
+#~ msgstr "синтаксис класса символов: [[:space:]], а не [:space:]"
+
+#~ msgid "unfinished \\ escape"
+#~ msgstr "незавершённая \\ экранирующая последовательность"
+
+#~ msgid "invalid content of \\{\\}"
+#~ msgstr "неправильное содержимое в \\{\\}"
+
+#~ msgid "regular expression too big"
+#~ msgstr "регулярное выражение слишком большое"
+
+#~ msgid "unbalanced ("
+#~ msgstr "несбалансированная ("
+
+#~ msgid "no syntax specified"
+#~ msgstr "не указан синтаксис"
+
+#~ msgid "unbalanced )"
+#~ msgstr "несбалансированная )"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "подпроцесс %s завершился с ошибкой"
+
+#~ msgid "regular empty file"
+#~ msgstr "пустой обычный файл"
+
+#~ msgid "regular file"
+#~ msgstr "обычный файл"
+
+#~ msgid "directory"
+#~ msgstr "каталог"
+
+#~ msgid "symbolic link"
+#~ msgstr "символьная ссылка"
+
+#~ msgid "message queue"
+#~ msgstr "очередь сообщений"
+
+#~ msgid "semaphore"
+#~ msgstr "семафор"
+
+#~ msgid "shared memory object"
+#~ msgstr "объект общей памяти"
+
+#~ msgid "typed memory object"
+#~ msgstr "объект типизированной памяти"
+
+#~ msgid "block special file"
+#~ msgstr "блочный специальный файл"
+
+#~ msgid "character special file"
+#~ msgstr "символьный специальный файл"
+
+#~ msgid "contiguous data"
+#~ msgstr "непрерывные данные"
+
+#~ msgid "fifo"
+#~ msgstr "файл-очередь"
+
+#~ msgid "door"
+#~ msgstr "дверь"
+
+#~ msgid "multiplexed block special file"
+#~ msgstr "мультиплексный блочный специальный файл"
+
+#~ msgid "multiplexed character special file"
+#~ msgstr "мультиплексный символьный специальный файл"
+
+#~ msgid "multiplexed file"
+#~ msgstr "мультиплексный файл"
+
+#~ msgid "named file"
+#~ msgstr "именованный файл"
+
+#~ msgid "network special file"
+#~ msgstr "сетевой специальный файл"
+
+#~ msgid "migrated file with data"
+#~ msgstr "переносной файл с данными"
+
+#~ msgid "migrated file without data"
+#~ msgstr "переносной файл без данных"
+
+#~ msgid "port"
+#~ msgstr "порт"
+
+#~ msgid "socket"
+#~ msgstr "сокет"
+
+#~ msgid "whiteout"
+#~ msgstr "замазка"
+
+#~ msgid "weird file"
+#~ msgstr "странный файл"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Адресное семейство не поддерживается для имени узла"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Временная ошибка при определении имени"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Неверное значение для ai_flags"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Невосстановимая ошибка при определении имени"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "ai_family не поддерживается"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Ошибка при выделении памяти"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "С именем узла не связано ни одного адреса"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Неизвестное имя или служба"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "Servname не поддерживается для ai_socktype"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "ai_socktype не поддерживается"
+
+#~ msgid "System error"
+#~ msgstr "Системная ошибка"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "Слишком маленький буфер, указанный в аргументе"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Выполняется обработка запроса"
+
+#~ msgid "Request canceled"
+#~ msgstr "Запрос отменён"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Запрос не отменён"
+
+#~ msgid "All requests done"
+#~ msgstr "Все запросы выполнены"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Прервано по сигналу"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "Строковый параметр неправильно закодирован"
+
+#~ msgid "Unknown error"
+#~ msgstr "Неизвестная ошибка"
+
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "неверный аргумент source_version для compile_java_class"
+
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "неверный аргумент target_version для compile_java_class"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "не удалось создать «%s»"
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "ошибка записи в файл «%s»"
+
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr ""
+#~ "Не найден компилятор Java, попробуйте установить gcj или задать $JAVAC"
+
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "Не найдена виртуальная машина Java, попробуйте установить gcj или задать "
+#~ "$JAVA"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "ошибка вв/вывода подпроцесса %s"
+
+#, c-format
+#~ msgid "cannot stat %s"
+#~ msgstr "не удалось выполнить stat для %s"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "невозможно изменить права доступа %s"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "невозможно создать каталог %s"
+
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Не удалось открыть /dev/zero на чтение"
+
+#~ msgid "creation of reading thread failed"
+#~ msgstr "не удалось создать нить для чтения"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "не удалось настроить неблокированный ввод-вывод в подпроцессе %s"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "не удалось связаться с подпроцессом %s"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "не удалось записать в подпроцесс %s"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "не удалось прочитать из подпроцесса %s"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "подпроцесс %s завершился с кодом выхода %d"
+
+#~ msgid "creation of threads failed"
+#~ msgstr "не удалось создать нити"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "подпроцесс %s завершился с кодом выхода %d"
+
+#~ msgid "`"
+#~ msgstr "«"
+
+#~ msgid "'"
+#~ msgstr "»"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[ДдYy]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[НнNn]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "задание прав доступа для %s"
+
+#~ msgid "Hangup"
+#~ msgstr "Обрыв терминальной линии"
+
+#~ msgid "Interrupt"
+#~ msgstr "Прерывание"
+
+#~ msgid "Quit"
+#~ msgstr "Аварийное прерывание"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "Недопустимая инструкция"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Прерывание на контрольной точке"
+
+#~ msgid "Aborted"
+#~ msgstr "Прервано"
+
+#~ msgid "Floating point exception"
+#~ msgstr "Ошибка операции с плавающей точкой"
+
+#~ msgid "Killed"
+#~ msgstr "Уничтожение"
+
+#~ msgid "Bus error"
+#~ msgstr "Ошибка шины"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "Нарушение сегментирования"
+
+#~ msgid "Broken pipe"
+#~ msgstr "Обрыв канала"
+
+#~ msgid "Alarm clock"
+#~ msgstr "Сигнал по таймеру"
+
+#~ msgid "Terminated"
+#~ msgstr "Завершение"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "Срочная операция ввода-вывода"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "Останов (сигнал)"
+
+#~ msgid "Stopped"
+#~ msgstr "Останов"
+
+#~ msgid "Continued"
+#~ msgstr "Возобновление"
+
+#~ msgid "Child exited"
+#~ msgstr "Потомок завершил работу"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Останов (ввод с терминала)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Останов (вывод с терминала)"
+
+#~ msgid "I/O possible"
+#~ msgstr "Возможен ввод-вывод"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "Превышен предел по процессорному времени"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "Превышен предел размера файла"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "Виртуальное время истекло"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "Время профилирования истекло"
+
+#~ msgid "Window changed"
+#~ msgstr "Окно изменено"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "Определяемый пользователем сигнал 1"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Определяемый пользователем сигнал 2"
+
+#~ msgid "EMT trap"
+#~ msgstr "Ловушка EMT"
+
+#~ msgid "Bad system call"
+#~ msgstr "Неправильный системный вызов"
+
+#~ msgid "Stack fault"
+#~ msgstr "Ошибка работы со стеком"
+
+#~ msgid "Information request"
+#~ msgstr "Запрос информации"
+
+#~ msgid "Power failure"
+#~ msgstr "Отказ питания"
+
+#~ msgid "Resource lost"
+#~ msgstr "Ресурс потерян"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "ошибка записи в закрытый канал или сокет"
+
+#~ msgid "cannot create pipe"
+#~ msgstr "не удалось создать канал"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "Сигнал реального времени %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Неизвестный сигнал %d"
+
+#~ msgid "Execution times (seconds)"
+#~ msgstr "Время выполнения (секунд)"
+
+#~ msgid "CPU user"
+#~ msgstr "пользовательское время на ЦП"
+
+#~ msgid "CPU system"
+#~ msgstr "системное время на ЦП"
+
+#~ msgid "wall clock"
+#~ msgstr "настенные часы"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "функция iconv неприменима"
+
+#~ msgid "iconv function not available"
+#~ msgstr "функция iconv недоступна"
+
+#~ msgid "character out of range"
+#~ msgstr "символ вне допустимого диапазона"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "невозможно преобразовать U+%04X в локальную кодировку"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "невозможно преобразовать U+%04X в локальную кодировку: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "неверный пользователь"
+
+#~ msgid "invalid group"
+#~ msgstr "неверная группа"
+
+#~ msgid "invalid spec"
+#~ msgstr "неверный spec"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "Упакован %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "Упакован %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "©"
+
+#, c-format
+#~ msgid ""
+#~ "License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ msgstr ""
+#~ "Лицензия GPLv3+: GNU GPL версии 3 или новее <%s>.\n"
+#~ "Это свободное ПО: вы можете изменять и распространять его.\n"
+#~ "Нет НИКАКИХ ГАРАНТИЙ в пределах действующего законодательства.\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Автор программы: %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Авторы программы: %s и %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Авторы программы: %s, %s и %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Авторы программы: %s, %s, %s\n"
+#~ "и %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Авторы программы: %s, %s, %s,\n"
+#~ "%s и %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Авторы программы: %s, %s, %s,\n"
+#~ "%s, %s и %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Авторы программы: %s, %s, %s,\n"
+#~ "%s, %s, %s и %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Авторы программы: %s, %s, %s,\n"
+#~ "%s, %s, %s, %s\n"
+#~ "и %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Авторы программы: %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s и %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Авторы программы: %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s и другие.\n"
+
+#, c-format
+#~ msgid "Report bugs to: %s\n"
+#~ msgstr "Об ошибках сообщайте по адресу: %s\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "Об ошибках в %s сообщайте по адресу: %s\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "Домашняя страница %s: <%s>\n"
+
+#, c-format
+#~ msgid "General help using GNU software: <%s>\n"
+#~ msgstr "Справка по работе с программами GNU: <%s>\n"
+
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "_open_osfhandle завершилась неудачно"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "не удалось восстановить fd %d: dup2 завершилась неудачно"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "подпроцесс %s"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "подпроцесс %s получил сигнал завершения %d"
+
+#~ msgid "failed to set file descriptor text/binary mode"
+#~ msgstr ""
+#~ "не удалось изменить текстовый/двоичный режим у файлового дескриптора"
+
+#~ msgid "stdin"
+#~ msgstr "stdin"
+
+#~ msgid "stdout"
+#~ msgstr "stdout"
+
+#~ msgid "stderr"
+#~ msgstr "stderr"
+
+#~ msgid "unknown stream"
+#~ msgstr "неизвестный поток"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "не удалось повторно открыть %s в режиме %s"
+
+#~ msgid "string comparison failed"
+#~ msgstr "сравнение строк завершилось неудачно"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Чтобы обойти эту проблему, установите LC_ALL='C'."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Сравнивались строки %s %s."
+
+#~ msgid "cannot perform formatted output"
+#~ msgstr "невозможно выполнить форматированный вывод"
+
+#, c-format
+#~ msgid "invalid %s%s argument '%s'"
+#~ msgstr "неверный аргумент %s%s в «%s»"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument '%s'"
+#~ msgstr "недопустимый суффикс в аргументе %s%s для «%s»"
+
+#, c-format
+#~ msgid "%s%s argument '%s' too large"
+#~ msgstr "аргумент %s%s слишком велик для «%s»"
+
+#~ msgid "%s home page: <https://www.gnu.org/software/%s/>\n"
+#~ msgstr "Домашняя страница %s: <https://www.gnu.org/software/%s/>\n"
+
+#~ msgid "%.*s: ARGP_HELP_FMT parameter must be positive"
+#~ msgstr "%.*s: значение параметра ARGP_HELP_FMT должно быть положительным"
+
+#~ msgid "%s: option '--%s' doesn't allow an argument\n"
+#~ msgstr "%s: для параметра «--%s» аргумент не разрешён\n"
+
+#~ msgid "%s: unrecognized option '--%s'\n"
+#~ msgstr "%s: нераспознанный параметр «--%s»\n"
+
+#~ msgid "%s: option '-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: у параметра «-W %s» не может быть аргумента\n"
+
+#~ msgid "%s: option '-W %s' requires an argument\n"
+#~ msgstr "%s: для параметра «-W %s» требуется аргумент\n"
+
+#~ msgid "Franc,ois Pinard"
+#~ msgstr "Френсис Пинард (Franc,ois Pinard)"
diff --git a/gl/po/rw.gmo b/gl/po/rw.gmo
new file mode 100644
index 0000000..93e277b
--- /dev/null
+++ b/gl/po/rw.gmo
Binary files differ
diff --git a/gl/po/rw.po b/gl/po/rw.po
new file mode 100644
index 0000000..fbdda98
--- /dev/null
+++ b/gl/po/rw.po
@@ -0,0 +1,587 @@
+# Kinyarwanda translations for mailutils package.
+# Copyright (C) 2005 Free Software Foundation, Inc.
+# This file is distributed under the same license as the mailutils package.
+# Steve Murphy <murf@e-tools.com>, 2005.
+# Steve performed initial rough translation from compendium built from translations provided by the following translators:
+# Philibert Ndandali <ndandali@yahoo.fr>, 2005.
+# Viateur MUGENZI <muvia1@yahoo.fr>, 2005.
+# Noëlla Mupole <s24211045@tuks.co.za>, 2005.
+# Carole Karema <karemacarole@hotmail.com>, 2005.
+# JEAN BAPTISTE NGENDAHAYO <ngenda_denis@yahoo.co.uk>, 2005.
+# Augustin KIBERWA <akiberwa@yahoo.co.uk>, 2005.
+# Donatien NSENGIYUMVA <ndonatienuk@yahoo.co.uk>, 2005.
+# Antoine Bigirimana <antoine@e-tools.com>, 2005.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mailutils 0.6\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2005-04-04 10:55-0700\n"
+"Last-Translator: Steven Michael Murphy <murf@e-tools.com>\n"
+"Language-Team: Kinyarwanda <translation-team-rw@lists.sourceforge.net>\n"
+"Language: rw\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:238
+#, fuzzy, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr ""
+"%.*Project- Id- Version: basctl\n"
+"POT- Creation- Date: 2003- 12- 07 17: 13+ 02\n"
+"PO- Revision- Date: 2004- 11- 04 10: 13- 0700\n"
+"Last- Translator: Language- Team:< en@ li. org> MIME- Version: 1. 0\n"
+"Content- Type: text/ plain; charset= UTF- 8\n"
+"Content- Transfer- Encoding: 8bit\n"
+"X- Generator: KBabel 1. 0\n"
+"."
+
+#: gl/lib/argp-help.c:248
+#, fuzzy, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr ""
+"%.*Project- Id- Version: basctl\n"
+"POT- Creation- Date: 2003- 12- 07 17: 13+ 02\n"
+"PO- Revision- Date: 2004- 11- 04 10: 13- 0700\n"
+"Last- Translator: Language- Team:< en@ li. org> MIME- Version: 1. 0\n"
+"Content- Type: text/ plain; charset= UTF- 8\n"
+"Content- Transfer- Encoding: 8bit\n"
+"X- Generator: KBabel 1. 0\n"
+"."
+
+#: gl/lib/argp-help.c:261
+#, fuzzy, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "in"
+
+#: gl/lib/argp-help.c:1374
+#, fuzzy
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Cyangwa Bitari ngombwa ingingo Kuri Amahitamo Cyangwa Bitari ngombwa "
+"kugirango Amahitamo"
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Ikoresha:"
+
+#: gl/lib/argp-help.c:1744
+#, fuzzy
+msgid " or: "
+msgstr "Cyangwa"
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr ""
+
+#: gl/lib/argp-help.c:1783
+#, fuzzy, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Cyangwa kugirango Birenzeho Ibisobanuro"
+
+#: gl/lib/argp-help.c:1811
+#, fuzzy, c-format
+msgid "Report bugs to %s.\n"
+msgstr "Kuri"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+#, fuzzy
+msgid "Unknown system error"
+msgstr "Sisitemu Ikosa"
+
+#: gl/lib/argp-parse.c:91
+#, fuzzy
+msgid "give this help list"
+msgstr "iyi Ifashayobora Urutonde"
+
+#: gl/lib/argp-parse.c:92
+#, fuzzy
+msgid "give a short usage message"
+msgstr "a Ikoresha: Ubutumwa"
+
+#: gl/lib/argp-parse.c:93
+#, fuzzy
+msgid "NAME"
+msgstr "Izina"
+
+#: gl/lib/argp-parse.c:94
+#, fuzzy
+msgid "set the program name"
+msgstr "i Porogaramu Izina:"
+
+# offmgr/source\offapp\dialog\optgdlg.src:OFA_TP_MISC.FT_HELPAGENT_TIME_UNIT.text
+#: gl/lib/argp-parse.c:95
+#, fuzzy
+msgid "SECS"
+msgstr "amasogonda"
+
+#: gl/lib/argp-parse.c:96
+#, fuzzy
+msgid "hang for SECS seconds (default 3600)"
+msgstr "kugirango amasogonda Mburabuzi"
+
+#: gl/lib/argp-parse.c:154
+#, fuzzy
+msgid "print program version"
+msgstr "Porogaramu Verisiyo"
+
+#: gl/lib/argp-parse.c:171
+#, fuzzy
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(Verisiyo"
+
+#: gl/lib/argp-parse.c:624
+#, fuzzy, c-format
+msgid "%s: Too many arguments\n"
+msgstr "ingingo"
+
+#: gl/lib/argp-parse.c:770
+#, fuzzy
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(Verisiyo"
+
+#: gl/lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s:Ihitamo ni"
+
+#: gl/lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s:Ihitamo ni"
+
+#: gl/lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s:Ihitamo"
+
+#: gl/lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s:Ihitamo Kwemerera"
+
+#: gl/lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s:Ihitamo"
+
+#: gl/lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s:Sibyo Ihitamo"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s:Ihitamo"
+
+#: gl/lib/openat-die.c:38
+#, fuzzy, c-format
+msgid "unable to record current working directory"
+msgstr "Kuri Icyabitswe KIGEZWEHO bushyinguro"
+
+#: gl/lib/openat-die.c:57
+#, fuzzy, c-format
+msgid "failed to return to initial working directory"
+msgstr "Byanze Kuri Garuka Kuri bushyinguro"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Ibyatunganye"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr ""
+
+#: gl/lib/regcomp.c:128
+#, fuzzy
+msgid "Invalid regular expression"
+msgstr "%s:Sibyo Ibisanzwe imvugo"
+
+#: gl/lib/regcomp.c:131
+#, fuzzy
+msgid "Invalid collation character"
+msgstr "Sibyo Inyuguti ishuri"
+
+#: gl/lib/regcomp.c:134
+#, fuzzy
+msgid "Invalid character class name"
+msgstr "Sibyo Inyuguti ishuri"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr ""
+
+#: gl/lib/regcomp.c:140
+#, fuzzy
+msgid "Invalid back reference"
+msgstr "Umubare utari wo"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr ""
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr ""
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr ""
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr ""
+
+#: gl/lib/regcomp.c:155
+#, fuzzy
+msgid "Invalid range end"
+msgstr "Ipaji Urutonde"
+
+#: gl/lib/regcomp.c:158
+#, fuzzy
+msgid "Memory exhausted"
+msgstr "Ububiko"
+
+#: gl/lib/regcomp.c:161
+#, fuzzy
+msgid "Invalid preceding regular expression"
+msgstr "%s:Sibyo Ibisanzwe imvugo"
+
+#: gl/lib/regcomp.c:164
+#, fuzzy
+msgid "Premature end of regular expression"
+msgstr "Ikosa in Ibisanzwe imvugo Gushaka"
+
+#: gl/lib/regcomp.c:167
+#, fuzzy
+msgid "Regular expression too big"
+msgstr "%s:Sibyo Ibisanzwe imvugo"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ""
+
+#: gl/lib/regcomp.c:650
+#, fuzzy
+msgid "No previous regular expression"
+msgstr "Ikosa in Ibisanzwe imvugo Gushaka"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: gl/lib/xalloc-die.c:34
+#, fuzzy
+msgid "memory exhausted"
+msgstr "Ububiko"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
+
+#, fuzzy, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "Sibyo kugirango"
+
+#, fuzzy, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "kugirango"
+
+#, fuzzy, c-format
+#~ msgid "Valid arguments are:"
+#~ msgstr "ingingo"
+
+# 4952
+#, fuzzy
+#~ msgid "program error"
+#~ msgstr "Ikosa ryo mu Isoma"
+
+# svtools/source\misc\errtxt.src:RID_ERRHDL.ERRCODE_CLASS_WRITE.text
+#, fuzzy
+#~ msgid "write error"
+#~ msgstr "Kwandika ikosa"
+
+#, fuzzy, c-format
+#~ msgid "error while opening \"%s\" for reading"
+#~ msgstr "Gufungura kugirango"
+
+#, fuzzy, c-format
+#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgstr "Gufungura kugirango"
+
+#, fuzzy, c-format
+#~ msgid "error reading \"%s\""
+#~ msgstr "Ikosa"
+
+#, fuzzy, c-format
+#~ msgid "error writing \"%s\""
+#~ msgstr "Ikosa"
+
+#, fuzzy, c-format
+#~ msgid "error after reading \"%s\""
+#~ msgstr "Ikosa"
+
+#, fuzzy
+#~ msgid "fdopen() failed"
+#~ msgstr "Gufungura Byanze"
+
+#, fuzzy, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s:Byanze"
+
+#, fuzzy
+#~ msgid "regular empty file"
+#~ msgstr "Ibisanzwe ubusa IDOSIYE"
+
+#, fuzzy
+#~ msgid "regular file"
+#~ msgstr "Ibisanzwe IDOSIYE"
+
+# svtools/source\dialogs\filedlg2.src:STR_FILEDLG_DIR.text
+#, fuzzy
+#~ msgid "directory"
+#~ msgstr "Ububiko"
+
+#, fuzzy
+#~ msgid "block special file"
+#~ msgstr "Funga Bidasanzwe IDOSIYE"
+
+#, fuzzy
+#~ msgid "character special file"
+#~ msgstr "Inyuguti Bidasanzwe IDOSIYE"
+
+#, fuzzy
+#~ msgid "symbolic link"
+#~ msgstr "Ihuza"
+
+#, fuzzy
+#~ msgid "message queue"
+#~ msgstr "Ubutumwa Umurongo"
+
+#, fuzzy
+#~ msgid "shared memory object"
+#~ msgstr "Ububiko Igikoresho"
+
+#, fuzzy
+#~ msgid "typed memory object"
+#~ msgstr "Ububiko Igikoresho"
+
+#, fuzzy
+#~ msgid "weird file"
+#~ msgstr "IDOSIYE"
+
+#, fuzzy
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Idosiye OYA"
+
+#, fuzzy
+#~ msgid "ai_family not supported"
+#~ msgstr "Idosiye OYA"
+
+#, fuzzy
+#~ msgid "Memory allocation failure"
+#~ msgstr "Byanze"
+
+#, fuzzy
+#~ msgid "ai_socktype not supported"
+#~ msgstr "Idosiye OYA"
+
+# svtools/source\misc\errtxt.src:RID_ERRHDL.ERRCODE_CLASS_WRITE.text
+#, fuzzy
+#~ msgid "System error"
+#~ msgstr "Kwandika ikosa"
+
+#, fuzzy
+#~ msgid "Request not canceled"
+#~ msgstr "Ikintu OYA Byabonetse"
+
+#, fuzzy
+#~ msgid "Unknown error"
+#~ msgstr "Sisitemu Ikosa"
+
+#, fuzzy, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s:Ihitamo Kwemerera"
+
+#, fuzzy, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s:Ihitamo"
+
+#, fuzzy, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s:Ihitamo"
+
+#, fuzzy, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s:Ihitamo ni"
+
+#, fuzzy, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s:Ihitamo Kwemerera"
+
+#, fuzzy
+#~ msgid "block size"
+#~ msgstr "Funga Ingano"
+
+#, fuzzy, c-format
+#~ msgid "%s exists but is not a directory"
+#~ msgstr "%sni OYA a bushyinguro"
+
+#, fuzzy, c-format
+#~ msgid "cannot change owner and/or group of %s"
+#~ msgstr "Guhindura>> Na Cyangwa Itsinda Bya"
+
+#, fuzzy, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "Kurema bushyinguro"
+
+#, fuzzy, c-format
+#~ msgid "cannot chdir to directory %s"
+#~ msgstr "Kuri bushyinguro"
+
+#, fuzzy, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "Guhindura>> Uruhushya Bya"
+
+#, fuzzy
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "%s:Byanze Kuri Gufungura kugirango"
+
+#, fuzzy
+#~ msgid "cannot create pipe"
+#~ msgstr "Kurema Ihuza"
+
+# basctl/source\basicide\basidesh.src:RID_IMGBTN_REMOVEWATCH.text
+#, fuzzy
+#~ msgid "`"
+#~ msgstr "`"
+
+#~ msgid "'"
+#~ msgstr "'"
+
+#, fuzzy
+#~ msgid "iconv function not usable"
+#~ msgstr "Umumaro OYA"
+
+#, fuzzy
+#~ msgid "iconv function not available"
+#~ msgstr "Umumaro OYA Bihari"
+
+#, fuzzy
+#~ msgid "character out of range"
+#~ msgstr "Inyuguti Inyuma Bya Urutonde"
+
+#, fuzzy, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "GUHINDURA U Kuri Inyuguti Gushyiraho"
+
+#, fuzzy, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "GUHINDURA U Kuri Inyuguti Gushyiraho"
+
+#, fuzzy
+#~ msgid "invalid user"
+#~ msgstr "Sibyo Ukoresha:"
+
+#, fuzzy
+#~ msgid "invalid group"
+#~ msgstr "Sibyo Itsinda"
+
+#, fuzzy
+#~ msgid "cannot get the login group of a numeric UID"
+#~ msgstr "Kubona i Ifashayinjira Itsinda Bya a Bikurikije umubare"
+
+#, fuzzy
+#~ msgid ""
+#~ "\n"
+#~ "This is free software. You may redistribute copies of it under the terms "
+#~ "of\n"
+#~ "the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Porogaramu ni Kigenga Na Cyangwa i Bya i Nka Verisiyo 2. Cyangwa ku "
+#~ "Ihitamo Verisiyo"
+
+#, fuzzy, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "ku"
+
+#, fuzzy, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "ku Na"
+
+#, fuzzy, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "ku Na"
+
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr "ku Na"
+
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr "ku Na"
+
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr "ku Na"
+
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr "ku Na"
+
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr "ku Na"
+
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr "ku Na"
+
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr "ku Na Ibindi"
+
+#, fuzzy
+#~ msgid "string comparison failed"
+#~ msgstr "Ikurikiranyanyuguti Byanze"
+
+#, fuzzy
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Kuri Akazi i"
+
+#, fuzzy, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Ikurikiranyanyuguti Na"
diff --git a/gl/po/sk.gmo b/gl/po/sk.gmo
new file mode 100644
index 0000000..4fdcf3e
--- /dev/null
+++ b/gl/po/sk.gmo
Binary files differ
diff --git a/gl/po/sk.po b/gl/po/sk.po
new file mode 100644
index 0000000..081095a
--- /dev/null
+++ b/gl/po/sk.po
@@ -0,0 +1,504 @@
+# Slovak translations for GNU textutils
+# Copyright (C) 1996 Free Software Foundation, Inc.
+# Miroslav Vasko <vasko@debian.cz>, 1999
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: textutils 2.0.14\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2001-06-08 22:10 +02:00\n"
+"Last-Translator: Stanislav Meduna <stano@trillian.eunet.sk>\n"
+"Language-Team: Slovak <sk-i18n@rak.isternet.sk>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-2\n"
+"Content-Transfer-Encoding: 8-bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr ""
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr ""
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr ""
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr ""
+
+#: gl/lib/argp-help.c:1756
+#, fuzzy
+msgid " [OPTION...]"
+msgstr "Pouitie: %s [PREPNA] [SBOR]...\n"
+
+#: gl/lib/argp-help.c:1783
+#, fuzzy, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Viac informci zskate prkazom `%s --help'.\n"
+
+#: gl/lib/argp-help.c:1811
+#, fuzzy, c-format
+msgid "Report bugs to %s.\n"
+msgstr ""
+"\n"
+" Chyby v programe oznamujte na adrese <bug-textutils@gnu.org> (iba\n"
+"anglicky), pripomienky k prekladu zasielajte na adresu <sk@li.org> "
+"(slovensky)."
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Neznma systmov chyba"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr ""
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr ""
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr ""
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr ""
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr ""
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr ""
+
+#: gl/lib/argp-parse.c:154
+#, fuzzy
+msgid "print program version"
+msgstr "chyba pri tan"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr ""
+
+#: gl/lib/argp-parse.c:624
+#, fuzzy, c-format
+msgid "%s: Too many arguments\n"
+msgstr "prli vea argumentov"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr ""
+
+#: gl/lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: voba `%s' nie je jednoznan\n"
+
+#: gl/lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: voba `%s' nie je jednoznan\n"
+
+#: gl/lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: neznmy prepna `%c%s'\n"
+
+#: gl/lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: prepna `%c%s' nepovouje argument\n"
+
+#: gl/lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: prepna `%s' vyaduje argument\n"
+
+#: gl/lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: chybn prepna -- %c\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: prepna vyaduje argument -- %c\n"
+
+#: gl/lib/openat-die.c:38
+#, fuzzy, c-format
+msgid "unable to record current working directory"
+msgstr "nie je mon vytvori adresr %s"
+
+#: gl/lib/openat-die.c:57
+#, fuzzy, c-format
+msgid "failed to return to initial working directory"
+msgstr "nie je mon vytvori adresr %s"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr ""
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr ""
+
+#: gl/lib/regcomp.c:128
+#, fuzzy
+msgid "Invalid regular expression"
+msgstr "%s: chybn regulrny vraz: %s"
+
+#: gl/lib/regcomp.c:131
+#, fuzzy
+msgid "Invalid collation character"
+msgstr "chybn trieda znaku `%s'"
+
+#: gl/lib/regcomp.c:134
+#, fuzzy
+msgid "Invalid character class name"
+msgstr "chybn trieda znaku `%s'"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr ""
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr ""
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr ""
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr ""
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr ""
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr ""
+
+#: gl/lib/regcomp.c:155
+#, fuzzy
+msgid "Invalid range end"
+msgstr "%s: chybn regulrny vraz: %s"
+
+#: gl/lib/regcomp.c:158
+#, fuzzy
+msgid "Memory exhausted"
+msgstr "vyerpan pam"
+
+#: gl/lib/regcomp.c:161
+#, fuzzy
+msgid "Invalid preceding regular expression"
+msgstr "%s: chybn regulrny vraz: %s"
+
+#: gl/lib/regcomp.c:164
+#, fuzzy
+msgid "Premature end of regular expression"
+msgstr "chyba pri vyhadvan pomocou regulrneho vrazu"
+
+#: gl/lib/regcomp.c:167
+#, fuzzy
+msgid "Regular expression too big"
+msgstr "%s: chybn regulrny vraz: %s"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ""
+
+#: gl/lib/regcomp.c:650
+#, fuzzy
+msgid "No previous regular expression"
+msgstr "chyba pri vyhadvan pomocou regulrneho vrazu"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "vyerpan pam"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
+
+#, fuzzy, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "chybn argument %s pre `%s'"
+
+#, fuzzy, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "nejednoznan argument %s pre `%s'"
+
+#, c-format
+#~ msgid "Valid arguments are:"
+#~ msgstr "Platn argumenty s:"
+
+#, fuzzy
+#~ msgid "program error"
+#~ msgstr "chyba pri tan"
+
+#~ msgid "write error"
+#~ msgstr "chyba pri zpise"
+
+#, fuzzy, c-format
+#~ msgid "error while opening \"%s\" for reading"
+#~ msgstr "nie je mon otvori %s pre tanie"
+
+#, fuzzy, c-format
+#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgstr "nie je mon otvori %s pre tanie"
+
+#, fuzzy, c-format
+#~ msgid "error reading \"%s\""
+#~ msgstr "chyba pri tan %s"
+
+#, fuzzy, c-format
+#~ msgid "error writing \"%s\""
+#~ msgstr "chyba pri zpise %s"
+
+#, fuzzy, c-format
+#~ msgid "error after reading \"%s\""
+#~ msgstr "chyba pri tan %s"
+
+#, fuzzy
+#~ msgid "fdopen() failed"
+#~ msgstr "zlyhalo otvorenie"
+
+#, fuzzy, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s: chybn vzor"
+
+#, fuzzy
+#~ msgid "regular empty file"
+#~ msgstr "zlyhalo tanie"
+
+#, fuzzy
+#~ msgid "regular file"
+#~ msgstr "zlyhalo tanie"
+
+#, fuzzy
+#~ msgid "directory"
+#~ msgstr "Adresr: "
+
+#, fuzzy
+#~ msgid "block special file"
+#~ msgstr "vekos bloku"
+
+#, fuzzy
+#~ msgid "character special file"
+#~ msgstr "pozcia znaku je nula"
+
+#, fuzzy
+#~ msgid "symbolic link"
+#~ msgstr "ioctl na `%s' nie je mon vykona"
+
+#, fuzzy
+#~ msgid "weird file"
+#~ msgstr "zlyhalo tanie"
+
+#, fuzzy
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "tento systm nepodporuje rry"
+
+#, fuzzy
+#~ msgid "ai_family not supported"
+#~ msgstr "tento systm nepodporuje rry"
+
+#, fuzzy
+#~ msgid "ai_socktype not supported"
+#~ msgstr "tento systm nepodporuje rry"
+
+#, fuzzy
+#~ msgid "System error"
+#~ msgstr "chyba pri zpise"
+
+#, fuzzy
+#~ msgid "Unknown error"
+#~ msgstr "Neznma systmov chyba"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: prepna `--%s' nepovouje argument\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: neznmy prepna `--%s'\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: nepovolen prepna -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: prepna `-W %s' nie je jednoznan\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: prepna `-W %s' nepovouje argument\n"
+
+#~ msgid "block size"
+#~ msgstr "vekos bloku"
+
+#, c-format
+#~ msgid "%s exists but is not a directory"
+#~ msgstr "%s existuje, ale nie je adresrom"
+
+#, c-format
+#~ msgid "cannot change owner and/or group of %s"
+#~ msgstr "nie je mon zmeni pouvatea a/alebo skupinu %s"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "nie je mon vytvori adresr %s"
+
+#, fuzzy, c-format
+#~ msgid "cannot chdir to directory %s"
+#~ msgstr "nie je mon vojs do adresra, %s"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "nie je mon zmeni prva %s"
+
+#, fuzzy
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "nie je mon zmeni prva %s"
+
+#, fuzzy
+#~ msgid "cannot create pipe"
+#~ msgstr "nie je mon vytvori adresr %s"
+
+#~ msgid "`"
+#~ msgstr "`"
+
+#~ msgid "'"
+#~ msgstr "'"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[yYaA]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#, fuzzy
+#~ msgid "iconv function not usable"
+#~ msgstr "nie je mon vypsa U+%04X: funkcia iconv nie je pouiten"
+
+#, fuzzy
+#~ msgid "iconv function not available"
+#~ msgstr "nie je mon vypsa U+%04X: funkcia iconv nie je dostupn"
+
+#, fuzzy
+#~ msgid "character out of range"
+#~ msgstr "U+%04X: znak je mimo rozsah"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "nie je mon konvertova U+%04X do loklnej znakovej sady"
+
+#, fuzzy, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "nie je mon konvertova U+%04X do loklnej znakovej sady"
+
+#~ msgid "invalid user"
+#~ msgstr "neplatn pouvate"
+
+#~ msgid "invalid group"
+#~ msgstr "neplatn skupina"
+
+#~ msgid "cannot get the login group of a numeric UID"
+#~ msgstr "nie je mon uri skupinu selnho UID"
+
+#, fuzzy
+#~ msgid ""
+#~ "\n"
+#~ "This is free software. You may redistribute copies of it under the terms "
+#~ "of\n"
+#~ "the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ " Tento program je von programov vybavenie; mete ho ri a "
+#~ "modifikova\n"
+#~ "poda podmienok Veobecnej verejnej licencie GNU, vydvanej Free "
+#~ "Software\n"
+#~ "Foundation; a to bu verzie 2 tejto licencie alebo (poda vho "
+#~ "uvenia),\n"
+#~ "ktorejkovek neskorej verzie.\n"
+#~ "\n"
+#~ " Tento program je rozirovan v ndeji, e bude uiton, avak BEZ "
+#~ "AKEJKOVEK\n"
+#~ "ZRUKY; neposkytuj sa ani odvoden zruky PREDAJNOSTI alebo VHODNOSTI "
+#~ "PRE\n"
+#~ "NEJAK KONKRTNY EL. aie podrobnosti njdete vo Veobecnej verejnej\n"
+#~ "licencii GNU.\n"
+#~ "\n"
+#~ " Kpia Veobecnej verejnej licencie GNU mala by dodan spolu s tmto\n"
+#~ "programom; pokia sa tak nestalo, napte do Free Software Foundation, "
+#~ "Inc.,\n"
+#~ "59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Napsal %s.\n"
+
+#, fuzzy, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Napsal %s.\n"
+
+#, fuzzy, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Napsal %s.\n"
+
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr "Napsal %s.\n"
+
+#, fuzzy, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr "Napsal %s.\n"
+
+#, fuzzy
+#~ msgid "string comparison failed"
+#~ msgstr "zlyhal stat"
+
+#, fuzzy, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "nie je mon vytvori odkaz %s"
diff --git a/gl/po/sl.gmo b/gl/po/sl.gmo
new file mode 100644
index 0000000..25400d0
--- /dev/null
+++ b/gl/po/sl.gmo
Binary files differ
diff --git a/gl/po/sl.po b/gl/po/sl.po
new file mode 100644
index 0000000..37acfd3
--- /dev/null
+++ b/gl/po/sl.po
@@ -0,0 +1,914 @@
+# -*- mode: po; coding: utf-8; -*- Slovenian message catalog for GNUlib.
+# Copyright (C) 2005, 2007, 2009, 2012 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+# Primož Peterlin <primozz.peterlin@gmail.com>, 2005, 2007, 2009, 2012.
+# $Id: gnulib-3.0.0.6062.a6b16.sl.po,v 1.5 2012/05/20 11:08:36 peterlin Exp $
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 3.0.0.6062.a6b16\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2012-05-20 13:08+0200\n"
+"Last-Translator: Primož Peterlin <primozz.peterlin@gmail.com>\n"
+"Language-Team: Slovenian <translation-team-sl@lists.sourceforge.net>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || "
+"n%100==4 ? 3 : 0);\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: vrednost %s je manjša ali enaka %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: ARGP_HELP_FMT parameter zahteva vrednost"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: Neznan parameter ARGP_HELP_FMT"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Smetje v ARGP_HELP_FMT: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Argumenti, navedeni kot obvezni ali neobvezni pri dolgi obliki izbire, so "
+"obvezni ali neobvezni tudi pri vseh odgovarjajočih kratkih oblikah."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Uporaba:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " ali: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [IZBIRA...]"
+
+#: gl/lib/argp-help.c:1783
+#, fuzzy, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Poskusite »%s --help« ali »%s --usage« za izčrpnejša navodila.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "Poročila o napakah: %s\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Neznana sistemska napaka"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "poda ta seznam pomoči"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "poda kratka navodila"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "IME"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "nastavi ime programa"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "SEK"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "zastane za SEK sekund (privzeto 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "izpiše različico programa"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(PROGRAMSKA NAPAKA) Različice ni moč ugotoviti?!"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: Preveč argumentov\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(PROGRAMSKA NAPAKA) Izbire bi morali prepoznati?!"
+
+#: gl/lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: izbira »-W %s« je dvoumna\n"
+
+#: gl/lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: izbira »%s« je dvoumna; možnosti:"
+
+#: gl/lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: neprepoznana izbira »%c%s«\n"
+
+#: gl/lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: izbira »%c%s« ne dovoljuje argumenta\n"
+
+#: gl/lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: izbira »--%s« zahteva argument\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: neveljavna izbira -- '%c'\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: izbira zahteva argument -- '%c'\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "ni mogoče zabeležiti trenutnega delovnega imenika"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "vrnitev v začetni delovni imenik ni uspela"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Uspešno"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Brez zadetkov"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Neveljaven regularni izraz"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Neveljaven razvrščevalni znak"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Neveljavno ime razreda znakov"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Zaključna obratna poševnica"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Neveljaven povratni sklic"
+
+#: gl/lib/regcomp.c:143
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Uklepaj [ ali [^ brez para"
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "Uklepaj ( ali \\( brez para"
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "Uklepaj \\{ brez para"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "Neveljavna vsebina \\{\\}"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Neveljaven konec razpona"
+
+# ! INEXACT
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Pomnilnik izčrpan"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Neveljaven predhodni regularni izraz"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Predčasen zaključek regularnega izraza"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "Regularni izraz je preobsežen"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr "Zaklepaj ) ali \\) brez para"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Prejšnjega regularnega izraza ni"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "sporočila o napaki ni mogoče prikazati"
+
+# ! INEXACT
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "zmanjkalo pomnilnika"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "neveljavni argument %s za %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "dvoumni argument %s za %s"
+
+#, c-format
+#~ msgid "Valid arguments are:"
+#~ msgstr "Veljavni argumenti so:"
+
+#, c-format
+#~ msgid "%.*s: ARGP_HELP_FMT parameter must be positive"
+#~ msgstr "%.*s: ARGP_HELP_FMT parameter mora biti pozitiven"
+
+#~ msgid "program error"
+#~ msgstr "napaka v programu"
+
+#~ msgid "stack overflow"
+#~ msgstr "prekoračitev sklada"
+
+#, c-format
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr "začasnega imenika ni moč najti, poskusite nastaviti $TMPDIR"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "začasnega imenika z uporabo šablone \"%s\" ni mogoče ustvariti"
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "začasne datoteke v %s ni mogoče odstraniti"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "začasnega imenika %s ni mogoče odstraniti"
+
+#~ msgid "error closing file"
+#~ msgstr "napaka pri zapiranju datoteke"
+
+#~ msgid "write error"
+#~ msgstr "napaka pri pisanju"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "ohranjena dovoljenja za %s"
+
+#, c-format
+#~ msgid "error while opening \"%s\" for reading"
+#~ msgstr "napaka pri odpiranju datoteke \"%s\" za branje"
+
+#, c-format
+#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgstr "varnostne kopije \"%s\" ni mogoče odpreti za pisanje"
+
+#, c-format
+#~ msgid "error reading \"%s\""
+#~ msgstr "napaka pri branju \"%s\""
+
+#, c-format
+#~ msgid "error writing \"%s\""
+#~ msgstr "napaka pri pisanju na \"%s\""
+
+#, c-format
+#~ msgid "error after reading \"%s\""
+#~ msgstr "napaka po branju \"%s\""
+
+#, c-format
+#~ msgid "fdopen() failed"
+#~ msgstr "klic fdopen() ni uspel"
+
+#, c-format
+#~ msgid "C# compiler not found, try installing pnet"
+#~ msgstr "prevajalnika za C# ni najti, namestite pnet"
+
+#, c-format
+#~ msgid "C# virtual machine not found, try installing pnet"
+#~ msgstr "virtualnega stroja C# ni najti, namestite pnet"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "podproces %s ni uspel"
+
+#~ msgid "regular empty file"
+#~ msgstr "navadna prazna datoteka"
+
+#~ msgid "regular file"
+#~ msgstr "navadna datoteka"
+
+#~ msgid "directory"
+#~ msgstr "imenik"
+
+#~ msgid "block special file"
+#~ msgstr "bločna enota"
+
+#~ msgid "character special file"
+#~ msgstr "znakovna enota"
+
+#~ msgid "fifo"
+#~ msgstr "FIFO"
+
+# ! INEXACT
+#~ msgid "symbolic link"
+#~ msgstr "simbolna povezava"
+
+#~ msgid "socket"
+#~ msgstr "vtičnica"
+
+#~ msgid "message queue"
+#~ msgstr "vrsta sporočil"
+
+#~ msgid "semaphore"
+#~ msgstr "semafor"
+
+#~ msgid "shared memory object"
+#~ msgstr "deljen pomnilniški predmet"
+
+#~ msgid "typed memory object"
+#~ msgstr "tipiziran pomnilniški predmet"
+
+#~ msgid "weird file"
+#~ msgstr "čudna datoteka"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Družina naslovov za ime gostitelja ni podprta"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Razreševanje imena začasno ni uspelo"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Slaba vrednost ai_flags"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Nepopravljiv neuspeh pri razreševanju imena"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "ai_family ni podprt"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Dodelitev pomnilnika ni uspela"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "Z imenom gostitelja ni povezan noben naslov"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Ime ali storitev ni poznana"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "Servname ni podprt za ai_socktype"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "ai_socktype ni podprt"
+
+#~ msgid "System error"
+#~ msgstr "Sistemska napaka"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "Medpomnilnik za argumente premajhen"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Obdelava zahtevka v teku"
+
+#~ msgid "Request canceled"
+#~ msgstr "Zahtevek preklican"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Zahtevek ni preklican"
+
+#~ msgid "All requests done"
+#~ msgstr "Vsi zahtevki obdelani"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Prekinjeno s signalom"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "Parametrični niz nepravilno kodiran"
+
+#~ msgid "Unknown error"
+#~ msgstr "Neznana napaka"
+
+#, c-format
+#~ msgid "%s: option '--%s' doesn't allow an argument\n"
+#~ msgstr "%s: izbira »--%s« ne dovoljuje argumenta\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option '--%s'\n"
+#~ msgstr "%s: neprepoznana izbira »--%s«\n"
+
+#, c-format
+#~ msgid "%s: option '-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: izbira »-W %s« ne dovoljuje argumenta\n"
+
+#, c-format
+#~ msgid "%s: option '-W %s' requires an argument\n"
+#~ msgstr "%s: izbira »-W %s« zahteva argument\n"
+
+#, c-format
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "neveljaven argument source_version za compile_java_class"
+
+#, c-format
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "neveljaven argument target_version za compile_java_class"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "ni mogoče ustvariti \"%s\""
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "napaka pri pisanju na datoteko \"%s\""
+
+#, c-format
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr "prevajalnika za Javo ni najti, nastavite $JAVAC ali namestite gcj"
+
+#, c-format
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "virtualnega stroja za Javo ni najti, nastavite $JAVA ali namestite gij"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "V/I napaka podprocesa %s"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "dovoljenj %s ni mogoče spremeniti"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "imenika %s ni mogoče ustvariti"
+
+#, c-format
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Datoteke /dev/null ni uspelo odpreti za branje"
+
+#, c-format
+#~ msgid "creation of reading thread failed"
+#~ msgstr "niti za pisanje ni bilo mogoče ustvariti"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "neblokiranega V/I za podproces %s ni mogoče nastaviti"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "komunikacija s podprocesom %s ni uspela"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "pisanje na podproces %s ni uspelo"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "branje s podprocesa %s ni uspelo"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "podproces %s se je zaključil z izhodno kodo %d"
+
+#, c-format
+#~ msgid "creation of threads failed"
+#~ msgstr "ustvarjanje niti ni uspelo"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "%s podproces se je zaključil z izhodno kodo %d"
+
+#~ msgid "Franc,ois Pinard"
+#~ msgstr "François Pinard"
+
+#~ msgid "`"
+#~ msgstr "»"
+
+#~ msgid "'"
+#~ msgstr "«"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[jJdD]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "nastavljena dovoljenja za %s"
+
+#~ msgid "Hangup"
+#~ msgstr "Odklop"
+
+#~ msgid "Interrupt"
+#~ msgstr "Prekinitev"
+
+#~ msgid "Quit"
+#~ msgstr "Končanje"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "Nedovoljen ukaz"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Past"
+
+#~ msgid "Aborted"
+#~ msgstr "Prekinjen"
+
+#~ msgid "Floating point exception"
+#~ msgstr "Prekoračitev plavajoče vejice"
+
+#~ msgid "Killed"
+#~ msgstr "Pobit"
+
+#~ msgid "Bus error"
+#~ msgstr "Napaka vodila"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "Napaka segmentacije"
+
+#~ msgid "Broken pipe"
+#~ msgstr "Prekinjen cevovod"
+
+#~ msgid "Alarm clock"
+#~ msgstr "Budilka"
+
+#~ msgid "Terminated"
+#~ msgstr "Zaključen"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "Nujno V/I stanje"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "Ustavljen (signal)"
+
+#~ msgid "Stopped"
+#~ msgstr "Ustavljen"
+
+#~ msgid "Continued"
+#~ msgstr "Nadaljevan"
+
+#~ msgid "Child exited"
+#~ msgstr "Izhod nasledniškega procesa"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Ustavljen (vhod TTY)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Ustavljen (izhod TTY)"
+
+#~ msgid "I/O possible"
+#~ msgstr "Mogoč V/I"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "Presežena omejitev procesorskega časa"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "Presežena omejitev dolžine datoteke"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "Iztek virtualne štoparice"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "Iztek profilirne štoparice"
+
+#~ msgid "Window changed"
+#~ msgstr "Zamenjano okno"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "Uporabniški signal 1"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Uporabniški signal 2"
+
+#~ msgid "EMT trap"
+#~ msgstr "Past EMT"
+
+#~ msgid "Bad system call"
+#~ msgstr "Slab sistemski klic"
+
+#~ msgid "Stack fault"
+#~ msgstr "Napaka sklada"
+
+#~ msgid "Information request"
+#~ msgstr "Informacijski zahtevek"
+
+#~ msgid "Power failure"
+#~ msgstr "Izpad toka"
+
+#~ msgid "Resource lost"
+#~ msgstr "Vir izgubljen"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "napaka pri pisanju na zaprt cevovod ali vtič"
+
+#, c-format
+#~ msgid "cannot create pipe"
+#~ msgstr "ni mogoče ustvariti cevovoda"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "Realnočasovni signal %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Neznani signal %d"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "funkcija iconv ne deluje"
+
+#~ msgid "iconv function not available"
+#~ msgstr "funkcija iconv ni na voljo"
+
+#~ msgid "character out of range"
+#~ msgstr "koda znaka izven obsega"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "znaka s kodo U+%04X ni mogoče pretvoriti v lokalni nabor znakov"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "znaka s kodo U+%04X ni moč pretvoriti v lokalni nabor znakov: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "neveljavno uporabniško ime"
+
+#~ msgid "invalid group"
+#~ msgstr "neveljavno ime skupine"
+
+#~ msgid "invalid spec"
+#~ msgstr "neveljavna specifikacija"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "Priprava paketa: %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "Priprava paketa: %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "©"
+
+#~ msgid ""
+#~ "\n"
+#~ "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl."
+#~ "html>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "\n"
+#~ "GPLv3+: GNU GPL, 3. izdaja ali poznejša <http://www.gnu.org/licenses/gpl."
+#~ "html>\n"
+#~ "To je prosto programje; lahko ga redistribuirate in/ali spreminjate.\n"
+#~ "Za izdelek ni NOBENEGA JAMSTVA, do z zakonom dovoljene meje.\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Avtor(ica): %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Avtorja: %s in %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Avtorji: %s, %s in %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Avtorji: %s, %s, %s\n"
+#~ "in %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Avtorji: %s, %s, %s,\n"
+#~ "%s in %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Avtorji: %s, %s, %s,\n"
+#~ "%s, %s in %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Avtorji: %s, %s, %s,\n"
+#~ "%s, %s, %s in %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Avtorji: %s, %s, %s,\n"
+#~ "%s, %s, %s, %s\n"
+#~ "in %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Avtorji: %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s in %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Avtorji: %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s in drugi.\n"
+
+#, c-format
+#~ msgid ""
+#~ "\n"
+#~ "Report bugs to: %s\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Poročila o napakah: %s\n"
+#~ "Napake v prevodu sporočite na <translation-team-sl@lists.sourceforge."
+#~ "net>.\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr ""
+#~ "Napake v programu %s sporočite na: %s\n"
+#~ "Napake v prevodu sporočite na <translation-team-sl@lists.sourceforge."
+#~ "net>.\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "Domača stran %s: <%s>\n"
+
+#, c-format
+#~ msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+#~ msgstr "Spletna stran %s: <http://www.gnu.org/software/%s/>.\n"
+
+#~ msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+#~ msgstr ""
+#~ "Splošna pomoč za rabo programja GNU: <http://www.gnu.org/gethelp/>.\n"
+
+#, c-format
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "klic _open_osfhandle ni uspel"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "ni mogoče obnoviti fd %d: klic dup2 ni uspel"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "podproces %s"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "podproces %s je prejel terminalni signal %d"
+
+#~ msgid "stdin"
+#~ msgstr "standardni vhod"
+
+#~ msgid "stdout"
+#~ msgstr "standardni izhod"
+
+#~ msgid "stderr"
+#~ msgstr "standardna izhod za napake"
+
+#~ msgid "unknown stream"
+#~ msgstr "neznani tok"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "ponovno odpiranje %s v načinu %s ni uspelo"
+
+#, c-format
+#~ msgid "string comparison failed"
+#~ msgstr "primerjanje nizov ni uspelo"
+
+#, c-format
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Nastavite LC_ALL='C', da bi odpravili težavo."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Primerjana niza sta bila %s in %s."
+
+#, c-format
+#~ msgid "cannot perform formatted output"
+#~ msgstr "oblikovanega izpisa ni mogoče izvesti"
+
+#, c-format
+#~ msgid "invalid %s%s argument `%s'"
+#~ msgstr "neveljavni %s%s argument »%s«"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument `%s'"
+#~ msgstr "neveljavna pripona pri %s%s argumentu »%s«"
+
+#, c-format
+#~ msgid "%s%s argument `%s' too large"
+#~ msgstr "%s%s: argument »%s« je prevelik"
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: nedovoljena izbira -- %c\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Report bugs to <%s>.\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Napake v programu sporočite na %s.\n"
+#~ "Napake v prevodu sporočite na <translation-team-sl@lists.sourceforge."
+#~ "net>.\n"
+
+#~ msgid "block size"
+#~ msgstr "velikost bloka"
+
+#~ msgid "%s exists but is not a directory"
+#~ msgstr "%s obstaja, vendar ni imenik"
+
+# ! INEXACT
+#~ msgid "cannot change owner and/or group of %s"
+#~ msgstr "lastnika in/ali skupine %s ni mogoče spremeniti"
+
+#~ msgid "cannot chdir to directory %s"
+#~ msgstr "dostop do imenika %s ni mogoč"
+
+#~ msgid "cannot get the login group of a numeric UID"
+#~ msgstr "imena skupine, ki pripada številčnemu UID, ni mogoče ugotoviti"
+
+#~ msgid ""
+#~ "\n"
+#~ "This is free software. You may redistribute copies of it under the terms "
+#~ "of\n"
+#~ "the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Ta program je prosta programska oprema; lahko ga redistribuirate in/ali\n"
+#~ "spreminjate po pogojih, določenih v »GNU General Public License«, \n"
+#~ "<http://www.gnu.org/licenses/gpl.html>. Za izdelek ni NOBENEGA JAMSTVA, "
+#~ "do\n"
+#~ "z zakonom dovoljene meje.\n"
diff --git a/gl/po/sr.gmo b/gl/po/sr.gmo
new file mode 100644
index 0000000..f557e1c
--- /dev/null
+++ b/gl/po/sr.gmo
Binary files differ
diff --git a/gl/po/sr.po b/gl/po/sr.po
new file mode 100644
index 0000000..7a8ec63
--- /dev/null
+++ b/gl/po/sr.po
@@ -0,0 +1,967 @@
+# Serbian translation of gnulib.
+# Copyright © 2020 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+# Мирослав Николић <miroslavnikolic@rocketmail.com>, 2013—2020.
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib-4.0.0.2567\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2020-04-20 09:38+0200\n"
+"Last-Translator: Мирослав Николић <miroslavnikolic@rocketmail.com>\n"
+"Language-Team: Serbian <(nothing)>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
+"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"X-Generator: Virtaal 0.7.1\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: %s вредност је мања од или једнака са %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: „ARGP_HELP_FMT“ параметар захтева вредност"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: Непознат параметар „ARGP_HELP_FMT“"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Ђубре у „ARGP_HELP_FMT“-у: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Обавезни или опционални аргументи за дуге опције су такође обавезни или "
+"опционални за све одговарајуће кратке опције."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Употреба:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " или: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [ОПЦИЈА...]"
+
+#: gl/lib/argp-help.c:1783
+#, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Покушајте „%s --help“ или „%s --usage“ за више података.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "Грешке пријавите на %s.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Непозната грешка система"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "приказује овај списак помоћи"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "приказује кратку поруку коришћења"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "НАЗИВ"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "поставља назив програма"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "СЕКУНДЕ"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "стаје за СЕКУНДЕ секунде (основно је 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "исписује издање програма"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(ГРЕШКА ПРОГРАМА) Није познато издање!?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: Превише аргумената\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(ГРЕШКА ПРОГРАМА) Опција треба да буде препозната!?"
+
+#: gl/lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: опција „%s%s“ је нејасна\n"
+
+#: gl/lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: опција „%s%s“ је нејасна; могућности:"
+
+#: gl/lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: непозната опција „%s%s“\n"
+
+#: gl/lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: опција „%s%s“ не дозвољава аргумент\n"
+
+#: gl/lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: опција „%s%s“ захтева аргумент\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: неисправна опција -- „%c“\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: опција захтева аргумент -- „%c“\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "не могу да снимим тренутни радни директоријум"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "не могу да се вратим у почетни радни директоријум"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Успешно"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Нема подударања"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Неправилан регуларан израз"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Неисправан знак поретка"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Неисправан назив класе знака"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Пратећа контра коса црта"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Неисправна повратна упута"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Неупарено [, [^, [:, [., или [="
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "Неупарено ( или \\("
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "Неупарено \\{"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "Неисправан садржај \\{\\}"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Неисправан крај опсега"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Меморија је потрошена"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Неисправан регуларан израз који претходи"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Прерани крај регуларног израза"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "Регуларни израз је превелик"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr "Непоклопљено ) или \\)"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Нема претходног регуларног израза"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "не могу да прикажем поруку грешке"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "меморија је потрошена"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr "стандардни описници датотеке"
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "неисправан аргумент „%s“ за „%s“"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "нејасан аргумент „%s“ за „%s“"
+
+#~ msgid "Valid arguments are:"
+#~ msgstr "Исправни аргументи су:"
+
+#, c-format
+#~ msgid "%u bitset_allocs, %u freed (%.2f%%).\n"
+#~ msgstr "%u битсет_доделе, %u ослобођених (%.2f%%).\n"
+
+#, c-format
+#~ msgid "%u bitset_sets, %u cached (%.2f%%)\n"
+#~ msgstr "%u битсет_поставки, %u кешираних (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_resets, %u cached (%.2f%%)\n"
+#~ msgstr "%u битсет_повраћаја, %u кешираних (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_tests, %u cached (%.2f%%)\n"
+#~ msgstr "%u битсет_тестова, %u кешираних (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_lists\n"
+#~ msgstr "%u битсет_спискова\n"
+
+#~ msgid "count log histogram\n"
+#~ msgstr "број хистограма дневника\n"
+
+#~ msgid "size log histogram\n"
+#~ msgstr "величина хистограма дневника\n"
+
+#~ msgid "density histogram\n"
+#~ msgstr "хистограм густине\n"
+
+#, c-format
+#~ msgid ""
+#~ "Bitset statistics:\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Статистике битсета:\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Accumulated runs = %u\n"
+#~ msgstr "Нагомиланих покретања = %u\n"
+
+#~ msgid "cannot read stats file"
+#~ msgstr "не могу да читам датотеку стања"
+
+#, c-format
+#~ msgid "bad stats file size\n"
+#~ msgstr "лоша величина датотеке стања\n"
+
+#~ msgid "cannot write stats file"
+#~ msgstr "не могу да пишем датотеку стања"
+
+#~ msgid "cannot open stats file for writing"
+#~ msgstr "не могу да отворим датотеку стања за упис"
+
+#~ msgid "program error"
+#~ msgstr "грешка програма"
+
+#~ msgid "stack overflow"
+#~ msgstr "стек је препуњен"
+
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr ""
+#~ "не могу да пронађем привремени директоријум, покушавам да подесим "
+#~ "„$TMPDIR“"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "не могу да направим привремени директоријум користећи шаблон „%s“"
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "не могу да уклоним привремену датотеку „%s“"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "не могу да уклоним привремени директоријум „%s“"
+
+#~ msgid "error closing file"
+#~ msgstr "грешка затварања датотеке"
+
+#~ msgid "write error"
+#~ msgstr "грешка записивања"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "причувавам овлашћења за %s"
+
+#, c-format
+#~ msgid "error while opening %s for reading"
+#~ msgstr "грешка приликом отварања „%s“ за читање"
+
+#, c-format
+#~ msgid "cannot open backup file %s for writing"
+#~ msgstr "не могу да отворим датотеку резерве „%s“ за упис"
+
+#, c-format
+#~ msgid "error reading %s"
+#~ msgstr "грешка читања „%s“"
+
+#, c-format
+#~ msgid "error writing %s"
+#~ msgstr "грешка писања „%s“"
+
+#, c-format
+#~ msgid "error after reading %s"
+#~ msgstr "грешка након читања „%s“"
+
+#~ msgid "fdopen() failed"
+#~ msgstr "није успела функција „fdopen()“"
+
+#~ msgid "C# compiler not found, try installing mono"
+#~ msgstr "нисам нашао Ц# преводиоца, покушајте да инсталирате моно"
+
+#~ msgid "C# virtual machine not found, try installing mono"
+#~ msgstr "нисам нашао Ц# виртуелну машину, покушајте да инсталирате моно"
+
+#~ msgid "unbalanced ["
+#~ msgstr "неуравнотежена ["
+
+#~ msgid "invalid character class"
+#~ msgstr "неисправна класа знака"
+
+#~ msgid "character class syntax is [[:space:]], not [:space:]"
+#~ msgstr "синтакса класе знака је [[:space:]], а не [:space:]"
+
+#~ msgid "unfinished \\ escape"
+#~ msgstr "недовршена \\ излаза"
+
+#~ msgid "invalid content of \\{\\}"
+#~ msgstr "неисправан садржај \\{\\}"
+
+#~ msgid "regular expression too big"
+#~ msgstr "регуларни израз је превелик"
+
+#~ msgid "unbalanced ("
+#~ msgstr "неуравнотежена ("
+
+#~ msgid "no syntax specified"
+#~ msgstr "није наведена синтакса"
+
+#~ msgid "unbalanced )"
+#~ msgstr "неуравнотежена )"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s потпроцес није успео"
+
+#~ msgid "regular empty file"
+#~ msgstr "обична празна датотека"
+
+#~ msgid "regular file"
+#~ msgstr "обична датотека"
+
+#~ msgid "directory"
+#~ msgstr "директоријум"
+
+#~ msgid "symbolic link"
+#~ msgstr "симболичка веза"
+
+#~ msgid "message queue"
+#~ msgstr "ред порука"
+
+#~ msgid "semaphore"
+#~ msgstr "семафор"
+
+#~ msgid "shared memory object"
+#~ msgstr "заједнички меморијски објекат"
+
+#~ msgid "typed memory object"
+#~ msgstr "типски меморијски објекат"
+
+#~ msgid "block special file"
+#~ msgstr "посебна датотека блока"
+
+#~ msgid "character special file"
+#~ msgstr "посебна датотека знака"
+
+#~ msgid "contiguous data"
+#~ msgstr "непрекидни подаци"
+
+#~ msgid "fifo"
+#~ msgstr "пупи"
+
+#~ msgid "door"
+#~ msgstr "врата"
+
+#~ msgid "multiplexed block special file"
+#~ msgstr "специјална датотека мултиплексираног блока"
+
+#~ msgid "multiplexed character special file"
+#~ msgstr "специјална датотека мултиплексираног знака"
+
+#~ msgid "multiplexed file"
+#~ msgstr "мултиплексирана датотека"
+
+#~ msgid "named file"
+#~ msgstr "именована датотека"
+
+#~ msgid "network special file"
+#~ msgstr "посебна датотека мреже"
+
+#~ msgid "migrated file with data"
+#~ msgstr "премештена датотека са подацима"
+
+#~ msgid "migrated file without data"
+#~ msgstr "премештена датотека без података"
+
+#~ msgid "port"
+#~ msgstr "порт"
+
+#~ msgid "socket"
+#~ msgstr "прикључница"
+
+#~ msgid "whiteout"
+#~ msgstr "празнина"
+
+#~ msgid "weird file"
+#~ msgstr "чудна датотека"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Породица адреса за назив домаћина није подржана"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Привремени неуспех одређивања назива"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Неисправна вредност за аи_опције"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Непоправљива грешка при одређивању назива"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "аи_породица није подржана"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Расподела меморије није успела"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "Ниједна адреса није придружена називу домаћина"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Није позната услуга или назив"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "Назив сервера није подржан за аи_врступрикључка"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "аи_врстаприкључка није подржана"
+
+#~ msgid "System error"
+#~ msgstr "Системска грешка"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "Међумеморија аргумента је премала"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Захтев обрађивања је у току"
+
+#~ msgid "Request canceled"
+#~ msgstr "Захтев је отказан"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Захтев није отказан"
+
+#~ msgid "All requests done"
+#~ msgstr "Сви захтеви су готови"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Прекинуто сигналом"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "Ниска параметра није исправно кодирана"
+
+#~ msgid "Unknown error"
+#~ msgstr "Непозната грешка"
+
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "неисправан аргумент издања_извора за преведи_јава_разред"
+
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "неисправан аргумент издања_мете за преведи_јава_разред"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "нисам успео да направим „%s“"
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "грешка приликом писања датотеке „%s“"
+
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr ""
+#~ "Нисам нашао Јава преводиоца, покушајте да инсталирате гцј или поставите "
+#~ "„$JAVAC“"
+
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "Нисам нашао виртуелну машину Јаве, покушајте да инсталирате гиј или да "
+#~ "поставите „$JAVA“"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "У/И грешка %s потпроцеса"
+
+#, c-format
+#~ msgid "cannot stat %s"
+#~ msgstr "не могу да добавим податке за „%s“"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "не могу да променим овлашћења за „%s“"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "не могу да направим директоријум „%s“"
+
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Нисам успео да отворим „/dev/zero“ за читање"
+
+#~ msgid "creation of reading thread failed"
+#~ msgstr "стварање нити за читање није успело"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "не могу да поставим неблокирајући У/И на потпроцес %s"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "комуницирање са %s потпроцесом није успело"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "писање у %s потпроцес није успело"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "читање из %s потпроцеса није успело"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "потпроцес %s је окончан са излазном шифром %d"
+
+#~ msgid "creation of threads failed"
+#~ msgstr "стварање нити није успело"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "%s потпроцес је окончан са излазном шифром %d"
+
+#~ msgid "`"
+#~ msgstr "„"
+
+#~ msgid "'"
+#~ msgstr "“"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[yY]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "подешавам овлашћења за %s"
+
+#~ msgid "Hangup"
+#~ msgstr "Обустави"
+
+#~ msgid "Interrupt"
+#~ msgstr "Прекини"
+
+#~ msgid "Quit"
+#~ msgstr "Изађи"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "Неисправна инструкција"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Замка праћења/тачке прекида"
+
+#~ msgid "Aborted"
+#~ msgstr "Прекинуто"
+
+#~ msgid "Floating point exception"
+#~ msgstr "Изузетак са покретним зарезом"
+
+#~ msgid "Killed"
+#~ msgstr "Убијено"
+
+#~ msgid "Bus error"
+#~ msgstr "Грешка сабирнице"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "Грешка сегментације"
+
+#~ msgid "Broken pipe"
+#~ msgstr "Прекинута спојка"
+
+#~ msgid "Alarm clock"
+#~ msgstr "Будилник"
+
+#~ msgid "Terminated"
+#~ msgstr "Окончан"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "Хитни У/И услов"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "Заустављен (сигнал)"
+
+#~ msgid "Stopped"
+#~ msgstr "Заустављен"
+
+#~ msgid "Continued"
+#~ msgstr "Настављен"
+
+#~ msgid "Child exited"
+#~ msgstr "Потпроцес је напуштен"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Заустављен (улаз конзоле)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Заустављен (излаз конзоле)"
+
+#~ msgid "I/O possible"
+#~ msgstr "I/O је могућ"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "Прекорачено је временско ограничење процесора"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "Прекорачено је ограничење величине датотеке"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "Виртуелни одбројавач је истекао"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "Одбројавач профилисања је истекао"
+
+#~ msgid "Window changed"
+#~ msgstr "Прозор је измењен"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "Кориснички одређени сигнал 1"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Кориснички одређени сигнал 2"
+
+#~ msgid "EMT trap"
+#~ msgstr "ЕМТ замка"
+
+#~ msgid "Bad system call"
+#~ msgstr "Лош системски позив"
+
+#~ msgid "Stack fault"
+#~ msgstr "Неуспех стека"
+
+#~ msgid "Information request"
+#~ msgstr "Захтев зе информацијама"
+
+#~ msgid "Power failure"
+#~ msgstr "Неуспех напајања"
+
+#~ msgid "Resource lost"
+#~ msgstr "Губитак изворишта"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "грешка писања на затворену спојку или прикључницу"
+
+#~ msgid "cannot create pipe"
+#~ msgstr "не могу да направим спојку"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "Сигнал у стварном времену %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Непознати сигнал %d"
+
+#~ msgid "Execution times (seconds)"
+#~ msgstr "Времена извршења (секунди)"
+
+#~ msgid "CPU user"
+#~ msgstr "ЦПЈ корисник"
+
+#~ msgid "CPU system"
+#~ msgstr "ЦПЈ систем"
+
+#~ msgid "wall clock"
+#~ msgstr "зидни сат"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "иконв функција није употребљива"
+
+#~ msgid "iconv function not available"
+#~ msgstr "иконв функција није доступна"
+
+#~ msgid "character out of range"
+#~ msgstr "знак је ван опсега"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "не могу да претворим U+%04X у месни скуп знакова"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "не могу да претворим U+%04X у месни скуп знакова: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "неисправан корисник"
+
+#~ msgid "invalid group"
+#~ msgstr "неисправна група"
+
+#~ msgid "invalid spec"
+#~ msgstr "неисправна одредница"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "Запаковао је %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "Запаковао је %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "©"
+
+#, c-format
+#~ msgid ""
+#~ "License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ msgstr ""
+#~ "Лиценца ОЈЛи3+: ГНУ ОЈЛ издање 3 или новије <%s>.\n"
+#~ "Ово је слободан софтвер: слободни сте да га мењате и расподељујете.\n"
+#~ "Не постоји НИКАКВА ГАРАНЦИЈА, у оквирима дозвољеним законом.\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Написао је %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Написали су %s и %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Написали су %s, %s, и %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Написали су %s, %s, %s,\n"
+#~ "и %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Написали су %s, %s, %s,\n"
+#~ "%s, и %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Написали су %s, %s, %s,\n"
+#~ "%s, %s, и %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Написали су %s, %s, %s,\n"
+#~ "%s, %s, %s, и %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Написали су %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "и %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Написали су %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, и %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Написали су %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, и други.\n"
+
+#, c-format
+#~ msgid "Report bugs to: %s\n"
+#~ msgstr "Грешке пријавите на: %s\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "Грешке програма „%s“ пријавите на: %s\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "%s матична страница: <%s>\n"
+
+#, c-format
+#~ msgid "General help using GNU software: <%s>\n"
+#~ msgstr "Општа помоћ користећи ГНУ софтвер: <%s>\n"
+
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "„_open_osfhandle“ није успело"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "не могу да повратим фд %d: „dup2“ није успело"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "%s потпроцес"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "%s потпроцес је добио кобни сигнал %d"
+
+#~ msgid "failed to set file descriptor text/binary mode"
+#~ msgstr "нисам успео да подесим текстуални/бинарни режим описника датотеке"
+
+#~ msgid "stdin"
+#~ msgstr "стдулаз"
+
+#~ msgid "stdout"
+#~ msgstr "стдизлаз"
+
+#~ msgid "stderr"
+#~ msgstr "стдгрешка"
+
+#~ msgid "unknown stream"
+#~ msgstr "непознат ток"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "нисам успео да поново отворим „%s“ са режимом %s"
+
+#~ msgid "string comparison failed"
+#~ msgstr "није успело поређење ниске"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Поставите LC_ALL='C' да решите проблем."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Поређене ниске су „%s“ и „%s“."
+
+#~ msgid "cannot perform formatted output"
+#~ msgstr "не могу да извршим обликовани излаз"
+
+#, c-format
+#~ msgid "invalid %s%s argument '%s'"
+#~ msgstr "неисправан %s%s аргумент „%s“"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument '%s'"
+#~ msgstr "неисправан суфикс у %s%s аргумент „%s“"
+
+#, c-format
+#~ msgid "%s%s argument '%s' too large"
+#~ msgstr "%s%s аргумент „%s“ је превелик"
+
+#~ msgid "%.*s: ARGP_HELP_FMT parameter must be positive"
+#~ msgstr "%.*s: „ARGP_HELP_FMT“ параметар мора бити позитиван"
+
+#~ msgid "%s: option '--%s' doesn't allow an argument\n"
+#~ msgstr "%s: опција „--%s“ не дозвољава аргумент\n"
+
+#~ msgid "%s: unrecognized option '--%s'\n"
+#~ msgstr "%s: непозната опција „--%s“\n"
+
+#~ msgid "%s: option '-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: опција „-W %s“ не дозвољава аргумент\n"
+
+#~ msgid "%s: option '-W %s' requires an argument\n"
+#~ msgstr "%s: опција „-W %s“ захтева аргумент\n"
+
+#~ msgid "Franc,ois Pinard"
+#~ msgstr "Франсуа Пинард"
+
+#~ msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+#~ msgstr "%s матична страница: <http://www.gnu.org/software/%s/>\n"
diff --git a/gl/po/stamp-po b/gl/po/stamp-po
new file mode 100644
index 0000000..9788f70
--- /dev/null
+++ b/gl/po/stamp-po
@@ -0,0 +1 @@
+timestamp
diff --git a/gl/po/sv.gmo b/gl/po/sv.gmo
new file mode 100644
index 0000000..38a7bc9
--- /dev/null
+++ b/gl/po/sv.gmo
Binary files differ
diff --git a/gl/po/sv.po b/gl/po/sv.po
new file mode 100644
index 0000000..403da15
--- /dev/null
+++ b/gl/po/sv.po
@@ -0,0 +1,954 @@
+# Swedish messages for gnulib.
+# Copyright © 1997, 2002, 2003, 2004, 2005, 2007, 2009, 2010, 2011, 2019, 2020 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+# Peter Antman <peter.antman@abc.se>, 1997.
+# Thomas Olsson <cid95tho@lustudat.student.lu.se>, 1997.
+# Daniel Resare <daniel@resare.com>, 1999, 2000.
+# Göran Uddeborg <goeran@uddeborg.se>, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009, 2010, 2011, 2019, 2020.
+#
+# $Revision: 1.19 $
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 4.0.0.2567\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2020-05-28 21:40+0200\n"
+"Last-Translator: Göran Uddeborg <goeran@uddeborg.se>\n"
+"Language-Team: Swedish <tp-sv-list@lists.sourceforge.net>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: värdet på %s är mindre än eller lika med %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: ARGP_HELP_FMT-parametern kräver ett värde"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: Okänd ARGP_HELP_FMT-parameter"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Skräp i ARGP_HELP_FMT: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Obligatoriska eller valfria argument till långa flaggor är obligatoriska "
+"eller valfria även för motsvarande korta flaggor."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Användning:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " eller: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [FLAGGA...]"
+
+#: gl/lib/argp-help.c:1783
+#, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Försök med ”%s --help” eller ”%s --usage” för mer information.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr ""
+"Rapportera fel till %s.\n"
+"Skicka synpunkter på översättningen till <tp-sv-list@lists.sourceforge."
+"net>.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Okänt systemfel"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "ge denna hjälplista"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "ge ett kort användningsmeddelande"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "NAMN"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "ange programnamnet"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "S"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "häng i S sekunder (3600 som standard)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "skriv ut programversion"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(PROGRAMFEL) Ingen version känd!?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: För många argument\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(PROGRAMFEL) Flaggan borde ha känts igen!?"
+
+#: gl/lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: flaggan ”%s%s” är tvetydig\n"
+
+#: gl/lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: flaggan ”%s%s” är tvetydig: möjligheter:"
+
+#: gl/lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: okänd flagga ”%s%s”\n"
+
+#: gl/lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: flaggan ”%s%s” tar inget argument\n"
+
+#: gl/lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: flaggan ”%s%s” kräver ett argument\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: ogiltig flagga -- ”%c”\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: flaggan kräver ett argument -- ”%c”\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "kan inte notera aktuell arbetskatalog"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "kunde inte återvända till den ursprungliga arbetskatalogen"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Lyckades"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Ingen träff"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Felaktigt reguljärt uttryck"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Ogiltigt sorteringstecken"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Ogiltigt teckenklassnamn"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Avslutande bakstreck"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Ogiltig bakåtreferens"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Ensam [, [^, [:, [. eller [="
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "Ensam ( eller \\("
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "Ensam \\{"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "Ogiltigt innehåll i \\{\\}"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Ogiltigt intervallslut"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Minnet slut"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Felaktigt föregående reguljärt uttryck"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Förtida slut av reguljärt uttryck"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "För stort reguljärt uttryck"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr "Ensam ) eller \\)"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Inget föregående reguljärt uttryck"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "kan inte visa felmeddelande"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "minnet slut"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr "standard filbeskrivare"
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "felaktigt argument %s till %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "tvetydigt argument %s till %s"
+
+#~ msgid "Valid arguments are:"
+#~ msgstr "Giltiga argument är:"
+
+#, c-format
+#~ msgid "%u bitset_allocs, %u freed (%.2f%%).\n"
+#~ msgstr "%u bitset-allokeringar, %u frigjorda (%.2f %%).\n"
+
+#, c-format
+#~ msgid "%u bitset_sets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset-mängder, %u cachade (%.2f %%)\n"
+
+#, c-format
+#~ msgid "%u bitset_resets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset-återställningar, %u cachade (%.2f %%)\n"
+
+#, c-format
+#~ msgid "%u bitset_tests, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset-tester, %u cachade (%.2f %%)\n"
+
+#, c-format
+#~ msgid "%u bitset_lists\n"
+#~ msgstr "%u bitset-listor\n"
+
+#~ msgid "count log histogram\n"
+#~ msgstr "antalsloggshistogram\n"
+
+#~ msgid "size log histogram\n"
+#~ msgstr "storleksloggshistogram\n"
+
+#~ msgid "density histogram\n"
+#~ msgstr "densitetshistogram\n"
+
+#, c-format
+#~ msgid ""
+#~ "Bitset statistics:\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Bitset-statistik:\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Accumulated runs = %u\n"
+#~ msgstr "Ackumulerade körningar = %u\n"
+
+#~ msgid "cannot read stats file"
+#~ msgstr "kan inte läsa statistikfilen"
+
+#, c-format
+#~ msgid "bad stats file size\n"
+#~ msgstr "felaktig storlek på statistikfil\n"
+
+#~ msgid "cannot write stats file"
+#~ msgstr "kan inte skriva statistikfilen"
+
+#~ msgid "cannot open stats file for writing"
+#~ msgstr "kan inte öppna statistikfilen för skrivning"
+
+#~ msgid "program error"
+#~ msgstr "programfel"
+
+#~ msgid "stack overflow"
+#~ msgstr "stackspill"
+
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr "kan inte hitta en temporärkatalog, försök sätta $TMPDIR"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "kan inte skapa en temporärkatalog med användning av mallen ”%s”"
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "kan inte ta bort temporärfil %s"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "kan inte ta bort temporärkatalog %s"
+
+#~ msgid "error closing file"
+#~ msgstr "fel när fil stängdes"
+
+#~ msgid "write error"
+#~ msgstr "skrivfel"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "bevarar rättigheter på %s"
+
+#, c-format
+#~ msgid "error while opening %s for reading"
+#~ msgstr "fel när %s öppnades för läsning"
+
+#, c-format
+#~ msgid "cannot open backup file %s for writing"
+#~ msgstr "det går inte att öppna säkerhetskopiefilen %s för skrivning"
+
+#, c-format
+#~ msgid "error reading %s"
+#~ msgstr "fel vid läsning av %s"
+
+#, c-format
+#~ msgid "error writing %s"
+#~ msgstr "fel vid skrivning av %s"
+
+#, c-format
+#~ msgid "error after reading %s"
+#~ msgstr "fel efter läsning av %s"
+
+#~ msgid "fdopen() failed"
+#~ msgstr "fdopen() misslyckades"
+
+#~ msgid "C# compiler not found, try installing mono"
+#~ msgstr "C#-kompilator hittades inte, försök installera mono"
+
+#~ msgid "C# virtual machine not found, try installing mono"
+#~ msgstr "den virtuella C#-maskinen hittades inte, försök installera mono"
+
+#~ msgid "unbalanced ["
+#~ msgstr "obalanserad ["
+
+#~ msgid "invalid character class"
+#~ msgstr "ogiltig teckenklass"
+
+#~ msgid "character class syntax is [[:space:]], not [:space:]"
+#~ msgstr "teckenklassyntaxen är [[:space:]], inte [:space:]"
+
+#~ msgid "unfinished \\ escape"
+#~ msgstr "oavslutad \\-sekvens"
+
+#~ msgid "invalid content of \\{\\}"
+#~ msgstr "ogiltigt innehåll i \\{\\}"
+
+#~ msgid "regular expression too big"
+#~ msgstr "för stort reguljärt uttryck"
+
+#~ msgid "unbalanced ("
+#~ msgstr "obalanserad ("
+
+#~ msgid "no syntax specified"
+#~ msgstr "ingen syntax angiven"
+
+#~ msgid "unbalanced )"
+#~ msgstr "obalanserad )"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s-underprocess misslyckades"
+
+#~ msgid "regular empty file"
+#~ msgstr "tom normal fil"
+
+#~ msgid "regular file"
+#~ msgstr "normal fil"
+
+#~ msgid "directory"
+#~ msgstr "katalog"
+
+#~ msgid "symbolic link"
+#~ msgstr "symbolisk länk"
+
+#~ msgid "message queue"
+#~ msgstr "meddelandekö"
+
+#~ msgid "semaphore"
+#~ msgstr "semafor"
+
+#~ msgid "shared memory object"
+#~ msgstr "objekt av delat minne"
+
+#~ msgid "typed memory object"
+#~ msgstr "objekt av typat minne"
+
+#~ msgid "block special file"
+#~ msgstr "blockspecialfil"
+
+#~ msgid "character special file"
+#~ msgstr "teckenspecialfil"
+
+#~ msgid "contiguous data"
+#~ msgstr "sammanhängande data"
+
+#~ msgid "fifo"
+#~ msgstr "fifo"
+
+#~ msgid "door"
+#~ msgstr "dörr"
+
+#~ msgid "multiplexed block special file"
+#~ msgstr "multiplexad blockspecialfil"
+
+#~ msgid "multiplexed character special file"
+#~ msgstr "multiplexad teckenspecialfil"
+
+#~ msgid "multiplexed file"
+#~ msgstr "multiplexad fil"
+
+#~ msgid "named file"
+#~ msgstr "namngiven fil"
+
+#~ msgid "network special file"
+#~ msgstr "nätverksspecialfil"
+
+#~ msgid "migrated file with data"
+#~ msgstr "migrerad fil med data"
+
+#~ msgid "migrated file without data"
+#~ msgstr "migrerad fil utan data"
+
+#~ msgid "port"
+#~ msgstr "port"
+
+#~ msgid "socket"
+#~ msgstr "uttag (socket)"
+
+#~ msgid "whiteout"
+#~ msgstr "övertäckningsfil"
+
+#~ msgid "weird file"
+#~ msgstr "konstig fil"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Adressfamiljen för värdnamnet stöds inte"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Tillfälligt fel i namnuppslagning"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Felaktigt värde för ai_flags"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Oreparabelt fel i namnuppslagning"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "ai_family stöds inte"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Minnesallokeringsfel"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "Ingen adress associerad med värdnamnet"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Namn eller tjänst inte känd"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "Servname stöds inte för ai_socktype"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "ai_socktype stöds inte"
+
+#~ msgid "System error"
+#~ msgstr "Systemfel"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "Argumentbufferten för liten"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Bearbetar pågående begäran"
+
+#~ msgid "Request canceled"
+#~ msgstr "Begäran annullerad"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Begäran inte annullerad"
+
+#~ msgid "All requests done"
+#~ msgstr "Alla begäran utförda"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Avbruten av en signal"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "Parametersträng inte korrekt kodad"
+
+#~ msgid "Unknown error"
+#~ msgstr "Okänt fel"
+
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "ogiltigt source_version-argument till compile_java_class"
+
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "ogiltigt target_version-argument till compile_java_class"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "det gick inte att skapa ”%s”"
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "fel vid skrivning av filen ”%s”"
+
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr ""
+#~ "Javakompilator hittades inte, försök installera gcj eller sätta $JAVAC"
+
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "Virtuell Javamaskin hittades inte, försök installera gij eller sätta $JAVA"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "%s-underprocess I/O-fel"
+
+#, c-format
+#~ msgid "cannot stat %s"
+#~ msgstr "kan inte ta status på %s"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "kan inte ändra rättigheter på %s"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "kan inte skapa katalogen %s"
+
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Misslyckades att öppna /dev/zero för läsning"
+
+#~ msgid "creation of reading thread failed"
+#~ msgstr "att skapa lästråd misslyckades"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr ""
+#~ "det gick inte att sätta upp icke blockerande I/O till %s-underprocess"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "kommunikation med %s-underprocess misslyckades"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "skrivning till %s-underprocess misslyckades"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "läsning från %s-underprocess misslyckades"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "underprocess %s avslutad med slutstatus %d"
+
+#~ msgid "creation of threads failed"
+#~ msgstr "att skapa trådar misslyckades"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "%s-underprocess avslutad med slutstatus %d"
+
+#~ msgid "`"
+#~ msgstr "”"
+
+#~ msgid "'"
+#~ msgstr "”"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[yYjJ]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "ändrar rättigheter på %s"
+
+#~ msgid "Hangup"
+#~ msgstr "Avringd"
+
+#~ msgid "Interrupt"
+#~ msgstr "Avbruten"
+
+#~ msgid "Quit"
+#~ msgstr "Lämnad"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "Otillåten instruktion"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Spårnings-/brytpunktsfälla"
+
+#~ msgid "Aborted"
+#~ msgstr "Avbruten (abort)"
+
+#~ msgid "Floating point exception"
+#~ msgstr "Flyttalsundantag"
+
+#~ msgid "Killed"
+#~ msgstr "Dödad"
+
+#~ msgid "Bus error"
+#~ msgstr "Bussfel"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "Segmenteringsfel"
+
+#~ msgid "Broken pipe"
+#~ msgstr "Brutet rör"
+
+#~ msgid "Alarm clock"
+#~ msgstr "Alarmklocka"
+
+#~ msgid "Terminated"
+#~ msgstr "Avslutad"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "Brådskande I/O-situation"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "Stoppad (signal)"
+
+#~ msgid "Stopped"
+#~ msgstr "Stoppad"
+
+#~ msgid "Continued"
+#~ msgstr "Återupptagen"
+
+#~ msgid "Child exited"
+#~ msgstr "Barn avslutade"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Stoppad (terminalläsning)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Stoppad (terminalskrivning)"
+
+#~ msgid "I/O possible"
+#~ msgstr "I/O möjligt"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "Begränsning av CPU-tid överskriden"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "Begränsning av filstorlek överskriden"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "Alarmklocka - virtuell tid gick ut"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "Profileringsklocka gick ut"
+
+#~ msgid "Window changed"
+#~ msgstr "Ändrat fönster"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "Användarsignal 1"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Användarsignal 2"
+
+#~ msgid "EMT trap"
+#~ msgstr "Emulatorfälla"
+
+#~ msgid "Bad system call"
+#~ msgstr "Felaktigt systemanrop"
+
+#~ msgid "Stack fault"
+#~ msgstr "Stackfel"
+
+#~ msgid "Information request"
+#~ msgstr "Informationsbegäran"
+
+#~ msgid "Power failure"
+#~ msgstr "Strömavbrott"
+
+#~ msgid "Resource lost"
+#~ msgstr "Förlorad resurs"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "fel vid skrivning till ett stängt rör eller uttag"
+
+#~ msgid "cannot create pipe"
+#~ msgstr "kan inte skapa rör"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "Realtidssignal %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Okänd signal %d"
+
+#~ msgid "Execution times (seconds)"
+#~ msgstr "Körtider (sekunder)"
+
+#~ msgid "CPU user"
+#~ msgstr "CPU användare"
+
+#~ msgid "CPU system"
+#~ msgstr "CPU system"
+
+#~ msgid "wall clock"
+#~ msgstr "väggklocka"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "iconv-funktion inte användbar"
+
+#~ msgid "iconv function not available"
+#~ msgstr "iconv-funktion inte tillgänglig"
+
+#~ msgid "character out of range"
+#~ msgstr "tecken utanför intervall"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "kan inte konvertera U+%04X till lokal teckenuppsättning"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "kan inte konvertera U+%04X till lokal teckenuppsättning: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "ogiltig användare"
+
+#~ msgid "invalid group"
+#~ msgstr "ogiltig grupp"
+
+#~ msgid "invalid spec"
+#~ msgstr "ogiltig specifikation"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "Paketerat av %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "Paketerat av %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "©"
+
+#, c-format
+#~ msgid ""
+#~ "License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ msgstr ""
+#~ "Licens GPLv3+: GNU GPL version 3 eller senare <%s>.\n"
+#~ "Detta är fri programvara: du får lov att ändra och vidaredistribuera "
+#~ "den.\n"
+#~ "Det finns INGEN GARANTI, så långt lagen tillåter.\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Skrivet av %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Skrivet av %s och %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Skrivet av %s, %s och %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Skrivet av %s, %s, %s\n"
+#~ "och %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Skrivet av %s, %s, %s,\n"
+#~ "%s och %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Skrivet av %s, %s, %s,\n"
+#~ "%s, %s och %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Skrivet av %s, %s, %s,\n"
+#~ "%s, %s, %s och %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Skrivet av %s, %s, %s,\n"
+#~ "%s, %s, %s, %s\n"
+#~ "och %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Skrivet av %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s och %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Skrivet av %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s med flera.\n"
+
+#, c-format
+#~ msgid "Report bugs to: %s\n"
+#~ msgstr ""
+#~ "Rapportera fel till: %s\n"
+#~ "Skicka synpunkter på översättningen till: tp-sv-list@lists.sourceforg."
+#~ "net\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "Rapportera %s-fel till: %s\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "Webbsida för %s: <%s>\n"
+
+#, c-format
+#~ msgid "General help using GNU software: <%s>\n"
+#~ msgstr "Allmän hjälp med att använda GNU-program: <%s>\n"
+
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "_open_osfhandle misslyckades"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "kan inte återställa fb %d: dup2 misslyckades"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "%s-underprocess"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "%s-underprocess fick ödesdiger signal %d"
+
+#~ msgid "failed to set file descriptor text/binary mode"
+#~ msgstr "misslyckades att sätta filbeskrivaren i text-/binärt läge"
+
+#~ msgid "stdin"
+#~ msgstr "standard in"
+
+#~ msgid "stdout"
+#~ msgstr "standard ut"
+
+#~ msgid "stderr"
+#~ msgstr "standard fel"
+
+#~ msgid "unknown stream"
+#~ msgstr "okänd ström"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "det gick inte att öppna om %s i läget %s"
+
+#~ msgid "string comparison failed"
+#~ msgstr "strängjämförelse misslyckades"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Sätt LC_ALL='C' för att gå runt problemet."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "De jämförda strängarna var %s och %s."
+
+#~ msgid "cannot perform formatted output"
+#~ msgstr "kan inte utföra formaterad utmatning"
+
+#, c-format
+#~ msgid "invalid %s%s argument '%s'"
+#~ msgstr "felaktigt %s%s-argument ”%s”"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument '%s'"
+#~ msgstr "felaktigt suffix i %s%s-argument ”%s”"
+
+#, c-format
+#~ msgid "%s%s argument '%s' too large"
+#~ msgstr "%s%s-argumentet ”%s” är för stort"
diff --git a/gl/po/tr.gmo b/gl/po/tr.gmo
new file mode 100644
index 0000000..e7477de
--- /dev/null
+++ b/gl/po/tr.gmo
Binary files differ
diff --git a/gl/po/tr.po b/gl/po/tr.po
new file mode 100644
index 0000000..26522c4
--- /dev/null
+++ b/gl/po/tr.po
@@ -0,0 +1,568 @@
+# translation of coreutils-5.3.0.tr.po to Turkish
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+# Ali Devin Sezer <Ali_Sezer@brown.edu>, 2002.
+# Nilgün Belma Bugüner <nilgun@superonline.com>, 2001, 2002.
+# Onur Tolga ŞEHİTOĞLU <onur@lcsl.metu.edu.tr>, 1998.
+# Deniz Akkus Kanca <deniz@arayan.com>, 2001,2003, 2004.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: coreutils 5.3.0\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2005-03-14 04:17+0200\n"
+"Last-Translator: Deniz Akkus Kanca <deniz@arayan.com>\n"
+"Language-Team: Turkish <gnu-tr-u12a@lists.sourceforge.net>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: KBabel 1.9.1\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr ""
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr ""
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr ""
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr ""
+
+#
+#: gl/lib/argp-help.c:1374
+#, fuzzy
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Uzun seçenekler için zorunlu olan argümanlar kısa seçenekler için de "
+"zorunludur.\n"
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr ""
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr ""
+
+#: gl/lib/argp-help.c:1756
+#, fuzzy
+msgid " [OPTION...]"
+msgstr "Kullanım: %s [SEÇENEK]...\n"
+
+#: gl/lib/argp-help.c:1783
+#, fuzzy, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Daha fazla bilgi için `%s --help' yazın.\n"
+
+#: gl/lib/argp-help.c:1811
+#, fuzzy, c-format
+msgid "Report bugs to %s.\n"
+msgstr ""
+"\n"
+"Yazılım hatalarını <%s> adresine,\n"
+"çeviri hatalarını <gnu-tr@belgeler.org> adresine bildirin.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Bilinmeyen sistem hatası"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr ""
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr ""
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "İSİM"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr ""
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr ""
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr ""
+
+#: gl/lib/argp-parse.c:154
+#, fuzzy
+msgid "print program version"
+msgstr "okuma hatası"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr ""
+
+#: gl/lib/argp-parse.c:624
+#, fuzzy, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: çok fazla sağlama satırı"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr ""
+
+#: gl/lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: `%s' seçeneği belirsiz\n"
+
+#: gl/lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: `%s' seçeneği belirsiz\n"
+
+#: gl/lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: `%c%s' seçeneği bilinmiyor\n"
+
+#: gl/lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: seçenek `%c%s' argümansız kullanılır\n"
+
+#: gl/lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: `%s' seçeneği bir argümanla kullanılır\n"
+
+#: gl/lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: geçersiz seçenek -- %c\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: seçenek bir argümanla kullanılır -- %c\n"
+
+#: gl/lib/openat-die.c:38
+#, fuzzy, c-format
+msgid "unable to record current working directory"
+msgstr "openat: çalışılan dizini kaydedemedi"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "başlangıç çalışma dizinine geri dönülemedi"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr ""
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr ""
+
+#: gl/lib/regcomp.c:128
+#, fuzzy
+msgid "Invalid regular expression"
+msgstr "%s: geçersiz düzenli ifade(regular expression): %s"
+
+#: gl/lib/regcomp.c:131
+#, fuzzy
+msgid "Invalid collation character"
+msgstr "geçersiz karakter sınıfı `%s'"
+
+#: gl/lib/regcomp.c:134
+#, fuzzy
+msgid "Invalid character class name"
+msgstr "geçersiz karakter sınıfı `%s'"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr ""
+
+#: gl/lib/regcomp.c:140
+#, fuzzy
+msgid "Invalid back reference"
+msgstr "Geçersiz sayfa aralığı `%s'"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr ""
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr ""
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr ""
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr ""
+
+#: gl/lib/regcomp.c:155
+#, fuzzy
+msgid "Invalid range end"
+msgstr "Geçersiz sayfa aralığı `%s'"
+
+#: gl/lib/regcomp.c:158
+#, fuzzy
+msgid "Memory exhausted"
+msgstr "bellek tükendi"
+
+#: gl/lib/regcomp.c:161
+#, fuzzy
+msgid "Invalid preceding regular expression"
+msgstr "%s: geçersiz düzenli ifade(regular expression): %s"
+
+#: gl/lib/regcomp.c:164
+#, fuzzy
+msgid "Premature end of regular expression"
+msgstr "düzenli ifade (regular expression) aramasında hata oluştu"
+
+#: gl/lib/regcomp.c:167
+#, fuzzy
+msgid "Regular expression too big"
+msgstr "%s: geçersiz düzenli ifade(regular expression): %s"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ""
+
+#: gl/lib/regcomp.c:650
+#, fuzzy
+msgid "No previous regular expression"
+msgstr "düzenli ifade (regular expression) aramasında hata oluştu"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "bellek tükendi"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "%s argümanı `%s' için geçersiz"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "%s argümanı `%s' için belirsiz"
+
+#, c-format
+#~ msgid "Valid arguments are:"
+#~ msgstr "Geçerli argümanlar:"
+
+#~ msgid "write error"
+#~ msgstr "yazma hatası"
+
+#, fuzzy, c-format
+#~ msgid "error while opening \"%s\" for reading"
+#~ msgstr "%s okumak için açılamadı"
+
+#, fuzzy, c-format
+#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgstr "%s yazmak için açılamadı"
+
+#, fuzzy, c-format
+#~ msgid "error reading \"%s\""
+#~ msgstr "%s'i okunurken hata"
+
+#, fuzzy, c-format
+#~ msgid "error writing \"%s\""
+#~ msgstr "%s'e yazarken hata"
+
+#, fuzzy, c-format
+#~ msgid "error after reading \"%s\""
+#~ msgstr "%s'i okunurken hata"
+
+#, fuzzy
+#~ msgid "fdopen() failed"
+#~ msgstr "açma işlemi başarısız"
+
+#, fuzzy, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s: arama (seek) başarısız"
+
+#
+#~ msgid "regular empty file"
+#~ msgstr "normal boş dosya"
+
+#
+#~ msgid "regular file"
+#~ msgstr "normal dosya"
+
+#~ msgid "directory"
+#~ msgstr "dizin"
+
+#
+#~ msgid "block special file"
+#~ msgstr "blok özel dosyası"
+
+#
+#~ msgid "character special file"
+#~ msgstr "karakter özel dosyası"
+
+#
+#~ msgid "fifo"
+#~ msgstr "fifo"
+
+#~ msgid "symbolic link"
+#~ msgstr "sembolik bağ"
+
+#~ msgid "socket"
+#~ msgstr "soket"
+
+#~ msgid "message queue"
+#~ msgstr "ileti kuyruğu"
+
+#~ msgid "semaphore"
+#~ msgstr "semafor"
+
+#
+#~ msgid "shared memory object"
+#~ msgstr "paylaşımlı bellek nesnesi"
+
+#
+#~ msgid "typed memory object"
+#~ msgstr "türlenmiş bellek nesnesi"
+
+#
+#~ msgid "weird file"
+#~ msgstr "garip dosya"
+
+#, fuzzy
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "fifo dosyaları desteklenmiyor"
+
+#, fuzzy
+#~ msgid "ai_family not supported"
+#~ msgstr "fifo dosyaları desteklenmiyor"
+
+#, fuzzy
+#~ msgid "ai_socktype not supported"
+#~ msgstr "fifo dosyaları desteklenmiyor"
+
+#, fuzzy
+#~ msgid "System error"
+#~ msgstr "yazma hatası"
+
+#, fuzzy
+#~ msgid "Unknown error"
+#~ msgstr "Bilinmeyen sistem hatası"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: `--%s' seçeneği argümansız kullanılır\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: `--%s' seçeneği bilinmiyor\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: kuraldışı seçenek -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: `-W %s' seçeneği belirsiz\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: `-W %s' seçeneği argümansız kullanılır\n"
+
+#~ msgid "block size"
+#~ msgstr "blok uzunluğu"
+
+#, c-format
+#~ msgid "%s exists but is not a directory"
+#~ msgstr "%s var ama bir dizin değil"
+
+#, c-format
+#~ msgid "cannot change owner and/or group of %s"
+#~ msgstr "%s'in sahibi ve/veya grubu değiştirilemiyor"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "%s dizini oluşturulamıyor"
+
+#, c-format
+#~ msgid "cannot chdir to directory %s"
+#~ msgstr "%s dizinine geçilemedi"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "%s'in erişim izinleri değiştirilemiyor"
+
+#, fuzzy
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "%s: yazmak için açılamadı"
+
+#, fuzzy
+#~ msgid "cannot create pipe"
+#~ msgstr "%s bağı oluşturulamadı"
+
+#~ msgid "`"
+#~ msgstr "`"
+
+#~ msgid "'"
+#~ msgstr "'"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[eE]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[hH]"
+
+#
+#~ msgid "iconv function not usable"
+#~ msgstr "iconv işlevi kullanılabilir değil"
+
+#~ msgid "iconv function not available"
+#~ msgstr "iconv işlevi yok"
+
+#~ msgid "character out of range"
+#~ msgstr "karakter kapsamdışı"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "U+%04X yerel karakter kümesine dönüştürülemiyor"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "U+%04X yerel karakter kümesine dönüştürülemiyor: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "kullanıcı geçersiz"
+
+#~ msgid "invalid group"
+#~ msgstr "grup geçersiz"
+
+#~ msgid "cannot get the login group of a numeric UID"
+#~ msgstr "bir sayısal kullanıcı-kimliğin grubu alınamıyor"
+
+#, fuzzy
+#~ msgid ""
+#~ "\n"
+#~ "This is free software. You may redistribute copies of it under the terms "
+#~ "of\n"
+#~ "the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Bu, bir serbest yazılımdır; Free Software Foundation tarafından "
+#~ "yayınlanan\n"
+#~ "GNU Genel Kamu Lisansı, 2. sürüm (veya sizin seçiminize bağlı olarak) "
+#~ "daha üst \n"
+#~ "sürüm koşulları altında değişiklik yapabilir ve/veya yeniden "
+#~ "dağıtabilirsiniz. \n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "%s tarafından yazıldı.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "%s ve %s tarafından yazıldı.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "%s, %s ve %s tarafından yazıldı.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "%s, %s, %s \n"
+#~ "ve %s tarafından yazıldı.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "%s, %s, %s, %s \n"
+#~ "ve %s tarafından yazıldı.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "%s, %s, %s, %s, \n"
+#~ "%s ve %s tarafından yazıldı.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "%s, %s, %s, %s, \n"
+#~ "%s, %s ve %s tarafından yazıldı.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "%s, %s, %s, \n"
+#~ "%s, %s, %s, \n"
+#~ "%s ve %s tarafından yazıldı.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "%s, %s, %s, \n"
+#~ "%s, %s, %s, \n"
+#~ "%s, %s ve %s tarafından yazıldı.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "%s, %s, %s, \n"
+#~ "%s, %s, %s, \n"
+#~ "%s, %s, %s ve başkaları tarafından yazıldı.\n"
+
+#
+#~ msgid "string comparison failed"
+#~ msgstr "dizge karşılaştırması başarısız"
+
+#
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Problemi devre dışı bırakmak için LC_ALL='C' tanımlayın."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Karşılaştırılan dizgeler %s ve %s idi."
diff --git a/gl/po/uk.gmo b/gl/po/uk.gmo
new file mode 100644
index 0000000..0cd26b2
--- /dev/null
+++ b/gl/po/uk.gmo
Binary files differ
diff --git a/gl/po/uk.po b/gl/po/uk.po
new file mode 100644
index 0000000..355adaa
--- /dev/null
+++ b/gl/po/uk.po
@@ -0,0 +1,973 @@
+# Ukrainian messages for gnulib
+# This file is distributed under the same license as the gnulib package.
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# Sergey Poznyakoff <gray@gnu.org>, 2010.
+# Yuri Chornoivan <yurchor@ukr.net>, 2011, 2019.
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 4.0.0.2567\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2019-05-19 14:26+0300\n"
+"Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n"
+"Language-Team: Ukrainian <trans-uk@lists.fedoraproject.org>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
+"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"X-Generator: Lokalize 19.03.70\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: значення %s є менше ніж або дорівнює %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: параметр ARGP_HELP_FMT вимагає значення"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: Невідомий параметр ARGP_HELP_FMT"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Хибні дані в ARGP_HELP_FMT: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Аргументи, обов'язкові для довгих ключів, є обов'язковими й для коротких."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Використання:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " чи: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [ПАРАМЕТР...]"
+
+#: gl/lib/argp-help.c:1783
+#, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "Віддайте команду «%s --help» або «%s --usage», щоб дізнатися більше.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "Про помилки звітуйте на <%s>.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Невідома системна помилка"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "вивести цю довідку"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "вивести коротке повідомлення про використання"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "НАЗВА"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "встановити назву програми"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "СЕКУНДИ"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "зачекати вказану кількість секунд (типово 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "вивести версію програми"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(ПОМИЛКА ПРОГРАМУВАННЯ) Невідома версія!?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: забагато аргументів\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(ПОМИЛКА ПРОГРАМУВАННЯ) Параметр мала бути розпізнана!?"
+
+#: gl/lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: параметр «%s%s» не є однозначним\n"
+
+#: gl/lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: неоднозначний параметр «%s%s»; можливі варіанти:"
+
+#: gl/lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: невідомий параметр «%s%s»\n"
+
+#: gl/lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: додавання аргументів до параметра «%s%s» не передбачено\n"
+
+#: gl/lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: до параметра «%s%s» слід додати аргумент\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: Некоректний параметр -- '%c'\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: параметр вимагає аргументу -- '%c'\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "не вдається змінити поточний каталог"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "не вдається зберегти поточний каталог"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Успіх"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Брак збігів"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Некоректний формальний вираз"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Некоректний об'єднувальний символ"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Некоректна назва класу символів"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Зворотна похила риска наприкінці виразу"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Недійсне зворотнє посилання"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Вираз без парних [, [^, [:, [. або [="
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "Незакрита ( або \\("
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "Незакрита \\{"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "Некоректний вміст \\{\\}"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Некоректний кінець діапазону"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Пам'ять вичерпана"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Некоректний попередній формальний вираз"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Передчасне закінчення формального виразу"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "Завеликий формальний вираз"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr "Неузгоджена ) або \\)"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Не вказано попереднього формального виразу"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "не вдається вивести повідомлення про помилку"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "пам'ять вичерпано"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr "стандартні дескриптори файлів"
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "некоректний аргумент %s для %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "неоднозначний аргумент %s для %s"
+
+#~ msgid "Valid arguments are:"
+#~ msgstr "Дозволені аргументи такі:"
+
+#, c-format
+#~ msgid "%u bitset_allocs, %u freed (%.2f%%).\n"
+#~ msgstr "%u bitset_allocs, %u звільнено (%.2f%%).\n"
+
+#, c-format
+#~ msgid "%u bitset_sets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_sets, %u кешовано (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_resets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_resets, %u кешовано (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_tests, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_tests, %u кешовано (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_lists\n"
+#~ msgstr "%u bitset_lists\n"
+
+#~ msgid "count log histogram\n"
+#~ msgstr "гістограма журналу лічильників\n"
+
+#~ msgid "size log histogram\n"
+#~ msgstr "гістограма журналу розміру\n"
+
+#~ msgid "density histogram\n"
+#~ msgstr "гістограма щільності\n"
+
+#, c-format
+#~ msgid ""
+#~ "Bitset statistics:\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Статистика наборів бітів:\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Accumulated runs = %u\n"
+#~ msgstr "Акумульовані запуски = %u\n"
+
+#~ msgid "cannot read stats file"
+#~ msgstr "не вдалося прочитати файл статистичних даних"
+
+#, c-format
+#~ msgid "bad stats file size\n"
+#~ msgstr "помилковий розмір файла статистичних даних\n"
+
+#~ msgid "cannot write stats file"
+#~ msgstr "не вдалося записати файл статистичних даних."
+
+#~ msgid "cannot open stats file for writing"
+#~ msgstr "не вдалося відкрити файл статистичних даних для запису"
+
+#~ msgid "program error"
+#~ msgstr "помилка програми"
+
+#~ msgid "stack overflow"
+#~ msgstr "переповнення стосу"
+
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr "не вдається знайти тимчасовий каталог, спробуйте встановити $TMPDIR"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr ""
+#~ "не вдається створити тимчасовий каталог використовуючи шаблон \"%s\""
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "не вдається усунути тимчасовий файл %s"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "не вдається усунути тимчасовий каталог %s"
+
+#~ msgid "error closing file"
+#~ msgstr "помилка закриття файлу"
+
+#~ msgid "write error"
+#~ msgstr "помилка запису"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "збереження прав доступу до %s"
+
+#, c-format
+#~ msgid "error while opening %s for reading"
+#~ msgstr "помилка при відкриванні «%s» для читання"
+
+#, c-format
+#~ msgid "cannot open backup file %s for writing"
+#~ msgstr "не вдається відкрити резервний файл «%s» для запису"
+
+#, c-format
+#~ msgid "error reading %s"
+#~ msgstr "помилка читання %s"
+
+#, c-format
+#~ msgid "error writing %s"
+#~ msgstr "помилка запису %s"
+
+#, c-format
+#~ msgid "error after reading %s"
+#~ msgstr "помилка після читання «%s»"
+
+#~ msgid "fdopen() failed"
+#~ msgstr "помилка fdopen()"
+
+#~ msgid "C# compiler not found, try installing mono"
+#~ msgstr "не знайдено компілятора C#, спробуйте встановити mono"
+
+#~ msgid "C# virtual machine not found, try installing mono"
+#~ msgstr "не знайдено віртуальної машини C#, спробуйте встановити mono"
+
+#~ msgid "unbalanced ["
+#~ msgstr "неврівноважена дужка ["
+
+#~ msgid "invalid character class"
+#~ msgstr "некоректний клас символів"
+
+#~ msgid "character class syntax is [[:space:]], not [:space:]"
+#~ msgstr ""
+#~ "синтаксис класу символів є таким: [[:space:]], — а не таким: [:space:]"
+
+#~ msgid "unfinished \\ escape"
+#~ msgstr "незавершене екранування \\"
+
+#~ msgid "invalid content of \\{\\}"
+#~ msgstr "некоректний вміст \\{\\}"
+
+#~ msgid "regular expression too big"
+#~ msgstr "занадто об'ємний формальний вираз"
+
+#~ msgid "unbalanced ("
+#~ msgstr "неврівноважена дужка ("
+
+#~ msgid "no syntax specified"
+#~ msgstr "не вказано синтаксису"
+
+#~ msgid "unbalanced )"
+#~ msgstr "неврівноважена дужка )"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "нащадок %s зазнав невдачі"
+
+#~ msgid "regular empty file"
+#~ msgstr "звичайний порожній файл"
+
+#~ msgid "regular file"
+#~ msgstr "звичайний файл"
+
+#~ msgid "directory"
+#~ msgstr "каталог"
+
+#~ msgid "symbolic link"
+#~ msgstr "символьне посилання"
+
+#~ msgid "message queue"
+#~ msgstr "черга повідомлень"
+
+#~ msgid "semaphore"
+#~ msgstr "семафор"
+
+#~ msgid "shared memory object"
+#~ msgstr "спільний об'єкт пам'яті"
+
+#~ msgid "typed memory object"
+#~ msgstr "типізований об'єкт пам'яті"
+
+#~ msgid "block special file"
+#~ msgstr "спеціальний блоковий файл"
+
+#~ msgid "character special file"
+#~ msgstr "спеціальний символьний файл"
+
+#~ msgid "contiguous data"
+#~ msgstr "неперервні дані"
+
+#~ msgid "fifo"
+#~ msgstr "fifo"
+
+#~ msgid "door"
+#~ msgstr "двері"
+
+#~ msgid "multiplexed block special file"
+#~ msgstr "спеціальний файл ущільненого блокового пристрою"
+
+#~ msgid "multiplexed character special file"
+#~ msgstr "спеціальний файл ущільненого символьного пристрою"
+
+#~ msgid "multiplexed file"
+#~ msgstr "ущільнений файл"
+
+#~ msgid "named file"
+#~ msgstr "іменований файл"
+
+#~ msgid "network special file"
+#~ msgstr "спеціальний файл мережі"
+
+#~ msgid "migrated file with data"
+#~ msgstr "перенесений файл з даними"
+
+#~ msgid "migrated file without data"
+#~ msgstr "перенесений файл без даних"
+
+#~ msgid "port"
+#~ msgstr "порт"
+
+#~ msgid "socket"
+#~ msgstr "гніздо"
+
+#~ msgid "whiteout"
+#~ msgstr "забілювання"
+
+#~ msgid "weird file"
+#~ msgstr "дивний файл"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Родина адрес для назви вузла не підтримується"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Тимчасова помилка розв'язування назви вузла"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Недійсне значення ai_flags"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Невиправна помилка розв'язування назви вузла"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "ai_family не підтримується"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Помилка розподілу пам'яті"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "З цією назвою вузла не пов’язано жодної адреси"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Невідоме ім'я або служба"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "Підтримки назв служб у ai_socktype не передбачено"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "ai_socktype не підтримується"
+
+#~ msgid "System error"
+#~ msgstr "Системна помилка"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "Замалий буфер для аргументів"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Виконується обробка запиту"
+
+#~ msgid "Request canceled"
+#~ msgstr "Запит скасовано"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Запит не скасовано"
+
+#~ msgid "All requests done"
+#~ msgstr "Всі запити оброблено"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "Переривання сигналом"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "Неправильно закодований рядок параметра"
+
+#~ msgid "Unknown error"
+#~ msgstr "Невідома помилка"
+
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "недійсне значення аргументу source_version для compile_java_class"
+
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "недійсне значення аргументу target_version для compile_java_class"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "не вдалося створити \"%s\""
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "помилка запису у файл \"%s\""
+
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr ""
+#~ "Не знайдено компілятора java, спробуйте встановити gcj або задати "
+#~ "значення $JAVAC"
+
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "Не знайдено віртуальної машини java, спробуйте встановити gij або задати "
+#~ "значення $JAVA"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "помилка вводу-виводу нащадка %s"
+
+#, c-format
+#~ msgid "cannot stat %s"
+#~ msgstr "не вдалося отримати статистичні дані щодо %s"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "не вдається змінити права доступу до %s"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "не вдається створити каталог %s"
+
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Не вдалося відкрити /dev/zero для читання"
+
+#~ msgid "creation of reading thread failed"
+#~ msgstr "не вдалося створити потік читання"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "не вдається встановити неблокуючий ввід-вивід з підпроцесом %s"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "помилка зв'язку з підпроцесом %s"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "помилка запису у підпроцес %s"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "помилка читання з підпроцесу %s"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "підпроцес %s закінчився кодом %d"
+
+#~ msgid "creation of threads failed"
+#~ msgstr "помилка створення потоків"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "підпроцес %s закінчився кодом %d"
+
+#~ msgid "`"
+#~ msgstr "`"
+
+#~ msgid "'"
+#~ msgstr "'"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[yYтТ]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nNнН]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "встановлення прав доступу до %s"
+
+#~ msgid "Hangup"
+#~ msgstr "Відбій"
+
+#~ msgid "Interrupt"
+#~ msgstr "Переривання"
+
+#~ msgid "Quit"
+#~ msgstr "Закінчення"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "Недійсна інструкція"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Перехоплення трасування/контрольної точки"
+
+#~ msgid "Aborted"
+#~ msgstr "Аварійне завершення"
+
+#~ msgid "Floating point exception"
+#~ msgstr "Виняток операції з рухомою крапкою"
+
+#~ msgid "Killed"
+#~ msgstr "Знищено"
+
+#~ msgid "Bus error"
+#~ msgstr "Помилка шини"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "Помилка сегментації"
+
+#~ msgid "Broken pipe"
+#~ msgstr "Розімкнений конвеєр"
+
+#~ msgid "Alarm clock"
+#~ msgstr "Таймер"
+
+#~ msgid "Terminated"
+#~ msgstr "Закінчено"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "Екстрена ситуація вводу-виводу"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "Припинення (сигнал)"
+
+#~ msgid "Stopped"
+#~ msgstr "Припинення"
+
+#~ msgid "Continued"
+#~ msgstr "Продовження"
+
+#~ msgid "Child exited"
+#~ msgstr "Нащадок завершився"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Припинення (ввід з консолі)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Припинення (вивід на консоль)"
+
+#~ msgid "I/O possible"
+#~ msgstr "Можливий ввід-вивід"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "Перевищення ліміту часу ЦП"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "Перевищення ліміту розміру файлів"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "Відлік віртуального таймера завершено"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "Відлік таймера профілювання завершено"
+
+#~ msgid "Window changed"
+#~ msgstr "Вікно змінилося"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "Визначений користувачем сигнал 1"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Визначений користувачем сигнал 2"
+
+#~ msgid "EMT trap"
+#~ msgstr "Пастка EMT"
+
+#~ msgid "Bad system call"
+#~ msgstr "Некоректний системний виклик"
+
+#~ msgid "Stack fault"
+#~ msgstr "Збій стосу"
+
+#~ msgid "Information request"
+#~ msgstr "Запит інформації"
+
+#~ msgid "Power failure"
+#~ msgstr "Аварія живлення"
+
+#~ msgid "Resource lost"
+#~ msgstr "Втрата засобу"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "помилка запису у закритий конвеєр або гніздо"
+
+#~ msgid "cannot create pipe"
+#~ msgstr "не вдається створити конвеєр"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "Сигнал реального часу %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Невідомий сигнал %d"
+
+#~ msgid "Execution times (seconds)"
+#~ msgstr "Час виконання (у секундах)"
+
+#~ msgid "CPU user"
+#~ msgstr "Користувач процесора"
+
+#~ msgid "CPU system"
+#~ msgstr "Система процесора"
+
+#~ msgid "wall clock"
+#~ msgstr "настінний годинник"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "функція iconv непридатна до вжитку"
+
+#~ msgid "iconv function not available"
+#~ msgstr "функція iconv недоступна"
+
+#~ msgid "character out of range"
+#~ msgstr "символ поза діапазоном"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "не вдається передати U+%04X у локальному зборі знаків"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "не вдається передати U+%04X у локальному зборі знаків: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "Некоректний користувач"
+
+#~ msgid "invalid group"
+#~ msgstr "недійсна група"
+
+#~ msgid "invalid spec"
+#~ msgstr "недійсна специфікація"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "Пакет створив %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "Пакет створив %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "©"
+
+#, c-format
+#~ msgid ""
+#~ "License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ msgstr ""
+#~ "Умови ліцензування викладено у GPLv3+: GNU GPL версії 3 або новішій, "
+#~ "<%s>\n"
+#~ "Це вільне програмне забезпечення: ви можете вільно змінювати і поширювати "
+#~ "його.\n"
+#~ "Вам не надається ЖОДНИХ ГАРАНТІЙ, окрім гарантій передбачених "
+#~ "законодавством.\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Автор: %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Автори: %s та %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Автори: %s, %s та %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Автори: %s, %s, %s\n"
+#~ "та %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Автори: %s, %s, %s\n"
+#~ "%s, та %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Автори: %s, %s, %s\n"
+#~ "%s, %s та %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Автори: %s, %s, %s\n"
+#~ "%s, %s, %s та %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Автори: %s, %s, %s\n"
+#~ "%s, %s, %s, %s та %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Автори: %s, %s, %s\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s та %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Автори: %s, %s, %s\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s та інші.\n"
+
+#, c-format
+#~ msgid "Report bugs to: %s\n"
+#~ msgstr "Про помилки звітуйте на %s\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "Про помилки у програмі %s звітуйте на %s\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "домашня сторінка %s: <%s>\n"
+
+#, c-format
+#~ msgid "General help using GNU software: <%s>\n"
+#~ msgstr ""
+#~ "Загальна довідкова інформація щодо використання програмного забезпечення "
+#~ "GNU: <%s>\n"
+
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "помилка _open_osfhandle"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "не вдається відновити дескриптор %d: помилка dup2"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "нащадок процесу %s"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "підпроцес %s отримав фатальний сигнал %d"
+
+#~ msgid "failed to set file descriptor text/binary mode"
+#~ msgstr ""
+#~ "не вдалося встановити текстовий або двійковий режим для дескриптора файла"
+
+#~ msgid "stdin"
+#~ msgstr "stdin"
+
+#~ msgid "stdout"
+#~ msgstr "stdout"
+
+#~ msgid "stderr"
+#~ msgstr "stderr"
+
+#~ msgid "unknown stream"
+#~ msgstr "невідомий потік"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "не вдалося відкрити %s у режимі %s"
+
+#~ msgid "string comparison failed"
+#~ msgstr "невдале порівняння рядків"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Встановити LC_ALL='C', щоб уникнути цієї помилки."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Порівнювалися рядки: \"%s\" та \"%s\"."
+
+#~ msgid "cannot perform formatted output"
+#~ msgstr "неможливо здійснити форматований вивід"
+
+#, c-format
+#~ msgid "invalid %s%s argument '%s'"
+#~ msgstr "некоректний аргумент %s%s — «%s»"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument '%s'"
+#~ msgstr "некоректний суфікс в аргументі %s%s: «%s»"
+
+#, c-format
+#~ msgid "%s%s argument '%s' too large"
+#~ msgstr "%s%s, аргумент «%s» є занадто об’ємним"
+
+#~ msgid "%s home page: <https://www.gnu.org/software/%s/>\n"
+#~ msgstr "Домашня сторінка %s: <https://www.gnu.org/software/%s/>\n"
+
+#~ msgid "%.*s: ARGP_HELP_FMT parameter must be positive"
+#~ msgstr "%.*s: параметр ARGP_HELP_FMT має бути додатнім"
+
+#~ msgid "%s: option '--%s' doesn't allow an argument\n"
+#~ msgstr "%s: параметр '--%s' не може мати аргументу\n"
+
+#~ msgid "%s: unrecognized option '--%s'\n"
+#~ msgstr "%s: невідомий параметр '--%s'\n"
+
+#~ msgid "%s: option '-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: параметр '-W %s' не може мати аргументу\n"
+
+#~ msgid "%s: option '-W %s' requires an argument\n"
+#~ msgstr "%s: для використання параметра «-W %s» слід вказати аргумент\n"
+
+#~ msgid "Franc,ois Pinard"
+#~ msgstr "Franc,ois Pinard"
diff --git a/gl/po/vi.gmo b/gl/po/vi.gmo
new file mode 100644
index 0000000..57d2dc7
--- /dev/null
+++ b/gl/po/vi.gmo
Binary files differ
diff --git a/gl/po/vi.po b/gl/po/vi.po
new file mode 100644
index 0000000..dad61c2
--- /dev/null
+++ b/gl/po/vi.po
@@ -0,0 +1,879 @@
+# Vietnamese translation for GNU Lib.
+# Bản dịch Tiếng Việt dành cho GNU Lib.
+# Copyright © 2014 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+# Clytie Siddall <clytie@riverland.net.au>, 2006-2010.
+# Trần Ngọc Quân <vnwildman@gmail.com>, 2012-2014.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib-3.0.0.6062.a6b16\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2014-01-13 08:31+0700\n"
+"Last-Translator: Trần Ngọc Quân <vnwildman@gmail.com>\n"
+"Language-Team: Vietnamese <translation-team-vi@lists.sourceforge.net>\n"
+"Language: vi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+"X-Generator: Poedit 1.5.5\n"
+"X-Poedit-SourceCharset: utf-8\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: giá trị %s nhỏ hơn hoặc bằng %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: tham số “ARGP_HELP_FMT” cần được gán giá trị"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: Không biết tham số “ARGP_HELP_FMT”"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "Gặp rác trong “ARGP_HELP_FMT”: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"Các đối số là bắt buộc hay chỉ là tùy chọn khi dùng với tùy chọn dài thì tùy "
+"chọn ngắn tương ứng cũng vậy."
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "Cách dùng:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " hoặc:"
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [TÙY_CHỌN...]"
+
+#: gl/lib/argp-help.c:1783
+#, fuzzy, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr ""
+"Hãy chạy “%s --help” (trợ giúp) hay “%s --usage” (cách dùng) để xem thông "
+"tin thêm.\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "Hãy thông báo lỗi cho %s.\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "Gặp lỗi hệ thống chưa biết"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "hiển thị trợ giúp này"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "hiển thị cách dùng dạng ngắn gọn"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "TÊN"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "đặt tên chương trình"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "GIÂY"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "treo trong vòng GIÂY giây (mặc định là 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "in ra phiên bản chương trình"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(LỖI CHƯƠNG TRÌNH) Không có phiên bản đã biết ?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s: Quá nhiều đối số\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(LỖI CHƯƠNG TRÌNH) Tùy chọn đáng ra nên được nhận diện!?"
+
+#: gl/lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: tùy chọn “-W %s” chưa rõ ràng\n"
+
+#: gl/lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: tùy chọn “%s” chưa rõ ràng; khả năng là:"
+
+#: gl/lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: không nhận ra tùy chọn “%c%s”\n"
+
+#: gl/lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: tùy chọn “%c%s” không cho phép đối số\n"
+
+#: gl/lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: tùy chọn “--%s” yêu cầu một đối số\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: tùy chọn không hợp lệ -- “%c”\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: tùy chọn yêu cầu một đối số -- “%c”\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "không thể ghi lại thư mục làm việc hiện thời"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "gặp lỗi khi quay trở về thư mục làm việc ban đầu"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "Thành công"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "Không khớp"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "Biểu thức chính quy không hợp lệ"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "Ký tự đối chiếu không hợp lệ"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "Tên loại ký tự không hợp lệ"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "Có xuyệc ngược theo sau"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "Tham chiếu ngược không hợp lệ"
+
+#: gl/lib/regcomp.c:143
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Chưa khớp ký tự “[” hay “[^”"
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "Chưa khớp ký tự “(” hay “\\(”"
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "Chưa khớp ký tự “\\{”"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "Nội dung của “\\{\\}” không hợp lệ"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "Kết thúc phạm vi không hợp lệ"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "Hết bộ nhớ"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "Biểu thức chính quy đi trước không hợp lệ"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "Biểu thức chính quy kết thúc quá sớm"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "Biểu thức chính quy quá lớn"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr "Chưa khớp ký tự “)” hay “\\)”"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "Không có biểu thức chính quy đi trước"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "không thể hiển thị thông điệp lỗi"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "hết bộ nhớ"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "đối số không hợp lệ %s cho %s"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "đối số chưa rõ ràng %s dành cho %s"
+
+#, c-format
+#~ msgid "Valid arguments are:"
+#~ msgstr "Các đối số hợp lệ:"
+
+#, c-format
+#~ msgid "%.*s: ARGP_HELP_FMT parameter must be positive"
+#~ msgstr "%.*s: tham số “ARGP_HELP_FMT” phải là số dương"
+
+#~ msgid "program error"
+#~ msgstr "lỗi chương trình"
+
+#~ msgid "stack overflow"
+#~ msgstr "tràn ngăn xếp"
+
+#, c-format
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr ""
+#~ "không tìm thấy thư mục tạm thời, hãy thử đặt biến môi trường $TMPDIR"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "không thể tạo một thư mục tạm thời dùng mẫu “%s”"
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "không thể gỡ bỏ tập tin tạm thời %s"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "không thể gỡ bỏ thư mục tạm thời %s"
+
+#~ msgid "error closing file"
+#~ msgstr "lỗi đóng tập tin"
+
+#~ msgid "write error"
+#~ msgstr "lỗi ghi"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "đang bảo tồn quyền hạn cho %s"
+
+#, c-format
+#~ msgid "error while opening \"%s\" for reading"
+#~ msgstr "gặp lỗi khi mở “%s” để đọc"
+
+#, c-format
+#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgstr "không thể mở tập tin sao lưu dự phòng “%s” để ghi"
+
+#, c-format
+#~ msgid "error reading \"%s\""
+#~ msgstr "gặp lỗi khi đọc “%s”"
+
+#, c-format
+#~ msgid "error writing \"%s\""
+#~ msgstr "gặp lỗi khi ghi “%s”"
+
+#, c-format
+#~ msgid "error after reading \"%s\""
+#~ msgstr "gặp lỗi sau khi đọc “%s”"
+
+#, c-format
+#~ msgid "fdopen() failed"
+#~ msgstr "fdopen() bị lỗi"
+
+#, c-format
+#~ msgid "C# compiler not found, try installing pnet"
+#~ msgstr "Không tìm thấy trình biên dịch C# nên thử cài đặt pnet"
+
+#, c-format
+#~ msgid "C# virtual machine not found, try installing pnet"
+#~ msgstr "Không tìm thấy cơ chế ảo C# nên thử cài đặt pnet"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "Tiến trình con %s bị lỗi"
+
+#~ msgid "regular empty file"
+#~ msgstr "tập tin rỗng kiểu thường"
+
+#~ msgid "regular file"
+#~ msgstr "tập tin thông thường"
+
+#~ msgid "directory"
+#~ msgstr "thư mục"
+
+#~ msgid "block special file"
+#~ msgstr "tập tin đặc biệt khối"
+
+#~ msgid "character special file"
+#~ msgstr "tập tin đặc biệt ký tự"
+
+#~ msgid "fifo"
+#~ msgstr "fifo (vào trước, ra trước)"
+
+#~ msgid "symbolic link"
+#~ msgstr "liên kết mềm"
+
+#~ msgid "socket"
+#~ msgstr "ổ cắm"
+
+#~ msgid "message queue"
+#~ msgstr "hàng đợi thông điệp"
+
+#~ msgid "semaphore"
+#~ msgstr "cờ hiệu"
+
+#~ msgid "shared memory object"
+#~ msgstr "đối tượng bộ nhớ dùng chung"
+
+#~ msgid "typed memory object"
+#~ msgstr "đốí tượng bộ nhớ đánh kiểu"
+
+#~ msgid "weird file"
+#~ msgstr "tập tin kỳ quặc"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "Họ địa chỉ dành cho tên máy không được hỗ trợ"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "Tạm thời không thể quyết định tên"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "Giá trị sai đối với “ai_flags” (cờ)"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "Lỗi không thể phục hồi khi phân giải tên"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "Không hỗ trợ “ai_family”"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "Lỗi cấp phát bộ nhớ"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "Không có địa chỉ liên quan đến tên máy"
+
+#~ msgid "Name or service not known"
+#~ msgstr "Không nhận ra tên hay dịch vụ"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "Không hỗ trợ tên máy phục vụ đối với “ai_socktype” (kiểu ổ cắm)"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "Không hỗ trợ “ai-socktype” (kiểu ổ cắm)"
+
+#~ msgid "System error"
+#~ msgstr "Lỗi hệ thống"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "Vùng đệm đối số quá ngắn"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "Yêu cầu xử lý đang chạy"
+
+#~ msgid "Request canceled"
+#~ msgstr "Yêu cầu bị hủy bỏ"
+
+#~ msgid "Request not canceled"
+#~ msgstr "Yêu cầu chưa bị hủy bỏ"
+
+#~ msgid "All requests done"
+#~ msgstr "Mọi yêu cầu hoàn tất"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "bị tín hiệu gián đoạn"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "Chuỗi tham số không phải được mã hóa đúng"
+
+#~ msgid "Unknown error"
+#~ msgstr "Gặp lỗi không rõ"
+
+#, c-format
+#~ msgid "%s: option '--%s' doesn't allow an argument\n"
+#~ msgstr "%s: tùy chọn “--%s” không cho phép đối số\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option '--%s'\n"
+#~ msgstr "%s: không nhận ra tùy chọn “--%s”\n"
+
+#, c-format
+#~ msgid "%s: option '-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: tùy chọn “-W %s” không cho phép đối số\n"
+
+#, c-format
+#~ msgid "%s: option '-W %s' requires an argument\n"
+#~ msgstr "%s: tùy chọn “-W %s” yêu cầu một đối số\n"
+
+#, c-format
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr ""
+#~ "đối số phiên bản nguồn “source_version” không hợp lệ đối với hạn Java "
+#~ "biên dịch “compile_java_class”"
+
+#, c-format
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr ""
+#~ "đối số phiên bản đích “source_version” không hợp lệ đối với hạn Java biên "
+#~ "dịch “compile_java_class”"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "gặp lỗi khi tạo “%s”"
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "gặp lỗi khi ghi tập tin “%s”"
+
+#, c-format
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr ""
+#~ "Không tìm thấy trình biên dịch Java nên thử cài đặt trình “gcj” hoặc đặt "
+#~ "biến môi trường “$JAVAC”."
+
+#, c-format
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "Không tìm thấy cơ chế ảo Java nên thử cài đặt trình “gcj” hoặc đặt biến "
+#~ "môi trường “$JAVAC”."
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "Lỗi V/R tiến trình con %s"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "không thể thay đổi quyền hạn của %s"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "không thể tạo thư mục %s"
+
+#, c-format
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "Gặp lỗi khi mở thiết bị “/dev/zero” để đọc"
+
+#, c-format
+#~ msgid "creation of reading thread failed"
+#~ msgstr "gặp lỗi khi tạo tuyến trình đọc"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "không thể cài đặt V/R không chặn đối với tiến trình con %s"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "lỗi liên lạc với tiến trình con %s"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "gặp lỗi khi ghi vào tiến trình con %s"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "gặp lỗi khi đọc từ tiến trình con %s"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "tiến trình con %s đã kết thúc với mã thoát %d"
+
+#, c-format
+#~ msgid "creation of threads failed"
+#~ msgstr "gặp lỗi khi tạo tuyến trình"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "tiến trình con %s đã kết thúc với mã thoát %d"
+
+#~ msgid "Franc,ois Pinard"
+#~ msgstr "Franc,ois Pinard"
+
+#~ msgid "`"
+#~ msgstr "“"
+
+#~ msgid "'"
+#~ msgstr "”"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[cC]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[kK]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "đang đặt quyền hạn cho %s"
+
+#~ msgid "Hangup"
+#~ msgstr "Ngưng"
+
+#~ msgid "Interrupt"
+#~ msgstr "Ngắt"
+
+#~ msgid "Quit"
+#~ msgstr "Thoát"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "Câu lệnh sai"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "Bẫy vết/điểm ngắt"
+
+#~ msgid "Aborted"
+#~ msgstr "Bị hủy bỏ"
+
+#~ msgid "Floating point exception"
+#~ msgstr "Ngoại lệ số thực dấu chấm động"
+
+#~ msgid "Killed"
+#~ msgstr "Bị buộc kết thúc"
+
+#~ msgid "Bus error"
+#~ msgstr "Lỗi bus"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "Lỗi phân đoạn"
+
+#~ msgid "Broken pipe"
+#~ msgstr "Ống dẫn bị hỏng"
+
+#~ msgid "Alarm clock"
+#~ msgstr "Đồng hồ báo động"
+
+#~ msgid "Terminated"
+#~ msgstr "Bị chấm dứt"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "Điều kiện V/R khẩn"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "Bị ngừng (ký hiệu)"
+
+#~ msgid "Stopped"
+#~ msgstr "Bị ngừng"
+
+#~ msgid "Continued"
+#~ msgstr "Đã tiếp tục"
+
+#~ msgid "Child exited"
+#~ msgstr "Tiến trình con đã thoát"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "Bị ngừng (đầu vào TTY)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "Bị ngừng (đầu ra TTY)"
+
+#~ msgid "I/O possible"
+#~ msgstr "Có thể V/R"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "Vượt quá thời hạn CPU"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "Vượt quá giới hạn kích cỡ tập tin"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "Hàm đếm thời gian ảo đã hết hạn"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "Hàm đếm thời gian đo hiệu năng sử dụng đã hết hạn"
+
+#~ msgid "Window changed"
+#~ msgstr "Cửa sổ bị thay đổi"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "Tín hiệu do người dùng xác định 1"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "Tín hiệu do người dùng xác định 2"
+
+#~ msgid "EMT trap"
+#~ msgstr "Bẫy EMT"
+
+#~ msgid "Bad system call"
+#~ msgstr "Cú gọi hệ thống sai"
+
+#~ msgid "Stack fault"
+#~ msgstr "Lỗi ngăn xếp"
+
+#~ msgid "Information request"
+#~ msgstr "Yêu cầu thông tin"
+
+#~ msgid "Power failure"
+#~ msgstr "Bị mất điện đột ngột"
+
+#~ msgid "Resource lost"
+#~ msgstr "Tài nguyên bị mất"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "lỗi ghi vào một đường ống hay ổ cắm bị đóng"
+
+#, c-format
+#~ msgid "cannot create pipe"
+#~ msgstr "không thể tạo ống dẫn"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "Tín hiệu thời gian thật %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "Không rõ tín hiệu %d"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "hàm iconv không khả dụng"
+
+#~ msgid "iconv function not available"
+#~ msgstr "không có hàm iconv"
+
+#~ msgid "character out of range"
+#~ msgstr "Ký tự ở ngoại phạm vi"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "không thể chuyển đổi U+%04X sang bộ ký tự địa phương"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "không thể chuyển đổi U+%04X sang bộ ký tự địa phương: %s"
+
+#~ msgid "invalid user"
+#~ msgstr "người dùng không hợp lệ"
+
+#~ msgid "invalid group"
+#~ msgstr "nhóm không hợp lệ"
+
+#~ msgid "invalid spec"
+#~ msgstr "đặc tả không hợp lệ"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "Gói đóng bởi %s (%s)\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "Gói đóng bởi %s\n"
+
+#~ msgid "(C)"
+#~ msgstr "©"
+
+#~ msgid ""
+#~ "\n"
+#~ "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl."
+#~ "html>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "\n"
+#~ "GPLv3+: Giấy Phép Công Cộng GNU, phiên bản 3 hay mới hơn <http://gnu.org/"
+#~ "licenses/gpl.html>\n"
+#~ "Đây là phần mềm tự do: bạn có quyền thay đổi và phát hành lại nó.\n"
+#~ "KHÔNG CÓ BẢO HÀNH GÌ CẢ, với điều kiện được pháp luật cho phép.\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "Tác giả: %s.\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "Tác giả: %s và %s.\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "Tác giả: %s, %s, và %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Tác giả: %s, %s, %s,\n"
+#~ "và %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Tác giả: %s, %s, %s,\n"
+#~ "%s, và %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Tác gia: %s, %s, %s,\n"
+#~ "%s, %s, và %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "Tác giả: %s, %s, %s,\n"
+#~ "%s, %s, %s, và %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "Tác giả: %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "và %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "Tác giả: %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, và %s.\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "Tác giả: %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, và các người khác.\n"
+
+#, c-format
+#~ msgid ""
+#~ "\n"
+#~ "Report bugs to: %s\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Hãy thông báo lỗi cho: %s\n"
+#~ "Thông báo lỗi dịch cho: <http://translationproject.org/team/vi.html>.\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr ""
+#~ "Hãy thông báo lỗi %s cho: %s\n"
+#~ "Thông báo lỗi dịch cho: <http://translationproject.org/team/vi.html>.\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "Trang chủ %s: <%s>\n"
+
+#, c-format
+#~ msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+#~ msgstr "Trang chủ %s: <http://www.gnu.org/software/%s/>\n"
+
+#~ msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+#~ msgstr ""
+#~ "Trợ giúp chung về cách sử dụng phần mềm GNU: <http://www.gnu.org/gethelp/"
+#~ ">\n"
+
+#, c-format
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "_open_osfhandle bị lỗi"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "không thể phục hồi bộ mô tả tập tin %d: “dup2” bị lỗi"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "Tiến trình con %s"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "Tiến trình con %s đã nhận tín hiệu nghiêm trọng %d"
+
+#~ msgid "stdin"
+#~ msgstr "đầu vào tiêu chuẩn"
+
+#~ msgid "stdout"
+#~ msgstr "đầu ra tiêu chuẩn"
+
+#~ msgid "stderr"
+#~ msgstr "đầu ra lỗi tiêu chuẩn"
+
+#~ msgid "unknown stream"
+#~ msgstr "không hiểu luồng dữ liệu"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "gặp lỗi khi mở lại %s trong chế độ %s"
+
+#, c-format
+#~ msgid "string comparison failed"
+#~ msgstr "gặp lỗi khi so sánh chuỗi"
+
+#, c-format
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "Hãy đặt “LC_ALL='C'” để sửa chữa trục trặc này."
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "Hai chuỗi được so sánh là %s và %s."
+
+#, c-format
+#~ msgid "cannot perform formatted output"
+#~ msgstr "không thể thực hiện kết xuất có định dạng"
+
+#, c-format
+#~ msgid "invalid %s%s argument `%s'"
+#~ msgstr "đối số %s%s không hợp lệ “%s”"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument `%s'"
+#~ msgstr "hậu tố không hợp lệ trong đối số %s%s “%s”"
+
+#, c-format
+#~ msgid "%s%s argument `%s' too large"
+#~ msgstr "Đối số %s%s “%s” quá lớn"
diff --git a/gl/po/zh_CN.gmo b/gl/po/zh_CN.gmo
new file mode 100644
index 0000000..91c8aeb
--- /dev/null
+++ b/gl/po/zh_CN.gmo
Binary files differ
diff --git a/gl/po/zh_CN.po b/gl/po/zh_CN.po
new file mode 100644
index 0000000..06640b1
--- /dev/null
+++ b/gl/po/zh_CN.po
@@ -0,0 +1,886 @@
+# simplified Chinese translation of gnulib.
+# Copyright (C) 2010 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+# Yip Chi Lap <clyip@cs.hku.hk>, 1998.
+# Abel Cheung <maddog@linux.org.hk>, 2002.
+# Anthony Fok <anthony@thizlinux.com>, 2002.
+# Funda Wang <fundawang@linux.net.cn>, 2004, 2005.
+# Ji ZhengYu <zhengyuji@gmail.com>, 2009, 2010.
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 2.0.0.3462.e9796\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2010-02-26 09:54+0800\n"
+"Last-Translator: Ji ZhengYu <zhengyuji@gmail.com>\n"
+"Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT: %s 的值小于或等于 %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s: ARGP_HELP_FMT 参数需要一个值"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s: 未知的 ARGP_HELP_FMT 参数"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "ARGP_HELP_FMT 中的无效参数: %s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr ""
+"选项完整形式所必须用的或是可选的参数,在使用选项缩写形式时也是必须的或是可选"
+"的。"
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "用法:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " 或者: "
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr "[选项...]"
+
+#: gl/lib/argp-help.c:1783
+#, fuzzy, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "请尝试执行“%s --help”或“%s --usage”来获取更多信息。\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "请向 %s 报告错误。\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "未知的系统错误"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "显示此帮助列表"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "显示一份简洁的用法信息"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "NAME"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "设定程序名称"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "SECS"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "挂起 SECS 秒(默认 3600 秒)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "打印程序版本"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(程序错误)未知版本!?"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s:参数太多\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(程序错误)未知的选项!?"
+
+#: gl/lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: 选项\"%s\"歧义\n"
+
+#: gl/lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: 选项\"%s\"歧义\n"
+
+#: gl/lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: 无法识别的选项\"%c%s\"\n"
+
+#: gl/lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: 选项\"%c%s\"不要参数\n"
+
+#: gl/lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: 选项\"%s\"必须带参数\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: 无效选项 -- \"%c\"\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: 选项需要参数 -- \"%c\"\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "无法记录当前工作的目录"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "返回到初始工作目录失败"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "成功"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "不匹配"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "正则表达式无效"
+
+#: gl/lib/regcomp.c:131
+#, fuzzy
+msgid "Invalid collation character"
+msgstr "无效的重组字符"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "无效的字符类名"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "多余的反斜杠"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "无效的向后索引"
+
+#: gl/lib/regcomp.c:143
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[ 或 [^ 不匹配"
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "( 或 \\( 不匹配"
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "\\{ 不匹配"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "\\{\\} 的内容无效"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "无效的范围结尾"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "内存用尽"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "前置的正则表达式无效"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "正则表达式结尾过早"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "正则表达式太大"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr ") 或 \\) 不匹配"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "没有前次正则表达式"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "无法显示错误信息"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "内存用尽"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr ""
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "%2$s 的参数 %1$s 无效"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "%2$s 的参数 %1$s 有歧义"
+
+#, c-format
+#~ msgid "Valid arguments are:"
+#~ msgstr "有效的参数为:"
+
+#, c-format
+#~ msgid "%.*s: ARGP_HELP_FMT parameter must be positive"
+#~ msgstr "%.*s: ARGP_HELP_FMT 参数必须为正值"
+
+#~ msgid "program error"
+#~ msgstr "程序错误"
+
+#~ msgid "stack overflow"
+#~ msgstr "堆栈溢出"
+
+#, c-format
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr "无法找到一个临时目录,请尝试设置 $TMPDIR 环境变量"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "无法以模板“%s”创建一个临时目录"
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "无法删除临时文件 %s"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "无法删除临时目录 %s"
+
+#~ msgid "error closing file"
+#~ msgstr "关闭文件时发生错误"
+
+#~ msgid "write error"
+#~ msgstr "写入错误"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "保留 %s 的权限"
+
+#, c-format
+#~ msgid "error while opening \"%s\" for reading"
+#~ msgstr "打开“%s”读取数据时发生错误"
+
+#, c-format
+#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgstr "无法打开备份文件“%s”写入数据"
+
+#, c-format
+#~ msgid "error reading \"%s\""
+#~ msgstr "读入“%s”时错误"
+
+#, c-format
+#~ msgid "error writing \"%s\""
+#~ msgstr "写入“%s”时错误"
+
+#, c-format
+#~ msgid "error after reading \"%s\""
+#~ msgstr "读入“%s”后错误"
+
+#, c-format
+#~ msgid "fdopen() failed"
+#~ msgstr "fdopen() 错误"
+
+#, c-format
+#~ msgid "C# compiler not found, try installing pnet"
+#~ msgstr "未找到 C# 编译器,尝试安装 pnet"
+
+#, c-format
+#~ msgid "C# virtual machine not found, try installing pnet"
+#~ msgstr "未找到 C# 虚拟机,尝试安装 pnet"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s 子进程错误"
+
+#~ msgid "regular empty file"
+#~ msgstr "一般空文件"
+
+#~ msgid "regular file"
+#~ msgstr "一般文件"
+
+#~ msgid "directory"
+#~ msgstr "目录"
+
+#~ msgid "block special file"
+#~ msgstr "块特殊文件"
+
+#~ msgid "character special file"
+#~ msgstr "字符特殊文件"
+
+#~ msgid "fifo"
+#~ msgstr "先进先出"
+
+#~ msgid "symbolic link"
+#~ msgstr "符号链接"
+
+#~ msgid "socket"
+#~ msgstr "套接字"
+
+#~ msgid "message queue"
+#~ msgstr "消息队列"
+
+#~ msgid "semaphore"
+#~ msgstr "信号量"
+
+#~ msgid "shared memory object"
+#~ msgstr "共享内存对象"
+
+#~ msgid "typed memory object"
+#~ msgstr "标准内存对象"
+
+#~ msgid "weird file"
+#~ msgstr "古怪文件"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "不支持主机名的地址族"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "名称解析时发生临时错误"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "ai_flags 的值错误"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "名称解析时发生不可恢复的错误"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "不支持 ai_family"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "内存分配错误"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "主机名未分配到地址"
+
+#~ msgid "Name or service not known"
+#~ msgstr "未知的名称或服务"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "ai_socktype 不支持的服务名"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "不支持 ai_socktype"
+
+#~ msgid "System error"
+#~ msgstr "系统错误"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "参数缓冲区太小"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "正在处理进程的请求"
+
+#~ msgid "Request canceled"
+#~ msgstr "请求已取消"
+
+#~ msgid "Request not canceled"
+#~ msgstr "请求未取消"
+
+#~ msgid "All requests done"
+#~ msgstr "已处理所有请求"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "被一个信号中断"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "参数字符串未正确编码"
+
+#~ msgid "Unknown error"
+#~ msgstr "未知错误"
+
+#, c-format
+#~ msgid "%s: option '--%s' doesn't allow an argument\n"
+#~ msgstr "%s: 选项\"--%s\"不要参数\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option '--%s'\n"
+#~ msgstr "%s: 无法识别的选项\"--%s\"\n"
+
+#, c-format
+#~ msgid "%s: option '-W %s' is ambiguous\n"
+#~ msgstr "%s: 选项\"-W %s\"有歧义\n"
+
+#, c-format
+#~ msgid "%s: option '-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: 选项\"-W %s\"不要带参数\n"
+
+#, c-format
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "compile_java_class 的 source_version 参数无效"
+
+#, c-format
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "compile_java_class 的 target_version 参数无效"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "无法创建“%s”"
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "正在写入“%s”文件时发生错误"
+
+#, c-format
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr "未找到 Java 编译器,尝试安装 gcj 或是设置 $JAVAC"
+
+#, c-format
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr "未找到 Java 虚拟机,尝试安装 gij 或是设置 $JAVA"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "%s 子进程输入/输出错误"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "无法更改 %s 的权限"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "无法创建目录 %s"
+
+#, c-format
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "无法以读方式打开 /dev/zero"
+
+#, c-format
+#~ msgid "creation of reading thread failed"
+#~ msgstr "读线程创建错误"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "无法为 %s 子进程设置非阻塞性 I/O"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "与 %s 子进程通讯错误"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "写入 %s 子进程错误"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "读取 %s 子进程错误"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "子进程 %s 由退出码 %d 终止"
+
+#, c-format
+#~ msgid "creation of threads failed"
+#~ msgstr "线程创建失败"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "子进程 %s 由退出码 %d 终止"
+
+#, c-format
+#~ msgid "cannot create pipe"
+#~ msgstr "无法创建管道"
+
+#~ msgid "`"
+#~ msgstr "“"
+
+#~ msgid "'"
+#~ msgstr "”"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[yY]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "设置 %s 的权限"
+
+#~ msgid "Hangup"
+#~ msgstr "挂起"
+
+#~ msgid "Interrupt"
+#~ msgstr "中断"
+
+#~ msgid "Quit"
+#~ msgstr "退出"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "非法指令"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "跟踪(断点)"
+
+#~ msgid "Aborted"
+#~ msgstr "取消"
+
+#~ msgid "Floating point exception"
+#~ msgstr "浮点溢出"
+
+#~ msgid "Killed"
+#~ msgstr "强行终止"
+
+#~ msgid "Bus error"
+#~ msgstr "总线错误"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "段错误"
+
+#~ msgid "Broken pipe"
+#~ msgstr "管道断开"
+
+#~ msgid "Alarm clock"
+#~ msgstr "时钟警报"
+
+#~ msgid "Terminated"
+#~ msgstr "被终止"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "I/O 条件不足"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "被停止(通过信号)"
+
+#~ msgid "Stopped"
+#~ msgstr "被停止"
+
+#~ msgid "Continued"
+#~ msgstr "继续"
+
+#~ msgid "Child exited"
+#~ msgstr "子进程退出"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "被停止(tty 输入)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "被停止(tty 输出)"
+
+#~ msgid "I/O possible"
+#~ msgstr "I/O 可能"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "超出CPU 时间限制"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "超出文件大小限制"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "虚拟计时器过期"
+
+#, fuzzy
+#~ msgid "Profiling timer expired"
+#~ msgstr "数据计时器过期"
+
+#~ msgid "Window changed"
+#~ msgstr "窗口改变"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "用户自定义信号 1"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "用户自定义信号 2"
+
+#~ msgid "EMT trap"
+#~ msgstr "仿真程序陷阱"
+
+#~ msgid "Bad system call"
+#~ msgstr "错误的系统调用"
+
+#~ msgid "Stack fault"
+#~ msgstr "堆栈错误"
+
+#~ msgid "Information request"
+#~ msgstr "信息请求"
+
+#~ msgid "Power failure"
+#~ msgstr "电力问题"
+
+#~ msgid "Resource lost"
+#~ msgstr "资源丢失"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "写入一个已关闭的管道或套接字时发生错误"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "实时信号 %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "未知信号 %d"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "iconv 函数无法使用"
+
+#~ msgid "iconv function not available"
+#~ msgstr "iconv 函数不存在"
+
+#~ msgid "character out of range"
+#~ msgstr "字符值超出可接受的范围以外"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "无法将 U+%04X 转换至用户的字符集"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "无法将 U+%04X 转换至用户的字符集:%s"
+
+#~ msgid "invalid user"
+#~ msgstr "无效的用户"
+
+#~ msgid "invalid group"
+#~ msgstr "无效的组"
+
+#~ msgid "invalid spec"
+#~ msgstr "无效的 spec"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "由 %s (%s) 打包\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "由 %s 打包\n"
+
+#~ msgid "(C)"
+#~ msgstr "(C)"
+
+#~ msgid ""
+#~ "\n"
+#~ "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl."
+#~ "html>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "\n"
+#~ "授权协议 GPLv3+: GNU GPL 版本 3 或更新版本 <http://gnu.org/licenses/gpl."
+#~ "html>\n"
+#~ "这是自由软件:您可以自由的更改并重新发布它。\n"
+#~ "在法律允许的范围内,没有任何担保。\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "由 %s 编写。\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "由 %s 和 %s 编写。\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "由 %s、%s 和 %s 编写。\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "由 %s、%s、%s 和\n"
+#~ "%s 编写。\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "由 %s、%s、%s、\n"
+#~ "%s 和 %s 编写。\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "由 %s、%s、%s、\n"
+#~ "%s、%s 和 %s 编写。\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "由 %s、%s、%s、\n"
+#~ "%s、%s、%s 和 %s 编写。\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "由 %s、%s、%s、\n"
+#~ "%s、%s、%s、%s\n"
+#~ "和 %s 编写。\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "由 %s、%s、%s、\n"
+#~ "%s、%s、%s、%s、\n"
+#~ "%s、和 %s 编写。\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "由 %s、%s、%s、\n"
+#~ "%s、%s、%s、%s、\n"
+#~ "%s、%s、和其他人编写。\n"
+
+#, c-format
+#~ msgid ""
+#~ "\n"
+#~ "Report bugs to: %s\n"
+#~ msgstr ""
+#~ "\n"
+#~ "请向 %s 报告错误。向 <i18n-zh@googlegroups.com> 报告翻译错误。\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "将 %s 错误报告给: %s\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "%s 主页: <%s>\n"
+
+#, c-format
+#~ msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+#~ msgstr "%s 主页: <http://www.gnu.org/software/%s/>\n"
+
+#~ msgid "General help using GNU software: <http://www.gnu.org/gethelp/>\n"
+#~ msgstr "GNU 软件的通用帮助: <http://www.gnu.org/gethelp/>\n"
+
+#, c-format
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "_open_osfhandle 失败"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "无法恢复文件描述符 %d: dup2 失败"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "%s 子进程"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "%s 子进程获得终结信号 %d"
+
+#~ msgid "stdin"
+#~ msgstr "标准输入"
+
+#~ msgid "stdout"
+#~ msgstr "标准输出"
+
+#~ msgid "stderr"
+#~ msgstr "标准错误输出"
+
+#~ msgid "unknown stream"
+#~ msgstr "未知的流"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "无法以 %2$s 模式重新打开 %1$s"
+
+#, c-format
+#~ msgid "string comparison failed"
+#~ msgstr "字符串比较出现错误"
+
+#, c-format
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "请设定 LC_ALL='C' 避免问题出现。"
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "要比较的字符串为 %s 和 %s。"
+
+#, c-format
+#~ msgid "cannot perform formatted output"
+#~ msgstr "无法执行格式化输出"
+
+#, c-format
+#~ msgid "invalid %s%s argument `%s'"
+#~ msgstr "%s%s 参数‘%s’无效"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument `%s'"
+#~ msgstr "%s%s 参数‘%s’的后缀无效"
+
+#, c-format
+#~ msgid "%s%s argument `%s' too large"
+#~ msgstr "%s%s 参数‘%s’太长"
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s:非法选项 -- %c\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Report bugs to <%s>.\n"
+#~ msgstr ""
+#~ "\n"
+#~ "请向 <%s> 报告错误。\n"
+
+#~ msgid "block size"
+#~ msgstr "块大小"
+
+#~ msgid "%s exists but is not a directory"
+#~ msgstr "%s 存在但并非目录"
+
+#~ msgid "cannot change owner and/or group of %s"
+#~ msgstr "无法更改 %s 的属主和/或组"
+
+#~ msgid "cannot chdir to directory %s"
+#~ msgstr "无法切换到目录 %s"
+
+#~ msgid "cannot get the login group of a numeric UID"
+#~ msgstr "无法取得 UID 数值所表示的用户的主组"
diff --git a/gl/po/zh_TW.gmo b/gl/po/zh_TW.gmo
new file mode 100644
index 0000000..35f1087
--- /dev/null
+++ b/gl/po/zh_TW.gmo
Binary files differ
diff --git a/gl/po/zh_TW.po b/gl/po/zh_TW.po
new file mode 100644
index 0000000..373b36c
--- /dev/null
+++ b/gl/po/zh_TW.po
@@ -0,0 +1,984 @@
+# traditional Chinese translation of coreutils.
+# Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc.
+# This file is distributed under the same license as the gnulib package.
+#
+# # Merged from textutils, sh-utils and fileutils translation:
+#
+# # Yip Chi Lap <clyip@cs.hku.hk>, 1998.
+# # Yuan-Chung Cheng <platin@ms.ccafps.khc.edu.tw>, 1998.
+# # Abel Cheung <abelcheung@gmail.com>, 2002.
+# # Pofeng Lee <pofeng@linux.org.tw>, 1998, 2002.
+# Abel Cheung <abelcheung@gmail.com>, 2005.
+# pan93412 <pan93412@gmail.com>, 2019.
+msgid ""
+msgstr ""
+"Project-Id-Version: gnulib 4.0.0.2567\n"
+"Report-Msgid-Bugs-To: bug-gnulib@gnu.org\n"
+"POT-Creation-Date: 2023-01-08 22:04+0000\n"
+"PO-Revision-Date: 2019-12-15 13:01+0800\n"
+"Last-Translator: pan93412 <pan93412@gmail.com>\n"
+"Language-Team: Chinese (traditional) <zh-l10n@lists.linux.org.tw>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+"X-Generator: Lokalize 19.12.0\n"
+
+#: gl/lib/argp-help.c:162
+#, c-format
+msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+msgstr "ARGP_HELP_FMT:%s 值小於或等於 %s"
+
+#: gl/lib/argp-help.c:238
+#, c-format
+msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+msgstr "%.*s:ARGP_HELP_FMT 參數需要一個值"
+
+#: gl/lib/argp-help.c:248
+#, c-format
+msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+msgstr "%.*s:未知 ARGP_HELP_FMT 參數"
+
+#: gl/lib/argp-help.c:261
+#, c-format
+msgid "Garbage in ARGP_HELP_FMT: %s"
+msgstr "ARGP_HELP_FMT 中的廢棄內容:%s"
+
+#: gl/lib/argp-help.c:1374
+msgid ""
+"Mandatory or optional arguments to long options are also mandatory or "
+"optional for any corresponding short options."
+msgstr "長選項所使用的參數,在相對應的短選項也必須使用。"
+
+#: gl/lib/argp-help.c:1740
+msgid "Usage:"
+msgstr "用法:"
+
+#: gl/lib/argp-help.c:1744
+msgid " or: "
+msgstr " 或:"
+
+#: gl/lib/argp-help.c:1756
+msgid " [OPTION...]"
+msgstr " [選項…]"
+
+#: gl/lib/argp-help.c:1783
+#, c-format
+msgid "Try '%s --help' or '%s --usage' for more information.\n"
+msgstr "嘗試「%s --help」或「%s --usage」取得更多資訊。\n"
+
+#: gl/lib/argp-help.c:1811
+#, c-format
+msgid "Report bugs to %s.\n"
+msgstr "請向 %s 匯報錯誤。\n"
+
+#: gl/lib/argp-help.c:2011 gl/lib/error.c:195
+msgid "Unknown system error"
+msgstr "未知系統錯誤"
+
+#: gl/lib/argp-parse.c:91
+msgid "give this help list"
+msgstr "提供此說明清單"
+
+#: gl/lib/argp-parse.c:92
+msgid "give a short usage message"
+msgstr "提供短用法訊息"
+
+#: gl/lib/argp-parse.c:93
+msgid "NAME"
+msgstr "名稱"
+
+#: gl/lib/argp-parse.c:94
+msgid "set the program name"
+msgstr "設定程式名稱"
+
+#: gl/lib/argp-parse.c:95
+msgid "SECS"
+msgstr "秒"
+
+#: gl/lib/argp-parse.c:96
+msgid "hang for SECS seconds (default 3600)"
+msgstr "掛斷秒數(預設 3600)"
+
+#: gl/lib/argp-parse.c:154
+msgid "print program version"
+msgstr "輸出程式版本"
+
+#: gl/lib/argp-parse.c:171
+msgid "(PROGRAM ERROR) No version known!?"
+msgstr "(程式錯誤)沒有已知版本?!"
+
+#: gl/lib/argp-parse.c:624
+#, c-format
+msgid "%s: Too many arguments\n"
+msgstr "%s:過多參數\n"
+
+#: gl/lib/argp-parse.c:770
+msgid "(PROGRAM ERROR) Option should have been recognized!?"
+msgstr "(程式錯誤)選項應該已被識別?!"
+
+#: gl/lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s:「%s%s」選項不明確\n"
+
+#: gl/lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s:「%s%s」選項不明確;可能是:"
+
+#: gl/lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s:無法識別「%s%s」選項\n"
+
+#: gl/lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s:「%s%s」選項不接受參數\n"
+
+#: gl/lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s:「%s%s」選項需要參數\n"
+
+#: gl/lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s:無效選項 -- '%c'\n"
+
+#: gl/lib/getopt.c:636 gl/lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s:選項需要參數 -- '%c'\n"
+
+#: gl/lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "無法記錄目前工作目錄"
+
+#: gl/lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "無法回到初始工作目錄"
+
+#: gl/lib/regcomp.c:122
+msgid "Success"
+msgstr "成功"
+
+#: gl/lib/regcomp.c:125
+msgid "No match"
+msgstr "無符合項目"
+
+#: gl/lib/regcomp.c:128
+msgid "Invalid regular expression"
+msgstr "正規表示式無效"
+
+#: gl/lib/regcomp.c:131
+msgid "Invalid collation character"
+msgstr "定序字元無效"
+
+#: gl/lib/regcomp.c:134
+msgid "Invalid character class name"
+msgstr "字元類型名稱無效"
+
+#: gl/lib/regcomp.c:137
+msgid "Trailing backslash"
+msgstr "末尾反斜線"
+
+#: gl/lib/regcomp.c:140
+msgid "Invalid back reference"
+msgstr "向後參考無效"
+
+#: gl/lib/regcomp.c:143
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "不對稱的 [、[^、[:、[. 或 [="
+
+#: gl/lib/regcomp.c:146
+msgid "Unmatched ( or \\("
+msgstr "不對稱的 ( 或 \\("
+
+#: gl/lib/regcomp.c:149
+msgid "Unmatched \\{"
+msgstr "不對稱的 \\{"
+
+#: gl/lib/regcomp.c:152
+msgid "Invalid content of \\{\\}"
+msgstr "\\{\\} 中內容無效"
+
+#: gl/lib/regcomp.c:155
+msgid "Invalid range end"
+msgstr "結束範圍無效"
+
+#: gl/lib/regcomp.c:158
+msgid "Memory exhausted"
+msgstr "記憶體用盡"
+
+#: gl/lib/regcomp.c:161
+msgid "Invalid preceding regular expression"
+msgstr "前置正規表示式無效"
+
+#: gl/lib/regcomp.c:164
+msgid "Premature end of regular expression"
+msgstr "正規表示式過早結束"
+
+#: gl/lib/regcomp.c:167
+msgid "Regular expression too big"
+msgstr "正規表示式過長"
+
+#: gl/lib/regcomp.c:170
+msgid "Unmatched ) or \\)"
+msgstr "不對稱的 ) 或 \\)"
+
+#: gl/lib/regcomp.c:650
+msgid "No previous regular expression"
+msgstr "沒有上一個正規表示式"
+
+#: gl/lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "無法顯示錯誤訊息"
+
+#: gl/lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "記憶體用盡"
+
+#: gl/lib/xstdopen.c:34
+#, c-format
+msgid "standard file descriptors"
+msgstr "標準檔案描述符"
+
+#, c-format
+#~ msgid "invalid argument %s for %s"
+#~ msgstr "傳入 %2$s 之參數 %1$s 無效"
+
+#, c-format
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "傳入 %2$s 之參數 %1$s 不明確"
+
+#~ msgid "Valid arguments are:"
+#~ msgstr "有效的參數為:"
+
+#, c-format
+#~ msgid "%u bitset_allocs, %u freed (%.2f%%).\n"
+#~ msgstr "%u bitset_allocs,已釋放 %u (%.2f%%)。\n"
+
+#, c-format
+#~ msgid "%u bitset_sets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_sets,已快取 %u (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_resets, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_resets,已快取 %u (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_tests, %u cached (%.2f%%)\n"
+#~ msgstr "%u bitset_tests,%u 已快取 (%.2f%%)\n"
+
+#, c-format
+#~ msgid "%u bitset_lists\n"
+#~ msgstr "%u bitset_lists\n"
+
+#, c-format
+#~ msgid ""
+#~ "Bitset statistics:\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Bitset 統計:\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Accumulated runs = %u\n"
+#~ msgstr "累積執行次數 = %u\n"
+
+#~ msgid "cannot read stats file"
+#~ msgstr "無法讀取統計檔案"
+
+#, c-format
+#~ msgid "bad stats file size\n"
+#~ msgstr "統計檔案大小無效\n"
+
+#~ msgid "cannot write stats file"
+#~ msgstr "無法寫入統計檔案"
+
+#~ msgid "cannot open stats file for writing"
+#~ msgstr "無法開啟統計檔案寫入"
+
+#~ msgid "program error"
+#~ msgstr "程式錯誤"
+
+#~ msgid "stack overflow"
+#~ msgstr "堆疊溢出"
+
+#~ msgid "cannot find a temporary directory, try setting $TMPDIR"
+#~ msgstr "未找到暫存目錄,請嘗試設定 $TMPDIR"
+
+#, c-format
+#~ msgid "cannot create a temporary directory using template \"%s\""
+#~ msgstr "無法使用「%s」範本建立暫存目錄"
+
+#, c-format
+#~ msgid "cannot remove temporary file %s"
+#~ msgstr "無法移除暫存檔 %s"
+
+#, c-format
+#~ msgid "cannot remove temporary directory %s"
+#~ msgstr "無法移除暫存目錄 %s"
+
+#~ msgid "error closing file"
+#~ msgstr "關閉檔案時發生錯誤"
+
+#~ msgid "write error"
+#~ msgstr "寫入時發生錯誤"
+
+#, c-format
+#~ msgid "preserving permissions for %s"
+#~ msgstr "正在保留 %s 的權限"
+
+#, c-format
+#~ msgid "error while opening %s for reading"
+#~ msgstr "開啟 %s 讀取時發生錯誤"
+
+#, c-format
+#~ msgid "cannot open backup file %s for writing"
+#~ msgstr "無法開啟備份檔 %s 寫入"
+
+#, c-format
+#~ msgid "error reading %s"
+#~ msgstr "讀取 %s 時發生錯誤"
+
+#, c-format
+#~ msgid "error writing %s"
+#~ msgstr "寫入 %s 時發生錯誤"
+
+#, c-format
+#~ msgid "error after reading %s"
+#~ msgstr "讀取 %s 後發生錯誤"
+
+#~ msgid "fdopen() failed"
+#~ msgstr "fdopen() 失敗"
+
+#~ msgid "C# compiler not found, try installing mono"
+#~ msgstr "未找到 C# 編譯器,嘗試安裝 mono"
+
+#~ msgid "C# virtual machine not found, try installing mono"
+#~ msgstr "未找到 C# 虛擬機,嘗試安裝 mono"
+
+#~ msgid "unbalanced ["
+#~ msgstr "不對稱的 ["
+
+#~ msgid "invalid character class"
+#~ msgstr "字元類型無效"
+
+#~ msgid "character class syntax is [[:space:]], not [:space:]"
+#~ msgstr "字元類型語法為 [[:space:]] 而非 [:space:]"
+
+#~ msgid "unfinished \\ escape"
+#~ msgstr "未完成的 \\ 跳脫字元"
+
+#~ msgid "invalid content of \\{\\}"
+#~ msgstr "\\{\\} 的內容無效"
+
+#~ msgid "regular expression too big"
+#~ msgstr "正規表示式過長"
+
+#~ msgid "unbalanced ("
+#~ msgstr "不對稱的 ("
+
+#~ msgid "no syntax specified"
+#~ msgstr "未指定語法"
+
+#~ msgid "unbalanced )"
+#~ msgstr "不對稱的 )"
+
+#, c-format
+#~ msgid "%s subprocess failed"
+#~ msgstr "%s 子執行程序執行失敗"
+
+#~ msgid "regular empty file"
+#~ msgstr "一般空白檔案"
+
+#~ msgid "regular file"
+#~ msgstr "一般檔案"
+
+#~ msgid "directory"
+#~ msgstr "目錄"
+
+#~ msgid "symbolic link"
+#~ msgstr "符號連結"
+
+#~ msgid "message queue"
+#~ msgstr "訊息佇列"
+
+#~ msgid "semaphore"
+#~ msgstr "旗號"
+
+#~ msgid "shared memory object"
+#~ msgstr "共用記憶體物件"
+
+#~ msgid "typed memory object"
+#~ msgstr "具類型記憶體物件"
+
+#~ msgid "block special file"
+#~ msgstr "區塊特殊檔案"
+
+#~ msgid "character special file"
+#~ msgstr "字元特殊檔案"
+
+#~ msgid "contiguous data"
+#~ msgstr "連續資料"
+
+#~ msgid "fifo"
+#~ msgstr "fifo"
+
+#~ msgid "door"
+#~ msgstr "門 (door)"
+
+#~ msgid "multiplexed block special file"
+#~ msgstr "多工區塊特殊檔"
+
+#~ msgid "multiplexed character special file"
+#~ msgstr "多工字元特殊檔"
+
+#~ msgid "multiplexed file"
+#~ msgstr "多工檔案"
+
+#~ msgid "named file"
+#~ msgstr "命名檔案"
+
+#~ msgid "network special file"
+#~ msgstr "網路特殊檔案"
+
+#~ msgid "migrated file with data"
+#~ msgstr "移轉檔(含資料)"
+
+#~ msgid "migrated file without data"
+#~ msgstr "移轉檔(不含資料)"
+
+#~ msgid "port"
+#~ msgstr "連線埠"
+
+#~ msgid "socket"
+#~ msgstr "socket"
+
+#~ msgid "whiteout"
+#~ msgstr "whiteout"
+
+#~ msgid "weird file"
+#~ msgstr "不正常檔案"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "不支援主機名稱的位址家族"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "解析名稱時發生暫時性錯誤"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "ai_flags 的值無效"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "解析名稱時發生無法復原錯誤"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "不支援 ai_family"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "分配記憶體失敗"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "沒有位址關聯至此主機名稱"
+
+#~ msgid "Name or service not known"
+#~ msgstr "名稱或服務未知"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "ai_socktype 不支援伺服器名稱 (Servname)"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "不支援 ai_socktype"
+
+#~ msgid "System error"
+#~ msgstr "系統錯誤"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "參數緩衝區過小"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "正在處理請求"
+
+#~ msgid "Request canceled"
+#~ msgstr "已取消請求"
+
+#~ msgid "Request not canceled"
+#~ msgstr "未取消請求"
+
+#~ msgid "All requests done"
+#~ msgstr "所有請求完成"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "遭信號中斷"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "未正確編碼參數字串"
+
+#~ msgid "Unknown error"
+#~ msgstr "未知錯誤"
+
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "傳入 compile_java_class 的 source_version 參數無效"
+
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "傳入 compile_java_class 的 target_version 參數無效"
+
+#, c-format
+#~ msgid "failed to create \"%s\""
+#~ msgstr "無法建立「%s」"
+
+#, c-format
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "寫入「%s」檔時發生錯誤"
+
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr "未找到 Java 編譯器。嘗試安裝 gcj,或設定 $JAVAC"
+
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr "未找到 Java 虛擬機。嘗試安裝 gij,或設定 $JAVA"
+
+#, c-format
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "%s 子執行程序發生 I/O 錯誤"
+
+#, c-format
+#~ msgid "cannot stat %s"
+#~ msgstr "無法取得 %s 的資訊"
+
+#, c-format
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "無法變更 %s 的權限"
+
+#, c-format
+#~ msgid "cannot create directory %s"
+#~ msgstr "無法建立 %s 目錄"
+
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "無法開啟 /dev/zero 讀取"
+
+#~ msgid "creation of reading thread failed"
+#~ msgstr "建立讀取執行緒失敗"
+
+#, c-format
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "無法對 %s 子執行程序設定非封鎖 I/O"
+
+#, c-format
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "與 %s 子執行程序通訊失敗"
+
+#, c-format
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "寫入 %s 子程序失敗"
+
+#, c-format
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "自 %s 子執行程序讀取失敗"
+
+#, c-format
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "子執行程序 %s 終止,結束碼 %d"
+
+#~ msgid "creation of threads failed"
+#~ msgstr "建立執行緒失敗"
+
+#, c-format
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "子執行程序 %s 終止,結束碼 %d"
+
+#~ msgid "`"
+#~ msgstr "「"
+
+#~ msgid "'"
+#~ msgstr "」"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[yY]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#, c-format
+#~ msgid "setting permissions for %s"
+#~ msgstr "正在設定 %s 的權限"
+
+#~ msgid "Hangup"
+#~ msgstr "掛斷"
+
+#~ msgid "Interrupt"
+#~ msgstr "中斷"
+
+#~ msgid "Quit"
+#~ msgstr "退出"
+
+#~ msgid "Illegal instruction"
+#~ msgstr "無效指令"
+
+#~ msgid "Trace/breakpoint trap"
+#~ msgstr "追蹤 / 斷點陷阱"
+
+#~ msgid "Aborted"
+#~ msgstr "中止"
+
+#~ msgid "Floating point exception"
+#~ msgstr "浮點數例外"
+
+#~ msgid "Killed"
+#~ msgstr "強制結束"
+
+#~ msgid "Bus error"
+#~ msgstr "匯流排錯誤"
+
+#~ msgid "Segmentation fault"
+#~ msgstr "程式記憶體區段錯誤"
+
+#~ msgid "Broken pipe"
+#~ msgstr "管線損壞"
+
+#~ msgid "Alarm clock"
+#~ msgstr "鬧鐘"
+
+#~ msgid "Terminated"
+#~ msgstr "終止"
+
+#~ msgid "Urgent I/O condition"
+#~ msgstr "緊急 I/O 條件"
+
+#~ msgid "Stopped (signal)"
+#~ msgstr "停止(信號)"
+
+#~ msgid "Stopped"
+#~ msgstr "停止"
+
+#~ msgid "Continued"
+#~ msgstr "繼續"
+
+#~ msgid "Child exited"
+#~ msgstr "子程序退出"
+
+#~ msgid "Stopped (tty input)"
+#~ msgstr "停止(tty 輸入)"
+
+#~ msgid "Stopped (tty output)"
+#~ msgstr "停止(tty 輸出)"
+
+#~ msgid "I/O possible"
+#~ msgstr "可能 I/O"
+
+#~ msgid "CPU time limit exceeded"
+#~ msgstr "到達 CPU 時間上限"
+
+#~ msgid "File size limit exceeded"
+#~ msgstr "到達檔案大小上限"
+
+#~ msgid "Virtual timer expired"
+#~ msgstr "虛擬計時器過期"
+
+#~ msgid "Profiling timer expired"
+#~ msgstr "分析計時器過期"
+
+#~ msgid "Window changed"
+#~ msgstr "已變更視窗"
+
+#~ msgid "User defined signal 1"
+#~ msgstr "使用者定義信號 1"
+
+#~ msgid "User defined signal 2"
+#~ msgstr "使用者定義信號 2"
+
+#~ msgid "EMT trap"
+#~ msgstr "EMT 陷阱"
+
+#~ msgid "Bad system call"
+#~ msgstr "無效系統呼叫"
+
+#~ msgid "Stack fault"
+#~ msgstr "堆疊錯誤"
+
+#~ msgid "Information request"
+#~ msgstr "資訊請求"
+
+#~ msgid "Power failure"
+#~ msgstr "電源錯誤"
+
+#~ msgid "Resource lost"
+#~ msgstr "資源遺失"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "寫入已關閉管線或 socket 時發生錯誤"
+
+#~ msgid "cannot create pipe"
+#~ msgstr "無法建立管線"
+
+#, c-format
+#~ msgid "Real-time signal %d"
+#~ msgstr "即時信號 %d"
+
+#, c-format
+#~ msgid "Unknown signal %d"
+#~ msgstr "未知信號 %d"
+
+#~ msgid "Execution times (seconds)"
+#~ msgstr "執行次數(秒)"
+
+#~ msgid "CPU user"
+#~ msgstr "CPU 使用者"
+
+#~ msgid "CPU system"
+#~ msgstr "CPU 系統"
+
+#~ msgid "wall clock"
+#~ msgstr "掛鐘"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "iconv 功能沒有用"
+
+#~ msgid "iconv function not available"
+#~ msgstr "iconv 功能不能使用"
+
+#~ msgid "character out of range"
+#~ msgstr "字元超出範圍"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "無法將 U+%04X 轉換至使用者的字元集"
+
+#, c-format
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "無法將 U+%04X 轉換至使用者的字元集:%s"
+
+#~ msgid "invalid user"
+#~ msgstr "使用者無效"
+
+#~ msgid "invalid group"
+#~ msgstr "群組無效"
+
+#~ msgid "invalid spec"
+#~ msgstr "規格無效"
+
+#, c-format
+#~ msgid "Packaged by %s (%s)\n"
+#~ msgstr "由 %s (%s) 打包\n"
+
+#, c-format
+#~ msgid "Packaged by %s\n"
+#~ msgstr "由 %s 打包\n"
+
+#~ msgid "(C)"
+#~ msgstr "(C)"
+
+#, c-format
+#~ msgid ""
+#~ "License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+#~ "This is free software: you are free to change and redistribute it.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ msgstr ""
+#~ "GPLv3+ 授權:GNU GPL 第三版或更新版本 <%s>。\n"
+#~ "此為自由軟體:您能自由變更及重散佈。\n"
+#~ "在法律所允許的範圍之內「沒有任何保證」。\n"
+#~ "\n"
+
+#, c-format
+#~ msgid "Written by %s.\n"
+#~ msgstr "由 %s 編寫。\n"
+
+#, c-format
+#~ msgid "Written by %s and %s.\n"
+#~ msgstr "由 %s 和 %s 編寫。\n"
+
+#, c-format
+#~ msgid "Written by %s, %s, and %s.\n"
+#~ msgstr "由 %s、%s 和 %s 編寫。\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "由 %s、%s、%s\n"
+#~ "和 %s 編寫。\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "由 %s、%s、%s、\n"
+#~ "%s 和 %s 編寫。\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, and %s.\n"
+#~ msgstr ""
+#~ "由 %s、%s、%s、\n"
+#~ "%s、%s 和 %s 編寫。\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, and %s.\n"
+#~ msgstr ""
+#~ "由 %s、%s、%s、%s、\n"
+#~ "%s、%s 和 %s 編寫。\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "and %s.\n"
+#~ msgstr ""
+#~ "由 %s、%s、%s、%s、\n"
+#~ "%s、%s、%s 和 %s 編寫。\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, and %s.\n"
+#~ msgstr ""
+#~ "由 %s、%s、%s、%s、\n"
+#~ "%s、%s、%s、%s\n"
+#~ "和 %s 編寫。\n"
+
+#, c-format
+#~ msgid ""
+#~ "Written by %s, %s, %s,\n"
+#~ "%s, %s, %s, %s,\n"
+#~ "%s, %s, and others.\n"
+#~ msgstr ""
+#~ "由 %s、%s、%s、%s、\n"
+#~ "%s、%s、%s、%s\n"
+#~ "和 %s 等人編寫。\n"
+
+#, c-format
+#~ msgid "Report bugs to: %s\n"
+#~ msgstr "匯報錯誤至:%s\n"
+
+#, c-format
+#~ msgid "Report %s bugs to: %s\n"
+#~ msgstr "請將 %s 的臭蟲匯報至:%s\n"
+
+#, c-format
+#~ msgid "%s home page: <%s>\n"
+#~ msgstr "%s 首頁:<%s>\n"
+
+#, c-format
+#~ msgid "General help using GNU software: <%s>\n"
+#~ msgstr "使用 GNU 軟體的一般說明:<%s>\n"
+
+#~ msgid "_open_osfhandle failed"
+#~ msgstr "_open_osfhandle 失敗"
+
+#, c-format
+#~ msgid "cannot restore fd %d: dup2 failed"
+#~ msgstr "無法復原 fd %d:dup2 失敗"
+
+#, c-format
+#~ msgid "%s subprocess"
+#~ msgstr "%s 子執行程序"
+
+#, c-format
+#~ msgid "%s subprocess got fatal signal %d"
+#~ msgstr "%s 子執行程序收到嚴重錯誤信號 %d"
+
+#~ msgid "failed to set file descriptor text/binary mode"
+#~ msgstr "無法將檔案描述符設定成文字 / 二進位模式"
+
+#~ msgid "stdin"
+#~ msgstr "標準輸入"
+
+#~ msgid "stdout"
+#~ msgstr "標準輸出"
+
+#~ msgid "stderr"
+#~ msgstr "標準錯誤"
+
+#~ msgid "unknown stream"
+#~ msgstr "未知串流"
+
+#, c-format
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "無法使用 %2$s 模式重開啟 %1$s"
+
+#~ msgid "string comparison failed"
+#~ msgstr "比較字串失敗"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "請設定 LC_ALL='C' 避免此問題發生。"
+
+#, c-format
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "要比較的字串為 %s 和 %s。"
+
+#~ msgid "cannot perform formatted output"
+#~ msgstr "無法執行格式化輸出"
+
+#, c-format
+#~ msgid "invalid %s%s argument '%s'"
+#~ msgstr "%s%s 參數「%s」無效"
+
+#, c-format
+#~ msgid "invalid suffix in %s%s argument '%s'"
+#~ msgstr "%s%s 參數「%s」有無效後綴"
+
+#, c-format
+#~ msgid "%s%s argument '%s' too large"
+#~ msgstr "%s%s 參數「%s」過長"
+
+#~ msgid "%s home page: <https://www.gnu.org/software/%s/>\n"
+#~ msgstr "%s 首頁:<https://www.gnu.org/software/%s/>\n"
+
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s:選項‘--%s’不可配合參數使用\n"
+
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s:無法識別的選項‘--%s’\n"
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s:不合法的選項 ─ %c\n"
+
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s:選項‘-W %s’不明確\n"
+
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s:選項‘-W %s’不可配合參數使用\n"
+
+#, fuzzy
+#~ msgid "block size"
+#~ msgstr "區塊特殊檔案"
+
+#~ msgid "%s exists but is not a directory"
+#~ msgstr "%s已存在但不是目錄"
+
+#~ msgid "cannot change owner and/or group of %s"
+#~ msgstr "無法更改%s的擁有者和/或所屬群組"
+
+#~ msgid "cannot chdir to directory %s"
+#~ msgstr "無法進入%s目錄"
+
+#~ msgid "cannot get the login group of a numeric UID"
+#~ msgstr "無法取得 UID 數值所代表的登入群組"
+
+#, fuzzy
+#~ msgid ""
+#~ "\n"
+#~ "This is free software. You may redistribute copies of it under the terms "
+#~ "of\n"
+#~ "the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "本程式是自由軟體;你可以根據 Free Software Foundation 所公佈的 GNU\n"
+#~ "General Public License 第二版或(自由選擇)較新的版本中的條款去重新\n"
+#~ "散佈及/或修改本軟體。\n"
+#~ "\n"